[NETFILTER]: nf_conntrack_sip: support method specific request/response handling
Add support for per-method request/response handlers and perform SDP parsing for INVITE/UPDATE requests and for all informational and successful responses. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7d3dd043b6
commit
30f33e6dee
@ -5,6 +5,25 @@
|
||||
#define SIP_PORT 5060
|
||||
#define SIP_TIMEOUT 3600
|
||||
|
||||
struct sip_handler {
|
||||
const char *method;
|
||||
unsigned int len;
|
||||
int (*request)(struct sk_buff *skb,
|
||||
const char **dptr, unsigned int *datalen,
|
||||
unsigned int cseq);
|
||||
int (*response)(struct sk_buff *skb,
|
||||
const char **dptr, unsigned int *datalen,
|
||||
unsigned int cseq, unsigned int code);
|
||||
};
|
||||
|
||||
#define SIP_HANDLER(__method, __request, __response) \
|
||||
{ \
|
||||
.method = (__method), \
|
||||
.len = sizeof(__method) - 1, \
|
||||
.request = (__request), \
|
||||
.response = (__response), \
|
||||
}
|
||||
|
||||
struct sip_header {
|
||||
const char *name;
|
||||
const char *cname;
|
||||
@ -35,6 +54,7 @@ struct sip_header {
|
||||
__SIP_HDR(__name, NULL, __search, __match)
|
||||
|
||||
enum sip_header_types {
|
||||
SIP_HDR_CSEQ,
|
||||
SIP_HDR_FROM,
|
||||
SIP_HDR_TO,
|
||||
SIP_HDR_CONTACT,
|
||||
|
Reference in New Issue
Block a user