~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/netfilter.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#endif
14
14
#include <linux/types.h>
15
15
#include <linux/compiler.h>
 
16
#include <linux/sysctl.h>
16
17
 
17
18
/* Responses from hook functions. */
18
19
#define NF_DROP 0
24
25
#define NF_MAX_VERDICT NF_STOP
25
26
 
26
27
/* we overload the higher bits for encoding auxiliary data such as the queue
27
 
 * number. Not nice, but better than additional function arguments. */
28
 
#define NF_VERDICT_MASK 0x0000ffff
29
 
#define NF_VERDICT_BITS 16
30
 
 
 
28
 * number or errno values. Not nice, but better than additional function
 
29
 * arguments. */
 
30
#define NF_VERDICT_MASK 0x000000ff
 
31
 
 
32
/* extra verdict flags have mask 0x0000ff00 */
 
33
#define NF_VERDICT_FLAG_QUEUE_BYPASS    0x00008000
 
34
 
 
35
/* queue number (NF_QUEUE) or errno (NF_DROP) */
31
36
#define NF_VERDICT_QMASK 0xffff0000
32
37
#define NF_VERDICT_QBITS 16
33
38
 
34
 
#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE)
 
39
#define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
35
40
 
36
 
#define NF_DROP_ERR(x) (((-x) << NF_VERDICT_BITS) | NF_DROP)
 
41
#define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
37
42
 
38
43
/* only for userspace compatibility */
39
44
#ifndef __KERNEL__
41
46
   <= 0x2000 is used for protocol-flags. */
42
47
#define NFC_UNKNOWN 0x4000
43
48
#define NFC_ALTERED 0x8000
 
49
 
 
50
/* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
 
51
#define NF_VERDICT_BITS 16
44
52
#endif
45
53
 
46
54
enum nf_inet_hooks {
72
80
 
73
81
#ifdef __KERNEL__
74
82
#ifdef CONFIG_NETFILTER
 
83
static inline int NF_DROP_GETERR(int verdict)
 
84
{
 
85
        return -(verdict >> NF_VERDICT_QBITS);
 
86
}
75
87
 
76
88
static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
77
89
                                   const union nf_inet_addr *a2)
259
271
                                            unsigned int dataoff,
260
272
                                            unsigned int len,
261
273
                                            u_int8_t protocol);
262
 
        int             (*route)(struct dst_entry **dst, struct flowi *fl);
 
274
        int             (*route)(struct net *net, struct dst_entry **dst,
 
275
                                 struct flowi *fl, bool strict);
263
276
        void            (*saveroute)(const struct sk_buff *skb,
264
277
                                     struct nf_queue_entry *entry);
265
278
        int             (*reroute)(struct sk_buff *skb,
267
280
        int             route_key_size;
268
281
};
269
282
 
270
 
extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO];
 
283
extern const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO];
271
284
static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family)
272
285
{
273
286
        return rcu_dereference(nf_afinfo[family]);
357
370
#endif /*CONFIG_NETFILTER*/
358
371
 
359
372
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
360
 
extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *);
 
373
extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu;
361
374
extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
362
 
extern void (*nf_ct_destroy)(struct nf_conntrack *);
 
375
extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
363
376
#else
364
377
static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
365
378
#endif