[NETFILTER]: Add SIP connection tracking helper
[linux-2.6.git] / include / linux / netfilter_ipv4 / ip_conntrack_sip.h
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__ */