forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
15 changed files
with
2,600 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef _NF_CONNTRACK_H323_H | ||
#define _NF_CONNTRACK_H323_H | ||
|
||
#ifdef __KERNEL__ | ||
|
||
#include <linux/netfilter/nf_conntrack_h323_asn1.h> | ||
|
||
#define RAS_PORT 1719 | ||
#define Q931_PORT 1720 | ||
#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
|
||
/* This structure exists only once per master */ | ||
struct nf_ct_h323_master { | ||
|
||
/* Original and NATed Q.931 or H.245 signal ports */ | ||
__be16 sig_port[IP_CT_DIR_MAX]; | ||
|
||
/* Original and NATed RTP ports */ | ||
__be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
|
||
union { | ||
/* RAS connection timeout */ | ||
u_int32_t timeout; | ||
|
||
/* Next TPKT length (for separate TPKT header and data) */ | ||
u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
}; | ||
}; | ||
|
||
struct nf_conn; | ||
|
||
extern int get_h225_addr(struct nf_conn *ct, unsigned char *data, | ||
TransportAddress *taddr, | ||
union nf_conntrack_address *addr, __be16 *port); | ||
extern void nf_conntrack_h245_expect(struct nf_conn *new, | ||
struct nf_conntrack_expect *this); | ||
extern void nf_conntrack_q931_expect(struct nf_conn *new, | ||
struct nf_conntrack_expect *this); | ||
extern int (*set_h245_addr_hook) (struct sk_buff **pskb, | ||
unsigned char **data, int dataoff, | ||
H245_TransportAddress *taddr, | ||
union nf_conntrack_address *addr, | ||
__be16 port); | ||
extern int (*set_h225_addr_hook) (struct sk_buff **pskb, | ||
unsigned char **data, int dataoff, | ||
TransportAddress *taddr, | ||
union nf_conntrack_address *addr, | ||
__be16 port); | ||
extern int (*set_sig_addr_hook) (struct sk_buff **pskb, | ||
struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, | ||
TransportAddress *taddr, int count); | ||
extern int (*set_ras_addr_hook) (struct sk_buff **pskb, | ||
struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, | ||
TransportAddress *taddr, int count); | ||
extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb, | ||
struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, int dataoff, | ||
H245_TransportAddress *taddr, | ||
__be16 port, __be16 rtp_port, | ||
struct nf_conntrack_expect *rtp_exp, | ||
struct nf_conntrack_expect *rtcp_exp); | ||
extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, int dataoff, | ||
H245_TransportAddress *taddr, __be16 port, | ||
struct nf_conntrack_expect *exp); | ||
extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, int dataoff, | ||
TransportAddress *taddr, __be16 port, | ||
struct nf_conntrack_expect *exp); | ||
extern int (*nat_callforwarding_hook) (struct sk_buff **pskb, | ||
struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, int dataoff, | ||
TransportAddress *taddr, | ||
__be16 port, | ||
struct nf_conntrack_expect *exp); | ||
extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct, | ||
enum ip_conntrack_info ctinfo, | ||
unsigned char **data, TransportAddress *taddr, | ||
int idx, __be16 port, | ||
struct nf_conntrack_expect *exp); | ||
|
||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/**************************************************************************** | ||
* ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 | ||
* conntrack/NAT module. | ||
* ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323 | ||
* conntrack/NAT module. | ||
* | ||
* Copyright (c) 2006 by Jing Min Zhao <[email protected]> | ||
* | ||
|
@@ -34,13 +34,13 @@ | |
* | ||
****************************************************************************/ | ||
|
||
#ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ | ||
#define _IP_CONNTRACK_HELPER_H323_ASN1_H_ | ||
#ifndef _NF_CONNTRACK_HELPER_H323_ASN1_H_ | ||
#define _NF_CONNTRACK_HELPER_H323_ASN1_H_ | ||
|
||
/***************************************************************************** | ||
* H.323 Types | ||
****************************************************************************/ | ||
#include "ip_conntrack_helper_h323_types.h" | ||
#include "nf_conntrack_h323_types.h" | ||
|
||
typedef struct { | ||
enum { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.