diff options
author | Darren Reed <darrenr@FreeBSD.org> | 1997-05-25 15:50:46 +0000 |
---|---|---|
committer | Darren Reed <darrenr@FreeBSD.org> | 1997-05-25 15:50:46 +0000 |
commit | e10102a12a980dc84a95a4a831769c1058c946c0 (patch) | |
tree | 25de559faf9011589a627f617cbd6ba5d2249232 /sys/netinet/ip_nat.h | |
parent | 1fddb84ad639d46f835aa6d5b12abdbbc6934d03 (diff) | |
download | src-e10102a12a980dc84a95a4a831769c1058c946c0.tar.gz src-e10102a12a980dc84a95a4a831769c1058c946c0.zip |
Import version 3.2alpha7vendor/ipfilter-sys/v3-2-a7
Notes
Notes:
svn path=/vendor-sys/ipfilter/dist-old/; revision=26124
svn path=/vendor-sys/ipfilter/v3-2-a7/; revision=26126; tag=vendor/ipfilter-sys/v3-2-a7
Diffstat (limited to 'sys/netinet/ip_nat.h')
-rw-r--r-- | sys/netinet/ip_nat.h | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/sys/netinet/ip_nat.h b/sys/netinet/ip_nat.h index 6dcd28be4185..add4a9a237e6 100644 --- a/sys/netinet/ip_nat.h +++ b/sys/netinet/ip_nat.h @@ -1,17 +1,21 @@ /* - * (C)opyright 1995 by Darren Reed. + * (C)opyright 1995-1997 by Darren Reed. * * Redistribution and use in source and binary forms are permitted * provided that this notice is preserved and due credit is given * to the original author and the contributors. * * @(#)ip_nat.h 1.5 2/4/96 - * $Id: ip_nat.h,v 1.1.1.2 1997/04/03 10:11:19 darrenr Exp $ + * $Id: ip_nat.h,v 2.0.2.12 1997/05/24 07:35:20 darrenr Exp $ */ -#ifndef __IP_NAT_H_ +#ifndef __IP_NAT_H__ #define __IP_NAT_H__ +#ifndef __IP_PROXY_H__ +#include "netinet/ip_proxy.h" +#endif + #ifndef SOLARIS #define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) #endif @@ -44,9 +48,12 @@ typedef struct nat { int nat_flags; u_long nat_sumd; u_long nat_ipsumd; + struct ipfr *nat_frag; struct in_addr nat_inip; struct in_addr nat_outip; struct in_addr nat_oip; /* other ip */ + U_QUAD_T nat_pkts; + U_QUAD_T nat_bytes; u_short nat_oport; /* other port */ u_short nat_inport; u_short nat_outport; @@ -56,6 +63,8 @@ typedef struct nat { struct nat *nat_next; struct nat *nat_hnext[2]; struct nat **nat_hstart[2]; + void *nat_ifp; + int nat_dir; } nat_t; typedef struct ipnat { @@ -69,8 +78,12 @@ typedef struct ipnat { u_short in_port[2]; struct in_addr in_in[2]; struct in_addr in_out[2]; + struct aproxy *in_apr; int in_redir; /* 0 if it's a mapping, 1 if it's a hard redir */ char in_ifname[IFNAMSIZ]; + char in_plabel[APR_LABELLEN]; /* proxy label */ + char in_p; /* protocol */ + u_short in_dport; } ipnat_t; #define in_pmin in_port[0] /* Also holds static redir port */ @@ -81,11 +94,12 @@ typedef struct ipnat { #define in_outip in_out[0].s_addr #define in_outmsk in_out[1].s_addr -#define NAT_INBOUND 0 -#define NAT_OUTBOUND 1 +#define NAT_OUTBOUND 0 +#define NAT_INBOUND 1 -#define NAT_MAP 0 -#define NAT_REDIRECT 1 +#define NAT_MAP 0x01 +#define NAT_REDIRECT 0x02 +#define NAT_BIMAP (NAT_MAP|NAT_REDIRECT) #define IPN_CMPSIZ (sizeof(struct in_addr) * 4 + sizeof(u_short) * 3 + \ sizeof(int)) @@ -99,6 +113,7 @@ typedef struct natlookup { typedef struct natstat { u_long ns_mapped[2]; + u_long ns_rules; u_long ns_added; u_long ns_expire; u_long ns_inuse; @@ -108,10 +123,11 @@ typedef struct natstat { ipnat_t *ns_list; } natstat_t; -#define IPN_ANY 0 -#define IPN_TCP 1 -#define IPN_UDP 2 -#define IPN_TCPUDP 3 +#define IPN_ANY 0x00 +#define IPN_TCP 0x01 +#define IPN_UDP 0x02 +#define IPN_TCPUDP 0x03 +#define IPN_DELETE 0x04 typedef struct natlog { @@ -124,6 +140,8 @@ typedef struct natlog { u_short nl_inport; u_short nl_type; int nl_rule; + U_QUAD_T nl_pkts; + U_QUAD_T nl_bytes; } natlog_t; @@ -132,18 +150,22 @@ typedef struct natlog { #define NL_EXPIRE 0xffff +extern u_long fr_defnatage; extern nat_t *nat_table[2][NAT_SIZE]; extern int nat_ioctl __P((caddr_t, int, int)); -extern nat_t *nat_outlookup __P((int, struct in_addr, u_short, +extern nat_t *nat_new __P((ipnat_t *, ip_t *, fr_info_t *, u_short, int)); +extern nat_t *nat_outlookup __P((void *, int, struct in_addr, u_short, struct in_addr, u_short)); -extern nat_t *nat_inlookup __P((int, struct in_addr, u_short, +extern nat_t *nat_inlookup __P((void *, int, struct in_addr, u_short, struct in_addr, u_short)); extern nat_t *nat_lookupredir __P((natlookup_t *)); -extern nat_t *nat_lookupmapip __P((int, struct in_addr, u_short, +extern nat_t *nat_lookupmapip __P((void *, int, struct in_addr, u_short, struct in_addr, u_short)); extern int ip_natout __P((ip_t *, int, fr_info_t *)); extern int ip_natin __P((ip_t *, int, fr_info_t *)); extern void ip_natunload __P((void)), ip_natexpire __P((void)); extern void nat_log __P((struct nat *, u_short)); +extern void fix_incksum __P((u_short *, u_long)); +extern void fix_outcksum __P((u_short *, u_long)); #endif /* __IP_NAT_H__ */ |