The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ipt_conntrack.h
Go to the documentation of this file.
1 /* Header file for kernel module to match connection tracking information.
2  * GPL (C) 2001 Marc Boucher (marc@mbsi.ca).
3  */
4 
5 #ifndef _IPT_CONNTRACK_H
6 #define _IPT_CONNTRACK_H
7 
8 #if 0
9 #include <linux/netfilter_ipv4/ip_conntrack.h>
10 #else
11 #include <linux/netfilter/nf_conntrack_common.h>
12 #include <linux/netfilter/nf_conntrack_tuple_common.h>
13 #endif
14 
15 /* backwards compatibility crap. only exists in userspace - HW */
16 #include <linux/version.h>
17 #ifndef KERNEL_VERSION
18 #define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
19 #endif
20 
21 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
22 #define IPS_EXPECTED (1 << 0)
23 #define IPS_SEEN_REPLY (1 << 1)
24 #define IPS_ASSURED (1 << 2)
25 #define IP_CT_DIR_ORIGINAL 0
26 #define IP_CT_DIR_REPLY 1
27 #define IP_CT_DIR_MAX 2
28 #endif
29 
30 #define IPT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
31 #define IPT_CONNTRACK_STATE_INVALID (1 << 0)
32 
33 #define IPT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
34 #define IPT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
35 #define IPT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
36 
37 /* flags, invflags: */
38 #define IPT_CONNTRACK_STATE 0x01
39 #define IPT_CONNTRACK_PROTO 0x02
40 #define IPT_CONNTRACK_ORIGSRC 0x04
41 #define IPT_CONNTRACK_ORIGDST 0x08
42 #define IPT_CONNTRACK_REPLSRC 0x10
43 #define IPT_CONNTRACK_REPLDST 0x20
44 #define IPT_CONNTRACK_STATUS 0x40
45 #define IPT_CONNTRACK_EXPIRES 0x80
46 
47 /* This is exposed to userspace, so remains frozen in time. */
49 {
50  struct {
51  u_int32_t ip;
52  union {
53  u_int16_t all;
54  } u;
55  } src;
56 
57  struct {
58  u_int32_t ip;
59  union {
60  u_int16_t all;
61  } u;
62 
63  /* The protocol. */
64  u_int16_t protonum;
65  } dst;
66 };
67 
69 {
70  unsigned int statemask, statusmask;
71 
74 
75 #ifdef KERNEL_64_USERSPACE_32
76  unsigned long long expires_min, expires_max;
77 #else
78  unsigned long expires_min, expires_max;
79 #endif
80 
81  /* Flags word */
82  u_int8_t flags;
83  /* Inverse flags */
84  u_int8_t invflags;
85 };
86 #endif /*_IPT_CONNTRACK_H*/
struct in_addr sipmsk[2]
Definition: ipt_conntrack.h:73
struct in_addr dipmsk[2]
Definition: ipt_conntrack.h:73
u_int16_t protonum
Definition: ipt_conntrack.h:64
unsigned long expires_min
Definition: ipt_conntrack.h:78
struct ip_conntrack_old_tuple::@4 dst
u_int32_t ip
Definition: ipt_conntrack.h:51
Definition: ipt_conntrack.h:48
#define IP_CT_DIR_MAX
Definition: ipt_conntrack.h:27
u_int16_t all
Definition: ipt_conntrack.h:53
u_int8_t flags
Definition: ipt_conntrack.h:82
struct ip_conntrack_old_tuple tuple[2]
Definition: ipt_conntrack.h:72
unsigned int statusmask
Definition: ipt_conntrack.h:70
u_int8_t invflags
Definition: ipt_conntrack.h:84
Definition: ipt_conntrack.h:68
struct ip_conntrack_old_tuple::@3 src
unsigned int statemask
Definition: ipt_conntrack.h:70
union ip_conntrack_old_tuple::@3::@5 u
unsigned long expires_max
Definition: ipt_conntrack.h:78