diff options
author | Patrick McHardy <kaber@trash.net> | 2007-09-28 17:37:03 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:31 -0400 |
commit | df6fb868d6118686805c2fa566e213a8f31c8e4f (patch) | |
tree | 3a0d7d7e9c7d2d8c2d7a06b32e02702eecbfddf6 /include/net | |
parent | 7c8d4cb4198d199e65a6ced8c81f71e3ac3f4cfc (diff) |
[NETFILTER]: nfnetlink: convert to generic netlink attribute functions
Get rid of the duplicated rtnetlink macros and use the generic netlink
attribute functions. The old duplicated stuff is moved to a new header
file that exists just for userspace.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_conntrack_l3proto.h | 5 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 10 | ||||
-rw-r--r-- | include/net/netfilter/nf_nat_protocol.h | 4 |
3 files changed, 9 insertions, 10 deletions
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 3c58a2c4df28..c02402d5ec36 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -11,11 +11,10 @@ | |||
11 | 11 | ||
12 | #ifndef _NF_CONNTRACK_L3PROTO_H | 12 | #ifndef _NF_CONNTRACK_L3PROTO_H |
13 | #define _NF_CONNTRACK_L3PROTO_H | 13 | #define _NF_CONNTRACK_L3PROTO_H |
14 | #include <linux/netlink.h> | ||
14 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
15 | #include <net/netfilter/nf_conntrack.h> | 16 | #include <net/netfilter/nf_conntrack.h> |
16 | 17 | ||
17 | struct nfattr; | ||
18 | |||
19 | struct nf_conntrack_l3proto | 18 | struct nf_conntrack_l3proto |
20 | { | 19 | { |
21 | /* L3 Protocol Family number. ex) PF_INET */ | 20 | /* L3 Protocol Family number. ex) PF_INET */ |
@@ -67,7 +66,7 @@ struct nf_conntrack_l3proto | |||
67 | int (*tuple_to_nfattr)(struct sk_buff *skb, | 66 | int (*tuple_to_nfattr)(struct sk_buff *skb, |
68 | const struct nf_conntrack_tuple *t); | 67 | const struct nf_conntrack_tuple *t); |
69 | 68 | ||
70 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 69 | int (*nfattr_to_tuple)(struct nlattr *tb[], |
71 | struct nf_conntrack_tuple *t); | 70 | struct nf_conntrack_tuple *t); |
72 | 71 | ||
73 | #ifdef CONFIG_SYSCTL | 72 | #ifdef CONFIG_SYSCTL |
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index f46cb930414c..a43c4e484ea1 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -9,10 +9,10 @@ | |||
9 | 9 | ||
10 | #ifndef _NF_CONNTRACK_L4PROTO_H | 10 | #ifndef _NF_CONNTRACK_L4PROTO_H |
11 | #define _NF_CONNTRACK_L4PROTO_H | 11 | #define _NF_CONNTRACK_L4PROTO_H |
12 | #include <linux/netlink.h> | ||
12 | #include <net/netfilter/nf_conntrack.h> | 13 | #include <net/netfilter/nf_conntrack.h> |
13 | 14 | ||
14 | struct seq_file; | 15 | struct seq_file; |
15 | struct nfattr; | ||
16 | 16 | ||
17 | struct nf_conntrack_l4proto | 17 | struct nf_conntrack_l4proto |
18 | { | 18 | { |
@@ -65,15 +65,15 @@ struct nf_conntrack_l4proto | |||
65 | int pf, unsigned int hooknum); | 65 | int pf, unsigned int hooknum); |
66 | 66 | ||
67 | /* convert protoinfo to nfnetink attributes */ | 67 | /* convert protoinfo to nfnetink attributes */ |
68 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, | 68 | int (*to_nfattr)(struct sk_buff *skb, struct nlattr *nla, |
69 | const struct nf_conn *ct); | 69 | const struct nf_conn *ct); |
70 | 70 | ||
71 | /* convert nfnetlink attributes to protoinfo */ | 71 | /* convert nfnetlink attributes to protoinfo */ |
72 | int (*from_nfattr)(struct nfattr *tb[], struct nf_conn *ct); | 72 | int (*from_nfattr)(struct nlattr *tb[], struct nf_conn *ct); |
73 | 73 | ||
74 | int (*tuple_to_nfattr)(struct sk_buff *skb, | 74 | int (*tuple_to_nfattr)(struct sk_buff *skb, |
75 | const struct nf_conntrack_tuple *t); | 75 | const struct nf_conntrack_tuple *t); |
76 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 76 | int (*nfattr_to_tuple)(struct nlattr *tb[], |
77 | struct nf_conntrack_tuple *t); | 77 | struct nf_conntrack_tuple *t); |
78 | 78 | ||
79 | #ifdef CONFIG_SYSCTL | 79 | #ifdef CONFIG_SYSCTL |
@@ -113,7 +113,7 @@ extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); | |||
113 | /* Generic netlink helpers */ | 113 | /* Generic netlink helpers */ |
114 | extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, | 114 | extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, |
115 | const struct nf_conntrack_tuple *tuple); | 115 | const struct nf_conntrack_tuple *tuple); |
116 | extern int nf_ct_port_nfattr_to_tuple(struct nfattr *tb[], | 116 | extern int nf_ct_port_nfattr_to_tuple(struct nlattr *tb[], |
117 | struct nf_conntrack_tuple *t); | 117 | struct nf_conntrack_tuple *t); |
118 | 118 | ||
119 | /* Log invalid packets */ | 119 | /* Log invalid packets */ |
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h index a9ec5ef61468..90a82de7e7e0 100644 --- a/include/net/netfilter/nf_nat_protocol.h +++ b/include/net/netfilter/nf_nat_protocol.h | |||
@@ -41,7 +41,7 @@ struct nf_nat_protocol | |||
41 | int (*range_to_nfattr)(struct sk_buff *skb, | 41 | int (*range_to_nfattr)(struct sk_buff *skb, |
42 | const struct nf_nat_range *range); | 42 | const struct nf_nat_range *range); |
43 | 43 | ||
44 | int (*nfattr_to_range)(struct nfattr *tb[], | 44 | int (*nfattr_to_range)(struct nlattr *tb[], |
45 | struct nf_nat_range *range); | 45 | struct nf_nat_range *range); |
46 | }; | 46 | }; |
47 | 47 | ||
@@ -64,7 +64,7 @@ extern struct nf_nat_protocol *find_nat_proto(u_int16_t protonum); | |||
64 | 64 | ||
65 | extern int nf_nat_port_range_to_nfattr(struct sk_buff *skb, | 65 | extern int nf_nat_port_range_to_nfattr(struct sk_buff *skb, |
66 | const struct nf_nat_range *range); | 66 | const struct nf_nat_range *range); |
67 | extern int nf_nat_port_nfattr_to_range(struct nfattr *tb[], | 67 | extern int nf_nat_port_nfattr_to_range(struct nlattr *tb[], |
68 | struct nf_nat_range *range); | 68 | struct nf_nat_range *range); |
69 | 69 | ||
70 | #endif /*_NF_NAT_PROTO_H*/ | 70 | #endif /*_NF_NAT_PROTO_H*/ |