Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273503
b: refs/heads/master
c: 8d83f63
h: refs/heads/master
i:
  273501: c0a22b5
  273499: e250728
  273495: 41c8c74
  273487: 90afc46
  273471: 681cf26
v: v3
  • Loading branch information
Pablo Neira Ayuso committed Nov 1, 2011
1 parent 72019ed commit 53deb99
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 52 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: 0a9ee81349d90c6c85831f38118bf569c60a4d51
refs/heads/master: 8d83f63b19d45ba0898b97824afcc8e0b5c954cb
1 change: 1 addition & 0 deletions trunk/include/linux/netfilter_ipv4/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ header-y += ipt_ah.h
header-y += ipt_ecn.h
header-y += ipt_realm.h
header-y += ipt_ttl.h
header-y += nf_nat.h
58 changes: 58 additions & 0 deletions trunk/include/linux/netfilter_ipv4/nf_nat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#ifndef _LINUX_NF_NAT_H
#define _LINUX_NF_NAT_H

#include <linux/types.h>

#define IP_NAT_RANGE_MAP_IPS 1
#define IP_NAT_RANGE_PROTO_SPECIFIED 2
#define IP_NAT_RANGE_PROTO_RANDOM 4
#define IP_NAT_RANGE_PERSISTENT 8

/* The protocol-specific manipulable parts of the tuple. */
union nf_conntrack_man_proto {
/* Add other protocols here. */
__be16 all;

struct {
__be16 port;
} tcp;
struct {
__be16 port;
} udp;
struct {
__be16 id;
} icmp;
struct {
__be16 port;
} dccp;
struct {
__be16 port;
} sctp;
struct {
__be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
} gre;
};

/* Single range specification. */
struct nf_nat_range {
/* Set to OR of flags above. */
unsigned int flags;

/* Inclusive: network order. */
__be32 min_ip, max_ip;

/* Inclusive: network order */
union nf_conntrack_man_proto min, max;
};

/* For backwards compat: don't use in modern code. */
struct nf_nat_multi_range_compat {
unsigned int rangesize; /* Must be 1. */

/* hangs off end. */
struct nf_nat_range range[1];
};

#define nf_nat_multi_range nf_nat_multi_range_compat

#endif
27 changes: 1 addition & 26 deletions trunk/include/net/netfilter/nf_conntrack_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/nf_conntrack_tuple_common.h>
#include <linux/netfilter_ipv4/nf_nat.h>
#include <linux/list_nulls.h>

/* A `tuple' is a structure containing the information to uniquely
Expand All @@ -24,32 +25,6 @@

#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all)

/* The protocol-specific manipulable parts of the tuple: always in
network order! */
union nf_conntrack_man_proto {
/* Add other protocols here. */
__be16 all;

struct {
__be16 port;
} tcp;
struct {
__be16 port;
} udp;
struct {
__be16 id;
} icmp;
struct {
__be16 port;
} dccp;
struct {
__be16 port;
} sctp;
struct {
__be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
} gre;
};

/* The manipulable part of the tuple. */
struct nf_conntrack_man {
union nf_inet_addr u3;
Expand Down
26 changes: 1 addition & 25 deletions trunk/include/net/netfilter/nf_nat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _NF_NAT_H
#define _NF_NAT_H
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv4/nf_nat.h>
#include <net/netfilter/nf_conntrack_tuple.h>

#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16
Expand All @@ -14,11 +15,6 @@ enum nf_nat_manip_type {
#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
(hooknum) != NF_INET_LOCAL_IN)

#define IP_NAT_RANGE_MAP_IPS 1
#define IP_NAT_RANGE_PROTO_SPECIFIED 2
#define IP_NAT_RANGE_PROTO_RANDOM 4
#define IP_NAT_RANGE_PERSISTENT 8

/* NAT sequence number modifications */
struct nf_nat_seq {
/* position of the last TCP sequence number modification (if any) */
Expand All @@ -28,26 +24,6 @@ struct nf_nat_seq {
int16_t offset_before, offset_after;
};

/* Single range specification. */
struct nf_nat_range {
/* Set to OR of flags above. */
unsigned int flags;

/* Inclusive: network order. */
__be32 min_ip, max_ip;

/* Inclusive: network order */
union nf_conntrack_man_proto min, max;
};

/* For backwards compat: don't use in modern code. */
struct nf_nat_multi_range_compat {
unsigned int rangesize; /* Must be 1. */

/* hangs off end. */
struct nf_nat_range range[1];
};

#include <linux/list.h>
#include <linux/netfilter/nf_conntrack_pptp.h>
#include <net/netfilter/nf_conntrack_extend.h>
Expand Down

0 comments on commit 53deb99

Please sign in to comment.