[MERGED] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Harald Welte has submitted this change and it was merged. Change subject: cosmetic: use enum ranap_nsap_addr_enc instead of int .. cosmetic: use enum ranap_nsap_addr_enc instead of int The only reason to use int instead of the enum was the lack of header iu_client.h when not building with Iu support. Rather use the configure result properly, include the header when Iu support is built and use the proper enum. Omit the entire iu sub-struct when building without Iu. Add LIBOSMORANAP_CFLAGS to libvlr, in order to find the iu_client.h header (now also included from gsm_data.h). Rationale: Instead of using a questionable typecast from int* to enum*, we can now use the enum member directly without needing to silence compiler warnings. Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f --- M include/osmocom/msc/gsm_data.h M src/libmsc/msc_vty.c M src/libvlr/Makefile.am 3 files changed, 18 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c5e7aaf..73047ee 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -23,6 +23,11 @@ /* TS 48.008 DLCI containing DCCH/ACCH + SAPI */ #define OMSC_LINKID_CB(__msgb) (__msgb)->cb[3] +#include "../../bscconfig.h" +#if BUILD_IU +#include +#endif + /** annotations for msgb ownership */ #define __uses @@ -311,12 +316,14 @@ struct mgcp_client *client; } mgw; +#if BUILD_IU struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - int rab_assign_addr_enc; + enum ranap_nsap_addr_enc rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; +#endif struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 84d4d14..d10028e 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -380,8 +380,14 @@ "cs7-instance-iu <0-15>", "Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference number\n") { +#if BUILD_IU gsmnet->iu.cs7_instance = atoi(argv[0]); return CMD_SUCCESS; +#else + vty_out(vty, "WARNING: 'cs7-instance-iu' without effect: built without Iu support%s", + VTY_NEWLINE); + return CMD_WARNING; +#endif } DEFUN(cfg_msc_auth_tuple_max_reuse_count, cfg_msc_auth_tuple_max_reuse_count_cmd, @@ -437,8 +443,10 @@ vty_out(vty, " cs7-instance-a %u%s", gsmnet->a.cs7_instance, VTY_NEWLINE); +#if BUILD_IU vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); +#endif if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count) vty_out(vty, " auth-tuple-max-reuse-count %d%s", @@ -1422,7 +1430,7 @@ mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc); #endif osmo_fsm_vty_add_cmds(); diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am index e3d5ced..1408f6c 100644 --- a/src/libvlr/Makefile.am +++ b/src/libvlr/Makefile.am @@ -6,6 +6,7 @@ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr
osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
[PATCH] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7296 to look at the new patch set (#4). cosmetic: use enum ranap_nsap_addr_enc instead of int The only reason to use int instead of the enum was the lack of header iu_client.h when not building with Iu support. Rather use the configure result properly, include the header when Iu support is built and use the proper enum. Omit the entire iu sub-struct when building without Iu. Add LIBOSMORANAP_CFLAGS to libvlr, in order to find the iu_client.h header (now also included from gsm_data.h). Rationale: Instead of using a questionable typecast from int* to enum*, we can now use the enum member directly without needing to silence compiler warnings. Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f --- M include/osmocom/msc/gsm_data.h M src/libmsc/msc_vty.c M src/libvlr/Makefile.am 3 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7296/4 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c5e7aaf..73047ee 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -23,6 +23,11 @@ /* TS 48.008 DLCI containing DCCH/ACCH + SAPI */ #define OMSC_LINKID_CB(__msgb) (__msgb)->cb[3] +#include "../../bscconfig.h" +#if BUILD_IU +#include +#endif + /** annotations for msgb ownership */ #define __uses @@ -311,12 +316,14 @@ struct mgcp_client *client; } mgw; +#if BUILD_IU struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - int rab_assign_addr_enc; + enum ranap_nsap_addr_enc rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; +#endif struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 84d4d14..d10028e 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -380,8 +380,14 @@ "cs7-instance-iu <0-15>", "Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference number\n") { +#if BUILD_IU gsmnet->iu.cs7_instance = atoi(argv[0]); return CMD_SUCCESS; +#else + vty_out(vty, "WARNING: 'cs7-instance-iu' without effect: built without Iu support%s", + VTY_NEWLINE); + return CMD_WARNING; +#endif } DEFUN(cfg_msc_auth_tuple_max_reuse_count, cfg_msc_auth_tuple_max_reuse_count_cmd, @@ -437,8 +443,10 @@ vty_out(vty, " cs7-instance-a %u%s", gsmnet->a.cs7_instance, VTY_NEWLINE); +#if BUILD_IU vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance, VTY_NEWLINE); +#endif if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count) vty_out(vty, " auth-tuple-max-reuse-count %d%s", @@ -1422,7 +1430,7 @@ mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc); #endif osmo_fsm_vty_add_cmds(); diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am index e3d5ced..1408f6c 100644 --- a/src/libvlr/Makefile.am +++ b/src/libvlr/Makefile.am @@ -6,6 +6,7 @@ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr
osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Patch Set 3: Code-Review+2 re-add previous +2, merely resolved merge conflicts -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
[PATCH] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7296 to look at the new patch set (#3). cosmetic: use enum ranap_nsap_addr_enc instead of int The only reason to use int instead of the enum was the lack of header iu_client.h when not building with Iu support. Rather use the configure result properly, include the header when Iu support is built and use the proper enum. Omit the entire iu sub-struct when building without Iu. Add LIBOSMORANAP_CFLAGS to libcommon in order to find the iu_client.h header. Rationale: Instead of using a questionable typecast from int* to enum*, we can now use the enum member directly without needing to silence compiler warnings. Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f --- M include/osmocom/msc/gsm_data.h M src/libgsupclient/Makefile.am M src/libmsc/msc_vty.c 3 files changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7296/3 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index c5e7aaf..73047ee 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -23,6 +23,11 @@ /* TS 48.008 DLCI containing DCCH/ACCH + SAPI */ #define OMSC_LINKID_CB(__msgb) (__msgb)->cb[3] +#include "../../bscconfig.h" +#if BUILD_IU +#include +#endif + /** annotations for msgb ownership */ #define __uses @@ -311,12 +316,14 @@ struct mgcp_client *client; } mgw; +#if BUILD_IU struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - int rab_assign_addr_enc; + enum ranap_nsap_addr_enc rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; +#endif struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libgsupclient/Makefile.am b/src/libgsupclient/Makefile.am index a33fb38..6b4826d 100644 --- a/src/libgsupclient/Makefile.am +++ b/src/libgsupclient/Makefile.am @@ -10,6 +10,9 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSCCP_CFLAGS) \ + $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 84d4d14..4ca6d55 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -1422,7 +1422,7 @@ mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc); #endif osmo_fsm_vty_add_cmds(); -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr
osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Patch Set 1: > Build Failed > > https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-msc/467/ : > FAILURE nice, stow prevented me from using a header without proper CFLAGS -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
[PATCH] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7296 to look at the new patch set (#2). cosmetic: use enum ranap_nsap_addr_enc instead of int The only reason to use int instead of the enum was the lack of header iu_client.h when not building with Iu support. Rather use the configure result properly, include the header when Iu support is built and use the proper enum. Omit the entire iu sub-struct when building without Iu. Add LIBOSMORANAP_CFLAGS to libcommon in order to find the iu_client.h header. Rationale: Instead of using a questionable typecast from int* to enum*, we can now use the enum member directly without needing to silence compiler warnings. Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f --- M include/osmocom/msc/gsm_data.h M src/libcommon/Makefile.am M src/libmsc/msc_vty.c 3 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7296/2 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2d1d20c..a4ce7e7 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -20,6 +20,10 @@ #include "gsm_data_shared.h" +#include "../../bscconfig.h" +#if BUILD_IU +#include +#endif /** annotations for msgb ownership */ @@ -286,12 +290,14 @@ struct mgcp_client *client; } mgw; +#if BUILD_IU struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - int rab_assign_addr_enc; + enum ranap_nsap_addr_enc rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; +#endif struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 30f37d4..9eb2af5 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -12,6 +12,7 @@ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 503ae68..649e431 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -239,7 +239,7 @@ mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc); #endif osmo_fsm_vty_add_cmds(); } -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels HofmeyrGerrit-Reviewer: Jenkins Builder
[PATCH] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int
Review at https://gerrit.osmocom.org/7296 cosmetic: use enum ranap_nsap_addr_enc instead of int The only reason to use int instead of the enum was the lack of header iu_client.h when not building with Iu support. Rather use the configure result properly, include the header when Iu support is built and use the proper enum. Omit the entire iu sub-struct when building without Iu. Instead of using a questionable typecast from int* to enum*, we can now use the enum member directly without needing to silence compiler warnings. Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f --- M include/osmocom/msc/gsm_data.h M src/libmsc/msc_vty.c 2 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7296/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2d1d20c..a4ce7e7 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -20,6 +20,10 @@ #include "gsm_data_shared.h" +#include "../../bscconfig.h" +#if BUILD_IU +#include +#endif /** annotations for msgb ownership */ @@ -286,12 +290,14 @@ struct mgcp_client *client; } mgw; +#if BUILD_IU struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - int rab_assign_addr_enc; + enum ranap_nsap_addr_enc rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; +#endif struct { /* CS7 instance id number (set via VTY) */ diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 503ae68..649e431 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -239,7 +239,7 @@ mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc); #endif osmo_fsm_vty_add_cmds(); } -- To view, visit https://gerrit.osmocom.org/7296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr