diff options
author | Patrick McHardy <kaber@trash.net> | 2006-11-28 20:35:26 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:31:23 -0500 |
commit | 9d5b8baa4e9ace9be113c6151aaeeb3c07a26fc8 (patch) | |
tree | 039d42ebf4734e665ccf4f9251668d31b10fdf2a /include/linux | |
parent | 337fbc4166967a72c3cc71c597bdde7e6a8633ab (diff) |
[NETFILTER]: sip conntrack: minor cleanup
- Use enum for header field enumeration
- Use numerical value instead of pointer to header info structure to
identify headers, unexport ct_sip_hdrs
- group SIP and SDP entries in header info structure
- remove double forward declaration of ct_sip_get_info
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack_sip.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h index 913dad66c0fb..2a15eb51fd6b 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_sip.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h | |||
@@ -5,23 +5,15 @@ | |||
5 | #define SIP_PORT 5060 | 5 | #define SIP_PORT 5060 |
6 | #define SIP_TIMEOUT 3600 | 6 | #define SIP_TIMEOUT 3600 |
7 | 7 | ||
8 | #define POS_VIA 0 | 8 | enum sip_header_pos { |
9 | #define POS_CONTACT 1 | 9 | POS_REQ_HEADER, |
10 | #define POS_CONTENT 2 | 10 | POS_VIA, |
11 | #define POS_MEDIA 3 | 11 | POS_CONTACT, |
12 | #define POS_OWNER 4 | 12 | POS_CONTENT, |
13 | #define POS_CONNECTION 5 | 13 | POS_MEDIA, |
14 | #define POS_REQ_HEADER 6 | 14 | POS_OWNER, |
15 | #define POS_SDP_HEADER 7 | 15 | POS_CONNECTION, |
16 | 16 | POS_SDP_HEADER, | |
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 | }; | 17 | }; |
26 | 18 | ||
27 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, | 19 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, |
@@ -36,7 +28,7 @@ extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb, | |||
36 | extern int ct_sip_get_info(const char *dptr, size_t dlen, | 28 | extern int ct_sip_get_info(const char *dptr, size_t dlen, |
37 | unsigned int *matchoff, | 29 | unsigned int *matchoff, |
38 | unsigned int *matchlen, | 30 | unsigned int *matchlen, |
39 | struct sip_header_nfo *hnfo); | 31 | enum sip_header_pos pos); |
40 | extern int ct_sip_lnlen(const char *line, const char *limit); | 32 | extern int ct_sip_lnlen(const char *line, const char *limit); |
41 | extern const char *ct_sip_search(const char *needle, const char *haystack, | 33 | extern const char *ct_sip_search(const char *needle, const char *haystack, |
42 | size_t needle_len, size_t haystack_len); | 34 | size_t needle_len, size_t haystack_len); |