Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WvIPAliaser Class Reference

#include <wvipaliaser.h>

List of all members.

Public Methods

 WvIPAliaser ()
 ~WvIPAliaser ()
void dump ()
void start_edit ()
void add (const WvIPAddr &ip)
void done_edit ()
 WvIPAliaser ()
 ~WvIPAliaser ()
void dump ()
void start_edit ()
void add (const WvIPAddr &ip)
void done_edit ()

Private Methods

WvIPAliaser::Aliasipsearch (WvIPAliaser::AliasList &l, const WvIPAddr &ip)
 DeclareWvList (Alias)
WvIPAliaser::Aliasipsearch (WvIPAliaser::AliasList &l, const WvIPAddr &ip)

Private Attributes

AliasList aliases
WvInterfaceDict interfaces

Static Private Attributes

AliasList all_aliases


Detailed Description

WvIPAliaser handles IP aliasing in the Linux kernel. Multiple instances of the object can be created, and they will share aliases between them. Aliased addresses are only removed when all WvIPAliaser objects using that address give it up. (ie. the object is destroyed, or the Aliaser is reconfigured without including that address)

Definition at line 18 of file include/wvipaliaser.h.


Constructor & Destructor Documentation

WvIPAliaser::WvIPAliaser  
 

Definition at line 72 of file wvipaliaser.cc.

References interfaces.

WvIPAliaser::~WvIPAliaser  
 

Definition at line 78 of file wvipaliaser.cc.

References done_edit(), and start_edit().

WvIPAliaser::WvIPAliaser  
 

WvIPAliaser::~WvIPAliaser  
 


Member Function Documentation

void WvIPAliaser::add const WvIPAddr   ip
 

void WvIPAliaser::add const WvIPAddr   ip
 

Definition at line 124 of file wvipaliaser.cc.

References aliases, all_aliases, WvList< Alias >::append(), interfaces, ipsearch(), WvInterfaceDict::islocal(), and WvIPAliaser::Alias::link_count.

WvIPAliaser::DeclareWvList Alias    [private]
 

void WvIPAliaser::done_edit  
 

void WvIPAliaser::done_edit  
 

Definition at line 150 of file wvipaliaser.cc.

References all_aliases, and WvIPAliaser::Alias::link_count.

Referenced by ~WvIPAliaser().

void WvIPAliaser::dump  
 

void WvIPAliaser::dump  
 

Definition at line 166 of file wvipaliaser.cc.

References aliases, all_aliases, WvIPAliaser::Alias::index, WvIPAliaser::Alias::ip, and WvIPAliaser::Alias::link_count.

WvIPAliaser::Alias* WvIPAliaser::ipsearch WvIPAliaser::AliasList   l,
const WvIPAddr   ip
[private]
 

WvIPAliaser::Alias * WvIPAliaser::ipsearch WvIPAliaser::AliasList   l,
const WvIPAddr   ip
[private]
 

Definition at line 109 of file wvipaliaser.cc.

Referenced by add().

void WvIPAliaser::start_edit  
 

you must call start_edit() once, then add() any number of times, then done_edit() once, to change your aliases. The addresses add()ed during the session become the _only_ ones that are aliases by this WvIPAliaser instance.

Why bother? This way, WvIPAliaser can see all the desired aliases when they are being changed, and only delete previously-added ones if they are no longer used. This is important, since if eg. Fast Forward has an open connection through 1.2.3.4, and we want to add 1.2.3.5 and delete 1.2.3.3, Fast Forward need not remember that it was using 1.2.3.3 but 1.2.3.4 does not get deleted, even temporarily.

If that was too confusing, just remember: call these functions in the order they appear below, always.

void WvIPAliaser::start_edit  
 

you must call start_edit() once, then add() any number of times, then done_edit() once, to change your aliases. The addresses add()ed during the session become the _only_ ones that are aliases by this WvIPAliaser instance.

Why bother? This way, WvIPAliaser can see all the desired aliases when they are being changed, and only delete previously-added ones if they are no longer used. This is important, since if eg. Fast Forward has an open connection through 1.2.3.4, and we want to add 1.2.3.5 and delete 1.2.3.3, Fast Forward need not remember that it was using 1.2.3.3 but 1.2.3.4 does not get deleted, even temporarily.

If that was too confusing, just remember: call these functions in the order they appear below, always.

Definition at line 86 of file wvipaliaser.cc.

References aliases, all_aliases, interfaces, WvInterfaceDict::update(), and WvList< Alias >::zap().

Referenced by ~WvIPAliaser().


Member Data Documentation

AliasList WvIPAliaser::aliases [private]
 

Definition at line 32 of file ipstreams/wvipaliaser.h.

Referenced by add(), dump(), start_edit(), and WvIPAliaser::AliasList::~AliasList().

AliasList WvIPAliaser::all_aliases [static, private]
 

Definition at line 31 of file ipstreams/wvipaliaser.h.

Referenced by add(), done_edit(), dump(), start_edit(), and WvIPAliaser::AliasList::~AliasList().

WvInterfaceDict WvIPAliaser::interfaces [private]
 

Definition at line 33 of file ipstreams/wvipaliaser.h.

Referenced by add(), start_edit(), WvIPAliaser(), and WvIPAliaser::AliasList::~AliasList().


The documentation for this class was generated from the following files:
Generated on Sat Aug 24 23:08:02 2002 for WvStreams by doxygen1.2.15