aboutsummaryrefslogtreecommitdiffstats
path: root/src/libiu/iu_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libiu/iu_vty.c')
-rw-r--r--src/libiu/iu_vty.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c
index 73ad126ba..3fd3cd15c 100644
--- a/src/libiu/iu_vty.c
+++ b/src/libiu/iu_vty.c
@@ -23,6 +23,8 @@
#include <osmocom/core/logging.h>
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
+#include <osmocom/sigtran/osmo_ss7.h>
+#include <osmocom/sigtran/sccp_sap.h>
#include <openbsc/iu.h>
@@ -52,9 +54,10 @@ DEFUN(logging_asn_xer_print,
return CMD_SUCCESS;
}
+#define IU_STR "Iu interface protocol options\n"
DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd,
"iu rab-assign-addr-enc (x213|v4raw)",
- "Iu interface protocol options\n"
+ IU_STR
"Choose RAB Assignment's Transport Layer Address encoding\n"
"ITU-T X.213 compliant address encoding (default)\n"
"32bit length raw IPv4 address (for ip.access nano3G)\n")
@@ -72,6 +75,24 @@ DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd,
return CMD_SUCCESS;
}
+extern struct osmo_sccp_addr local_sccp_addr;
+
+/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to
+ * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command
+ * and use the point code defined via libosmo-sccp vty commands instead. */
+DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd,
+ "iu local-address point-code PC",
+ IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n")
+{
+ local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN;
+ local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC;
+ local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */
+
int iu_vty_config_write(struct vty *vty, const char *indent)
{
if (!g_rab_assign_addr_enc) {
@@ -95,6 +116,9 @@ int iu_vty_config_write(struct vty *vty, const char *indent)
return CMD_WARNING;
}
+ vty_out(vty, "%siu local-address point-code %s%s", indent,
+ osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -105,4 +129,5 @@ void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc)
install_element(CFG_LOG_NODE, &logging_asn_debug_cmd);
install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd);
install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd);
+ install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd);
}