]> err.no Git - linux-2.6/blobdiff - include/linux/netfilter.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / include / linux / netfilter.h
index 84506dfa1f37dd8635828adee6edeac980c85347..412e52ca9720c7d942948b904554cf6052a8ac16 100644 (file)
@@ -80,10 +80,14 @@ struct nf_sockopt_ops
        int set_optmin;
        int set_optmax;
        int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
+       int (*compat_set)(struct sock *sk, int optval,
+                       void __user *user, unsigned int len);
 
        int get_optmin;
        int get_optmax;
        int (*get)(struct sock *sk, int optval, void __user *user, int *len);
+       int (*compat_get)(struct sock *sk, int optval,
+                       void __user *user, int *len);
 
        /* Number of users inside set() or get(). */
        unsigned int use;
@@ -184,8 +188,11 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
                                 struct sk_buff **pskb,
                                 struct net_device *indev,
                                 struct net_device *outdev,
-                                int (*okfn)(struct sk_buff *), int thresh)
+                                int (*okfn)(struct sk_buff *), int thresh,
+                                int cond)
 {
+       if (!cond)
+               return 1;
 #ifndef CONFIG_NETFILTER_DEBUG
        if (list_empty(&nf_hooks[pf][hook]))
                return 1;
@@ -197,7 +204,7 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
                          struct net_device *indev, struct net_device *outdev,
                          int (*okfn)(struct sk_buff *))
 {
-       return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN);
+       return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN, 1);
 }
                    
 /* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -224,7 +231,13 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
 
 #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)            \
 ({int __ret;                                                                  \
-if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh)) == 1)\
+if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh, 1)) == 1)\
+       __ret = (okfn)(skb);                                                   \
+__ret;})
+
+#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond)                \
+({int __ret;                                                                  \
+if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\
        __ret = (okfn)(skb);                                                   \
 __ret;})
 
@@ -237,6 +250,11 @@ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt,
 int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt,
                  int *len);
 
+int compat_nf_setsockopt(struct sock *sk, int pf, int optval,
+               char __user *opt, int len);
+int compat_nf_getsockopt(struct sock *sk, int pf, int optval,
+               char __user *opt, int *len);
+
 /* Packet queuing */
 struct nf_queue_handler {
        int (*outfn)(struct sk_buff *skb, struct nf_info *info,
@@ -295,7 +313,24 @@ extern struct proc_dir_entry *proc_net_netfilter;
 
 #else /* !CONFIG_NETFILTER */
 #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
+#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
+static inline int nf_hook_thresh(int pf, unsigned int hook,
+                                struct sk_buff **pskb,
+                                struct net_device *indev,
+                                struct net_device *outdev,
+                                int (*okfn)(struct sk_buff *), int thresh,
+                                int cond)
+{
+       return okfn(*pskb);
+}
+static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
+                         struct net_device *indev, struct net_device *outdev,
+                         int (*okfn)(struct sk_buff *))
+{
+       return 1;
+}
 static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
+struct flowi;
 static inline void
 nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {}
 #endif /*CONFIG_NETFILTER*/