diff options
author | Patrick McHardy <kaber@trash.net> | 2006-12-03 01:08:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-12-03 01:08:46 -0500 |
commit | f587de0e2feb9eb9b94f98d0a7b7437e4d6617b4 (patch) | |
tree | 64d29dcacf895c37c4b7520bc8b07f0845baf914 /include | |
parent | 16958900578b94585c2ab9a2d20d837b4d5e3ba6 (diff) |
[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper port
Add IPv4 and IPv6 capable nf_conntrack port of the H.323 conntrack/NAT helper.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/nf_conntrack_h323.h | 92 | ||||
-rw-r--r-- | include/linux/netfilter/nf_conntrack_h323_asn1.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h) | 10 | ||||
-rw-r--r-- | include/linux/netfilter/nf_conntrack_h323_types.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h) | 12 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/Kbuild | 2 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_h323.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_expect.h | 1 |
7 files changed, 113 insertions, 8 deletions
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h new file mode 100644 index 000000000000..08e2f4977c2e --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_h323.h | |||
@@ -0,0 +1,92 @@ | |||
1 | #ifndef _NF_CONNTRACK_H323_H | ||
2 | #define _NF_CONNTRACK_H323_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/netfilter/nf_conntrack_h323_asn1.h> | ||
7 | |||
8 | #define RAS_PORT 1719 | ||
9 | #define Q931_PORT 1720 | ||
10 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
11 | |||
12 | /* This structure exists only once per master */ | ||
13 | struct nf_ct_h323_master { | ||
14 | |||
15 | /* Original and NATed Q.931 or H.245 signal ports */ | ||
16 | __be16 sig_port[IP_CT_DIR_MAX]; | ||
17 | |||
18 | /* Original and NATed RTP ports */ | ||
19 | __be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
20 | |||
21 | union { | ||
22 | /* RAS connection timeout */ | ||
23 | u_int32_t timeout; | ||
24 | |||
25 | /* Next TPKT length (for separate TPKT header and data) */ | ||
26 | u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
27 | }; | ||
28 | }; | ||
29 | |||
30 | struct nf_conn; | ||
31 | |||
32 | extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, | ||
33 | TransportAddress *taddr, | ||
34 | union nf_conntrack_address *addr, __be16 *port); | ||
35 | extern void nf_conntrack_h245_expect(struct nf_conn *new, | ||
36 | struct nf_conntrack_expect *this); | ||
37 | extern void nf_conntrack_q931_expect(struct nf_conn *new, | ||
38 | struct nf_conntrack_expect *this); | ||
39 | extern int (*set_h245_addr_hook) (struct sk_buff **pskb, | ||
40 | unsigned char **data, int dataoff, | ||
41 | H245_TransportAddress *taddr, | ||
42 | union nf_conntrack_address *addr, | ||
43 | __be16 port); | ||
44 | extern int (*set_h225_addr_hook) (struct sk_buff **pskb, | ||
45 | unsigned char **data, int dataoff, | ||
46 | TransportAddress *taddr, | ||
47 | union nf_conntrack_address *addr, | ||
48 | __be16 port); | ||
49 | extern int (*set_sig_addr_hook) (struct sk_buff **pskb, | ||
50 | struct nf_conn *ct, | ||
51 | enum ip_conntrack_info ctinfo, | ||
52 | unsigned char **data, | ||
53 | TransportAddress *taddr, int count); | ||
54 | extern int (*set_ras_addr_hook) (struct sk_buff **pskb, | ||
55 | struct nf_conn *ct, | ||
56 | enum ip_conntrack_info ctinfo, | ||
57 | unsigned char **data, | ||
58 | TransportAddress *taddr, int count); | ||
59 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb, | ||
60 | struct nf_conn *ct, | ||
61 | enum ip_conntrack_info ctinfo, | ||
62 | unsigned char **data, int dataoff, | ||
63 | H245_TransportAddress *taddr, | ||
64 | __be16 port, __be16 rtp_port, | ||
65 | struct nf_conntrack_expect *rtp_exp, | ||
66 | struct nf_conntrack_expect *rtcp_exp); | ||
67 | extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
68 | enum ip_conntrack_info ctinfo, | ||
69 | unsigned char **data, int dataoff, | ||
70 | H245_TransportAddress *taddr, __be16 port, | ||
71 | struct nf_conntrack_expect *exp); | ||
72 | extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
73 | enum ip_conntrack_info ctinfo, | ||
74 | unsigned char **data, int dataoff, | ||
75 | TransportAddress *taddr, __be16 port, | ||
76 | struct nf_conntrack_expect *exp); | ||
77 | extern int (*nat_callforwarding_hook) (struct sk_buff **pskb, | ||
78 | struct nf_conn *ct, | ||
79 | enum ip_conntrack_info ctinfo, | ||
80 | unsigned char **data, int dataoff, | ||
81 | TransportAddress *taddr, | ||
82 | __be16 port, | ||
83 | struct nf_conntrack_expect *exp); | ||
84 | extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
85 | enum ip_conntrack_info ctinfo, | ||
86 | unsigned char **data, TransportAddress *taddr, | ||
87 | int idx, __be16 port, | ||
88 | struct nf_conntrack_expect *exp); | ||
89 | |||
90 | #endif | ||
91 | |||
92 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h index c6e9a0b6d30b..8dab5968fc7e 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h +++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 | 2 | * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323 |
3 | * conntrack/NAT module. | 3 | * conntrack/NAT module. |
4 | * | 4 | * |
5 | * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> | 5 | * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> |
6 | * | 6 | * |
@@ -34,13 +34,13 @@ | |||
34 | * | 34 | * |
35 | ****************************************************************************/ | 35 | ****************************************************************************/ |
36 | 36 | ||
37 | #ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ | 37 | #ifndef _NF_CONNTRACK_HELPER_H323_ASN1_H_ |
38 | #define _IP_CONNTRACK_HELPER_H323_ASN1_H_ | 38 | #define _NF_CONNTRACK_HELPER_H323_ASN1_H_ |
39 | 39 | ||
40 | /***************************************************************************** | 40 | /***************************************************************************** |
41 | * H.323 Types | 41 | * H.323 Types |
42 | ****************************************************************************/ | 42 | ****************************************************************************/ |
43 | #include "ip_conntrack_helper_h323_types.h" | 43 | #include "nf_conntrack_h323_types.h" |
44 | 44 | ||
45 | typedef struct { | 45 | typedef struct { |
46 | enum { | 46 | enum { |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter/nf_conntrack_h323_types.h index 3d4a773799fc..38d74d5c9700 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h +++ b/include/linux/netfilter/nf_conntrack_h323_types.h | |||
@@ -10,6 +10,11 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */ | |||
10 | unsigned ip; | 10 | unsigned ip; |
11 | } TransportAddress_ipAddress; | 11 | } TransportAddress_ipAddress; |
12 | 12 | ||
13 | typedef struct TransportAddress_ip6Address { /* SEQUENCE */ | ||
14 | int options; /* No use */ | ||
15 | unsigned ip6; | ||
16 | } TransportAddress_ip6Address; | ||
17 | |||
13 | typedef struct TransportAddress { /* CHOICE */ | 18 | typedef struct TransportAddress { /* CHOICE */ |
14 | enum { | 19 | enum { |
15 | eTransportAddress_ipAddress, | 20 | eTransportAddress_ipAddress, |
@@ -22,6 +27,7 @@ typedef struct TransportAddress { /* CHOICE */ | |||
22 | } choice; | 27 | } choice; |
23 | union { | 28 | union { |
24 | TransportAddress_ipAddress ipAddress; | 29 | TransportAddress_ipAddress ipAddress; |
30 | TransportAddress_ip6Address ip6Address; | ||
25 | }; | 31 | }; |
26 | } TransportAddress; | 32 | } TransportAddress; |
27 | 33 | ||
@@ -93,6 +99,11 @@ typedef struct UnicastAddress_iPAddress { /* SEQUENCE */ | |||
93 | unsigned network; | 99 | unsigned network; |
94 | } UnicastAddress_iPAddress; | 100 | } UnicastAddress_iPAddress; |
95 | 101 | ||
102 | typedef struct UnicastAddress_iP6Address { /* SEQUENCE */ | ||
103 | int options; /* No use */ | ||
104 | unsigned network; | ||
105 | } UnicastAddress_iP6Address; | ||
106 | |||
96 | typedef struct UnicastAddress { /* CHOICE */ | 107 | typedef struct UnicastAddress { /* CHOICE */ |
97 | enum { | 108 | enum { |
98 | eUnicastAddress_iPAddress, | 109 | eUnicastAddress_iPAddress, |
@@ -105,6 +116,7 @@ typedef struct UnicastAddress { /* CHOICE */ | |||
105 | } choice; | 116 | } choice; |
106 | union { | 117 | union { |
107 | UnicastAddress_iPAddress iPAddress; | 118 | UnicastAddress_iPAddress iPAddress; |
119 | UnicastAddress_iP6Address iP6Address; | ||
108 | }; | 120 | }; |
109 | } UnicastAddress; | 121 | } UnicastAddress; |
110 | 122 | ||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 591c1a809c00..180337801a86 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -1,6 +1,4 @@ | |||
1 | header-y += ip_conntrack_helper.h | 1 | header-y += ip_conntrack_helper.h |
2 | header-y += ip_conntrack_helper_h323_asn1.h | ||
3 | header-y += ip_conntrack_helper_h323_types.h | ||
4 | header-y += ip_conntrack_protocol.h | 2 | header-y += ip_conntrack_protocol.h |
5 | header-y += ip_conntrack_sctp.h | 3 | header-y += ip_conntrack_sctp.h |
6 | header-y += ip_conntrack_tcp.h | 4 | header-y += ip_conntrack_tcp.h |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 943cc6a4871d..18f769818f4e 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> | 6 | #include <linux/netfilter/nf_conntrack_h323_asn1.h> |
7 | 7 | ||
8 | #define RAS_PORT 1719 | 8 | #define RAS_PORT 1719 |
9 | #define Q931_PORT 1720 | 9 | #define Q931_PORT 1720 |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 83694cfdfa8f..1646076933b1 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -41,11 +41,13 @@ union nf_conntrack_expect_proto { | |||
41 | 41 | ||
42 | /* Add protocol helper include file here */ | 42 | /* Add protocol helper include file here */ |
43 | #include <linux/netfilter/nf_conntrack_ftp.h> | 43 | #include <linux/netfilter/nf_conntrack_ftp.h> |
44 | #include <linux/netfilter/nf_conntrack_h323.h> | ||
44 | 45 | ||
45 | /* per conntrack: application helper private data */ | 46 | /* per conntrack: application helper private data */ |
46 | union nf_conntrack_help { | 47 | union nf_conntrack_help { |
47 | /* insert conntrack helper private data (master) here */ | 48 | /* insert conntrack helper private data (master) here */ |
48 | struct nf_ct_ftp_master ct_ftp_info; | 49 | struct nf_ct_ftp_master ct_ftp_info; |
50 | struct nf_ct_h323_master ct_h323_info; | ||
49 | }; | 51 | }; |
50 | 52 | ||
51 | #include <linux/types.h> | 53 | #include <linux/types.h> |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 54a3d038beaa..cef3136e22a3 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -41,6 +41,7 @@ struct nf_conntrack_expect | |||
41 | unsigned int flags; | 41 | unsigned int flags; |
42 | 42 | ||
43 | #ifdef CONFIG_NF_NAT_NEEDED | 43 | #ifdef CONFIG_NF_NAT_NEEDED |
44 | __be32 saved_ip; | ||
44 | /* This is the original per-proto part, used to map the | 45 | /* This is the original per-proto part, used to map the |
45 | * expected connection the way the recipient expects. */ | 46 | * expected connection the way the recipient expects. */ |
46 | union nf_conntrack_man_proto saved_proto; | 47 | union nf_conntrack_man_proto saved_proto; |