1 #ifndef _NF_CONNTRACK_ZONES_H 2 #define _NF_CONNTRACK_ZONES_H 3 4 #define NF_CT_DEFAULT_ZONE 0 5 6 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 7 #include <net/netfilter/nf_conntrack_extend.h> 8 9 struct nf_conntrack_zone { 10 u16 id; 11 }; 12 nf_ct_zone(const struct nf_conn * ct)13static inline u16 nf_ct_zone(const struct nf_conn *ct) 14 { 15 #ifdef CONFIG_NF_CONNTRACK_ZONES 16 struct nf_conntrack_zone *nf_ct_zone; 17 nf_ct_zone = nf_ct_ext_find(ct, NF_CT_EXT_ZONE); 18 if (nf_ct_zone) 19 return nf_ct_zone->id; 20 #endif 21 return NF_CT_DEFAULT_ZONE; 22 } 23 24 #endif /* CONFIG_NF_CONNTRACK || CONFIG_NF_CONNTRACK_MODULE */ 25 #endif /* _NF_CONNTRACK_ZONES_H */ 26