lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/43999?usp=email ) Change subject: tcap_as_loadshare: add TCAP IPA MT_TID_ACCEPT_NEW_TRAN ...................................................................... tcap_as_loadshare: add TCAP IPA MT_TID_ACCEPT_NEW_TRAN With MT_TID_ACCEPT_NEW_TRANS a TCAP loadsharing ASP can control if it receives new TCAP transactions (TCAP Begin messages). When disabled, a TCAP loadsharing ASP will still receive TCAP transaction inside their TCAP range as well transaction associated via transaction tracking. Related: SYS#8283 Change-Id: Id4e7bb022a0c8b52369f6ded2729cf6cf8679556 --- M src/ss7_asp.c M src/ss7_asp.h M src/tcap_as_loadshare.c 3 files changed, 36 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/99/43999/1 diff --git a/src/ss7_asp.c b/src/ss7_asp.c index 63038d9..53c8644 100644 --- a/src/ss7_asp.c +++ b/src/ss7_asp.c @@ -778,6 +778,11 @@ /* The SUA code internally needs SCCP to work */ if (proto == OSMO_SS7_ASP_PROT_SUA) osmo_ss7_ensure_sccp(inst); + +#ifdef WITH_TCAP_LOADSHARING + asp->tcap.accept_new_trans = true; +#endif /* WITH_TCAP_LOADSHARING */ + return asp; } diff --git a/src/ss7_asp.h b/src/ss7_asp.h index b7f0058..a292b44 100644 --- a/src/ss7_asp.h +++ b/src/ss7_asp.h @@ -105,6 +105,8 @@ #ifdef WITH_TCAP_LOADSHARING struct { bool enabled; + /* is this ASP is available for new TCAP sessions (Begin) */ + bool accept_new_trans; } tcap; #endif /* WITH_TCAP_LOADSHARING */ diff --git a/src/tcap_as_loadshare.c b/src/tcap_as_loadshare.c index f394499..ecd1d5f 100644 --- a/src/tcap_as_loadshare.c +++ b/src/tcap_as_loadshare.c @@ -260,7 +260,7 @@ for (unsigned int i = 0; i < as->num_assoc_asps; i++) { assoc = ss7_as_asp_assoc_llist_round_robin(as, &as->tcap.last_asp_idx_sent); - if (assoc && osmo_ss7_asp_active(assoc->asp) && assoc->asp->tcap.enabled) + if (assoc && osmo_ss7_asp_active(assoc->asp) && assoc->asp->tcap.enabled && assoc->asp->tcap.accept_new_trans) return assoc->asp; } return NULL; @@ -807,6 +807,7 @@ MT_TID_ADD_RANGE = 0x01, MT_TID_ACK = 0x02, MT_TID_NACK = 0x03, + MT_TID_ACCEPT_NEW_TRANS = 0x04, }; enum ipa_tcap_routing_nack_error { @@ -839,6 +840,14 @@ uint8_t err; } __attribute__((packed)); +/* Controls if the ASP may receive new transaction (TCAP Begin). + * + * When the ASP disabled new transaction, it still receive TCAP transactions which matches + * the DTID (TCAP Continue/End) or if transaction tracking matches an ongoing transaction. */ +struct ipa_tcap_routing_accept_new_trans { + uint8_t accept; +} __attribute__((packed)); + static struct msgb *ipa_tcap_routing_alloc(uint32_t seq_nr, uint8_t mt) { struct ipa_tcap_routing_hdr hdr = { @@ -967,6 +976,25 @@ rc = ipa_tx_tcap_routing_ack(asp, osmo_ntohl(hdr->seq)); break; } + case MT_TID_ACCEPT_NEW_TRANS: { + uint8_t accept_new; + + if (msgb_length(msg) < sizeof(*hdr) + sizeof(struct ipa_tcap_routing_accept_new_trans)) { + LOGPASP(asp, DLTCAP, LOGL_ERROR, "TCAP routing message is too small\n"); + rc = -EINVAL; + goto out; + } + + msgb_pull(msg, sizeof(*hdr)); + accept_new = msgb_pull_u8(msg); + + asp->tcap.enabled = true; + asp->tcap.accept_new_trans = accept_new; + + rc = ipa_tx_tcap_routing_ack(asp, osmo_ntohl(hdr->seq)); + + break; + } case MT_TID_ACK: /* shouldn't received from other end */ case MT_TID_NACK: /* shouldn't received from other end */ default: -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43999?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Id4e7bb022a0c8b52369f6ded2729cf6cf8679556 Gerrit-Change-Number: 43999 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>