libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
[MERGED] libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Harald Welte has submitted this change and it was merged. Change subject: Add osmo-stp executable as new "Osmocom Signaling Transfer Point" .. Add osmo-stp executable as new "Osmocom Signaling Transfer Point" osmo-stp is able to define multiple M3UA and/or SUA application servers (AS) as well as application server processes (ASPs). Clients can then connect via M3UA or SUA, perform the respective ASPSM / ASPTM state changes and finally exchange MTP signaling such as ISUP or SCCP on top of it. Routing is currently only based on point codes (PC). Routing table is fully configurable with Destination PC and mask. Shortcomings: * xUA: only "override" traffic mode supported, no load-balance or broadcast * xUA: no SNM supported, i.e. DAVA/DUNA/... messages are neither parsed nor generated * SCCP: no Global Title based Routing (GTR) yet * SCCP: no Global Title Translation (GTT) yet * no M2PA / M2UA sigtran dialects * no classic CS7 based signaling links(E1/T1 TDM) Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e --- M .gitignore M Makefile.am M configure.ac M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c A stp/Makefile.am A stp/internal.h R stp/osmo_ss7_vty.c A stp/stp_main.c 9 files changed, 414 insertions(+), 62 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 83f1333..c38bac1 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,8 @@ examples/m3ua_example +stp/osmo-stp + *.pc config.* diff --git a/Makefile.am b/Makefile.am index dd73ec2..ededdac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src tests examples +SUBDIRS = include src tests examples stp pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc diff --git a/configure.ac b/configure.ac index 6dc0ebd..82c7ee8 100644 --- a/configure.ac +++ b/configure.ac @@ -70,5 +70,6 @@ tests/xua/Makefile tests/ss7/Makefile examples/Makefile +stp/Makefile Makefile) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 5becc0e..dff206d 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -9,6 +9,8 @@ #include #include +extern struct llist_head osmo_ss7_xua_servers; + struct osmo_ss7_instance; struct osmo_ss7_user; struct osmo_sccp_instance; diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index bb13b43..7ed216a 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ static bool ss7_initialized = false; static LLIST_HEAD(ss7_instances); -static LLIST_HEAD(ss7_xua_servers); +LLIST_HEAD(osmo_ss7_xua_servers); static int32_t next_rctx = 1; static int32_t next_l_rk_id = 1; @@ -1539,7 +1540,7 @@ struct osmo_xua_server *xs; OSMO_ASSERT(ss7_initialized); - llist_for_each_entry(xs, &ss7_xua_servers, list) { + llist_for_each_entry(xs, &osmo_ss7_xua_servers, list) { if (proto == xs->cfg.proto && local_port == xs->cfg.local.port) return xs; @@ -1589,7 +1590,7 @@ } oxs->inst = inst; - llist_add_tail(&oxs->list, &ss7_xua_servers); + llist_add_tail(&oxs->list, &osmo_ss7_xua_servers); return oxs; } diff --git a/stp/Makefile.am b/stp/Makefile.am new file mode 100644 index 000..81aa11c --- /dev/null +++ b/stp/Makefile.am @@ -0,0 +1,11 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(COVERAGE_FLAGS) +AM_LDFLAGS=$(COVERAGE_LDFLAGS) + +EXTRA_DIST = internal.h + +bin_PROGRAMS = osmo-stp + +osmo_stp_SOURCES = stp_main.c osmo_ss7_vty.c +osmo_stp_LDADD = $(top_builddir)/src/libosmo-sigtran.la \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) diff --git a/stp/internal.h b/stp/internal.h new file mode 100644 index 000..0a434cc --- /dev/null +++ b/stp/internal.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum stp_vty_node { + L_CS7_AS_NODE = _LAST_OSMOVTY_NODE + 1, + L_CS7_ASP_NODE, + L_CS7_SUA_NODE, + L_CS7_M3UA_NODE, + L_CS7_RTABLE_NODE, +}; + +int osmo_ss7_vty_init(void); +int osmo_ss7_vty_go_parent(struct vty *vty); +int osmo_ss7_is_config_node(struct vty *vty, int node); + +extern struct osmo_ss7_instance *g_s7i; + diff --git a/src/osmo_ss7_vty.c b/stp/osmo_ss7_vty.c similarity index 68% rename from src/osmo_ss7_vty.c rename to stp/osmo_ss7_vty.c index 80cd4d0..905c4f6 100644 --- a/src/osmo_ss7_vty.c +++ b/stp/osmo_ss7_vty.c @@ -33,6 +33,9 @@ #include #include +#include + +#include "internal.h" #define CS7_STR"ITU-T
[PATCH] libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2281 to look at the new patch set (#3). Add osmo-stp executable as new "Osmocom Signaling Transfer Point" osmo-stp is able to define multiple M3UA and/or SUA application servers (AS) as well as application server processes (ASPs). Clients can then connect via M3UA or SUA, perform the respective ASPSM / ASPTM state changes and finally exchange MTP signaling such as ISUP or SCCP on top of it. Routing is currently only based on point codes (PC). Routing table is fully configurable with Destination PC and mask. Shortcomings: * xUA: only "override" traffic mode supported, no load-balance or broadcast * xUA: no SNM supported, i.e. DAVA/DUNA/... messages are neither parsed nor generated * SCCP: no Global Title based Routing (GTR) yet * SCCP: no Global Title Translation (GTT) yet * no M2PA / M2UA sigtran dialects * no classic CS7 based signaling links(E1/T1 TDM) Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e --- M .gitignore M Makefile.am M configure.ac M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c A stp/Makefile.am A stp/internal.h R stp/osmo_ss7_vty.c A stp/stp_main.c 9 files changed, 414 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/81/2281/3 diff --git a/.gitignore b/.gitignore index 83f1333..c38bac1 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,8 @@ examples/m3ua_example +stp/osmo-stp + *.pc config.* diff --git a/Makefile.am b/Makefile.am index dd73ec2..ededdac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src tests examples +SUBDIRS = include src tests examples stp pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc diff --git a/configure.ac b/configure.ac index 6dc0ebd..82c7ee8 100644 --- a/configure.ac +++ b/configure.ac @@ -70,5 +70,6 @@ tests/xua/Makefile tests/ss7/Makefile examples/Makefile +stp/Makefile Makefile) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 5becc0e..dff206d 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -9,6 +9,8 @@ #include #include +extern struct llist_head osmo_ss7_xua_servers; + struct osmo_ss7_instance; struct osmo_ss7_user; struct osmo_sccp_instance; diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index bb13b43..7ed216a 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ static bool ss7_initialized = false; static LLIST_HEAD(ss7_instances); -static LLIST_HEAD(ss7_xua_servers); +LLIST_HEAD(osmo_ss7_xua_servers); static int32_t next_rctx = 1; static int32_t next_l_rk_id = 1; @@ -1539,7 +1540,7 @@ struct osmo_xua_server *xs; OSMO_ASSERT(ss7_initialized); - llist_for_each_entry(xs, &ss7_xua_servers, list) { + llist_for_each_entry(xs, &osmo_ss7_xua_servers, list) { if (proto == xs->cfg.proto && local_port == xs->cfg.local.port) return xs; @@ -1589,7 +1590,7 @@ } oxs->inst = inst; - llist_add_tail(&oxs->list, &ss7_xua_servers); + llist_add_tail(&oxs->list, &osmo_ss7_xua_servers); return oxs; } diff --git a/stp/Makefile.am b/stp/Makefile.am new file mode 100644 index 000..81aa11c --- /dev/null +++ b/stp/Makefile.am @@ -0,0 +1,11 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(COVERAGE_FLAGS) +AM_LDFLAGS=$(COVERAGE_LDFLAGS) + +EXTRA_DIST = internal.h + +bin_PROGRAMS = osmo-stp + +osmo_stp_SOURCES = stp_main.c osmo_ss7_vty.c +osmo_stp_LDADD = $(top_builddir)/src/libosmo-sigtran.la \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) diff --git a/stp/internal.h b/stp/internal.h new file mode 100644 index 000..0a434cc --- /dev/null +++ b/stp/internal.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum stp_vty_node { + L_CS7_AS_NODE = _LAST_OSMOVTY_NODE + 1, + L_CS7_ASP_NODE, + L_CS7_SUA_NODE, + L_CS7_M3UA_NODE, + L_CS7_RTABLE_NODE, +}; + +int osmo_ss7_vty_init(void); +int osmo_ss7_vty_go_parent(struct vty *vty); +int osmo_ss7_is_config_node(struct vty *vty, int node); + +extern struct osmo_ss7_instance *g_s7i; + diff --git a/src/osmo_ss7_vty.c b/stp/osmo_ss7_vty.c similarity index 68% rename from src/osmo_ss7_vty.c rename to stp/osmo_ss7_vty.c index 80cd4d0..905c4f6 100644 --- a/src/osmo_ss7_vty.c +++ b/stp/osmo_ss7_vty.c @@ -33,6 +33,9 @@ #include #include +#include + +#include "internal.h" #define CS7_STR"ITU-T Signaling System 7\n" #define PC_STR "Point Code\n" @@
libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Patch Set 2: Code-Review+1 (3 comments) https://gerrit.osmocom.org/#/c/2281/2//COMMIT_MSG Commit Message: Line 21: * SCCP: no Global Title Translatio (GTT) yet If you rebase, add the 'n' to Translation https://gerrit.osmocom.org/#/c/2281/2/stp/osmo_ss7_vty.c File stp/osmo_ss7_vty.c: Line 226: vty_out(vty, "cannot create route%s", VTY_NEWLINE); Maybe print the dpc and mask here? IIRC the VTY code will not print the failing rule itself? https://gerrit.osmocom.org/#/c/2281/2/stp/stp_main.c File stp/stp_main.c: Line 53: /* Hack to enable debug logging for all relevant (used?) subsystems */ hehe, it is not that bad ;) -- To view, visit https://gerrit.osmocom.org/2281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes
libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Patch Set 2: I think we should add it to debian/ as well. -- To view, visit https://gerrit.osmocom.org/2281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No
libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Patch Set 2: Code-Review-1 the debug logging hack should be removed, and the xua_servers public export needs to be revisited. -- To view, visit https://gerrit.osmocom.org/2281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] libosmo-sccp[master]: Add osmo-stp executable as new "Osmocom Signaling Transfer P...
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2281 to look at the new patch set (#2). Add osmo-stp executable as new "Osmocom Signaling Transfer Point" osmo-stp is able to define multiple M3UA and/or SUA application servers (AS) as well as application server processes (ASPs). Clients can then connect via M3UA or SUA, perform the respective ASPSM / ASPTM state changes and finally exchange MTP signaling such as ISUP or SCCP on top of it. Routing is currently only based on point codes (PC). Routing table is fully configurable with Destination PC and mask. Shortcomings: * xUA: only "override" traffic mode supported, no load-balance or broadcast * xUA: no SNM supported, i.e. DAVA/DUNA/... messages are neither parsed nor generated * SCCP: no Global Title based Routing (GTR) yet * SCCP: no Global Title Translatio (GTT) yet * no M2PA / M2UA sigtran dialects * no classic CS7 based signaling links(E1/T1 TDM) Change-Id: If32227b8d3127c6178e4ee45527ce65f69bc7b1e --- M .gitignore M Makefile.am M configure.ac M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c A stp/Makefile.am A stp/internal.h R stp/osmo_ss7_vty.c A stp/stp_main.c 9 files changed, 413 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/81/2281/2 diff --git a/.gitignore b/.gitignore index 83f1333..c38bac1 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,8 @@ examples/m3ua_example +stp/osmo-stp + *.pc config.* diff --git a/Makefile.am b/Makefile.am index dd73ec2..ededdac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src tests examples +SUBDIRS = include src tests examples stp pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc diff --git a/configure.ac b/configure.ac index 6dc0ebd..82c7ee8 100644 --- a/configure.ac +++ b/configure.ac @@ -70,5 +70,6 @@ tests/xua/Makefile tests/ss7/Makefile examples/Makefile +stp/Makefile Makefile) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index cbc6a02..2d5eba9 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -9,6 +9,8 @@ #include #include +extern struct llist_head osmo_ss7_xua_servers; + struct osmo_ss7_instance; struct osmo_ss7_user; struct osmo_sccp_instance; diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 103c05b..e55d55c 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -52,7 +53,7 @@ static bool ss7_initialized = false; static LLIST_HEAD(ss7_instances); -static LLIST_HEAD(ss7_xua_servers); +LLIST_HEAD(osmo_ss7_xua_servers); static int32_t next_rctx = 1; struct value_string osmo_ss7_as_traffic_mode_vals[] = { @@ -1449,7 +1450,7 @@ struct osmo_xua_server *xs; OSMO_ASSERT(ss7_initialized); - llist_for_each_entry(xs, &ss7_xua_servers, list) { + llist_for_each_entry(xs, &osmo_ss7_xua_servers, list) { if (proto == xs->cfg.proto && local_port == xs->cfg.local.port) return xs; @@ -1498,7 +1499,7 @@ } oxs->inst = inst; - llist_add_tail(&oxs->list, &ss7_xua_servers); + llist_add_tail(&oxs->list, &osmo_ss7_xua_servers); return oxs; } diff --git a/stp/Makefile.am b/stp/Makefile.am new file mode 100644 index 000..81aa11c --- /dev/null +++ b/stp/Makefile.am @@ -0,0 +1,11 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(COVERAGE_FLAGS) +AM_LDFLAGS=$(COVERAGE_LDFLAGS) + +EXTRA_DIST = internal.h + +bin_PROGRAMS = osmo-stp + +osmo_stp_SOURCES = stp_main.c osmo_ss7_vty.c +osmo_stp_LDADD = $(top_builddir)/src/libosmo-sigtran.la \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) diff --git a/stp/internal.h b/stp/internal.h new file mode 100644 index 000..0a434cc --- /dev/null +++ b/stp/internal.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +enum stp_vty_node { + L_CS7_AS_NODE = _LAST_OSMOVTY_NODE + 1, + L_CS7_ASP_NODE, + L_CS7_SUA_NODE, + L_CS7_M3UA_NODE, + L_CS7_RTABLE_NODE, +}; + +int osmo_ss7_vty_init(void); +int osmo_ss7_vty_go_parent(struct vty *vty); +int osmo_ss7_is_config_node(struct vty *vty, int node); + +extern struct osmo_ss7_instance *g_s7i; + diff --git a/src/osmo_ss7_vty.c b/stp/osmo_ss7_vty.c similarity index 68% rename from src/osmo_ss7_vty.c rename to stp/osmo_ss7_vty.c index 80cd4d0..f8fb24b 100644 --- a/src/osmo_ss7_vty.c +++ b/stp/osmo_ss7_vty.c @@ -33,6 +33,9 @@ #include #include +#include + +#include "internal.h" #define CS7_STR"ITU-T Signaling System 7\n" #define PC_STR "Point Code\