lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2025

  • 1 participants
  • 1182 discussions
[M] Change in osmocom-bb[master]: trx_toolkit/*: Try to avoid copying burst data where possible
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39537?usp=email ) Change subject: trx_toolkit/*: Try to avoid copying burst data where possible ...................................................................... Patch Set 2: (1 comment) Patchset: PS2: Thanks. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39537?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I147da2f110dedc863361059c931f609c28a69e9c Gerrit-Change-Number: 39537 Gerrit-PatchSet: 2 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:57:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[S] Change in osmocom-bb[master]: trx_toolkit/transceiver: Use with tx_queue_lock instead of manual acq...
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39535?usp=email ) Change subject: trx_toolkit/transceiver: Use with tx_queue_lock instead of manual acquire/release ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Thanks. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39535?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I74b194120bcc518d44796b57e36368bdc8de4aab Gerrit-Change-Number: 39535 Gerrit-PatchSet: 1 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:57:30 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in osmocom-bb[master]: trx_toolkit/transceiver: Do not scan tx_queue twice on tx path
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39534?usp=email ) Change subject: trx_toolkit/transceiver: Do not scan tx_queue twice on tx path ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Thanks. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39534?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I225c44c4cc327b6786efce96d1278c6ec68fbc25 Gerrit-Change-Number: 39534 Gerrit-PatchSet: 1 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:57:13 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[S] Change in osmocom-bb[master]: trx_toolkit/transceiver: Do not forward nor log from under tx_queue_lock
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39533?usp=email ) Change subject: trx_toolkit/transceiver: Do not forward nor log from under tx_queue_lock ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Thanks. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39533?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7d10c972c45b2b5765e7c3a28f8646508b3c8a82 Gerrit-Change-Number: 39533 Gerrit-PatchSet: 1 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:56:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in osmocom-bb[master]: trxcon: Advance Uplink TDMA Fn by default again
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39532?usp=email ) Change subject: trxcon: Advance Uplink TDMA Fn by default again ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Thanks. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39532?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Icf0b4568b44eb75ee0733391d94b0af86f27ee2e Gerrit-Change-Number: 39532 Gerrit-PatchSet: 1 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:56:46 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmocom-bb[master]: trx_toolkit/*: Represent bursts as arrays instead of lists
by kirr 25 Feb '25

25 Feb '25
kirr has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39536?usp=email ) Change subject: trx_toolkit/*: Represent bursts as arrays instead of lists ...................................................................... Patch Set 2: (2 comments) Patchset: PS2: Thanks for review and merging. File src/target/trx_toolkit/data_msg.py: https://gerrit.osmocom.org/c/osmocom-bb/+/39536/comment/559e8473_188bb5d9?u… : PS2, Line 31: struct.unpack('b', struct.pack('B', x))[0] > Alternatively, we could use `int.to_bytes()` / `int.from_bytes()` API here: […] Performance does not matter here at all as _bu2s is used only at import time to construct `_tab_sbit2usbit` and `_tab_sbit2ubit` tables. But anyway here is performance comparision of this two approaches: ``` In [2]: def _bu2s(x): ...: return struct.unpack('b', struct.pack('B', x))[0] ...: In [3]: def V_bu2s(x): return int.from_bytes(x.to_bytes(1), signed=True) In [6]: _bu2s(0x81) Out[6]: -127 In [7]: V_bu2s(0x81) Out[7]: -127 In [8]: %timeit _bu2s(0x81) 137 ns ± 1.21 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each) In [9]: %timeit V_bu2s(0x81) 162 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each) ``` so struct-based variant works a bit faster. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39536?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7314e9e79752e06fa86b9e346a9beacc5e59579e Gerrit-Change-Number: 39536 Gerrit-PatchSet: 2 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:54:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-msc[master]: Release BSS connection when CC transaction fails
by jolly 25 Feb '25

25 Feb '25
jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38513?usp=email ) Change subject: Release BSS connection when CC transaction fails ...................................................................... Release BSS connection when CC transaction fails When the creation of the transaction structure fails, the MSC will send a RELEASE COMPLETE message. This patch ensures that the MSC_A use counter is decremented, so that the BSS connection is released, if it is not used by any other transaction. Without this patch, the msc_a_fsm would wait 5 seconds for an initial transaction before releasing the BSS connection. Related: OS#6427 Change-Id: Icb893d5c1ce4c77a29259ce66189576dcaa5a44a --- M src/libmsc/gsm_04_08_cc.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index e144b47..467305d 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -2649,6 +2649,9 @@ if (!vsub) { LOG_TRANS(trans, LOGL_ERROR, "Invalid conn: no subscriber\n"); + /* Decrement use counter that has been incremented by CM Service Request (CC). + * If there is no other service request, the BSS connection will be released. */ + msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_CC); return -EINVAL; } @@ -2666,6 +2669,9 @@ rc = gsm48_tx_simple(msc_a, GSM48_PDISC_CC | (transaction_id << 4), GSM48_MT_CC_RELEASE_COMPL); + /* Decrement use counter that has been incremented by CM Service Request (CC). + * If there is no other service request, the BSS connection will be released. */ + msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_CC); return -ENOMEM; } if (osmo_fsm_inst_dispatch(msc_a->c.fi, MSC_A_EV_TRANSACTION_ACCEPTED, trans)) { -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38513?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Icb893d5c1ce4c77a29259ce66189576dcaa5a44a Gerrit-Change-Number: 38513 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-msc[master]: Indicate error and release BSS connection when SMS transaction fails
by jolly 25 Feb '25

25 Feb '25
jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38514?usp=email ) Change subject: Indicate error and release BSS connection when SMS transaction fails ...................................................................... Indicate error and release BSS connection when SMS transaction fails When the creation of the transaction structure fails, the MSC will send a CP-ERROR message. This patch ensures that the MSC_A use counter is decremented, so that the BSS connection is released, if it is not used by any other transaction. Without this patch, the msc_a_fsm would wait 5 seconds for an initial transaction before releasing the BSS connection. Related: OS#6427 Change-Id: I82da9c283205c69b19ceb4ba40ac5aa7f37d159b --- M src/libmsc/gsm_04_11.c 1 file changed, 29 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index b6d5f4a..209ca28 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -231,6 +231,20 @@ return gsm411_sendmsg(trans, msg); } +int gsm411_send_cp_error(struct msc_a *msc_a, uint8_t pdisc, uint8_t cause) +{ + struct msgb *msg = gsm411_msgb_alloc(); + struct gsm48_hdr *gh; + + msgb_put_u8(msg, cause); + + gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); + gh->proto_discr = pdisc; + gh->msg_type = GSM411_MT_CP_ERROR; + + return msc_a_tx_dtap_to_i(msc_a, msg); +} + /* mm_send: receive MMCCSMS sap message from SMC */ static int gsm411_mm_send(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type) @@ -1339,6 +1353,12 @@ "to us anymore. We are ignoring it, maybe a CP-ERROR " "from a MS?\n", transaction_id); + /* Decrement use counter that has been incremented by CM Service Request (SMS). + * If there is no other service request, the BSS connection will be released. */ + if (!osmo_use_count_by(&msc_a->use_count, MSC_A_USE_CM_SERVICE_SMS)) + LOG_TRANS(trans, LOGL_ERROR, "MO SMS without prior CM Service Request\n"); + else + msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_SMS); return -EINVAL; } @@ -1346,7 +1366,15 @@ new_trans = 1; trans = gsm411_trans_init(net, vsub, msc_a, transaction_id, true); if (!trans) { - /* FIXME: send some error message */ + /* Send error message. */ + gsm411_send_cp_error(msc_a, GSM48_PDISC_SMS | (transaction_id << 4), + GSM411_CP_CAUSE_NET_FAIL); + /* Decrement use counter that has been incremented by CM Service Request (SMS). + * If there is no other service request, the BSS connection will be released. */ + if (!osmo_use_count_by(&msc_a->use_count, MSC_A_USE_CM_SERVICE_SMS)) + LOG_TRANS(trans, LOGL_ERROR, "MO SMS without prior CM Service Request\n"); + else + msc_a_put(msc_a, MSC_A_USE_CM_SERVICE_SMS); return -ENOMEM; } -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38514?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I82da9c283205c69b19ceb4ba40ac5aa7f37d159b Gerrit-Change-Number: 38514 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmocore[master]: gprs: define OSMO_RESERVED_RAC 0xff
by pespin 25 Feb '25

25 Feb '25
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/libosmocore/+/39557?usp=email ) Change subject: gprs: define OSMO_RESERVED_RAC 0xff ...................................................................... Patch Set 1: (1 comment) File include/osmocom/gsm/protocol/gsm_04_08_gprs.h: https://gerrit.osmocom.org/c/libosmocore/+/39557/comment/29623828_391ca609?… : PS1, Line 14: #define OSMO_RESERVED_RAC 0xff > so basically pespins point would be to mark it GSM*_RESERVED_RAC instead of OSMO_RESERVED_RAC. […] I'm actually more concerned about the comment in line 11 stating "osmocom specific". Having whatever defined prefixed as OSMO_ is fine (regardless of it being osmocom specific or not, simply for C namespacing..) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39557?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I17a2adedc2c2ab158f40d58280f5df5c6967b8ec Gerrit-Change-Number: 39557 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Tue, 25 Feb 2025 12:44:24 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in libosmo-sigtran[master]: Move osmo_ss7_route_name() to osmo_ss7_route.c
by pespin 25 Feb '25

25 Feb '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39608?usp=email ) Change subject: Move osmo_ss7_route_name() to osmo_ss7_route.c ...................................................................... Move osmo_ss7_route_name() to osmo_ss7_route.c Change-Id: I6889a9b6c86453044a6cf6728e7e61264d594a4e --- M src/osmo_ss7_hmrt.c M src/osmo_ss7_route.c 2 files changed, 60 insertions(+), 59 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/08/39608/1 diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index 5fca2d8..839b8ad 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -146,65 +146,6 @@ } } -/*! Return human readable representation of the route, in a static buffer. - * This uses both osmo_ss7_pointcode_print() and osmo_ss7_pointcode_print2(), so pairing - * osmo_ss7_route_name() with osmo_ss7_pointcode_print() in the same printf statement is likely to - * conflict. - * \param[in] rt The route information to print, or NULL. - * \param[in] list_asps If true, append info for all ASPs for the route's AS. - * \returns A string constant or static buffer. */ -const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps) -{ - static char buf[256]; - char *pos = buf; - struct osmo_ss7_instance *inst; - size_t l; - - if (!rt) - return "no route"; - - inst = rt->rtable->inst; - -#define APPEND(fmt, args ...) \ - do { \ - l = snprintf(pos, sizeof(buf) - (pos - buf), fmt, ## args); \ - pos += l; \ - if (pos - buf >= sizeof(buf) ) \ - goto out; \ - } while (0) - - APPEND("pc=%u=%s mask=0x%x=%s", - rt->cfg.pc, osmo_ss7_pointcode_print(inst, rt->cfg.pc), - rt->cfg.mask, osmo_ss7_pointcode_print2(inst, rt->cfg.mask)); - - if (rt->dest.as) { - struct osmo_ss7_as *as = rt->dest.as; - int i; - APPEND(" via AS %s proto=%s", as->cfg.name, osmo_ss7_asp_protocol_name(as->cfg.proto)); - - if (list_asps) { - for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { - struct osmo_ss7_asp *asp = as->cfg.asps[i]; - if (!asp) - continue; - APPEND(" ASP"); - if (asp->cfg.name) - APPEND(" %s", asp->cfg.name); - if (asp->sock_name) - APPEND(" %s", asp->sock_name); - } - } - } else if (rt->dest.linkset) - APPEND(" via linkset %s", rt->dest.linkset->cfg.name); - else - APPEND(" has no route set"); -#undef APPEND - -out: - buf[sizeof(buf)-1] = '\0'; - return buf; -} - /* HMDC->HMRT Msg For Routing; Figure 26/Q.704 */ /* local message was receive d from L4, SRM, SLM, STM or SLTC, or * remote message received from L2 and HMDC determined msg for routing */ diff --git a/src/osmo_ss7_route.c b/src/osmo_ss7_route.c index 1afc75c..8a1592f 100644 --- a/src/osmo_ss7_route.c +++ b/src/osmo_ss7_route.c @@ -28,6 +28,7 @@ #include "ss7_linkset.h" #include "ss7_as.h" +#include "ss7_asp.h" #include "ss7_route.h" #include "ss7_route_table.h" #include "ss7_internal.h" @@ -295,6 +296,65 @@ return buf; } +/*! Return human readable representation of the route, in a static buffer. + * This uses both osmo_ss7_pointcode_print() and osmo_ss7_pointcode_print2(), so pairing + * osmo_ss7_route_name() with osmo_ss7_pointcode_print() in the same printf statement is likely to + * conflict. + * \param[in] rt The route information to print, or NULL. + * \param[in] list_asps If true, append info for all ASPs for the route's AS. + * \returns A string constant or static buffer. */ +const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps) +{ + static char buf[256]; + char *pos = buf; + struct osmo_ss7_instance *inst; + size_t l; + + if (!rt) + return "no route"; + + inst = rt->rtable->inst; + +#define APPEND(fmt, args ...) \ + do { \ + l = snprintf(pos, sizeof(buf) - (pos - buf), fmt, ## args); \ + pos += l; \ + if (pos - buf >= sizeof(buf)) \ + goto out; \ + } while (0) + + APPEND("pc=%u=%s mask=0x%x=%s", + rt->cfg.pc, osmo_ss7_pointcode_print(inst, rt->cfg.pc), + rt->cfg.mask, osmo_ss7_pointcode_print2(inst, rt->cfg.mask)); + + if (rt->dest.as) { + struct osmo_ss7_as *as = rt->dest.as; + int i; + APPEND(" via AS %s proto=%s", as->cfg.name, osmo_ss7_asp_protocol_name(as->cfg.proto)); + + if (list_asps) { + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + struct osmo_ss7_asp *asp = as->cfg.asps[i]; + if (!asp) + continue; + APPEND(" ASP"); + if (asp->cfg.name) + APPEND(" %s", asp->cfg.name); + if (asp->sock_name) + APPEND(" %s", asp->sock_name); + } + } + } else if (rt->dest.linkset) + APPEND(" via linkset %s", rt->dest.linkset->cfg.name); + else + APPEND(" has no route set"); +#undef APPEND + +out: + buf[sizeof(buf)-1] = '\0'; + return buf; +} + /*! \brief Find a SS7 route for given destination point code in given SS7 */ struct osmo_ss7_route * osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39608?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: I6889a9b6c86453044a6cf6728e7e61264d594a4e Gerrit-Change-Number: 39608 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • ...
  • 119
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.