2 * IP_MASQ user space control interface
3 * $Id: ip_masq.h,v 1.2 1998/12/08 05:41:48 davem Exp $
6 #ifndef _LINUX_IP_MASQ_H
7 #define _LINUX_IP_MASQ_H
10 #include <linux/types.h>
11 #include <linux/stddef.h>
13 #include <sys/types.h>
19 u_int16_t sport
, dport
, mport
;
20 u_int32_t saddr
, daddr
, maddr
;
21 u_int32_t rt_daddr
; /* dst address to use for rt query */
23 u_int32_t ip_tos
; /* TOS */
24 unsigned timeout
; /* in ticks (HZ per sec) */
26 int fd
; /* NOT IMPL: attach tunnel to this fd */
27 int state
; /* NOT IMPL: return conn state */
30 #define IP_MASQ_USER_F_LISTEN 0x01 /* put entry to LISTEN state */
31 #define IP_MASQ_USER_F_DEAD 0x02 /* mark as DEAD */
32 #define IP_MASQ_USER_F_FORCE 0x04 /* force operation */
34 struct ip_masq_timeout
{
56 #define IP_FWD_RANGE 1
58 #define IP_FWD_DIRECT 3
60 #define IP_AUTOFW_ACTIVE 1
61 #define IP_AUTOFW_USETIME 2
62 #define IP_AUTOFW_SECURE 4
65 /* WARNING: bitwise equal to ip_autofw in net/ip_autofw.h */
66 struct ip_autofw_user
{
74 u_int32_t lastcontact
;
79 /* struct timer_list timer; */
85 struct ip_portfw_user
{
86 u_int16_t protocol
; /* Which protocol are we talking? */
87 u_int32_t laddr
, raddr
; /* Remote address */
88 u_int16_t lport
, rport
; /* Local and remote port */
89 int pref
; /* Preference value */
96 u_int32_t fwmark
; /* Firewalling mark */
97 u_int32_t raddr
; /* remote port */
98 u_int16_t rport
; /* remote port */
99 u_int16_t dummy
; /* Make up to multiple of 4 */
100 int pref
; /* Preference value */
101 unsigned flags
; /* misc flags */
104 #define IP_MASQ_MFW_SCHED 0x01
106 #define IP_FW_MASQCTL_MAX 256
107 #define IP_MASQ_TNAME_MAX 32
112 char m_tname
[IP_MASQ_TNAME_MAX
];
114 struct ip_portfw_user portfw_user
;
115 struct ip_autofw_user autofw_user
;
116 struct ip_mfw_user mfw_user
;
117 struct ip_masq_user user
;
118 unsigned char m_raw
[IP_FW_MASQCTL_MAX
];
122 #define IP_MASQ_CTL_BSIZE (offsetof (struct ip_masq_ctl,u))
124 #define IP_MASQ_TARGET_CORE 1
125 #define IP_MASQ_TARGET_MOD 2 /* masq_mod is selected by "name" */
126 #define IP_MASQ_TARGET_USER 3
127 #define IP_MASQ_TARGET_LAST 4
129 #define IP_MASQ_CMD_NONE 0 /* just peek */
130 #define IP_MASQ_CMD_INSERT 1
131 #define IP_MASQ_CMD_ADD 2
132 #define IP_MASQ_CMD_SET 3
133 #define IP_MASQ_CMD_DEL 4
134 #define IP_MASQ_CMD_GET 5
135 #define IP_MASQ_CMD_FLUSH 6
136 #define IP_MASQ_CMD_LIST 7 /* actually fake: done via /proc */
137 #define IP_MASQ_CMD_ENABLE 8
138 #define IP_MASQ_CMD_DISABLE 9
140 #endif /* _LINUX_IP_MASQ_H */