Deleted Added
full compact
ip_nat.h (60857) ip_nat.h (63523)
1/*
2 * Copyright (C) 1995-2000 by Darren Reed.
3 *
4 * Redistribution and use in source and binary forms are permitted
5 * provided that this notice is preserved and due credit is given
6 * to the original author and the contributors.
7 *
8 * @(#)ip_nat.h 1.5 2/4/96
1/*
2 * Copyright (C) 1995-2000 by Darren Reed.
3 *
4 * Redistribution and use in source and binary forms are permitted
5 * provided that this notice is preserved and due credit is given
6 * to the original author and the contributors.
7 *
8 * @(#)ip_nat.h 1.5 2/4/96
9 * $Id: ip_nat.h,v 2.1.2.3 2000/01/24 12:44:24 darrenr Exp $
10 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_nat.h 60857 2000-05-24 04:40:17Z darrenr $
9 * $Id: ip_nat.h,v 2.17.2.6 2000/07/15 14:50:06 darrenr Exp $
10 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_nat.h 63523 2000-07-19 14:02:09Z darrenr $
11 */
12
13#ifndef __IP_NAT_H__
14#define __IP_NAT_H__
15
16#ifndef SOLARIS
17#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
18#endif

--- 80 unchanged lines hidden (view full) ---

99 struct ipnat **in_pmnext;
100 void *in_ifp;
101 void *in_apr;
102 u_long in_space;
103 u_int in_use;
104 u_int in_hits;
105 struct in_addr in_nextip;
106 u_short in_pnext;
11 */
12
13#ifndef __IP_NAT_H__
14#define __IP_NAT_H__
15
16#ifndef SOLARIS
17#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
18#endif

--- 80 unchanged lines hidden (view full) ---

99 struct ipnat **in_pmnext;
100 void *in_ifp;
101 void *in_apr;
102 u_long in_space;
103 u_int in_use;
104 u_int in_hits;
105 struct in_addr in_nextip;
106 u_short in_pnext;
107 u_short in_ppip; /* ports per IP */
108 u_short in_ippip; /* IP #'s per IP# */
107 u_short in_ippip; /* IP #'s per IP# */
109 u_short in_flags; /* From here to in_dport must be reflected */
108 u_32_t in_flags; /* From here to in_dport must be reflected */
109 u_short in_spare;
110 u_short in_ppip; /* ports per IP */
110 u_short in_port[2]; /* correctly in IPN_CMPSIZ */
111 struct in_addr in_in[2];
112 struct in_addr in_out[2];
113 struct in_addr in_src[2];
114 struct frtuc in_tuc;
115 int in_redir; /* 0 if it's a mapping, 1 if it's a hard redir */
116 char in_ifname[IFNAMSIZ];
117 char in_plabel[APR_LABELLEN]; /* proxy label */

--- 90 unchanged lines hidden (view full) ---

208#define IPN_TCP 0x001
209#define IPN_UDP 0x002
210#define IPN_TCPUDP (IPN_TCP|IPN_UDP)
211#define IPN_DELETE 0x004
212#define IPN_ICMPERR 0x008
213#define IPN_RF (IPN_TCPUDP|IPN_DELETE|IPN_ICMPERR)
214#define IPN_AUTOPORTMAP 0x010
215#define IPN_IPRANGE 0x020
111 u_short in_port[2]; /* correctly in IPN_CMPSIZ */
112 struct in_addr in_in[2];
113 struct in_addr in_out[2];
114 struct in_addr in_src[2];
115 struct frtuc in_tuc;
116 int in_redir; /* 0 if it's a mapping, 1 if it's a hard redir */
117 char in_ifname[IFNAMSIZ];
118 char in_plabel[APR_LABELLEN]; /* proxy label */

--- 90 unchanged lines hidden (view full) ---

209#define IPN_TCP 0x001
210#define IPN_UDP 0x002
211#define IPN_TCPUDP (IPN_TCP|IPN_UDP)
212#define IPN_DELETE 0x004
213#define IPN_ICMPERR 0x008
214#define IPN_RF (IPN_TCPUDP|IPN_DELETE|IPN_ICMPERR)
215#define IPN_AUTOPORTMAP 0x010
216#define IPN_IPRANGE 0x020
216#define IPN_USERFLAGS (IPN_TCPUDP|IPN_AUTOPORTMAP|IPN_IPRANGE|\
217 IPN_SPLIT|IPN_ROUNDR|IPN_FILTER)
217#define IPN_USERFLAGS (IPN_TCPUDP|IPN_AUTOPORTMAP|IPN_IPRANGE|IPN_SPLIT|\
218 IPN_ROUNDR|IPN_FILTER|IPN_NOTSRC|IPN_NOTDST)
218#define IPN_FILTER 0x040
219#define IPN_SPLIT 0x080
220#define IPN_ROUNDR 0x100
219#define IPN_FILTER 0x040
220#define IPN_SPLIT 0x080
221#define IPN_ROUNDR 0x100
222#define IPN_NOTSRC 0x080000
223#define IPN_NOTDST 0x100000
221
222
223typedef struct natlog {
224 struct in_addr nl_origip;
225 struct in_addr nl_outip;
226 struct in_addr nl_inip;
227 u_short nl_origport;
228 u_short nl_outport;
229 u_short nl_inport;
230 u_short nl_type;
231 int nl_rule;
232 U_QUAD_T nl_pkts;
233 U_QUAD_T nl_bytes;
234 u_char nl_p;
235} natlog_t;
236
237
238#define NL_NEWMAP NAT_MAP
239#define NL_NEWRDR NAT_REDIRECT
224
225
226typedef struct natlog {
227 struct in_addr nl_origip;
228 struct in_addr nl_outip;
229 struct in_addr nl_inip;
230 u_short nl_origport;
231 u_short nl_outport;
232 u_short nl_inport;
233 u_short nl_type;
234 int nl_rule;
235 U_QUAD_T nl_pkts;
236 U_QUAD_T nl_bytes;
237 u_char nl_p;
238} natlog_t;
239
240
241#define NL_NEWMAP NAT_MAP
242#define NL_NEWRDR NAT_REDIRECT
243#define NL_NEWBIMAP NAT_BIMAP
244#define NL_NEWBLOCK NAT_MAPBLK
240#define NL_EXPIRE 0xffff
241
242#define NAT_HASH_FN(k,l,m) (((k) + ((k) >> 12) + l) % (m))
243
244#define LONG_SUM(in) (((in) & 0xffff) + ((in) >> 16))
245
246#define CALC_SUMD(s1, s2, sd) { \
247 (s1) = ((s1) & 0xffff) + ((s1) >> 16); \

--- 48 unchanged lines hidden ---
245#define NL_EXPIRE 0xffff
246
247#define NAT_HASH_FN(k,l,m) (((k) + ((k) >> 12) + l) % (m))
248
249#define LONG_SUM(in) (((in) & 0xffff) + ((in) >> 16))
250
251#define CALC_SUMD(s1, s2, sd) { \
252 (s1) = ((s1) & 0xffff) + ((s1) >> 16); \

--- 48 unchanged lines hidden ---