Skip to content

Commit 5e35941

Browse files
Jing Min Zhaodavem330
authored andcommitted
[NETFILTER]: Add H.323 conntrack/NAT helper
Signed-off-by: Jing Min Zhao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 30ca3e3 commit 5e35941

10 files changed

+6231
-0
lines changed

include/linux/netfilter_ipv4/ip_conntrack.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ union ip_conntrack_expect_proto {
2929
};
3030

3131
/* Add protocol helper include file here */
32+
#include <linux/netfilter_ipv4/ip_conntrack_h323.h>
3233
#include <linux/netfilter_ipv4/ip_conntrack_pptp.h>
3334
#include <linux/netfilter_ipv4/ip_conntrack_amanda.h>
3435
#include <linux/netfilter_ipv4/ip_conntrack_ftp.h>
@@ -37,6 +38,7 @@ union ip_conntrack_expect_proto {
3738
/* per conntrack: application helper private data */
3839
union ip_conntrack_help {
3940
/* insert conntrack helper private data (master) here */
41+
struct ip_ct_h323_master ct_h323_info;
4042
struct ip_ct_pptp_master ct_pptp_info;
4143
struct ip_ct_ftp_master ct_ftp_info;
4244
struct ip_ct_irc_master ct_irc_info;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef _IP_CONNTRACK_H323_H
2+
#define _IP_CONNTRACK_H323_H
3+
4+
#ifdef __KERNEL__
5+
6+
#define RAS_PORT 1719
7+
#define Q931_PORT 1720
8+
#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */
9+
10+
/* This structure exists only once per master */
11+
struct ip_ct_h323_master {
12+
13+
/* Original and NATed Q.931 or H.245 signal ports */
14+
u_int16_t sig_port[IP_CT_DIR_MAX];
15+
16+
/* Original and NATed RTP ports */
17+
u_int16_t rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX];
18+
19+
union {
20+
/* RAS connection timeout */
21+
u_int32_t timeout;
22+
23+
/* Next TPKT length (for separate TPKT header and data) */
24+
u_int16_t tpkt_len[IP_CT_DIR_MAX];
25+
};
26+
};
27+
28+
#endif
29+
30+
#endif

net/ipv4/netfilter/Kconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,26 @@ config IP_NF_PPTP
168168
If you want to compile it as a module, say M here and read
169169
Documentation/modules.txt. If unsure, say `N'.
170170

171+
config IP_NF_H323
172+
tristate 'H.323 protocol support'
173+
depends on IP_NF_CONNTRACK
174+
help
175+
H.323 is a VoIP signalling protocol from ITU-T. As one of the most
176+
important VoIP protocols, it is widely used by voice hardware and
177+
software including voice gateways, IP phones, Netmeeting, OpenPhone,
178+
Gnomemeeting, etc.
179+
180+
With this module you can support H.323 on a connection tracking/NAT
181+
firewall.
182+
183+
This module supports RAS, Fast-start, H.245 tunnelling, RTP/RTCP
184+
and T.120 based data and applications including audio, video, FAX,
185+
chat, whiteboard, file transfer, etc. For more information, please
186+
see http://nath323.sourceforge.net/.
187+
188+
If you want to compile it as a module, say 'M' here and read
189+
Documentation/modules.txt. If unsure, say 'N'.
190+
171191
config IP_NF_QUEUE
172192
tristate "IP Userspace queueing via NETLINK (OBSOLETE)"
173193
help
@@ -484,6 +504,12 @@ config IP_NF_NAT_PPTP
484504
default IP_NF_NAT if IP_NF_PPTP=y
485505
default m if IP_NF_PPTP=m
486506

507+
config IP_NF_NAT_H323
508+
tristate
509+
depends on IP_NF_IPTABLES!=n && IP_NF_CONNTRACK!=n && IP_NF_NAT!=n
510+
default IP_NF_NAT if IP_NF_H323=y
511+
default m if IP_NF_H323=m
512+
487513
# mangle + specific targets
488514
config IP_NF_MANGLE
489515
tristate "Packet mangling"

net/ipv4/netfilter/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ iptable_nat-objs := ip_nat_rule.o ip_nat_standalone.o
1010
ip_conntrack_pptp-objs := ip_conntrack_helper_pptp.o ip_conntrack_proto_gre.o
1111
ip_nat_pptp-objs := ip_nat_helper_pptp.o ip_nat_proto_gre.o
1212

13+
ip_conntrack_h323-objs := ip_conntrack_helper_h323.o ip_conntrack_helper_h323_asn1.o
14+
ip_nat_h323-objs := ip_nat_helper_h323.o
15+
1316
# connection tracking
1417
obj-$(CONFIG_IP_NF_CONNTRACK) += ip_conntrack.o
1518
obj-$(CONFIG_IP_NF_NAT) += ip_nat.o
@@ -22,6 +25,7 @@ obj-$(CONFIG_IP_NF_CONNTRACK_NETLINK) += ip_conntrack_netlink.o
2225
obj-$(CONFIG_IP_NF_CT_PROTO_SCTP) += ip_conntrack_proto_sctp.o
2326

2427
# connection tracking helpers
28+
obj-$(CONFIG_IP_NF_H323) += ip_conntrack_h323.o
2529
obj-$(CONFIG_IP_NF_PPTP) += ip_conntrack_pptp.o
2630
obj-$(CONFIG_IP_NF_AMANDA) += ip_conntrack_amanda.o
2731
obj-$(CONFIG_IP_NF_TFTP) += ip_conntrack_tftp.o
@@ -30,6 +34,7 @@ obj-$(CONFIG_IP_NF_IRC) += ip_conntrack_irc.o
3034
obj-$(CONFIG_IP_NF_NETBIOS_NS) += ip_conntrack_netbios_ns.o
3135

3236
# NAT helpers
37+
obj-$(CONFIG_IP_NF_NAT_H323) += ip_nat_h323.o
3338
obj-$(CONFIG_IP_NF_NAT_PPTP) += ip_nat_pptp.o
3439
obj-$(CONFIG_IP_NF_NAT_AMANDA) += ip_nat_amanda.o
3540
obj-$(CONFIG_IP_NF_NAT_TFTP) += ip_nat_tftp.o

0 commit comments

Comments
 (0)