Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a149460 authored by Paras Singh Jain's avatar Paras Singh Jain Committed by Gerrit - the friendly Code Review server
Browse files

netfilter: nf_conntrack_sip: Dynamically enable/disable SIP direct media



Enabling SIP direct media allows flow of SIP media traffic only between
the SIP signalling end points. Disabling SIP direct media allows flow of
SIP media traffic between 2 SIP clients which interact with each other
with the help of SIP server as the intermediate entity, which is the more
common usecase. This change allows easy way to enable/disable SIP direct
media from userspace to cater to the more common usecase.

Change-Id: Iadfd7062e48c8b4e2f7af919a6062360c165344c
Acked-by: default avatarVinisha Varre <vvarre@qti.qualcomm.com>
Signed-off-by: default avatarParas Singh Jain <parassin@codeaurora.org>
parent 4035b90f
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -50,11 +50,6 @@ module_param(sip_direct_signalling, int, 0600);
MODULE_PARM_DESC(sip_direct_signalling, "expect incoming calls from registrar "
					"only (default 1)");

static int sip_direct_media __read_mostly = 1;
module_param(sip_direct_media, int, 0600);
MODULE_PARM_DESC(sip_direct_media, "Expect Media streams between signalling "
				   "endpoints only (default 1)");

static int sip_external_media __read_mostly = 0;
module_param(sip_external_media, int, 0600);
MODULE_PARM_DESC(sip_external_media, "Expect Media streams between external "
@@ -64,6 +59,7 @@ const struct nf_nat_sip_hooks *nf_nat_sip_hooks;
EXPORT_SYMBOL_GPL(nf_nat_sip_hooks);
static struct ctl_table_header *sip_sysctl_header;
static unsigned int nf_ct_disable_sip_alg;
static int sip_direct_media = 1;
static struct ctl_table sip_sysctl_tbl[] = {
	{
		.procname     = "nf_conntrack_disable_sip_alg",
@@ -72,6 +68,13 @@ static struct ctl_table sip_sysctl_tbl[] = {
		.mode         = 0644,
		.proc_handler = proc_dointvec,
	},
	{
		.procname     = "nf_conntrack_sip_direct_media",
		.data         = &sip_direct_media,
		.maxlen       = sizeof(int),
		.mode         = 0644,
		.proc_handler = proc_dointvec,
	},
	{}
};