Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41910
b: refs/heads/master
c: 77ab9cf
h: refs/heads/master
v: v3
  • Loading branch information
Martin Josefsson authored and David S. Miller committed Dec 3, 2006
1 parent 528478f commit f4639bd
Show file tree
Hide file tree
Showing 11 changed files with 453 additions and 402 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2e4bdc8704b0e711c5046a430bfd1681b0bd5a9
refs/heads/master: 77ab9cff0f4112703df3ef7903c1a15adb967114
49 changes: 1 addition & 48 deletions trunk/include/net/netfilter/nf_conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,44 +124,6 @@ struct nf_conn
char data[0];
};

struct nf_conntrack_expect
{
/* Internal linked list (global expectation list) */
struct list_head list;

/* We expect this tuple, with the following mask */
struct nf_conntrack_tuple tuple, mask;

/* Function to call after setup and insertion */
void (*expectfn)(struct nf_conn *new,
struct nf_conntrack_expect *this);

/* The conntrack of the master connection */
struct nf_conn *master;

/* Timer function; deletes the expectation. */
struct timer_list timeout;

/* Usage count. */
atomic_t use;

/* Unique ID */
unsigned int id;

/* Flags */
unsigned int flags;

#ifdef CONFIG_NF_NAT_NEEDED
/* This is the original per-proto part, used to map the
* expected connection the way the recipient expects. */
union nf_conntrack_manip_proto saved_proto;
/* Direction relative to the master connection. */
enum ip_conntrack_dir dir;
#endif
};

#define NF_CT_EXPECT_PERMANENT 0x1

static inline struct nf_conn *
nf_ct_tuplehash_to_ctrack(const struct nf_conntrack_tuple_hash *hash)
{
Expand Down Expand Up @@ -208,16 +170,6 @@ __nf_conntrack_find(const struct nf_conntrack_tuple *tuple,

extern void nf_conntrack_hash_insert(struct nf_conn *ct);

extern struct nf_conntrack_expect *
__nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);

extern struct nf_conntrack_expect *
nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);

extern void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);

extern void nf_ct_remove_expectations(struct nf_conn *ct);

extern void nf_conntrack_flush(void);

extern struct nf_conntrack_helper *
Expand Down Expand Up @@ -295,6 +247,7 @@ extern int nf_conntrack_checksum;
#ifdef CONFIG_NF_CONNTRACK_EVENTS
#include <linux/notifier.h>
#include <linux/interrupt.h>
#include <net/netfilter/nf_conntrack_expect.h>

struct nf_conntrack_ecache {
struct nf_conn *ct;
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/net/netfilter/nf_conntrack_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#define _NF_CONNTRACK_CORE_H

#include <linux/netfilter.h>
#include <net/netfilter/nf_conntrack_l3proto.h>
#include <net/netfilter/nf_conntrack_protocol.h>

/* This header is used to share core functionality between the
standalone connection tracking module, and the compatibility layer's use
Expand Down Expand Up @@ -70,6 +72,11 @@ static inline int nf_conntrack_confirm(struct sk_buff **pskb)

extern void __nf_conntrack_attach(struct sk_buff *nskb, struct sk_buff *skb);

int
print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
struct nf_conntrack_l3proto *l3proto,
struct nf_conntrack_protocol *proto);

extern struct list_head *nf_conntrack_hash;
extern struct list_head nf_conntrack_expect_list;
extern rwlock_t nf_conntrack_lock ;
Expand Down
72 changes: 72 additions & 0 deletions trunk/include/net/netfilter/nf_conntrack_expect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* connection tracking expectations.
*/

#ifndef _NF_CONNTRACK_EXPECT_H
#define _NF_CONNTRACK_EXPECT_H
#include <net/netfilter/nf_conntrack.h>

extern struct list_head nf_conntrack_expect_list;
extern kmem_cache_t *nf_conntrack_expect_cachep;
extern struct file_operations exp_file_ops;

struct nf_conntrack_expect
{
/* Internal linked list (global expectation list) */
struct list_head list;

/* We expect this tuple, with the following mask */
struct nf_conntrack_tuple tuple, mask;

/* Function to call after setup and insertion */
void (*expectfn)(struct nf_conn *new,
struct nf_conntrack_expect *this);

/* The conntrack of the master connection */
struct nf_conn *master;

/* Timer function; deletes the expectation. */
struct timer_list timeout;

/* Usage count. */
atomic_t use;

/* Unique ID */
unsigned int id;

/* Flags */
unsigned int flags;

#ifdef CONFIG_NF_NAT_NEEDED
/* This is the original per-proto part, used to map the
* expected connection the way the recipient expects. */
union nf_conntrack_manip_proto saved_proto;
/* Direction relative to the master connection. */
enum ip_conntrack_dir dir;
#endif
};

#define NF_CT_EXPECT_PERMANENT 0x1


struct nf_conntrack_expect *
__nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);

struct nf_conntrack_expect *
nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple);

struct nf_conntrack_expect *
find_expectation(const struct nf_conntrack_tuple *tuple);

void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
void nf_ct_remove_expectations(struct nf_conn *ct);
void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp);

/* Allocate space for an expectation: this is mandatory before calling
nf_conntrack_expect_related. You will have to call put afterwards. */
struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me);
void nf_conntrack_expect_put(struct nf_conntrack_expect *exp);
int nf_conntrack_expect_related(struct nf_conntrack_expect *expect);

#endif /*_NF_CONNTRACK_EXPECT_H*/

10 changes: 0 additions & 10 deletions trunk/include/net/netfilter/nf_conntrack_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,4 @@ struct nf_conntrack_helper
extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);

/* Allocate space for an expectation: this is mandatory before calling
nf_conntrack_expect_related. You will have to call put afterwards. */
extern struct nf_conntrack_expect *
nf_conntrack_expect_alloc(struct nf_conn *master);
extern void nf_conntrack_expect_put(struct nf_conntrack_expect *exp);

/* Add an expected connection: can have more than one per connection */
extern int nf_conntrack_expect_related(struct nf_conntrack_expect *exp);
extern void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp);

#endif /*_NF_CONNTRACK_HELPER_H*/
2 changes: 1 addition & 1 deletion trunk/net/netfilter/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
netfilter-objs := core.o nf_log.o nf_queue.o nf_sockopt.o
nf_conntrack-objs := nf_conntrack_core.o nf_conntrack_standalone.o nf_conntrack_l3proto_generic.o nf_conntrack_proto_generic.o nf_conntrack_proto_tcp.o nf_conntrack_proto_udp.o
nf_conntrack-objs := nf_conntrack_core.o nf_conntrack_standalone.o nf_conntrack_expect.o nf_conntrack_l3proto_generic.o nf_conntrack_proto_generic.o nf_conntrack_proto_tcp.o nf_conntrack_proto_udp.o

obj-$(CONFIG_NETFILTER) = netfilter.o

Expand Down
Loading

0 comments on commit f4639bd

Please sign in to comment.