--- fwsync/driver/fwsync.h 2022/08/18 13:02:13 1.10 +++ fwsync/driver/fwsync.h 2022/08/26 13:33:43 1.10.2.1 @@ -147,36 +147,6 @@ struct fwsync_context { #define CTX_COLLECTOR_1_ONLINE 0x80 #define CTX_COLLECTOR_2_ONLINE 0x100 -#if 0 -#define DRETFLUSH _IOW('D', 1, u_char) -#define DRETADDFILT _IOW('D', 2, struct dret_filter) -#define DRETDELFILT _IOW('D', 3, struct dret_filter) -#define DRETACCTFLUSH _IOW('D', 4, u_char) -#define DRETACCTDEL _IOW('D', 5, struct tagAccount) -#define DRETACCTGET _IOWR('D', 6, struct tagAccount) - -#define DRETDIROFF 0 -#define DRETDIRIN 1 -#define DRETDIROUT 2 -#define DRETDIRANY 3 -#define DRETACCT 4 - -struct dret_filter { - u_char filt_dir; - u_int filt_proto[8]; - char filt_iface[IFNAMSIZ]; - netaddr_t filt_net; -}; -#define FP_MASK(n) ((u_int) 1 << ((n) % 32)) -#define FP_ISSET(n, a) ((a)[(n) / 32] & FP_MASK(n)) -#define FP_CLR(n, a) ((a)[(n) / 32] &= ~FP_MASK(n)) -#define FP_SET(n, a) ((a)[(n) / 32] |= FP_MASK(n)) -#define FP_ZERO(a) do { int _i = 8; \ - while (_i > 0) \ - (a)[--_i] = 0; \ - } while (0) -#endif - struct fws_sndpkt { struct fws_proto sp_proto; TAILQ_ENTRY(fws_sndpkt) sp_next; @@ -184,6 +154,11 @@ struct fws_sndpkt { typedef TAILQ_HEAD(, fws_sndpkt) fwsync_sndpkt_t; +struct fws_acct { + uint64_t states[2]; + uint64_t aliases[2]; +}; + extern int fwsync_debug; extern struct fwsync_context fws_ctx; extern struct cfg_sync fws_cfg; @@ -193,6 +168,7 @@ extern struct callout fws_co; extern struct mtx fws_mtx_c, fws_mtx_e, fws_mtx_u, fws_mtx_n; extern struct mbuf *fws_sndpkt; extern fwsync_sndpkt_t fwsync_sndpkt, fwsync_updpkt, fwsync_natpkt; +extern struct fws_acct fws_acct; int fwsync_cfg(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd); int fwsync_destroy(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd);