aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netfilter.h
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:00 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:00 -0400
commit76108cea065cda58366d16a7eb6ca90d717a1396 (patch)
treec4fc31d490c902f2c2478a6344ee988dccc6286f /include/linux/netfilter.h
parentbe713a443ee019489890e93654557916fbf72612 (diff)
netfilter: Use unsigned types for hooknum and pf vars
and (try to) consistently use u_int8_t for the L3 family. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux/netfilter.h')
-rw-r--r--include/linux/netfilter.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0c5eb7ed8b3..8c83d2e23bd 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -92,8 +92,8 @@ struct nf_hook_ops
92 /* User fills in from here down. */ 92 /* User fills in from here down. */
93 nf_hookfn *hook; 93 nf_hookfn *hook;
94 struct module *owner; 94 struct module *owner;
95 int pf; 95 u_int8_t pf;
96 int hooknum; 96 unsigned int hooknum;
97 /* Hooks are ordered in ascending priority. */ 97 /* Hooks are ordered in ascending priority. */
98 int priority; 98 int priority;
99}; 99};
@@ -102,7 +102,7 @@ struct nf_sockopt_ops
102{ 102{
103 struct list_head list; 103 struct list_head list;
104 104
105 int pf; 105 u_int8_t pf;
106 106
107 /* Non-inclusive ranges: use 0/0/NULL to never get called. */ 107 /* Non-inclusive ranges: use 0/0/NULL to never get called. */
108 int set_optmin; 108 int set_optmin;
@@ -140,7 +140,7 @@ extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[];
140 140
141extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 141extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
142 142
143int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, 143int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
144 struct net_device *indev, struct net_device *outdev, 144 struct net_device *indev, struct net_device *outdev,
145 int (*okfn)(struct sk_buff *), int thresh); 145 int (*okfn)(struct sk_buff *), int thresh);
146 146
@@ -151,7 +151,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
151 * okfn must be invoked by the caller in this case. Any other return 151 * okfn must be invoked by the caller in this case. Any other return
152 * value indicates the packet has been consumed by the hook. 152 * value indicates the packet has been consumed by the hook.
153 */ 153 */
154static inline int nf_hook_thresh(int pf, unsigned int hook, 154static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
155 struct sk_buff *skb, 155 struct sk_buff *skb,
156 struct net_device *indev, 156 struct net_device *indev,
157 struct net_device *outdev, 157 struct net_device *outdev,
@@ -167,7 +167,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
167 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); 167 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh);
168} 168}
169 169
170static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, 170static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
171 struct net_device *indev, struct net_device *outdev, 171 struct net_device *indev, struct net_device *outdev,
172 int (*okfn)(struct sk_buff *)) 172 int (*okfn)(struct sk_buff *))
173{ 173{
@@ -212,14 +212,14 @@ __ret;})
212 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) 212 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN)
213 213
214/* Call setsockopt() */ 214/* Call setsockopt() */
215int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, 215int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
216 int len); 216 int len);
217int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, 217int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
218 int *len); 218 int *len);
219 219
220int compat_nf_setsockopt(struct sock *sk, int pf, int optval, 220int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
221 char __user *opt, int len); 221 char __user *opt, int len);
222int compat_nf_getsockopt(struct sock *sk, int pf, int optval, 222int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
223 char __user *opt, int *len); 223 char __user *opt, int *len);
224 224
225/* Call this before modifying an existing packet: ensures it is 225/* Call this before modifying an existing packet: ensures it is
@@ -292,7 +292,7 @@ extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo);
292extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); 292extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
293 293
294static inline void 294static inline void
295nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) 295nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
296{ 296{
297#ifdef CONFIG_NF_NAT_NEEDED 297#ifdef CONFIG_NF_NAT_NEEDED
298 void (*decodefn)(struct sk_buff *, struct flowi *); 298 void (*decodefn)(struct sk_buff *, struct flowi *);
@@ -315,7 +315,7 @@ extern struct proc_dir_entry *proc_net_netfilter;
315#else /* !CONFIG_NETFILTER */ 315#else /* !CONFIG_NETFILTER */
316#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) 316#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
317#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) 317#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
318static inline int nf_hook_thresh(int pf, unsigned int hook, 318static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
319 struct sk_buff *skb, 319 struct sk_buff *skb,
320 struct net_device *indev, 320 struct net_device *indev,
321 struct net_device *outdev, 321 struct net_device *outdev,
@@ -324,7 +324,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
324{ 324{
325 return okfn(skb); 325 return okfn(skb);
326} 326}
327static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, 327static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
328 struct net_device *indev, struct net_device *outdev, 328 struct net_device *indev, struct net_device *outdev,
329 int (*okfn)(struct sk_buff *)) 329 int (*okfn)(struct sk_buff *))
330{ 330{
@@ -332,7 +332,9 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
332} 332}
333struct flowi; 333struct flowi;
334static inline void 334static inline void
335nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} 335nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
336{
337}
336#endif /*CONFIG_NETFILTER*/ 338#endif /*CONFIG_NETFILTER*/
337 339
338#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 340#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)