diff options
author | Patrick McHardy <kaber@trash.net> | 2008-03-25 23:25:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-25 23:25:13 -0400 |
commit | 0f32a40fc91a9ebbbf66e826ac2a829ab37d9cf8 (patch) | |
tree | 0c221d19a91fa5ab4d746480438ea0f47031062d /include | |
parent | c978cd3a937141deaf7995b849824af6dacdeae7 (diff) |
[NETFILTER]: nf_conntrack_sip: create signalling expectations
Create expectations for incoming signalling connections when seeing
a REGISTER request. This is needed when the registrar uses a
different source port number for signalling messages and for receiving
incoming calls from other endpoints than the registrar.
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_sip.h | 18 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 87e402825dba..7cc84ed0c5da 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -5,6 +5,17 @@ | |||
5 | #define SIP_PORT 5060 | 5 | #define SIP_PORT 5060 |
6 | #define SIP_TIMEOUT 3600 | 6 | #define SIP_TIMEOUT 3600 |
7 | 7 | ||
8 | struct nf_ct_sip_master { | ||
9 | unsigned int register_cseq; | ||
10 | }; | ||
11 | |||
12 | enum sip_expectation_classes { | ||
13 | SIP_EXPECT_SIGNALLING, | ||
14 | SIP_EXPECT_AUDIO, | ||
15 | __SIP_EXPECT_MAX | ||
16 | }; | ||
17 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) | ||
18 | |||
8 | struct sip_handler { | 19 | struct sip_handler { |
9 | const char *method; | 20 | const char *method; |
10 | unsigned int len; | 21 | unsigned int len; |
@@ -59,6 +70,7 @@ enum sip_header_types { | |||
59 | SIP_HDR_TO, | 70 | SIP_HDR_TO, |
60 | SIP_HDR_CONTACT, | 71 | SIP_HDR_CONTACT, |
61 | SIP_HDR_VIA, | 72 | SIP_HDR_VIA, |
73 | SIP_HDR_EXPIRES, | ||
62 | SIP_HDR_CONTENT_LENGTH, | 74 | SIP_HDR_CONTENT_LENGTH, |
63 | }; | 75 | }; |
64 | 76 | ||
@@ -75,6 +87,12 @@ enum sdp_header_types { | |||
75 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 87 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
76 | const char **dptr, | 88 | const char **dptr, |
77 | unsigned int *datalen); | 89 | unsigned int *datalen); |
90 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | ||
91 | const char **dptr, | ||
92 | unsigned int *datalen, | ||
93 | struct nf_conntrack_expect *exp, | ||
94 | unsigned int matchoff, | ||
95 | unsigned int matchlen); | ||
78 | extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb, | 96 | extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb, |
79 | const char **dptr, | 97 | const char **dptr, |
80 | unsigned int *datalen, | 98 | unsigned int *datalen, |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 922877133598..4a4f870d2a5e 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -46,6 +46,7 @@ union nf_conntrack_expect_proto { | |||
46 | #include <linux/netfilter/nf_conntrack_pptp.h> | 46 | #include <linux/netfilter/nf_conntrack_pptp.h> |
47 | #include <linux/netfilter/nf_conntrack_h323.h> | 47 | #include <linux/netfilter/nf_conntrack_h323.h> |
48 | #include <linux/netfilter/nf_conntrack_sane.h> | 48 | #include <linux/netfilter/nf_conntrack_sane.h> |
49 | #include <linux/netfilter/nf_conntrack_sip.h> | ||
49 | 50 | ||
50 | /* per conntrack: application helper private data */ | 51 | /* per conntrack: application helper private data */ |
51 | union nf_conntrack_help { | 52 | union nf_conntrack_help { |
@@ -54,6 +55,7 @@ union nf_conntrack_help { | |||
54 | struct nf_ct_pptp_master ct_pptp_info; | 55 | struct nf_ct_pptp_master ct_pptp_info; |
55 | struct nf_ct_h323_master ct_h323_info; | 56 | struct nf_ct_h323_master ct_h323_info; |
56 | struct nf_ct_sane_master ct_sane_info; | 57 | struct nf_ct_sane_master ct_sane_info; |
58 | struct nf_ct_sip_master ct_sip_info; | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | #include <linux/types.h> | 61 | #include <linux/types.h> |
@@ -76,7 +78,7 @@ do { \ | |||
76 | struct nf_conntrack_helper; | 78 | struct nf_conntrack_helper; |
77 | 79 | ||
78 | /* Must be kept in sync with the classes defined by helpers */ | 80 | /* Must be kept in sync with the classes defined by helpers */ |
79 | #define NF_CT_MAX_EXPECT_CLASSES 1 | 81 | #define NF_CT_MAX_EXPECT_CLASSES 2 |
80 | 82 | ||
81 | /* nf_conn feature for connections that have a helper */ | 83 | /* nf_conn feature for connections that have a helper */ |
82 | struct nf_conn_help { | 84 | struct nf_conn_help { |