pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40012?usp=email )
Change subject: Unify amount of supported rctx items in IE to 128 ......................................................................
Unify amount of supported rctx items in IE to 128
Change-Id: I703c9e62ed909dc1cd9c3e943612205856edbf2c --- M include/osmocom/sigtran/osmo_ss7.h M src/xua_asp_fsm.c M src/xua_snm.c 3 files changed, 9 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/12/40012/1
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 264507b..0bde3d9 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -11,6 +11,9 @@ #include <osmocom/core/socket.h> #include <osmocom/core/rate_ctr.h>
+/* Maximum number of supported RCTXs present in RFC4666 Routing Context IE. */ +#define OSMO_SS7_MAX_RCTX_COUNT 128 + struct osmo_ss7_instance;
extern struct llist_head osmo_ss7_instances; diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 3834ece..4603734 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -174,7 +174,7 @@ static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp) { struct osmo_ss7_as *as; - uint32_t rctx[128]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; unsigned int i = 0;
/* iterate over all ASs and build array of routing contexts */ diff --git a/src/xua_snm.c b/src/xua_snm.c index 1481178..edb1210 100644 --- a/src/xua_snm.c +++ b/src/xua_snm.c @@ -175,7 +175,7 @@ { struct osmo_ss7_instance *s7i = as->inst; struct osmo_ss7_asp *asp; - uint32_t rctx[32]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; unsigned int num_rctx;
/* inform local users via a MTP-{PAUSE, RESUME} primitive */ @@ -217,7 +217,7 @@ { struct osmo_ss7_instance *s7i = as->inst; struct osmo_ss7_asp *asp; - uint32_t rctx[32]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; unsigned int num_rctx; uint32_t _smi = smi ? *smi : 0; /* 0 == reserved/unknown in SUA */
@@ -252,7 +252,7 @@ { struct osmo_ss7_instance *s7i = as->inst; struct osmo_ss7_asp *asp; - uint32_t rctx[32]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; unsigned int num_rctx;
/* Translate to MTP-STATUS.ind towards SCCP (will create N-PCSTATE.ind to SCU) */ @@ -284,7 +284,7 @@ { struct osmo_ss7_instance *s7i = as->inst; struct osmo_ss7_asp *asp; - uint32_t rctx[32]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; unsigned int num_rctx;
/* TODO: How to translate to MTP and towards SCCP (create N-PCSTATE.ind to SCU) */ @@ -318,7 +318,7 @@ unsigned int num_aff_pc; unsigned int num_rctx; const uint32_t *aff_pc; - uint32_t rctx[32]; + uint32_t rctx[OSMO_SS7_MAX_RCTX_COUNT]; int log_ss = osmo_ss7_asp_get_log_subsys(asp); int i;