pespin submitted this change.
Move iuh fields in iuh substruct
Change-Id: If6954929def24d48661bc132070440513b01289e
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
M src/osmo-hnbgw/hnbgw_vty.c
M src/osmo-hnbgw/osmo_hnbgw_main.c
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index 86fded3..981b809 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -87,17 +87,17 @@
struct hnbgw {
struct {
- const char *iuh_local_ip;
- /*! SCTP port for Iuh listening */
- uint16_t iuh_local_port;
struct osmo_plmn_id plmn;
uint16_t rnc_id;
- bool hnbap_allow_tmsi;
/*! print hnb-id (true) or MCC-MNC-LAC-RAC-SAC (false) in logs */
bool log_prefix_hnb_id;
bool accept_all_hnb;
struct mgcp_client_conf *mgcp_client;
struct {
+ const char *local_ip;
+ /*! SCTP port for Iuh listening */
+ uint16_t local_port;
+ bool hnbap_allow_tmsi;
unsigned int tx_queue_max_length;
} iuh;
struct {
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index a8f827c..32605b7 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -211,9 +211,9 @@
g_hnbgw = talloc_zero(ctx, struct hnbgw);
/* strdup so we can easily talloc_free in the VTY code */
- g_hnbgw->config.iuh_local_ip = talloc_strdup(g_hnbgw, HNBGW_LOCAL_IP_DEFAULT);
- g_hnbgw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT;
- g_hnbgw->config.hnbap_allow_tmsi = true;
+ g_hnbgw->config.iuh.local_ip = talloc_strdup(g_hnbgw, HNBGW_LOCAL_IP_DEFAULT);
+ g_hnbgw->config.iuh.local_port = IUH_DEFAULT_SCTP_PORT;
+ g_hnbgw->config.iuh.hnbap_allow_tmsi = true;
g_hnbgw->config.log_prefix_hnb_id = true;
g_hnbgw->config.accept_all_hnb = true;
g_hnbgw->config.iuh.tx_queue_max_length = IUH_TX_QUEUE_MAX_LENGTH;
diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c
index 8185f72..75b1250 100644
--- a/src/osmo-hnbgw/hnbgw_hnbap.c
+++ b/src/osmo-hnbgw/hnbgw_hnbap.c
@@ -617,7 +617,7 @@
break;
case HNBAP_UE_Identity_PR_tMSILAI:
case HNBAP_UE_Identity_PR_pTMSIRAI:
- if (g_hnbgw->config.hnbap_allow_tmsi) {
+ if (g_hnbgw->config.iuh.hnbap_allow_tmsi) {
rc = hnbgw_tx_ue_register_acc_tmsi(ctx, &ies.uE_Identity, get_next_ue_ctx_id());
} else {
cause.present = HNBAP_Cause_PR_radioNetwork;
diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c
index c74c5db..28d5e84 100644
--- a/src/osmo-hnbgw/hnbgw_vty.c
+++ b/src/osmo-hnbgw/hnbgw_vty.c
@@ -305,8 +305,8 @@
"Accept Iuh connections on local interface\n"
"Local interface IP address (default: " HNBGW_LOCAL_IP_DEFAULT ")")
{
- talloc_free((void *)g_hnbgw->config.iuh_local_ip);
- g_hnbgw->config.iuh_local_ip = talloc_strdup(g_hnbgw, argv[0]);
+ talloc_free((void *)g_hnbgw->config.iuh.local_ip);
+ g_hnbgw->config.iuh.local_ip = talloc_strdup(g_hnbgw, argv[0]);
return CMD_SUCCESS;
}
@@ -314,7 +314,7 @@
"Accept Iuh connections on local port\n"
"Local interface port (default: 29169)")
{
- g_hnbgw->config.iuh_local_port = atoi(argv[0]);
+ g_hnbgw->config.iuh.local_port = atoi(argv[0]);
return CMD_SUCCESS;
}
@@ -336,7 +336,7 @@
"Only accept IMSI identity, reject TMSI or PTMSI\n"
"Accept IMSI, TMSI or PTMSI as UE identity (default)\n")
{
- g_hnbgw->config.hnbap_allow_tmsi = (*argv[0] == '1');
+ g_hnbgw->config.iuh.hnbap_allow_tmsi = (*argv[0] == '1');
return CMD_SUCCESS;
}
@@ -1043,18 +1043,18 @@
vty_out(vty, " iuh%s", VTY_NEWLINE);
- addr = g_hnbgw->config.iuh_local_ip;
+ addr = g_hnbgw->config.iuh.local_ip;
if (addr && (strcmp(addr, HNBGW_LOCAL_IP_DEFAULT) != 0))
vty_out(vty, " local-ip %s%s", addr, VTY_NEWLINE);
- port = g_hnbgw->config.iuh_local_port;
+ port = g_hnbgw->config.iuh.local_port;
if (port && port != IUH_DEFAULT_SCTP_PORT)
vty_out(vty, " local-port %u%s", port, VTY_NEWLINE);
if (g_hnbgw->config.iuh.tx_queue_max_length != IUH_TX_QUEUE_MAX_LENGTH)
vty_out(vty, " tx-queue-max-length %u%s", g_hnbgw->config.iuh.tx_queue_max_length, VTY_NEWLINE);
- if (!g_hnbgw->config.hnbap_allow_tmsi)
+ if (!g_hnbgw->config.iuh.hnbap_allow_tmsi)
vty_out(vty, " hnbap-allow-tmsi 0%s", VTY_NEWLINE);
return CMD_SUCCESS;
diff --git a/src/osmo-hnbgw/osmo_hnbgw_main.c b/src/osmo-hnbgw/osmo_hnbgw_main.c
index 1664f02..34375a9 100644
--- a/src/osmo-hnbgw/osmo_hnbgw_main.c
+++ b/src/osmo-hnbgw/osmo_hnbgw_main.c
@@ -300,10 +300,10 @@
LOGP(DHNBAP, LOGL_NOTICE, "Using RNC-Id %u\n", g_hnbgw->config.rnc_id);
- OSMO_ASSERT(g_hnbgw->config.iuh_local_ip);
+ OSMO_ASSERT(g_hnbgw->config.iuh.local_ip);
LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n",
- g_hnbgw->config.iuh_local_ip,
- g_hnbgw->config.iuh_local_port);
+ g_hnbgw->config.iuh.local_ip,
+ g_hnbgw->config.iuh.local_port);
srv = osmo_stream_srv_link_create(g_hnbgw);
if (!srv) {
perror("cannot create server");
@@ -312,8 +312,8 @@
osmo_stream_srv_link_set_data(srv, g_hnbgw);
osmo_stream_srv_link_set_proto(srv, IPPROTO_SCTP);
osmo_stream_srv_link_set_nodelay(srv, true);
- osmo_stream_srv_link_set_addr(srv, g_hnbgw->config.iuh_local_ip);
- osmo_stream_srv_link_set_port(srv, g_hnbgw->config.iuh_local_port);
+ osmo_stream_srv_link_set_addr(srv, g_hnbgw->config.iuh.local_ip);
+ osmo_stream_srv_link_set_port(srv, g_hnbgw->config.iuh.local_port);
osmo_stream_srv_link_set_accept_cb(srv, hnbgw_rua_accept_cb);
osmo_stream_srv_link_set_msgb_alloc_info(srv, IUH_MSGB_SIZE, 0);
osmo_stream_srv_link_set_tx_queue_max_length(srv, g_hnbgw->config.iuh.tx_queue_max_length);
To view, visit change 41441. To unsubscribe, or for help writing mail filters, visit settings.