File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mpd / src / nat.h
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:39:23 2021 UTC (3 years, 3 months ago) by misho
Branches: mpd, MAIN
CVS tags: v5_9p16, v5_9, HEAD
mpd 5.9

    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: 
   11: #include "command.h"
   12: #include "vars.h"
   13: 
   14: #include <netgraph/ng_nat.h>
   15: 
   16: #ifdef NG_NAT_DESC_LENGTH
   17: /* max. number of red-port rules */
   18: #define NM_PORT		32
   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[];
   54: #ifdef NG_NAT_DESC_LENGTH
   55:   extern const struct cmdtab	NatUnSetCmds[];
   56: #endif
   57: 
   58:   extern void	NatInit(Bund b);
   59:   extern int	NatStat(Context ctx, int ac, const char *const av[], const void *arg);
   60: 
   61: #endif
   62: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>