diff options
author | Patrick McHardy <kaber@trash.net> | 2006-05-29 21:27:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 00:29:15 -0400 |
commit | ae5b7d8ba2c28d7d9835856fe0ca5f6ec95ea768 (patch) | |
tree | 54de467b6ee9344a51c8b254be3da933b57cc531 /include | |
parent | e44ab66a75e20c02193440a5e27c16c91630109b (diff) |
[NETFILTER]: Add SIP connection tracking helper
Add SIP connection tracking helper. Originally written by
Christian Hentschel <chentschel@arnet.com.ar>, some cleanup, minor
fixes and bidirectional SIP support added by myself.
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_ipv4/ip_conntrack_sip.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h new file mode 100644 index 000000000000..913dad66c0fb --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __IP_CONNTRACK_SIP_H__ | ||
2 | #define __IP_CONNTRACK_SIP_H__ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #define SIP_PORT 5060 | ||
6 | #define SIP_TIMEOUT 3600 | ||
7 | |||
8 | #define POS_VIA 0 | ||
9 | #define POS_CONTACT 1 | ||
10 | #define POS_CONTENT 2 | ||
11 | #define POS_MEDIA 3 | ||
12 | #define POS_OWNER 4 | ||
13 | #define POS_CONNECTION 5 | ||
14 | #define POS_REQ_HEADER 6 | ||
15 | #define POS_SDP_HEADER 7 | ||
16 | |||
17 | struct sip_header_nfo { | ||
18 | const char *lname; | ||
19 | const char *sname; | ||
20 | const char *ln_str; | ||
21 | size_t lnlen; | ||
22 | size_t snlen; | ||
23 | size_t ln_strlen; | ||
24 | int (*match_len)(const char *, const char *, int *); | ||
25 | }; | ||
26 | |||
27 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, | ||
28 | enum ip_conntrack_info ctinfo, | ||
29 | struct ip_conntrack *ct, | ||
30 | const char **dptr); | ||
31 | extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb, | ||
32 | enum ip_conntrack_info ctinfo, | ||
33 | struct ip_conntrack_expect *exp, | ||
34 | const char *dptr); | ||
35 | |||
36 | extern int ct_sip_get_info(const char *dptr, size_t dlen, | ||
37 | unsigned int *matchoff, | ||
38 | unsigned int *matchlen, | ||
39 | struct sip_header_nfo *hnfo); | ||
40 | extern int ct_sip_lnlen(const char *line, const char *limit); | ||
41 | extern const char *ct_sip_search(const char *needle, const char *haystack, | ||
42 | size_t needle_len, size_t haystack_len); | ||
43 | #endif /* __KERNEL__ */ | ||
44 | #endif /* __IP_CONNTRACK_SIP_H__ */ | ||