This repo is obsolete, please see git://git.code.sf.net/p/dummynet/code@master
[ipfw.git] / ipfw / include / alias.h
1 #ifndef _ALIAS_H_
2 #define _ALIAS_H_
3
4 #define LIBALIAS_BUF_SIZE 128
5
6 /*
7  * If PKT_ALIAS_LOG is set, a message will be printed to /var/log/alias.log
8  * every time a link is created or deleted.  This is useful for debugging.
9  */
10 #define PKT_ALIAS_LOG                   0x01
11
12 /*
13  * If PKT_ALIAS_DENY_INCOMING is set, then incoming connections (e.g. to ftp,
14  * telnet or web servers will be prevented by the aliasing mechanism.
15  */
16 #define PKT_ALIAS_DENY_INCOMING         0x02
17
18 /*
19  * If PKT_ALIAS_SAME_PORTS is set, packets will be attempted sent from the
20  * same port as they originated on.  This allows e.g. rsh to work *99% of the
21  * time*, but _not_ 100% (it will be slightly flakey instead of not working
22  * at all).  This mode bit is set by PacketAliasInit(), so it is a default
23  * mode of operation.
24  */
25 #define PKT_ALIAS_SAME_PORTS            0x04
26
27 /*
28  * If PKT_ALIAS_USE_SOCKETS is set, then when partially specified links (e.g.
29  * destination port and/or address is zero), the packet aliasing engine will
30  * attempt to allocate a socket for the aliasing port it chooses.  This will
31  * avoid interference with the host machine.  Fully specified links do not
32  * require this.  This bit is set after a call to PacketAliasInit(), so it is
33  * a default mode of operation.
34  */
35 #ifndef NO_USE_SOCKETS
36 #define PKT_ALIAS_USE_SOCKETS           0x08
37 #endif
38 /*-
39  * If PKT_ALIAS_UNREGISTERED_ONLY is set, then only packets with
40  * unregistered source addresses will be aliased.  Private
41  * addresses are those in the following ranges:
42  *
43  *              10.0.0.0     ->   10.255.255.255
44  *              172.16.0.0   ->   172.31.255.255
45  *              192.168.0.0  ->   192.168.255.255
46  */
47 #define PKT_ALIAS_UNREGISTERED_ONLY     0x10
48
49 /*
50  * If PKT_ALIAS_RESET_ON_ADDR_CHANGE is set, then the table of dynamic
51  * aliasing links will be reset whenever PacketAliasSetAddress() changes the
52  * default aliasing address.  If the default aliasing address is left
53  * unchanged by this function call, then the table of dynamic aliasing links
54  * will be left intact.  This bit is set after a call to PacketAliasInit().
55  */
56 #define PKT_ALIAS_RESET_ON_ADDR_CHANGE  0x20
57
58
59 /*
60  * If PKT_ALIAS_PROXY_ONLY is set, then NAT will be disabled and only
61  * transparent proxying is performed.
62  */
63 #define PKT_ALIAS_PROXY_ONLY            0x40
64
65 /*
66  * If PKT_ALIAS_REVERSE is set, the actions of PacketAliasIn() and
67  * PacketAliasOut() are reversed.
68  */
69 #define PKT_ALIAS_REVERSE               0x80
70
71 #endif                          /* !_ALIAS_H_ */