Annotation of embedaddon/mpd/src/nat.h, revision 1.1.1.3
1.1 misho 1:
2: /*
3: * nat.h
4: *
5: * Written by Alexander Motin <mav@FreeBSD.org>
6: */
7:
8: #ifndef _NAT_H_
9: #define _NAT_H_
10:
1.1.1.3 ! misho 11: #include "command.h"
! 12: #include "vars.h"
! 13:
1.1 misho 14: #include <netgraph/ng_nat.h>
15:
16: #ifdef NG_NAT_DESC_LENGTH
17: /* max. number of red-port rules */
1.1.1.2 misho 18: #define NM_PORT 32
1.1 misho 19: /* max. number of red-addr rules */
20: #define NM_ADDR 8
21: /* max. number of red-proto rules */
22: #define NM_PROTO 8
23: #endif
24:
25: /* Configuration options */
26:
27: enum {
28: NAT_CONF_LOG,
29: NAT_CONF_INCOMING,
30: NAT_CONF_SAME_PORTS,
31: NAT_CONF_UNREG_ONLY
32: };
33:
34: struct natstate {
35: struct optinfo options; /* Configuration options */
36: struct u_addr alias_addr; /* Alias IP address */
37: struct u_addr target_addr; /* Target IP address */
38: #ifdef NG_NAT_DESC_LENGTH
39: struct ng_nat_redirect_port nrpt[NM_PORT]; /* NAT redirect port */
40: int nrpt_id[NM_PORT]; /* NAT redirect port ID's */
41: struct ng_nat_redirect_addr nrad[NM_ADDR]; /* NAT redirect address */
42: int nrad_id[NM_ADDR]; /* NAT redirect address ID's */
43: struct ng_nat_redirect_proto nrpr[NM_PROTO];/* NAT redirect proto */
44: int nrpr_id[NM_PROTO]; /* NAT redirect proto ID's */
45: #endif
46: };
47: typedef struct natstate *NatState;
48:
49: /*
50: * VARIABLES
51: */
52:
53: extern const struct cmdtab NatSetCmds[];
1.1.1.2 misho 54: #ifdef NG_NAT_DESC_LENGTH
55: extern const struct cmdtab NatUnSetCmds[];
56: #endif
1.1 misho 57:
58: extern void NatInit(Bund b);
1.1.1.3 ! misho 59: extern int NatStat(Context ctx, int ac, const char *const av[], const void *arg);
1.1 misho 60:
61: #endif
62:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>