File:  [ELWIX - Embedded LightWeight unIX -] / fwsync / patches / ip_fw_private_h.patch
Revision 1.7: download - view: text, annotated - select for diffs - revision graph
Thu Aug 18 11:33:20 2022 UTC (21 months, 2 weeks ago) by misho
Branches: MAIN
CVS tags: fwsync1_2, fwsync1_1, HEAD, FWSYNC1_1
sync accroding last version of fwsync driver

    1: diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h
    2: index 1440b1a40ee..bd4cefb7fed 100644
    3: --- a/sys/netpfil/ipfw/ip_fw_private.h
    4: +++ b/sys/netpfil/ipfw/ip_fw_private.h
    5: @@ -251,6 +251,40 @@ VNET_DECLARE(unsigned int, fw_tables_sets);
    6:  
    7:  struct tables_config;
    8:  
    9: +#ifndef V_hook_state
   10: +typedef int (*ipfw_hook_t)(const void *arg, const void *extdata);
   11: +/* callback hooks for notify on update of internal states and aliases */
   12: +VNET_DECLARE(ipfw_hook_t, hook_state);
   13: +#define V_hook_state		VNET(hook_state)
   14: +VNET_DECLARE(ipfw_hook_t, hook_alias);
   15: +#define V_hook_alias		VNET(hook_alias)
   16: +VNET_DECLARE(ipfw_hook_t, sync_state);
   17: +#define V_sync_state		VNET(sync_state)
   18: +VNET_DECLARE(ipfw_hook_t, sync_alias);
   19: +#define V_sync_alias		VNET(sync_alias)
   20: +#endif
   21: +
   22: +struct ipfw_dyn_hook_extdata {
   23: +	unsigned int	ruleid;
   24: +	unsigned short	rulenum;
   25: +	unsigned short	fibnum;
   26: +	unsigned short	kidx;
   27: +	unsigned char	cmdtype;
   28: +};
   29: +
   30: +int ipfw_dyn_install_sync_state(const struct ipfw_flow_id *pkt, void *rule, 
   31: +		uint32_t ruleid, uint16_t rulenum, uint16_t kidx, uint8_t cmdtype);
   32: +
   33: +#define ipfw_unregister_state_hook()	V_hook_state = NULL
   34: +#define ipfw_unregister_alias_hook()	V_hook_alias = NULL
   35: +#define ipfw_register_state_hook(_hcb)	V_hook_state = (_hcb)
   36: +#define ipfw_register_alias_hook(_hcb)	V_hook_alias = (_hcb)
   37: +
   38: +#define ipfw_unregister_state_sync()	V_sync_state = NULL
   39: +#define ipfw_unregister_alias_sync()	V_sync_alias = NULL
   40: +#define ipfw_register_state_sync(_hcb)	V_sync_state = (_hcb)
   41: +#define ipfw_register_alias_sync(_hcb)	V_sync_alias = (_hcb)
   42: +
   43:  #ifdef _KERNEL
   44:  /*
   45:   * Here we have the structure representing an ipfw rule.
   46: @@ -295,6 +329,22 @@ struct ip_fw {
   47:  
   48:  #endif
   49:  
   50: +/* Nat configuration data struct. */
   51: +struct cfg_nat {
   52: +	/* chain of nat instances */
   53: +	LIST_ENTRY(cfg_nat)	_next;
   54: +	int			id;		/* nat id  */
   55: +	struct in_addr		ip;		/* nat ip address */
   56: +	struct libalias		*lib;		/* libalias instance */
   57: +	int			mode;		/* aliasing mode */
   58: +	int			redir_cnt; /* number of entry in spool chain */
   59: +	/* chain of redir instances */
   60: +	LIST_HEAD(redir_chain, cfg_redir) redir_chain;  
   61: +	char			if_name[IF_NAMESIZE];	/* interface name */
   62: +	u_short			alias_port_lo;	/* low range for port aliasing */
   63: +	u_short			alias_port_hi;	/* high range for port aliasing */
   64: +};
   65: +
   66:  struct ip_fw_chain {
   67:  	struct ip_fw	**map;		/* array of rule ptrs to ease lookup */
   68:  	uint32_t	id;		/* ruleset id */

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