2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
6 #ifndef __WVIPALIASER_H
7 #define __WVIPALIASER_H
9 #include "wvinterface.h"
13 * WvIPAliaser handles IP aliasing in the Linux kernel. Multiple instances
14 * of the object can be created, and they will share aliases between them.
15 * Aliased addresses are only removed when all WvIPAliaser objects using
16 * that address give it up. (ie. the object is destroyed, or the Aliaser
17 * is reconfigured without including that address)
23 int index
, link_count
;
26 Alias(const WvIPAddr
&_ip
);
32 static AliasList all_aliases
;
34 WvInterfaceDict interfaces
;
36 WvIPAliaser::Alias
*ipsearch(WvIPAliaser::AliasList
&l
,
46 * you must call start_edit() once, then add() any number of times, then
47 * done_edit() once, to change your aliases. The addresses add()ed
48 * during the session become the _only_ ones that are aliases by this
49 * WvIPAliaser instance.
51 * Why bother? This way, WvIPAliaser can see all the desired aliases
52 * when they are being changed, and only delete previously-added ones
53 * if they are no longer used. This is important, since if eg. Fast
54 * Forward has an open connection through 1.2.3.4, and we want to add
55 * 1.2.3.5 and delete 1.2.3.3, Fast Forward need not remember that it
56 * was using 1.2.3.3 but 1.2.3.4 does not get deleted, even temporarily.
58 * If that was too confusing, just remember: call these functions in
59 * the order they appear below, always.
61 * If add() returns true, then an interface was just created. If it returns
62 * false, then that call made no changes.
64 * If done_edit() returns true, then one or more interfaces were just
65 * destroyed. If it returns false, then that call made no changes.
68 bool add(const WvIPAddr
&ip
);
73 #endif // __WVIPALIASER_H