]> Pileus Git - ~andy/linux/blob - include/linux/netfilter/nfnetlink.h
netfilter: rename netlink related "pid" variables to "portid"
[~andy/linux] / include / linux / netfilter / nfnetlink.h
1 #ifndef _NFNETLINK_H
2 #define _NFNETLINK_H
3
4
5 #include <linux/netlink.h>
6 #include <linux/capability.h>
7 #include <net/netlink.h>
8 #include <uapi/linux/netfilter/nfnetlink.h>
9
10 struct nfnl_callback {
11         int (*call)(struct sock *nl, struct sk_buff *skb, 
12                     const struct nlmsghdr *nlh,
13                     const struct nlattr * const cda[]);
14         int (*call_rcu)(struct sock *nl, struct sk_buff *skb, 
15                     const struct nlmsghdr *nlh,
16                     const struct nlattr * const cda[]);
17         const struct nla_policy *policy;        /* netlink attribute policy */
18         const u_int16_t attr_count;             /* number of nlattr's */
19 };
20
21 struct nfnetlink_subsystem {
22         const char *name;
23         __u8 subsys_id;                 /* nfnetlink subsystem ID */
24         __u8 cb_count;                  /* number of callbacks */
25         const struct nfnl_callback *cb; /* callback for individual types */
26 };
27
28 extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
29 extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
30
31 extern int nfnetlink_has_listeners(struct net *net, unsigned int group);
32 extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
33                           unsigned int group, int echo, gfp_t flags);
34 extern int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
35 extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net,
36                              u32 portid, int flags);
37
38 extern void nfnl_lock(__u8 subsys_id);
39 extern void nfnl_unlock(__u8 subsys_id);
40
41 #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
42         MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
43
44 #endif  /* _NFNETLINK_H */