--- zzzz-none-000/linux-4.1.52/include/net/netfilter/nf_conntrack.h 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/include/net/netfilter/nf_conntrack.h 2022-03-02 11:37:13.000000000 +0000 @@ -22,6 +22,11 @@ #include #include #include +#if defined(CONFIG_BCM_KF_PROTO_IPSEC) && \ + (defined(CONFIG_NF_CONNTRACK_IPSEC) || defined(CONFIG_NF_CONNTRACK_IPSEC_MODULE)) +#include +#include +#endif #include #include @@ -33,12 +38,20 @@ struct ip_ct_sctp sctp; struct ip_ct_tcp tcp; struct nf_ct_gre gre; +#if defined(CONFIG_BCM_KF_PROTO_ESP) && \ + (defined(CONFIG_NF_CT_PROTO_ESP) || defined(CONFIG_NF_CT_PROTO_ESP_MODULE)) + struct nf_ct_esp esp; +#endif }; union nf_conntrack_expect_proto { /* insert expect proto private data here */ }; +#if defined(CONFIG_BCM_KF_NETFILTER) +#define NF_ALG_BUFFER_SIZE 2000 +#endif + #include #include #include @@ -71,6 +84,10 @@ #include #include +#if defined(CONFIG_BCM_KF_DPI) && defined(CONFIG_BCM_DPI_MODULE) +#include +#endif + struct nf_conn { /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, * plus 1 for any connection(s) we are `master' for @@ -85,13 +102,54 @@ spinlock_t lock; u16 cpu; +#if defined(CONFIG_BCM_KF_BLOG) +#if defined(CONFIG_BLOG) + unsigned int blog_key[2]; /* Associating 2=IP_CT_DIR_MAX blogged flows */ + unsigned long extra_jiffies;/* connection timeout value */ +#endif + uint8_t iq_prio; /* Ingress QoS Prio */ + uint8_t unused0; + uint16_t unused1; +#endif + +#if defined(CONFIG_BCM_KF_NETFILTER) + uint32_t hw_accel_flows; /* Number of HW accelerated flows, need 32 bit for tunnel connection */ + uint32_t sw_accel_flows; /* Number of SW accelerated flows, need 32 bit for tunnel connection */ + struct list_head safe_list; /* regardless drop of connections */ + struct list_head *curr_safe_list; /* current safe_list for this connection*/ + struct list_head derived_connections; /* Used by master connection */ + struct list_head derived_list; /* Used by child connection */ + unsigned derived_timeout; /* 0 means no derived_timeout, 0xFFFFFFFF + * means never timeout until master ct is + * disconnected, others means timeout secs */ + + /* Have we seen traffic both ways yet? (bitset) */ // bcm version + unsigned long status; // moved position for bcm + +#if defined(CONFIG_NF_DYNDSCP) || defined(CONFIG_NF_DYNDSCP_MODULE) + struct nf_tos_inheritance { + u_int16_t status; + u_int8_t dscp[2]; /* IP_CT_DIR_MAX */ + }dyndscp; +#endif + /*---------- Add any custom fields below this line ----------*/ + + /* If we were expected by an expectation, this will be it */ + struct nf_conn *master; // moved position for bcm +#endif /* CONFIG_BCM_KF_NETFILTER */ + +#if defined(CONFIG_BCM_KF_DPI) && defined(CONFIG_BCM_DPI_MODULE) + struct dpi_info dpi; +#endif /* XXX should I move this to the tail ? - Y.K */ /* These are my tuples; original and reply */ struct nf_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; +#if !defined(CONFIG_BCM_KF_NETFILTER) /* Have we seen traffic both ways yet? (bitset) */ unsigned long status; +#endif /* Timer function; drops refcnt when it goes off. */ struct timer_list timeout; @@ -100,8 +158,10 @@ /* all members below initialized via memset */ u8 __nfct_init_offset[0]; +#if !defined(CONFIG_BCM_KF_NETFILTER) /* If we were expected by an expectation, this will be it */ struct nf_conn *master; +#endif #if defined(CONFIG_NF_CONNTRACK_MARK) u_int32_t mark; @@ -116,6 +176,12 @@ /* Storage reserved for other modules, must be the last member */ union nf_conntrack_proto proto; + +#if defined(CONFIG_BCM_KF_RUNNER) +#if defined(CONFIG_BCM_RDPA) || defined(CONFIG_BCM_RDPA_MODULE) + void *bl_ctx; +#endif /* CONFIG_BCM_RDPA || CONFIG_BCM_RDPA_MODULE */ +#endif /* CONFIG_BCM_KF_RUNNER */ }; static inline struct nf_conn * @@ -251,10 +317,19 @@ int (*iter)(struct nf_conn *i, void *data), void *data, u32 portid, int report); void nf_conntrack_free(struct nf_conn *ct); +#if defined(CONFIG_BCM_KF_NETFILTER) +struct nf_conn * +nf_conntrack_alloc(struct net *net, u16 zone, + struct sk_buff *skb, + const struct nf_conntrack_tuple *orig, + const struct nf_conntrack_tuple *repl, + gfp_t gfp); +#else struct nf_conn *nf_conntrack_alloc(struct net *net, u16 zone, const struct nf_conntrack_tuple *orig, const struct nf_conntrack_tuple *repl, gfp_t gfp); +#endif static inline int nf_ct_is_template(const struct nf_conn *ct) {