fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sccp/+/35795?usp=email )
Change subject: cosmetic: rename OSMO_SS7_ASP_PROT_M3UA[_SCTP]
......................................................................
cosmetic: rename OSMO_SS7_ASP_PROT_M3UA[_SCTP]
This commit prepares for adding M3UA-over-TCP support.
Make it clear on the API level that the existing protocol works
over SCTP. Keep the VTY commands unchanged in order to keep it
closer to the Cisco ITP syntax.
Change-Id: Ife0ae7a4956980da40ee045b0b7eb5cd0ccd1aef
Related: SYS#5424
---
M examples/sccp_demo_user.c
M include/osmocom/sigtran/osmo_ss7.h
M src/m3ua.c
M src/osmo_ss7_asp.c
M src/osmo_ss7_hmrt.c
M src/osmo_ss7_vty.c
M src/sccp_scrc.c
M src/sccp_user.c
M src/xua_rkm.c
M src/xua_snm.c
M tests/ss7/ss7_test.c
11 files changed, 43 insertions(+), 24 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/95/35795/1
diff --git a/examples/sccp_demo_user.c b/examples/sccp_demo_user.c
index d67bd27..a9e470d 100644
--- a/examples/sccp_demo_user.c
+++ b/examples/sccp_demo_user.c
@@ -185,7 +185,7 @@
int remote_port = DEFAULT_REMOTE_PORT_SERVER;
int remote_pc = DEFAULT_PC_CLIENT;
bool lflag = false, rflag = false, Lflag = false, Rflag = false;
- enum osmo_ss7_asp_protocol protocol = OSMO_SS7_ASP_PROT_M3UA;
+ enum osmo_ss7_asp_protocol protocol = OSMO_SS7_ASP_PROT_M3UA_SCTP;
void *tall_ctx = talloc_named_const(NULL, 1, "sccp_demo_user");
init_logging(tall_ctx);
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index a8a624f..ca7087b 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -277,11 +277,14 @@
enum osmo_ss7_asp_protocol {
OSMO_SS7_ASP_PROT_NONE,
OSMO_SS7_ASP_PROT_SUA,
- OSMO_SS7_ASP_PROT_M3UA,
+ OSMO_SS7_ASP_PROT_M3UA_SCTP,
OSMO_SS7_ASP_PROT_IPA,
_NUM_OSMO_SS7_ASP_PROT
};
+/* backwards compatibility alias */
+#define OSMO_SS7_ASP_PROT_M3UA OSMO_SS7_ASP_PROT_M3UA_SCTP
+
extern struct value_string osmo_ss7_asp_protocol_vals[];
static inline const char *
diff --git a/src/m3ua.c b/src/m3ua.c
index f4dbf76..2c2a2a5 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -478,7 +478,7 @@
{
struct msgb *msg = m3ua_to_msg(xua);
- OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA);
+ OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA_SCTP);
if (!msg)
return -1;
@@ -495,7 +495,7 @@
struct msgb *msg;
int rc;
- OSMO_ASSERT(as->cfg.proto == OSMO_SS7_ASP_PROT_M3UA);
+ OSMO_ASSERT(as->cfg.proto == OSMO_SS7_ASP_PROT_M3UA_SCTP);
/* Add RC for this AS */
if (as->cfg.routing_key.context)
@@ -693,7 +693,7 @@
struct xua_msg *xua = NULL, *err = NULL;
int rc = 0;
- OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA);
+ OSMO_ASSERT(asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA_SCTP);
/* caller owns msg memory, we shall neither free it here nor
* keep references beyond the execution of this function and its
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index f867ce5..ac30b75 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -115,7 +115,7 @@
struct value_string osmo_ss7_asp_protocol_vals[] = {
{ OSMO_SS7_ASP_PROT_NONE, "none" },
{ OSMO_SS7_ASP_PROT_SUA, "sua" },
- { OSMO_SS7_ASP_PROT_M3UA, "m3ua" },
+ { OSMO_SS7_ASP_PROT_M3UA_SCTP, "m3ua" },
{ OSMO_SS7_ASP_PROT_IPA, "ipa" },
{ 0, NULL }
};
@@ -133,7 +133,7 @@
case OSMO_SS7_ASP_PROT_IPA:
return IPPROTO_TCP;
case OSMO_SS7_ASP_PROT_SUA:
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
default:
return IPPROTO_SCTP;
}
@@ -142,7 +142,7 @@
static const uint16_t prot2port[] = {
[OSMO_SS7_ASP_PROT_NONE] = 0,
[OSMO_SS7_ASP_PROT_SUA] = SUA_PORT,
- [OSMO_SS7_ASP_PROT_M3UA] = M3UA_PORT,
+ [OSMO_SS7_ASP_PROT_M3UA_SCTP] = M3UA_PORT,
[OSMO_SS7_ASP_PROT_IPA] = 5000,
};
@@ -828,7 +828,7 @@
if (ppid == SUA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_SUA)
rc = sua_rx_msg(asp, msg);
- else if (ppid == M3UA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA)
+ else if (ppid == M3UA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA_SCTP)
rc = m3ua_rx_msg(asp, msg);
else
rc = ss7_asp_rx_unknown(asp, ppid, msg);
@@ -977,7 +977,7 @@
if (ppid == SUA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_SUA)
rc = sua_rx_msg(asp, msg);
- else if (ppid == M3UA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA)
+ else if (ppid == M3UA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_M3UA_SCTP)
rc = m3ua_rx_msg(asp, msg);
else
rc = ss7_asp_rx_unknown(asp, ppid, msg);
@@ -1030,7 +1030,7 @@
case OSMO_SS7_ASP_PROT_SUA:
msgb_sctp_ppid(msg) = SUA_PPID;
break;
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
msgb_sctp_ppid(msg) = M3UA_PPID;
break;
case OSMO_SS7_ASP_PROT_IPA:
@@ -1108,7 +1108,7 @@
int osmo_ss7_asp_get_log_subsys(const struct osmo_ss7_asp *asp)
{
switch (asp->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
return DLM3UA;
case OSMO_SS7_ASP_PROT_SUA:
return DLSUA;
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c
index 3ac43b8..76b174b 100644
--- a/src/osmo_ss7_hmrt.c
+++ b/src/osmo_ss7_hmrt.c
@@ -237,7 +237,7 @@
rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TX_MSU_TOTAL);
switch (as->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
DEBUGP(DLSS7, "rt->dest.as proto is M3UA for dpc=%u=%s\n",
dpc, osmo_ss7_pointcode_print(inst, dpc));
return m3ua_tx_xua_as(as,xua);
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 1483ac0..5b8269f 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -2011,7 +2011,7 @@
vty_out(vty, "------------ ------------ ---------- ------------- ---- -------------
--- ----- ----- -------%s", VTY_NEWLINE);
llist_for_each_entry(as, &inst->as_list, list) {
- if (filter && !strcmp(filter, "m3ua") && as->cfg.proto !=
OSMO_SS7_ASP_PROT_M3UA)
+ if (filter && !strcmp(filter, "m3ua") && as->cfg.proto !=
OSMO_SS7_ASP_PROT_M3UA_SCTP)
continue;
if (filter && !strcmp(filter, "sua") && as->cfg.proto !=
OSMO_SS7_ASP_PROT_SUA)
continue;
diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c
index be23c21..79b2857 100644
--- a/src/sccp_scrc.c
+++ b/src/sccp_scrc.c
@@ -151,7 +151,7 @@
switch (as->cfg.proto) {
case OSMO_SS7_ASP_PROT_SUA:
return sua_tx_xua_as(as, xua);
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
case OSMO_SS7_ASP_PROT_IPA:
return sua2sccp_tx_m3ua(inst, xua);
default:
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 94b6d02..2d13a2f 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -490,7 +490,7 @@
* \param[in] ss7_id of the SS7/CS7 instance
* \param[in] name human readable name
* \param[in] default_pc pointcode to be used on missing VTY setting
- * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
+ * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA_SCTP)
* \param[in] default_local_port local port to be used on missing VTY setting
* \param[in] default_local_ip local IP-address to be used on missing VTY setting (NULL:
use library own defaults)
* \param[in] default_remote_port remote port to be used on missing VTY setting
@@ -721,7 +721,7 @@
* \param[in] ctx talloc context
* \param[in] name human readable name
* \param[in] default_pc pointcode to be used on missing VTY setting
- * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
+ * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA_SCTP)
* \param[in] default_local_port local port to be used on missing VTY setting
* \param[in] default_local_ip local IP-address to be used on missing VTY setting
* \param[in] default_remote_port remote port to be used on missing VTY setting
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 6abd17d..aba6187 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -237,7 +237,7 @@
} else if (asp->inst->cfg.permit_dyn_rkm_alloc) {
/* Create an AS for this routing key */
snprintf(namebuf, sizeof(namebuf), "as-rkm-%u", rctx);
- as = osmo_ss7_as_find_or_create(asp->inst, namebuf, OSMO_SS7_ASP_PROT_M3UA);
+ as = osmo_ss7_as_find_or_create(asp->inst, namebuf, OSMO_SS7_ASP_PROT_M3UA_SCTP);
if (!as) {
LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: Cannot create AS %s\n", namebuf);
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
diff --git a/src/xua_snm.c b/src/xua_snm.c
index c7d0d2e..63aaa80 100644
--- a/src/xua_snm.c
+++ b/src/xua_snm.c
@@ -89,7 +89,7 @@
const char *info_str, bool available)
{
switch (asp->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
m3ua_tx_snm_available(asp, rctx, num_rctx, aff_pc, num_aff_pc, info_str, available);
break;
case OSMO_SS7_ASP_PROT_SUA:
@@ -104,7 +104,7 @@
uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str)
{
switch (asp->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
m3ua_tx_dupu(asp, rctx, num_rctx, dpc, user, cause, info_str);
break;
case OSMO_SS7_ASP_PROT_SUA:
@@ -121,7 +121,7 @@
const char *info_string)
{
switch (asp->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
m3ua_tx_snm_congestion(asp, rctx, num_rctx, aff_pc, num_aff_pc,
concerned_dpc, cong_level, info_string);
break;
@@ -435,7 +435,7 @@
return;
switch (asp->cfg.proto) {
- case OSMO_SS7_ASP_PROT_M3UA:
+ case OSMO_SS7_ASP_PROT_M3UA_SCTP:
cause_user = xua_msg_get_u32(xua, M3UA_IEI_USER_CAUSE);
break;
case OSMO_SS7_ASP_PROT_SUA:
diff --git a/tests/ss7/ss7_test.c b/tests/ss7/ss7_test.c
index cf48b89..e6b4968 100644
--- a/tests/ss7/ss7_test.c
+++ b/tests/ss7/ss7_test.c
@@ -240,7 +240,7 @@
struct osmo_ss7_asp *asp;
OSMO_ASSERT(osmo_ss7_as_find_by_name(s7i, "as1") == NULL);
- as = osmo_ss7_as_find_or_create(s7i, "as1", OSMO_SS7_ASP_PROT_M3UA);
+ as = osmo_ss7_as_find_or_create(s7i, "as1", OSMO_SS7_ASP_PROT_M3UA_SCTP);
OSMO_ASSERT(as);
OSMO_ASSERT(osmo_ss7_as_find_by_name(s7i, "as1") == as);
OSMO_ASSERT(osmo_ss7_as_find_by_rctx(s7i, 2342) == NULL);
@@ -248,7 +248,7 @@
OSMO_ASSERT(osmo_ss7_as_find_by_rctx(s7i, 2342) == as);
OSMO_ASSERT(osmo_ss7_as_add_asp(as, "asp1") == -ENODEV);
- asp = osmo_ss7_asp_find_or_create(s7i, "asp1", 0, M3UA_PORT,
OSMO_SS7_ASP_PROT_M3UA);
+ asp = osmo_ss7_asp_find_or_create(s7i, "asp1", 0, M3UA_PORT,
OSMO_SS7_ASP_PROT_M3UA_SCTP);
OSMO_ASSERT(asp);
OSMO_ASSERT(osmo_ss7_as_has_asp(as, asp) == false);
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sccp/+/35795?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ife0ae7a4956980da40ee045b0b7eb5cd0ccd1aef
Gerrit-Change-Number: 35795
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange