Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9d288dff
Commit
9d288dff
authored
Feb 11, 2010
by
Patrick McHardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netfilter: nf_conntrack_sip: add T.38 FAX support
Signed-off-by:
Patrick McHardy
<
kaber@trash.net
>
parent
48f8ac26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
include/linux/netfilter/nf_conntrack_sip.h
include/linux/netfilter/nf_conntrack_sip.h
+1
-0
include/net/netfilter/nf_conntrack.h
include/net/netfilter/nf_conntrack.h
+1
-1
net/netfilter/nf_conntrack_sip.c
net/netfilter/nf_conntrack_sip.c
+23
-5
No files found.
include/linux/netfilter/nf_conntrack_sip.h
View file @
9d288dff
...
...
@@ -14,6 +14,7 @@ enum sip_expectation_classes {
SIP_EXPECT_SIGNALLING
,
SIP_EXPECT_AUDIO
,
SIP_EXPECT_VIDEO
,
SIP_EXPECT_IMAGE
,
__SIP_EXPECT_MAX
};
#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1)
...
...
include/net/netfilter/nf_conntrack.h
View file @
9d288dff
...
...
@@ -70,7 +70,7 @@ union nf_conntrack_help {
struct
nf_conntrack_helper
;
/* Must be kept in sync with the classes defined by helpers */
#define NF_CT_MAX_EXPECT_CLASSES
3
#define NF_CT_MAX_EXPECT_CLASSES
4
/* nf_conn feature for connections that have a helper */
struct
nf_conn_help
{
...
...
net/netfilter/nf_conntrack_sip.c
View file @
9d288dff
...
...
@@ -907,6 +907,7 @@ static int set_expected_rtp_rtcp(struct sk_buff *skb, unsigned int dataoff,
static
const
struct
sdp_media_type
sdp_media_types
[]
=
{
SDP_MEDIA_TYPE
(
"audio "
,
SIP_EXPECT_AUDIO
),
SDP_MEDIA_TYPE
(
"video "
,
SIP_EXPECT_VIDEO
),
SDP_MEDIA_TYPE
(
"image "
,
SIP_EXPECT_IMAGE
),
};
static
const
struct
sdp_media_type
*
sdp_media_type
(
const
char
*
dptr
,
...
...
@@ -932,7 +933,6 @@ static int process_sdp(struct sk_buff *skb, unsigned int dataoff,
{
enum
ip_conntrack_info
ctinfo
;
struct
nf_conn
*
ct
=
nf_ct_get
(
skb
,
&
ctinfo
);
struct
nf_conn_help
*
help
=
nfct_help
(
ct
);
unsigned
int
matchoff
,
matchlen
;
unsigned
int
mediaoff
,
medialen
;
unsigned
int
sdpoff
;
...
...
@@ -1024,9 +1024,6 @@ static int process_sdp(struct sk_buff *skb, unsigned int dataoff,
ret
=
nf_nat_sdp_session
(
skb
,
dataoff
,
dptr
,
datalen
,
sdpoff
,
&
rtp_addr
);
if
(
ret
==
NF_ACCEPT
&&
i
>
0
)
help
->
help
.
ct_sip_info
.
invite_cseq
=
cseq
;
return
ret
;
}
static
int
process_invite_response
(
struct
sk_buff
*
skb
,
unsigned
int
dataoff
,
...
...
@@ -1077,6 +1074,22 @@ static int process_prack_response(struct sk_buff *skb, unsigned int dataoff,
return
NF_ACCEPT
;
}
static
int
process_invite_request
(
struct
sk_buff
*
skb
,
unsigned
int
dataoff
,
const
char
**
dptr
,
unsigned
int
*
datalen
,
unsigned
int
cseq
)
{
enum
ip_conntrack_info
ctinfo
;
struct
nf_conn
*
ct
=
nf_ct_get
(
skb
,
&
ctinfo
);
struct
nf_conn_help
*
help
=
nfct_help
(
ct
);
unsigned
int
ret
;
flush_expectations
(
ct
,
true
);
ret
=
process_sdp
(
skb
,
dataoff
,
dptr
,
datalen
,
cseq
);
if
(
ret
==
NF_ACCEPT
)
help
->
help
.
ct_sip_info
.
invite_cseq
=
cseq
;
return
ret
;
}
static
int
process_bye_request
(
struct
sk_buff
*
skb
,
unsigned
int
dataoff
,
const
char
**
dptr
,
unsigned
int
*
datalen
,
unsigned
int
cseq
)
...
...
@@ -1257,7 +1270,7 @@ static int process_register_response(struct sk_buff *skb, unsigned int dataoff,
}
static
const
struct
sip_handler
sip_handlers
[]
=
{
SIP_HANDLER
(
"INVITE"
,
process_
sdp
,
process_invite_response
),
SIP_HANDLER
(
"INVITE"
,
process_
invite_request
,
process_invite_response
),
SIP_HANDLER
(
"UPDATE"
,
process_sdp
,
process_update_response
),
SIP_HANDLER
(
"ACK"
,
process_sdp
,
NULL
),
SIP_HANDLER
(
"PRACK"
,
process_sdp
,
process_prack_response
),
...
...
@@ -1473,6 +1486,11 @@ static const struct nf_conntrack_expect_policy sip_exp_policy[SIP_EXPECT_MAX + 1
.
max_expected
=
2
*
IP_CT_DIR_MAX
,
.
timeout
=
3
*
60
,
},
[
SIP_EXPECT_IMAGE
]
=
{
.
name
=
"image"
,
.
max_expected
=
IP_CT_DIR_MAX
,
.
timeout
=
3
*
60
,
},
};
static
void
nf_conntrack_sip_fini
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment