1 #ifndef _NF_CONNTRACK_EXTEND_H
2 #define _NF_CONNTRACK_EXTEND_H
4 #include <net/netfilter/nf_conntrack.h>
13 #define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
14 #define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
16 /* Extensions: optional stuff which isn't permanently in struct. */
19 u8 offset
[NF_CT_EXT_NUM
];
24 static inline int nf_ct_ext_exist(const struct nf_conn
*ct
, u8 id
)
26 return (ct
->ext
&& ct
->ext
->offset
[id
]);
29 static inline void *__nf_ct_ext_find(const struct nf_conn
*ct
, u8 id
)
31 if (!nf_ct_ext_exist(ct
, id
))
34 return (void *)ct
->ext
+ ct
->ext
->offset
[id
];
36 #define nf_ct_ext_find(ext, id) \
37 ((id##_TYPE *)__nf_ct_ext_find((ext), (id)))
39 /* Destroy all relationships */
40 extern void __nf_ct_ext_destroy(struct nf_conn
*ct
);
41 static inline void nf_ct_ext_destroy(struct nf_conn
*ct
)
44 __nf_ct_ext_destroy(ct
);
47 /* Free operation. If you want to free a object referred from private area,
48 * please implement __nf_ct_ext_free() and call it.
50 static inline void nf_ct_ext_free(struct nf_conn
*ct
)
56 /* Add this type, returns pointer to data or NULL. */
58 __nf_ct_ext_add(struct nf_conn
*ct
, enum nf_ct_ext_id id
, gfp_t gfp
);
59 #define nf_ct_ext_add(ct, id, gfp) \
60 ((id##_TYPE *)__nf_ct_ext_add((ct), (id), (gfp)))
62 #define NF_CT_EXT_F_PREALLOC 0x0001
66 /* Destroys relationships (can be NULL). */
67 void (*destroy
)(struct nf_conn
*ct
);
68 /* Called when realloacted (can be NULL).
69 Contents has already been moved. */
70 void (*move
)(void *new, void *old
);
76 /* Length and min alignment. */
79 /* initial size of nf_ct_ext. */
83 int nf_ct_extend_register(struct nf_ct_ext_type
*type
);
84 void nf_ct_extend_unregister(struct nf_ct_ext_type
*type
);
85 #endif /* _NF_CONNTRACK_EXTEND_H */
This page took 0.039895 seconds and 5 git commands to generate.