aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-19 19:06:06 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-08-21 11:11:09 +0200
commit2c90899bc4386d4e5dae41e098b17e87cae99e42 (patch)
treeec60c62b533095edbf4d287aa66efe030035f537
parent1aaeea490029264062406ccf1afd25e87dfd0e2e (diff)
vty: Introduce cs7-instance-iu
Similar to what we already have in osmo-msc. Change-Id: Iaa9e1d06dd0430848ef4f7498a3c15d13f899904
-rw-r--r--doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg1
-rw-r--r--doc/manuals/vty/sgsn_vty_reference.xml6
-rw-r--r--include/osmocom/sgsn/sgsn.h1
-rw-r--r--src/gprs/sgsn_main.c4
-rw-r--r--src/gprs/sgsn_vty.c14
5 files changed, 25 insertions, 1 deletions
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
index a18d76a13..f60c076c2 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
@@ -21,6 +21,7 @@ sgsn
auth-policy remote
gsup remote-ip 127.0.0.1
gsup remote-port 4222
+ cs7-instance-iu 0
!
ns
timer tns-block 3
diff --git a/doc/manuals/vty/sgsn_vty_reference.xml b/doc/manuals/vty/sgsn_vty_reference.xml
index c3f91cf70..38e21c2f1 100644
--- a/doc/manuals/vty/sgsn_vty_reference.xml
+++ b/doc/manuals/vty/sgsn_vty_reference.xml
@@ -2502,6 +2502,12 @@
<param name='passive' doc='Compression is available on request' />
</params>
</command>
+ <command id='cs7-instance-iu &lt;0-15&gt;'>
+ <params>
+ <param name='cs7-instance-iu' doc='Set SS7 to be used by the Iu-Interface.' />
+ <param name='&lt;0-15&gt;' doc='SS7 instance reference number (default: 0)' />
+ </params>
+ </command>
<command id='iu rab-assign-addr-enc (x213|v4raw)'>
<params>
<param name='iu' doc='Iu interface protocol options' />
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 6e4f5ca04..78803c77b 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -112,6 +112,7 @@ struct sgsn_config {
#if BUILD_IU
struct {
enum ranap_nsap_addr_enc rab_assign_addr_enc;
+ uint32_t cs7_instance;
} iu;
#endif
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 5979886bf..4232e2384 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -500,7 +500,9 @@ int main(int argc, char **argv)
#if BUILD_IU
/* Note that these are mostly defaults and can be overriden from the VTY */
- sccp = osmo_sccp_simple_client_on_ss7_id(tall_sgsn_ctx, 0, "OsmoSGSN",
+ sccp = osmo_sccp_simple_client_on_ss7_id(tall_sgsn_ctx,
+ sgsn->cfg.iu.cs7_instance,
+ "OsmoSGSN",
(23 << 3) + 4,
OSMO_SS7_ASP_PROT_M3UA,
0, NULL,
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 66986911c..68d3a77f7 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -289,6 +289,8 @@ static int config_write_sgsn(struct vty *vty)
vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
#ifdef BUILD_IU
+ vty_out(vty, " cs7-instance-iu %u%s", g_cfg->iu.cs7_instance,
+ VTY_NEWLINE);
ranap_iu_vty_config_write(vty, " ");
#endif
@@ -1378,6 +1380,17 @@ DEFUN(cfg_comp_v42bisp, cfg_comp_v42bisp_cmd,
return CMD_SUCCESS;
}
+#if BUILD_IU
+DEFUN(cfg_sgsn_cs7_instance_iu,
+ cfg_sgsn_cs7_instance_iu_cmd,
+ "cs7-instance-iu <0-15>",
+ "Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference number (default: 0)\n")
+{
+ g_cfg->iu.cs7_instance = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+#endif
+
int sgsn_vty_init(struct sgsn_config *cfg)
{
g_cfg = cfg;
@@ -1441,6 +1454,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
#ifdef BUILD_IU
+ install_element(SGSN_NODE, &cfg_sgsn_cs7_instance_iu_cmd);
ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
#endif
return 0;