netfilter: ctnetlink: allow to set expectfn for expectations
This patch allows you to set expectfn which is specifically used by the NAT side of most of the existing conntrack helpers. I have added a symbol map that uses a string as key to look up for the function that is attached to the expectation object. This is the best solution I came out with to solve this issue. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
@@ -69,4 +69,17 @@ extern int nf_conntrack_broadcast_help(struct sk_buff *skb,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
unsigned int timeout);
|
||||
|
||||
struct nf_ct_helper_expectfn {
|
||||
struct list_head head;
|
||||
const char *name;
|
||||
void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
|
||||
};
|
||||
|
||||
void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n);
|
||||
void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n);
|
||||
struct nf_ct_helper_expectfn *
|
||||
nf_ct_helper_expectfn_find_by_name(const char *name);
|
||||
struct nf_ct_helper_expectfn *
|
||||
nf_ct_helper_expectfn_find_by_symbol(const void *symbol);
|
||||
|
||||
#endif /*_NF_CONNTRACK_HELPER_H*/
|
||||
|
Reference in New Issue
Block a user