Home | History | Annotate | Line # | Download | only in netinet
ip_proxy.h revision 1.1.1.2
      1      1.1  christos /*	$NetBSD: ip_proxy.h,v 1.1.1.2 2012/07/22 13:45:33 darrenr Exp $	*/
      2      1.1  christos 
      3      1.1  christos /*
      4  1.1.1.2   darrenr  * Copyright (C) 2012 by Darren Reed.
      5      1.1  christos  *
      6      1.1  christos  * See the IPFILTER.LICENCE file for details on licencing.
      7      1.1  christos  *
      8  1.1.1.2   darrenr  * $Id: ip_proxy.h,v 1.1.1.2 2012/07/22 13:45:33 darrenr Exp $
      9      1.1  christos  */
     10      1.1  christos 
     11      1.1  christos #ifndef	__IP_PROXY_H__
     12      1.1  christos #define	__IP_PROXY_H__
     13      1.1  christos 
     14      1.1  christos #ifndef SOLARIS
     15      1.1  christos #define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
     16      1.1  christos #endif
     17      1.1  christos 
     18      1.1  christos #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)
     19      1.1  christos #define	SIOCPROXY	_IOWR('r', 64, struct ap_control)
     20      1.1  christos #else
     21      1.1  christos #define	SIOCPROXY	_IOWR(r, 64, struct ap_control)
     22      1.1  christos #endif
     23      1.1  christos 
     24      1.1  christos #ifndef	APR_LABELLEN
     25      1.1  christos #define	APR_LABELLEN	16
     26      1.1  christos #endif
     27      1.1  christos #define	AP_SESS_SIZE	53
     28      1.1  christos 
     29      1.1  christos struct	nat;
     30      1.1  christos struct	ipnat;
     31      1.1  christos struct	ipstate;
     32      1.1  christos 
     33      1.1  christos typedef	struct	ap_tcp {
     34      1.1  christos 	u_short	apt_sport;	/* source port */
     35      1.1  christos 	u_short	apt_dport;	/* destination port */
     36      1.1  christos 	short	apt_sel[2];	/* {seq,ack}{off,min} set selector */
     37      1.1  christos 	short	apt_seqoff[2];	/* sequence # difference */
     38      1.1  christos 	u_32_t	apt_seqmin[2];	/* don't change seq-off until after this */
     39      1.1  christos 	short	apt_ackoff[2];	/* sequence # difference */
     40      1.1  christos 	u_32_t	apt_ackmin[2];	/* don't change seq-off until after this */
     41      1.1  christos 	u_char	apt_state[2];	/* connection state */
     42      1.1  christos } ap_tcp_t;
     43      1.1  christos 
     44      1.1  christos typedef	struct	ap_udp {
     45      1.1  christos 	u_short	apu_sport;	/* source port */
     46      1.1  christos 	u_short	apu_dport;	/* destination port */
     47      1.1  christos } ap_udp_t;
     48      1.1  christos 
     49      1.1  christos typedef	struct ap_session {
     50      1.1  christos 	struct	aproxy	*aps_apr;
     51      1.1  christos 	union {
     52      1.1  christos 		struct	ap_tcp	apu_tcp;
     53      1.1  christos 		struct	ap_udp	apu_udp;
     54      1.1  christos 	} aps_un;
     55      1.1  christos 	U_QUAD_T aps_bytes;	/* bytes sent */
     56      1.1  christos 	U_QUAD_T aps_pkts;	/* packets sent */
     57      1.1  christos 	void	*aps_nat;	/* pointer back to nat struct */
     58      1.1  christos 	void	*aps_data;	/* private data */
     59      1.1  christos 	int	aps_psiz;	/* size of private data */
     60      1.1  christos 	struct	ap_session	*aps_next;
     61      1.1  christos } ap_session_t;
     62      1.1  christos 
     63      1.1  christos #define	aps_sport	aps_un.apu_tcp.apt_sport
     64      1.1  christos #define	aps_dport	aps_un.apu_tcp.apt_dport
     65      1.1  christos #define	aps_sel		aps_un.apu_tcp.apt_sel
     66      1.1  christos #define	aps_seqoff	aps_un.apu_tcp.apt_seqoff
     67      1.1  christos #define	aps_seqmin	aps_un.apu_tcp.apt_seqmin
     68      1.1  christos #define	aps_state	aps_un.apu_tcp.apt_state
     69      1.1  christos #define	aps_ackoff	aps_un.apu_tcp.apt_ackoff
     70      1.1  christos #define	aps_ackmin	aps_un.apu_tcp.apt_ackmin
     71      1.1  christos 
     72      1.1  christos 
     73      1.1  christos typedef	struct	ap_control {
     74      1.1  christos 	char	apc_label[APR_LABELLEN];
     75      1.1  christos 	char	apc_config[APR_LABELLEN];
     76      1.1  christos 	u_char	apc_p;
     77      1.1  christos 	/*
     78      1.1  christos 	 * The following fields are upto the proxy's apr_ctl routine to deal
     79      1.1  christos 	 * with.  When the proxy gets this in kernel space, apc_data will
     80      1.1  christos 	 * point to a malloc'd region of memory of apc_dsize bytes.  If the
     81      1.1  christos 	 * proxy wants to keep that memory, it must set apc_data to NULL
     82      1.1  christos 	 * before it returns.  It is expected if this happens that it will
     83      1.1  christos 	 * take care to free it in apr_fini or otherwise as appropriate.
     84      1.1  christos 	 * apc_cmd is provided as a standard place to put simple commands,
     85      1.1  christos 	 * with apc_arg being available to put a simple arg.
     86      1.1  christos 	 */
     87      1.1  christos 	u_long	apc_cmd;
     88      1.1  christos 	u_long	apc_arg;
     89      1.1  christos 	void	*apc_data;
     90      1.1  christos 	size_t	apc_dsize;
     91      1.1  christos } ap_ctl_t;
     92      1.1  christos 
     93      1.1  christos #define	APC_CMD_ADD	0
     94      1.1  christos #define	APC_CMD_DEL	1
     95      1.1  christos 
     96      1.1  christos 
     97      1.1  christos typedef	struct	aproxy	{
     98      1.1  christos 	struct	aproxy	*apr_next;
     99      1.1  christos 	struct	aproxy	*apr_parent;
    100      1.1  christos 	char	apr_label[APR_LABELLEN];	/* Proxy label # */
    101      1.1  christos 	u_char	apr_p;				/* protocol */
    102      1.1  christos 	int	apr_flags;
    103      1.1  christos 	int	apr_ref;
    104      1.1  christos 	int	apr_clones;
    105      1.1  christos 	void	(* apr_load) __P((void));
    106      1.1  christos 	void	(* apr_unload) __P((void));
    107      1.1  christos 	void	*(* apr_create) __P((ipf_main_softc_t *));
    108      1.1  christos 	void	(* apr_destroy) __P((ipf_main_softc_t *, void *));
    109      1.1  christos 	int	(* apr_init) __P((ipf_main_softc_t *, void *));
    110      1.1  christos 	void	(* apr_fini) __P((ipf_main_softc_t *, void *));
    111      1.1  christos 	int	(* apr_new) __P((void *, fr_info_t *, ap_session_t *,
    112      1.1  christos 				 struct nat *));
    113      1.1  christos 	void	(* apr_del) __P((ipf_main_softc_t *, ap_session_t *));
    114      1.1  christos 	int	(* apr_inpkt) __P((void *, fr_info_t *, ap_session_t *,
    115      1.1  christos 				   struct nat *));
    116      1.1  christos 	int	(* apr_outpkt) __P((void *, fr_info_t *, ap_session_t *,
    117      1.1  christos 				    struct nat *));
    118      1.1  christos 	int	(* apr_match) __P((fr_info_t *, ap_session_t *, struct nat *));
    119      1.1  christos 	int	(* apr_ctl) __P((ipf_main_softc_t *, void *, ap_ctl_t *));
    120      1.1  christos 	int	(* apr_clear) __P((struct aproxy *));
    121      1.1  christos 	int	(* apr_flush) __P((struct aproxy *, int));
    122      1.1  christos 	void	*apr_soft;
    123      1.1  christos } aproxy_t;
    124      1.1  christos 
    125      1.1  christos #define	APR_DELETE	1
    126      1.1  christos 
    127      1.1  christos #define	APR_ERR(x)	((x) << 16)
    128      1.1  christos #define	APR_EXIT(x)	(((x) >> 16) & 0xffff)
    129      1.1  christos #define	APR_INC(x)	((x) & 0xffff)
    130      1.1  christos 
    131      1.1  christos 
    132      1.1  christos #ifdef _KERNEL
    133      1.1  christos /*
    134      1.1  christos  * Generic #define's to cover missing things in the kernel
    135      1.1  christos  */
    136      1.1  christos # ifndef isdigit
    137      1.1  christos #  define isdigit(x)	((x) >= '0' && (x) <= '9')
    138      1.1  christos # endif
    139      1.1  christos # ifndef isupper
    140      1.1  christos #  define isupper(x)	(((unsigned)(x) >= 'A') && ((unsigned)(x) <= 'Z'))
    141      1.1  christos # endif
    142      1.1  christos # ifndef islower
    143      1.1  christos #  define islower(x)	(((unsigned)(x) >= 'a') && ((unsigned)(x) <= 'z'))
    144      1.1  christos # endif
    145      1.1  christos # ifndef isalpha
    146      1.1  christos #  define isalpha(x)	(isupper(x) || islower(x))
    147      1.1  christos # endif
    148      1.1  christos # ifndef toupper
    149      1.1  christos #  define toupper(x)	(isupper(x) ? (x) : (x) - 'a' + 'A')
    150      1.1  christos # endif
    151      1.1  christos # ifndef isspace
    152      1.1  christos #  define isspace(x)	(((x) == ' ') || ((x) == '\r') || ((x) == '\n') || \
    153      1.1  christos 			 ((x) == '\t') || ((x) == '\b'))
    154      1.1  christos # endif
    155      1.1  christos #endif /* _KERNEL */
    156      1.1  christos 
    157      1.1  christos /*
    158      1.1  christos  * For the ftp proxy.
    159      1.1  christos  */
    160      1.1  christos #define	FTP_BUFSZ	160
    161      1.1  christos #define	IPF_FTPBUFSZ	160
    162      1.1  christos 
    163      1.1  christos typedef struct  ftpside {
    164      1.1  christos 	char	*ftps_rptr;
    165      1.1  christos 	char	*ftps_wptr;
    166      1.1  christos 	void	*ftps_ifp;
    167      1.1  christos 	u_32_t	ftps_seq[2];
    168      1.1  christos 	u_32_t	ftps_len;
    169      1.1  christos 	int	ftps_junk;
    170      1.1  christos 	int	ftps_cmds;
    171      1.1  christos 	int	ftps_cmd;
    172      1.1  christos 	char	ftps_buf[FTP_BUFSZ];
    173      1.1  christos } ftpside_t;
    174      1.1  christos 
    175      1.1  christos typedef struct  ftpinfo {
    176      1.1  christos 	int 	  	ftp_passok;
    177      1.1  christos 	int		ftp_incok;
    178      1.1  christos 	void		*ftp_pendstate;
    179      1.1  christos 	nat_t		*ftp_pendnat;
    180      1.1  christos 	ftpside_t	ftp_side[2];
    181      1.1  christos } ftpinfo_t;
    182      1.1  christos 
    183      1.1  christos 
    184      1.1  christos /*
    185  1.1.1.2   darrenr  * IPsec proxy
    186  1.1.1.2   darrenr  */
    187  1.1.1.2   darrenr typedef u_32_t		ipsec_cookie_t[2];
    188  1.1.1.2   darrenr 
    189  1.1.1.2   darrenr typedef struct ipsec_pxy {
    190  1.1.1.2   darrenr 	ipsec_cookie_t	ipsc_icookie;
    191  1.1.1.2   darrenr 	ipsec_cookie_t	ipsc_rcookie;
    192  1.1.1.2   darrenr 	int		ipsc_rckset;
    193  1.1.1.2   darrenr 	nat_t		*ipsc_nat;
    194  1.1.1.2   darrenr 	struct ipstate	*ipsc_state;
    195  1.1.1.2   darrenr 	ipnat_t		*ipsc_rule;
    196  1.1.1.2   darrenr } ipsec_pxy_t;
    197  1.1.1.2   darrenr 
    198  1.1.1.2   darrenr 
    199  1.1.1.2   darrenr /*
    200      1.1  christos  * For the irc proxy.
    201      1.1  christos  */
    202      1.1  christos typedef	struct	ircinfo {
    203      1.1  christos 	size_t	irc_len;
    204      1.1  christos 	char	*irc_snick;
    205      1.1  christos 	char	*irc_dnick;
    206      1.1  christos 	char	*irc_type;
    207      1.1  christos 	char	*irc_arg;
    208      1.1  christos 	char	*irc_addr;
    209      1.1  christos 	u_32_t	irc_ipnum;
    210      1.1  christos 	u_short	irc_port;
    211      1.1  christos } ircinfo_t;
    212      1.1  christos 
    213      1.1  christos 
    214      1.1  christos /*
    215      1.1  christos  * For the DNS "proxy"
    216      1.1  christos  */
    217      1.1  christos typedef struct dnsinfo {
    218      1.1  christos         ipfmutex_t	dnsi_lock;
    219      1.1  christos 	u_short		dnsi_id;
    220      1.1  christos 	char		dnsi_buffer[512];
    221      1.1  christos } dnsinfo_t;
    222      1.1  christos 
    223      1.1  christos 
    224      1.1  christos /*
    225      1.1  christos  * Real audio proxy structure and #defines
    226      1.1  christos  */
    227      1.1  christos typedef	struct	raudio_s {
    228      1.1  christos 	int	rap_seenpna;
    229      1.1  christos 	int	rap_seenver;
    230      1.1  christos 	int	rap_version;
    231      1.1  christos 	int	rap_eos;	/* End Of Startup */
    232      1.1  christos 	int	rap_gotid;
    233      1.1  christos 	int	rap_gotlen;
    234      1.1  christos 	int	rap_mode;
    235      1.1  christos 	int	rap_sdone;
    236      1.1  christos 	u_short	rap_plport;
    237      1.1  christos 	u_short	rap_prport;
    238      1.1  christos 	u_short	rap_srport;
    239      1.1  christos 	char	rap_svr[19];
    240      1.1  christos 	u_32_t	rap_sbf;	/* flag to indicate which of the 19 bytes have
    241      1.1  christos 				 * been filled
    242      1.1  christos 				 */
    243      1.1  christos 	u_32_t	rap_sseq;
    244      1.1  christos } raudio_t;
    245      1.1  christos 
    246      1.1  christos #define	RA_ID_END	0
    247      1.1  christos #define	RA_ID_UDP	1
    248      1.1  christos #define	RA_ID_ROBUST	7
    249      1.1  christos 
    250      1.1  christos #define	RAP_M_UDP	1
    251      1.1  christos #define	RAP_M_ROBUST	2
    252      1.1  christos #define	RAP_M_TCP	4
    253      1.1  christos #define	RAP_M_UDP_ROBUST	(RAP_M_UDP|RAP_M_ROBUST)
    254      1.1  christos 
    255      1.1  christos 
    256      1.1  christos /*
    257      1.1  christos  * MSN RPC proxy
    258      1.1  christos  */
    259      1.1  christos typedef	struct	msnrpcinfo	{
    260      1.1  christos 	u_int		mri_flags;
    261      1.1  christos 	int		mri_cmd[2];
    262      1.1  christos 	u_int		mri_valid;
    263      1.1  christos 	struct	in_addr	mri_raddr;
    264      1.1  christos 	u_short		mri_rport;
    265      1.1  christos } msnrpcinfo_t;
    266      1.1  christos 
    267      1.1  christos 
    268      1.1  christos /*
    269      1.1  christos  * Sun RPCBIND proxy
    270      1.1  christos  */
    271      1.1  christos #define RPCB_MAXMSG	888
    272      1.1  christos #define RPCB_RES_PMAP	0	/* Response contains a v2 port. */
    273      1.1  christos #define RPCB_RES_STRING	1	/* " " " v3 (GETADDR) string. */
    274      1.1  christos #define RPCB_RES_LIST	2	/* " " " v4 (GETADDRLIST) list. */
    275      1.1  christos #define RPCB_MAXREQS	32	/* Arbitrary limit on tracked transactions */
    276      1.1  christos 
    277      1.1  christos #define RPCB_REQMIN	40
    278      1.1  christos #define RPCB_REQMAX	888
    279      1.1  christos #define RPCB_REPMIN	20
    280      1.1  christos #define	RPCB_REPMAX	604	/* XXX double check this! */
    281      1.1  christos 
    282      1.1  christos /*
    283      1.1  christos  * These macros determine the number of bytes between p and the end of
    284      1.1  christos  * r->rs_buf relative to l.
    285      1.1  christos  */
    286      1.1  christos #define RPCB_BUF_END(r) (char *)((r)->rm_msgbuf + (r)->rm_buflen)
    287      1.1  christos #define RPCB_BUF_GEQ(r, p, l)   \
    288      1.1  christos         ((RPCB_BUF_END((r)) > (char *)(p)) &&           \
    289      1.1  christos          ((RPCB_BUF_END((r)) - (char *)(p)) >= (l)))
    290      1.1  christos #define	RPCB_BUF_EQ(r, p, l)                            \
    291      1.1  christos         (RPCB_BUF_END((r)) == ((char *)(p) + (l)))
    292      1.1  christos 
    293      1.1  christos /*
    294      1.1  christos  * The following correspond to RPC(B) detailed in RFC183[13].
    295      1.1  christos  */
    296      1.1  christos #define RPCB_CALL		0
    297      1.1  christos #define RPCB_REPLY		1
    298      1.1  christos #define RPCB_MSG_VERSION	2
    299      1.1  christos #define RPCB_PROG		100000
    300      1.1  christos #define RPCB_GETPORT		3
    301      1.1  christos #define RPCB_GETADDR		3
    302      1.1  christos #define RPCB_GETADDRLIST	11
    303      1.1  christos #define RPCB_MSG_ACCEPTED	0
    304      1.1  christos #define RPCB_MSG_DENIED		1
    305      1.1  christos 
    306      1.1  christos /* BEGIN (Generic XDR structures) */
    307      1.1  christos typedef struct xdr_string {
    308      1.1  christos 	u_32_t	*xs_len;
    309      1.1  christos 	char	*xs_str;
    310      1.1  christos } xdr_string_t;
    311      1.1  christos 
    312      1.1  christos typedef struct xdr_auth {
    313      1.1  christos 	/* u_32_t	xa_flavor; */
    314      1.1  christos 	xdr_string_t	xa_string;
    315      1.1  christos } xdr_auth_t;
    316      1.1  christos 
    317      1.1  christos typedef struct xdr_uaddr {
    318      1.1  christos 	u_32_t		xu_ip;
    319      1.1  christos 	u_short         xu_port;
    320      1.1  christos 	xdr_string_t	xu_str;
    321      1.1  christos } xdr_uaddr_t;
    322      1.1  christos 
    323      1.1  christos typedef	struct xdr_proto {
    324      1.1  christos 	u_int		xp_proto;
    325      1.1  christos 	xdr_string_t	xp_str;
    326      1.1  christos } xdr_proto_t;
    327      1.1  christos 
    328      1.1  christos #define xu_xslen	xu_str.xs_len
    329      1.1  christos #define xu_xsstr	xu_str.xs_str
    330      1.1  christos #define	xp_xslen	xp_str.xs_len
    331      1.1  christos #define xp_xsstr	xp_str.xs_str
    332      1.1  christos /* END (Generic XDR structures) */
    333      1.1  christos 
    334      1.1  christos /* BEGIN (RPC call structures) */
    335      1.1  christos typedef struct pmap_args {
    336      1.1  christos 	/* u_32_t	pa_prog; */
    337      1.1  christos 	/* u_32_t	pa_vers; */
    338      1.1  christos 	u_32_t		*pa_prot;
    339      1.1  christos 	/* u_32_t	pa_port; */
    340      1.1  christos } pmap_args_t;
    341      1.1  christos 
    342      1.1  christos typedef struct rpcb_args {
    343      1.1  christos 	/* u_32_t	*ra_prog; */
    344      1.1  christos 	/* u_32_t	*ra_vers; */
    345      1.1  christos 	xdr_proto_t	ra_netid;
    346      1.1  christos 	xdr_uaddr_t	ra_maddr;
    347      1.1  christos 	/* xdr_string_t	ra_owner; */
    348      1.1  christos } rpcb_args_t;
    349      1.1  christos 
    350      1.1  christos typedef struct rpc_call {
    351      1.1  christos 	/* u_32_t	rc_rpcvers; */
    352      1.1  christos 	/* u_32_t	rc_prog; */
    353      1.1  christos 	u_32_t	*rc_vers;
    354      1.1  christos 	u_32_t	*rc_proc;
    355      1.1  christos 	xdr_auth_t	rc_authcred;
    356      1.1  christos 	xdr_auth_t	rc_authverf;
    357      1.1  christos 	union {
    358      1.1  christos 		pmap_args_t	ra_pmapargs;
    359      1.1  christos 		rpcb_args_t	ra_rpcbargs;
    360      1.1  christos 	} rpcb_args;
    361      1.1  christos } rpc_call_t;
    362      1.1  christos 
    363      1.1  christos #define	rc_pmapargs	rpcb_args.ra_pmapargs
    364      1.1  christos #define rc_rpcbargs	rpcb_args.ra_rpcbargs
    365      1.1  christos /* END (RPC call structures) */
    366      1.1  christos 
    367      1.1  christos /* BEGIN (RPC reply structures) */
    368      1.1  christos typedef struct rpcb_entry {
    369      1.1  christos 	xdr_uaddr_t	re_maddr;
    370      1.1  christos 	xdr_proto_t	re_netid;
    371      1.1  christos 	/* u_32_t	re_semantics; */
    372      1.1  christos 	xdr_string_t	re_family;
    373      1.1  christos 	xdr_proto_t	re_proto;
    374      1.1  christos 	u_32_t		*re_more; /* 1 == another entry follows */
    375      1.1  christos } rpcb_entry_t;
    376      1.1  christos 
    377      1.1  christos typedef struct rpcb_listp {
    378      1.1  christos 	u_32_t		*rl_list; /* 1 == list follows */
    379      1.1  christos 	int		rl_cnt;
    380      1.1  christos 	rpcb_entry_t	rl_entries[2]; /* TCP / UDP only */
    381      1.1  christos } rpcb_listp_t;
    382      1.1  christos 
    383      1.1  christos typedef struct rpc_resp {
    384      1.1  christos 	/* u_32_t	rr_acceptdeny; */
    385      1.1  christos 	/* Omitted 'message denied' fork; we don't care about rejects. */
    386      1.1  christos 	xdr_auth_t	rr_authverf;
    387      1.1  christos 	/* u_32_t		*rr_astat;	*/
    388      1.1  christos 	union {
    389      1.1  christos 		u_32_t		*resp_pmap;
    390      1.1  christos 		xdr_uaddr_t	resp_getaddr;
    391      1.1  christos 		rpcb_listp_t	resp_getaddrlist;
    392      1.1  christos 	} rpcb_reply;
    393      1.1  christos } rpc_resp_t;
    394      1.1  christos 
    395      1.1  christos #define	rr_v2	rpcb_reply.resp_pmap
    396      1.1  christos #define rr_v3	rpcb_reply.resp_getaddr
    397      1.1  christos #define	rr_v4	rpcb_reply.resp_getaddrlist
    398      1.1  christos /* END (RPC reply structures) */
    399      1.1  christos 
    400      1.1  christos /* BEGIN (RPC message structure & macros) */
    401      1.1  christos typedef struct rpc_msg {
    402      1.1  christos 	char	rm_msgbuf[RPCB_MAXMSG];	/* RPCB data buffer */
    403      1.1  christos 	u_int	rm_buflen;
    404      1.1  christos 	u_32_t	*rm_xid;
    405      1.1  christos 	/* u_32_t Call vs Reply */
    406      1.1  christos 	union {
    407      1.1  christos 		rpc_call_t	rb_call;
    408      1.1  christos 		rpc_resp_t	rb_resp;
    409      1.1  christos 	} rm_body;
    410      1.1  christos } rpc_msg_t;
    411      1.1  christos 
    412      1.1  christos #define rm_call		rm_body.rb_call
    413      1.1  christos #define rm_resp		rm_body.rb_resp
    414      1.1  christos /* END (RPC message structure & macros) */
    415      1.1  christos 
    416      1.1  christos /*
    417      1.1  christos  * These code paths aren't hot enough to warrant per transaction
    418      1.1  christos  * mutexes.
    419      1.1  christos  */
    420      1.1  christos typedef struct rpcb_xact {
    421      1.1  christos 	struct	rpcb_xact	*rx_next;
    422      1.1  christos 	struct	rpcb_xact	**rx_pnext;
    423      1.1  christos 	u_32_t	rx_xid;		/* RPC transmission ID */
    424      1.1  christos 	u_int	rx_type;	/* RPCB response type */
    425      1.1  christos 	u_int	rx_ref;         /* reference count */
    426      1.1  christos 	u_int	rx_proto;	/* transport protocol (v2 only) */
    427      1.1  christos } rpcb_xact_t;
    428      1.1  christos 
    429      1.1  christos typedef struct rpcb_session {
    430      1.1  christos         ipfmutex_t	rs_rxlock;
    431      1.1  christos 	rpcb_xact_t	*rs_rxlist;
    432      1.1  christos } rpcb_session_t;
    433      1.1  christos 
    434      1.1  christos /*
    435      1.1  christos  * For an explanation, please see the following:
    436      1.1  christos  *   RFC1832 - Sections 3.11, 4.4, and 4.5.
    437      1.1  christos  */
    438      1.1  christos #define XDRALIGN(x)	((((x) % 4) != 0) ? ((((x) + 3) / 4) * 4) : (x))
    439      1.1  christos 
    440      1.1  christos extern	int	ipf_proxy_add __P((void *, aproxy_t *));
    441      1.1  christos extern	int	ipf_proxy_check __P((fr_info_t *, struct nat *));
    442      1.1  christos extern	int	ipf_proxy_ctl __P((ipf_main_softc_t *, void *, ap_ctl_t *));
    443      1.1  christos extern	int	ipf_proxy_del __P((aproxy_t *));
    444  1.1.1.2   darrenr extern	void	ipf_proxy_deref __P((aproxy_t *));
    445      1.1  christos extern	void	ipf_proxy_flush __P((void *, int));
    446      1.1  christos extern	int	ipf_proxy_init __P((void));
    447      1.1  christos extern	int	ipf_proxy_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, void *));
    448      1.1  christos extern	aproxy_t	*ipf_proxy_lookup __P((void *, u_int, char *));
    449      1.1  christos extern	int	ipf_proxy_match __P((fr_info_t *, struct nat *));
    450      1.1  christos extern	int	ipf_proxy_new __P((fr_info_t *, struct nat *));
    451      1.1  christos extern	int	ipf_proxy_ok __P((fr_info_t *, tcphdr_t *, struct ipnat *));
    452  1.1.1.2   darrenr extern	void	ipf_proxy_free __P((ipf_main_softc_t *, ap_session_t *));
    453      1.1  christos extern	int	ipf_proxy_main_load __P((void));
    454      1.1  christos extern	int	ipf_proxy_main_unload __P((void));
    455  1.1.1.2   darrenr extern	ipnat_t	*ipf_proxy_rule_fwd __P((nat_t *));
    456  1.1.1.2   darrenr extern	ipnat_t	*ipf_proxy_rule_rev __P((nat_t *));
    457      1.1  christos extern	void	*ipf_proxy_soft_create __P((ipf_main_softc_t *));
    458      1.1  christos extern	void	ipf_proxy_soft_destroy __P((ipf_main_softc_t *, void *));
    459      1.1  christos extern	int	ipf_proxy_soft_init __P((ipf_main_softc_t *, void *));
    460      1.1  christos extern	int	ipf_proxy_soft_fini __P((ipf_main_softc_t *, void *));
    461      1.1  christos 
    462      1.1  christos #endif /* __IP_PROXY_H__ */
    463