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

October 2024

  • 1 participants
  • 1631 discussions
[XS] Change in osmo-msc[master]: vlr: add functions for vlr_is_cs() vlr_is_ps()
by laforge 15 Oct '24

15 Oct '24
Attention is currently required from: lynxis lazus, pespin. laforge has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-msc/+/38405?usp=email ) Change subject: vlr: add functions for vlr_is_cs() vlr_is_ps() ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38405?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I88810f3703813e98be8a37d0445ad641b0cac11d Gerrit-Change-Number: 38405 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Tue, 15 Oct 2024 15:43:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libosmo-sigtran[master]: ss7 vty: Validate qos-class number being passed to 'update route'
by laforge 15 Oct '24

15 Oct '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38388?usp=email ) Change subject: ss7 vty: Validate qos-class number being passed to 'update route' ...................................................................... ss7 vty: Validate qos-class number being passed to 'update route' While at it, organize the related strings used in several places in the file. Change-Id: Ib81499d5ac692e1de463efe931381bbb68fd1131 --- M src/osmo_ss7_vty.c M tests/vty/osmo_stp_test.vty 2 files changed, 15 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 06fa823..b1029ed 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -67,6 +67,14 @@ "SCTP (Stream Control Transmission Protocol)\n" \ "TCP (Transmission Control Protocol)\n" +#define QOS_CLASS_RANGE_STR "<0-255>" +#define QOS_CLASS_RANGE_HELP_STR "QoS Class\n" +#define QOS_CLASS_VAR_STR "(" QOS_CLASS_RANGE_STR "|default)" +#define QOS_CLASS_VAR_HELP_STR \ + QOS_CLASS_RANGE_HELP_STR \ + "Default QoS Class (0)\n" + + /* netinet/tcp.h */ static const struct value_string tcp_info_state_values[] = { { TCP_ESTABLISHED, "ESTABLISHED" }, @@ -341,7 +349,7 @@ } DEFUN_ATTR(cs7_rt_upd, cs7_rt_upd_cmd, - "update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(CLASS|default)]", + "update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [" QOS_CLASS_VAR_STR "]", "Update the Route\n" "Update the Route\n" "Destination Point Code\n" @@ -351,8 +359,7 @@ "Specify Priority\n" "Priority\n" "Specify QoS Class\n" - "QoS Class\n" - "Default QoS Class\n", + QOS_CLASS_VAR_HELP_STR, CMD_ATTR_IMMEDIATE) { struct osmo_ss7_route_table *rtable = vty->index; @@ -1073,9 +1080,9 @@ } DEFUN_ATTR(asp_qos_clas, asp_qos_class_cmd, - "qos-class <0-255>", + "qos-class " QOS_CLASS_RANGE_STR, "Specify QoS Class of ASP\n" - "QoS Class of ASP\n", + QOS_CLASS_RANGE_HELP_STR, CMD_ATTR_NODE_EXIT) { struct osmo_ss7_asp *asp = vty->index; @@ -1934,9 +1941,9 @@ } DEFUN_ATTR(as_qos_clas, as_qos_class_cmd, - "qos-class <0-255>", + "qos-class " QOS_CLASS_RANGE_STR, "Specity QoS Class of AS\n" - "QoS Class of AS\n", + QOS_CLASS_RANGE_HELP_STR, CMD_ATTR_IMMEDIATE) { struct osmo_ss7_as *as = vty->index; diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty index b2f5270..33e092b 100644 --- a/tests/vty/osmo_stp_test.vty +++ b/tests/vty/osmo_stp_test.vty @@ -570,7 +570,7 @@ OsmoSTP(config-cs7)# route-table system OsmoSTP(config-cs7-rt)# list ... - update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(CLASS|default)] + update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(<0-255>|default)] remove route POINT_CODE MASK OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass OsmoSTP(config-cs7-rt)# show running-config -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38388?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Ib81499d5ac692e1de463efe931381bbb68fd1131 Gerrit-Change-Number: 38388 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: ss7 vty: Handle 'update route ... qos-class default' properly
by laforge 15 Oct '24

15 Oct '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38387?usp=email ) Change subject: ss7 vty: Handle 'update route ... qos-class default' properly ...................................................................... ss7 vty: Handle 'update route ... qos-class default' properly If "default" is passed, use the default value generated by ss7_route_alloc() (zero). A follow-up patch will be submitted to also force the CLASS to be a number. Change-Id: I370bc19ef5cf2d21fa3408baf26bf8d1ce7bf362 --- M src/osmo_ss7_vty.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index a43e312..06fa823 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -410,7 +410,9 @@ if (argc > argind && !strcmp(argv[argind], "qos-class")) { argind++; - rt->cfg.qos_class = atoi(argv[argind++]); + if (strcmp(argv[argind], "default") != 0) + rt->cfg.qos_class = atoi(argv[argind]); + argind++; } if ((rc = ss7_route_insert(rt)) < 0) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38387?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I370bc19ef5cf2d21fa3408baf26bf8d1ce7bf362 Gerrit-Change-Number: 38387 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[L] Change in libosmo-sigtran[master]: ss7 vty: Fix insert order of routes with higher priority
by laforge 15 Oct '24

15 Oct '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email ) Change subject: ss7 vty: Fix insert order of routes with higher priority ...................................................................... ss7 vty: Fix insert order of routes with higher priority Route lookup ((hmrt_message_for_routing() => osmo_ss7_route_lookup() => osmo_ss7_route_find_dpc_mask())) iterates the list of routes assuming they are ordered by mask length (so it doesn't need to iterate the full list every time). Similary, it implicitly seems to assume that the entries are also sorted by priority. However, priority is not currently taken into account when being inserted in the routing table, so the route ends up in the incorrect place. The VTY "update route" command used to first insert the route and only *after* that tweak some of its fields, like priority or qos-class. This commit adds a new set of osmo_ss7_route API which allows users to *first* allocate a route and configure it completelly, and *second* insert it once it contains all the information. This way, the insert algorithm can take into account the configured route priority and place the route entry in the routing table at the proper place. Related: SYS#7112 Change-Id: I6e7b5e3f06ae2c9468da58c55d2f42cbcd777218 --- M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/ss7_internal.h M tests/vty/osmo_stp_route_prio.vty 4 files changed, 202 insertions(+), 55 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 55d3d02..cc40fe1 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -657,6 +657,100 @@ * SS7 Routes ***********************************************************************/ +/*! \brief Allocate a route entry + * \param[in] rtbl Routing Table where the route belongs + * \param[in] pc Point Code of the destination of the route + * \param[in] mask Mask of the destination Point Code \ref pc + * \returns Allocated route (not yet inserted into its rtbl), NULL on error + * + * The returned route has no linkset associated yet, user *must* associate it + * using API ss7_route_set_linkset() before inserting the route into its + * routing table. + * + * Fields priority and qos_class may be set *before* inserting the route into + * its routing table: + * - A default priority of 0 is configured on the route. + * - A default qos-class of 0 is configured on the route. + * + * Use API ss7_route_insert() to insert the route into its routing table. + * + * The route entry allocated with this API can be destroyed/freed at any point using API + * osmo_ss7_route_destroy(), regardless of it being already inserted or not in + * its routing table. + */ +struct osmo_ss7_route * +ss7_route_alloc(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask) +{ + struct osmo_ss7_route *rt; + + OSMO_ASSERT(ss7_initialized); + + rt = talloc_zero(rtbl, struct osmo_ss7_route); + if (!rt) + return NULL; + + /* Mark it as not being inserted yet in rtbl */ + INIT_LLIST_HEAD(&rt->list); + rt->rtable = rtbl; + /* truncate mask to maximum. Let's avoid callers specifying arbitrary large + * masks to ensure we don't fail duplicate detection with longer mask lengths */ + rt->cfg.mask = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, mask); + rt->cfg.pc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, pc); + return rt; +} + +/*! \brief Check whether route has already been inserted into its routing table. + * \returns true if already inserted, false if not. + */ +static bool ss7_route_inserted(const struct osmo_ss7_route *rt) +{ + return !llist_empty(&rt->list); +} + +/*! \brief Set linkset on route entry + * \param[in] rt Route to be configured + * \param[in] linkset_name string name of the linkset to be used + * \returns 0 on success, negative on error. + */ +int +ss7_route_set_linkset(struct osmo_ss7_route *rt, const char *linkset_name) +{ + struct osmo_ss7_linkset *lset; + struct osmo_ss7_as *as = NULL; + struct osmo_ss7_route_table *rtbl = rt->rtable; + + if (rt->cfg.linkset_name) { + LOGSS7(rtbl->inst, LOGL_ERROR, "Attempt setting linkset on route already configured!\n"); + return -EBUSY; + } + + if (ss7_route_inserted(rt)) { + LOGSS7(rtbl->inst, LOGL_ERROR, "Attempt setting linkset on route already in the routing table!\n"); + return -EALREADY; + } + + lset = osmo_ss7_linkset_find_by_name(rtbl->inst, linkset_name); + if (!lset) { + as = osmo_ss7_as_find_by_name(rtbl->inst, linkset_name); + if (!as) + return -ENODEV; + } + + rt->cfg.linkset_name = talloc_strdup(rt, linkset_name); + if (lset) { + rt->dest.linkset = lset; + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via linkset '%s'\n", + rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, rt->cfg.pc), + rt->cfg.mask, lset->cfg.name); + } else { + rt->dest.as = as; + LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via AS '%s'\n", + rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, rt->cfg.pc), + rt->cfg.mask, as->cfg.name); + } + return 0; +} + /*! \brief Find a SS7 route for given destination point code in given table */ struct osmo_ss7_route * osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc) @@ -709,6 +803,7 @@ /* insert the route in the ordered list of routes. The list is sorted by * mask length, so that the more specific (longer mask) routes are * first, while the less specific routes with shorter masks are last. + * Within the same mask length, the routes are ordered by priority. * Hence, the first matching route in a linear iteration is the most * specific match. */ static void route_insert_sorted(struct osmo_ss7_route_table *rtbl, @@ -717,73 +812,94 @@ struct osmo_ss7_route *rt; llist_for_each_entry(rt, &rtbl->routes, list) { + if (rt->cfg.mask == cmp->cfg.mask && + rt->cfg.priority > cmp->cfg.priority) { + /* insert before the current entry */ + llist_add(&cmp->list, rt->list.prev); + return; + } if (rt->cfg.mask < cmp->cfg.mask) { /* insert before the current entry */ llist_add(&cmp->list, rt->list.prev); return; } } - /* not added, i.e. no smaller mask length found: we are the - * smallest mask and thus should go last */ + /* not added, i.e. no smaller mask length and priority found: we are the + * smallest mask and priority and thus should go last */ llist_add_tail(&cmp->list, &rtbl->routes); } +/*! \brief Insert route into its routing table + * \param[in] rt Route to be inserted into its routing table + * \returns 0 on success, negative on error + * + * A route is only really used once it has been inserted into its routing table. + */ +int +ss7_route_insert(struct osmo_ss7_route *rt) +{ + struct osmo_ss7_route *prev_rt; + struct osmo_ss7_route_table *rtbl = rt->rtable; + + if (ss7_route_inserted(rt)) { + LOGSS7(rtbl->inst, LOGL_ERROR, "Attempt insert of route already in the routing table!\n"); + return -EALREADY; + } + + if (!rt->cfg.linkset_name) { + LOGSS7(rtbl->inst, LOGL_ERROR, "Attempt insert of route with unset linkset!\n"); + return -EINVAL; + } + + /* check for duplicates */ + prev_rt = osmo_ss7_route_find_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask); + if (prev_rt && !strcmp(prev_rt->cfg.linkset_name, rt->cfg.linkset_name)) { + LOGSS7(rtbl->inst, LOGL_ERROR, + "Refusing to create route with existing linkset name: pc=%u=%s mask=0x%x via linkset/AS '%s'\n", + rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, rt->cfg.pc), + rt->cfg.mask, rt->cfg.linkset_name); + return -EADDRINUSE; + } + + route_insert_sorted(rtbl, rt); + return 0; +} + /*! \brief Create a new route in the given routing table * \param[in] rtbl Routing Table in which the route is to be created * \param[in] pc Point Code of the destination of the route * \param[in] mask Mask of the destination Point Code \ref pc * \param[in] linkset_name string name of the linkset to be used - * \returns caller-allocated + initialized route, NULL on error + * \returns callee-allocated + initialized route, NULL on error + * + * The route allocated and returned by this API is already inserted into the + * routing table, with priority and qos-class set to 0. + * If you plan to use different values for priority and qos-class, avoid using + * this API and use ss7_route_alloc() + ss7_route_set_linkset() + + * ss7_route_insert() instead. */ struct osmo_ss7_route * osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, const char *linkset_name) { struct osmo_ss7_route *rt; - struct osmo_ss7_linkset *lset; - struct osmo_ss7_as *as = NULL; + int rc; - /* truncate mask to maximum. Let's avoid callers specifying arbitrary large - * masks to ensure we don't fail duplicate detection with longer mask lengths */ - mask = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, mask); - pc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, pc); - - OSMO_ASSERT(ss7_initialized); - lset = osmo_ss7_linkset_find_by_name(rtbl->inst, linkset_name); - if (!lset) { - as = osmo_ss7_as_find_by_name(rtbl->inst, linkset_name); - if (!as) - return NULL; - } - - /* check for duplicates */ - rt = osmo_ss7_route_find_dpc_mask(rtbl, pc, mask); - if (rt && !strcmp(rt->cfg.linkset_name, linkset_name)) { - LOGSS7(rtbl->inst, LOGL_ERROR, "Refusing to create duplicate route: " - "pc=%u=%s mask=0x%x via linkset/AS '%s'\n", - pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, linkset_name); - return rt; - } - - rt = talloc_zero(rtbl, struct osmo_ss7_route); + rt = ss7_route_alloc(rtbl, pc, mask); if (!rt) return NULL; - rt->cfg.pc = pc; - rt->cfg.mask = mask; - rt->cfg.linkset_name = talloc_strdup(rt, linkset_name); - if (lset) { - rt->dest.linkset = lset; - LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via linkset '%s'\n", - pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, lset->cfg.name); - } else { - rt->dest.as = as; - LOGSS7(rtbl->inst, LOGL_INFO, "Creating route: pc=%u=%s mask=0x%x via AS '%s'\n", - pc, osmo_ss7_pointcode_print(rtbl->inst, pc), mask, as->cfg.name); + if (ss7_route_set_linkset(rt, linkset_name) < 0) { + talloc_free(rt); + return NULL; } - rt->rtable = rtbl; - route_insert_sorted(rtbl, rt); + rc = ss7_route_insert(rt); + /* Keep old behavior, return already existing route: */ + if (rc == -EADDRINUSE) { + talloc_free(rt); + return osmo_ss7_route_find_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask); + } return rt; } @@ -795,10 +911,16 @@ OSMO_ASSERT(ss7_initialized); - LOGSS7(rtbl->inst, LOGL_INFO, "Destroying route: pc=%u=%s mask=0x%x via linkset/ASP '%s'\n", - rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, rt->cfg.pc), rt->cfg.mask, rt->cfg.linkset_name); + if (!rt) + return; - llist_del(&rt->list); + if (ss7_route_inserted(rt)) { + LOGSS7(rtbl->inst, LOGL_INFO, + "Destroying route: pc=%u=%s mask=0x%x via linkset/ASP '%s'\n", + rt->cfg.pc, osmo_ss7_pointcode_print(rtbl->inst, rt->cfg.pc), + rt->cfg.mask, rt->cfg.linkset_name); + llist_del(&rt->list); + } talloc_free(rt); } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 0dd8a58..a43e312 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -361,6 +361,7 @@ int mask = osmo_ss7_pointcode_parse_mask_or_len(rtable->inst, argv[1]); const char *ls_name = argv[2]; unsigned int argind; + int rc; if (dpc < 0) { vty_out(vty, "%% Invalid point code (%s)%s", argv[0], VTY_NEWLINE); @@ -372,16 +373,9 @@ return CMD_WARNING; } - rt = osmo_ss7_route_create(rtable, dpc, mask, ls_name); - if (!rt) { - vty_out(vty, "%% Cannot create route %s/%s to %s%s", - argv[0], argv[1], argv[2], VTY_NEWLINE); - return CMD_WARNING; - } - switch (argc) { case 3: - return CMD_SUCCESS; + break; /* Continue below */ case 5: if (strcmp(argv[3], "priority") != 0 && strcmp(argv[3], "qos-class") != 0) @@ -397,6 +391,17 @@ return CMD_WARNING; } + rt = ss7_route_alloc(rtable, dpc, mask); + if (!rt) { + vty_out(vty, "%% Cannot allocate new route%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if ((rc = ss7_route_set_linkset(rt, ls_name)) < 0) { + vty_out(vty, "%% Cannot find linkset %s%s", ls_name, VTY_NEWLINE); + goto destroy_warning; + } + argind = 3; if (argc > argind && !strcmp(argv[argind], "priority")) { argind++; @@ -408,7 +413,20 @@ rt->cfg.qos_class = atoi(argv[argind++]); } + if ((rc = ss7_route_insert(rt)) < 0) { + char buf_err[128]; + strerror_r(-rc, buf_err, sizeof(buf_err)); + vty_out(vty, "%% Cannot insert route %s/%s to %s: %s (%d)%s", + argv[0], argv[1], argv[2], + buf_err, rc, VTY_NEWLINE); + goto destroy_warning; + } + return CMD_SUCCESS; + +destroy_warning: + osmo_ss7_route_destroy(rt); + return CMD_WARNING; } DEFUN_ATTR(cs7_rt_rem, cs7_rt_rem_cmd, diff --git a/src/ss7_internal.h b/src/ss7_internal.h index dcc2ef1..623c607 100644 --- a/src/ss7_internal.h +++ b/src/ss7_internal.h @@ -50,3 +50,11 @@ SS7_ASP_CTR_PKT_RX_UNKNOWN, SS7_ASP_CTR_PKT_TX_TOTAL, }; + +/*********************************************************************** + * SS7 Routes + ***********************************************************************/ +struct osmo_ss7_route * +ss7_route_alloc(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask); +int ss7_route_set_linkset(struct osmo_ss7_route *rt, const char *linkset_name); +int ss7_route_insert(struct osmo_ss7_route *rt); diff --git a/tests/vty/osmo_stp_route_prio.vty b/tests/vty/osmo_stp_route_prio.vty index 178f9be..6cc862a 100644 --- a/tests/vty/osmo_stp_route_prio.vty +++ b/tests/vty/osmo_stp_route_prio.vty @@ -68,15 +68,14 @@ OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as1 priority 5 OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as3 OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as2 priority 2 -OsmoSTP(config-cs7-rt)# ! FIXME! THIS IS WRONG ORDER: OsmoSTP(config-cs7-rt)# show running-config ... cs7 instance 0 ... route-table system - update route 3.2.1 7.255.7 linkset as1 priority 5 update route 3.2.1 7.255.7 linkset as3 update route 3.2.1 7.255.7 linkset as2 priority 2 + update route 3.2.1 7.255.7 linkset as1 priority 5 ... OsmoSTP(config-cs7-rt)# do show cs7 instance 0 route Routing table = system @@ -84,6 +83,6 @@ Destination C Q P Linkset Name Linkset Non-adj Route ---------------------- - - - ------------------- ------- ------- ------- -3.2.1/14 5 as1 ? ? ? 3.2.1/14 0 as3 ? ? ? 3.2.1/14 2 as2 ? ? ? +3.2.1/14 5 as1 ? ? ? -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38375?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I6e7b5e3f06ae2c9468da58c55d2f42cbcd777218 Gerrit-Change-Number: 38375 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: ss7 vty: Limit qos-class range to 0-7
by laforge 15 Oct '24

15 Oct '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38389?usp=email ) Change subject: ss7 vty: Limit qos-class range to 0-7 ...................................................................... ss7 vty: Limit qos-class range to 0-7 This matches QoS ranges used by other vendors. Change-Id: I541723e4551977cb2b7afcac01e3bfee070e7bac --- M src/osmo_ss7_vty.c M tests/vty/osmo_stp_test.vty 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b1029ed..35a940f 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -67,7 +67,7 @@ "SCTP (Stream Control Transmission Protocol)\n" \ "TCP (Transmission Control Protocol)\n" -#define QOS_CLASS_RANGE_STR "<0-255>" +#define QOS_CLASS_RANGE_STR "<0-7>" #define QOS_CLASS_RANGE_HELP_STR "QoS Class\n" #define QOS_CLASS_VAR_STR "(" QOS_CLASS_RANGE_STR "|default)" #define QOS_CLASS_VAR_HELP_STR \ diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty index 33e092b..5253b9a 100644 --- a/tests/vty/osmo_stp_test.vty +++ b/tests/vty/osmo_stp_test.vty @@ -263,7 +263,7 @@ no remote-ip (A.B.C.D|X:X::X:X) local-ip (A.B.C.D|X:X::X:X) [primary] no local-ip (A.B.C.D|X:X::X:X) - qos-class <0-255> + qos-class <0-7> role (sg|asp|ipsp) transport-role (client|server) sctp-param init (num-ostreams|max-instreams|max-attempts|timeout) <0-65535> @@ -347,7 +347,7 @@ traffic-mode (broadcast | loadshare | roundrobin | override) no traffic-mode recovery-timeout <1-2000> - qos-class <0-255> + qos-class <0-7> routing-key RCONTEXT DPC routing-key RCONTEXT DPC si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup) routing-key RCONTEXT DPC ssn SSN @@ -570,7 +570,7 @@ OsmoSTP(config-cs7)# route-table system OsmoSTP(config-cs7-rt)# list ... - update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(<0-255>|default)] + update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(<0-7>|default)] remove route POINT_CODE MASK OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass OsmoSTP(config-cs7-rt)# show running-config -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38389?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I541723e4551977cb2b7afcac01e3bfee070e7bac Gerrit-Change-Number: 38389 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: ss7 vty: Set default route priority to 5
by laforge 15 Oct '24

15 Oct '24
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38390?usp=email ) Change subject: ss7 vty: Set default route priority to 5 ...................................................................... ss7 vty: Set default route priority to 5 Use a priority != 0 (best prio) as default priority. This allows adding manual routes with higher prio (lower value) more easily. Value 5 is chosen to resemble other systems users may be already used to. Changing the default priority value in routes now shouldn't be much of a problem, since the only way to set up a specific priority (VTY) was broken until now and would return an error, so we know for sure nobody has been setting priorities other than the default value. Hence, with this change even older implementations reading a backward compatible file would still work the same by using all-prio-0 instead of all-prio-5. The "update route" VTY cmd gets a new "default" param value for the "priority" param, hence getting some syntatic sugar which also helps users understand what's the default value through the CMD help string. Change-Id: I4e283cc07b8e9ea2124ec9da18cbce77c3d866ee --- M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/ss7_internal.h M tests/vty/osmo_stp_route_prio.vty M tests/vty/osmo_stp_test.vty 5 files changed, 49 insertions(+), 20 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index cc40fe1..bcbe76c 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -696,6 +696,7 @@ * masks to ensure we don't fail duplicate detection with longer mask lengths */ rt->cfg.mask = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, mask); rt->cfg.pc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, pc); + rt->cfg.priority = OSMO_SS7_ROUTE_PRIO_DEFAULT; return rt; } diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 35a940f..356090c 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -74,6 +74,12 @@ QOS_CLASS_RANGE_HELP_STR \ "Default QoS Class (0)\n" +#define ROUTE_PRIO_RANGE_STR "<0-4294967295>" +#define ROUTE_PRIO_RANGE_HELP_STR "Priority\n" +#define ROUTE_PRIO_VAR_STR "(" ROUTE_PRIO_RANGE_STR "|default)" +#define ROUTE_PRIO_VAR_HELP_STR \ + ROUTE_PRIO_RANGE_HELP_STR \ + "Default Priority (5)\n" /* netinet/tcp.h */ static const struct value_string tcp_info_state_values[] = { @@ -349,7 +355,7 @@ } DEFUN_ATTR(cs7_rt_upd, cs7_rt_upd_cmd, - "update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [" QOS_CLASS_VAR_STR "]", + "update route POINT_CODE MASK linkset LS_NAME [priority] [" ROUTE_PRIO_VAR_STR "] [qos-class] [" QOS_CLASS_VAR_STR "]", "Update the Route\n" "Update the Route\n" "Destination Point Code\n" @@ -357,7 +363,7 @@ "Specify Destination Linkset\n" "Linkset Name\n" "Specify Priority\n" - "Priority\n" + ROUTE_PRIO_VAR_HELP_STR "Specify QoS Class\n" QOS_CLASS_VAR_HELP_STR, CMD_ATTR_IMMEDIATE) @@ -412,7 +418,9 @@ argind = 3; if (argc > argind && !strcmp(argv[argind], "priority")) { argind++; - rt->cfg.priority = atoi(argv[argind++]); + if (strcmp(argv[argind], "default") != 0) + rt->cfg.priority = atoi(argv[argind]); + argind++; } if (argc > argind && !strcmp(argv[argind], "qos-class")) { @@ -484,7 +492,7 @@ osmo_ss7_pointcode_print(rtable->inst, rt->cfg.pc), osmo_ss7_pointcode_print2(rtable->inst, rt->cfg.mask), rt->cfg.linkset_name); - if (rt->cfg.priority) + if (rt->cfg.priority != OSMO_SS7_ROUTE_PRIO_DEFAULT) vty_out(vty, " priority %u", rt->cfg.priority); if (rt->cfg.qos_class) vty_out(vty, " qos-class %u", rt->cfg.qos_class); diff --git a/src/ss7_internal.h b/src/ss7_internal.h index 623c607..61fe20e 100644 --- a/src/ss7_internal.h +++ b/src/ss7_internal.h @@ -54,6 +54,8 @@ /*********************************************************************** * SS7 Routes ***********************************************************************/ +#define OSMO_SS7_ROUTE_PRIO_DEFAULT 5 + struct osmo_ss7_route * ss7_route_alloc(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask); int ss7_route_set_linkset(struct osmo_ss7_route *rt, const char *linkset_name); diff --git a/tests/vty/osmo_stp_route_prio.vty b/tests/vty/osmo_stp_route_prio.vty index 6cc862a..10833ea 100644 --- a/tests/vty/osmo_stp_route_prio.vty +++ b/tests/vty/osmo_stp_route_prio.vty @@ -65,17 +65,17 @@ OsmoSTP(config-cs7)# ! ADD 2 ROUTES WITH DECREASING PRIORITIES. THEY SHOULD END UP REORDERED BY PRIORITY: OsmoSTP(config-cs7)# route-table system -OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as1 priority 5 -OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as3 -OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as2 priority 2 +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as1 priority 6 +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as2 +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset as3 priority 2 OsmoSTP(config-cs7-rt)# show running-config ... cs7 instance 0 ... route-table system - update route 3.2.1 7.255.7 linkset as3 - update route 3.2.1 7.255.7 linkset as2 priority 2 - update route 3.2.1 7.255.7 linkset as1 priority 5 + update route 3.2.1 7.255.7 linkset as3 priority 2 + update route 3.2.1 7.255.7 linkset as2 + update route 3.2.1 7.255.7 linkset as1 priority 6 ... OsmoSTP(config-cs7-rt)# do show cs7 instance 0 route Routing table = system @@ -83,6 +83,6 @@ Destination C Q P Linkset Name Linkset Non-adj Route ---------------------- - - - ------------------- ------- ------- ------- -3.2.1/14 0 as3 ? ? ? -3.2.1/14 2 as2 ? ? ? -3.2.1/14 5 as1 ? ? ? +3.2.1/14 2 as3 ? ? ? +3.2.1/14 5 as2 ? ? ? +3.2.1/14 6 as1 ? ? ? diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty index 5253b9a..7967216 100644 --- a/tests/vty/osmo_stp_test.vty +++ b/tests/vty/osmo_stp_test.vty @@ -570,7 +570,7 @@ OsmoSTP(config-cs7)# route-table system OsmoSTP(config-cs7-rt)# list ... - update route POINT_CODE MASK linkset LS_NAME [priority] [PRIO] [qos-class] [(<0-7>|default)] + update route POINT_CODE MASK linkset LS_NAME [priority] [(<0-4294967295>|default)] [qos-class] [(<0-7>|default)] remove route POINT_CODE MASK OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass OsmoSTP(config-cs7-rt)# show running-config @@ -587,13 +587,31 @@ ... route-table system ... !update route 3.2.1 7.255.7 linkset my-ass +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority default +OsmoSTP(config-cs7-rt)# show running-config +... +cs7 instance 0 +... + route-table system + update route 3.2.1 7.255.7 linkset my-ass +... +OsmoSTP(config-cs7-rt)# remove route 3.2.1 7.255.7 OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority 5 OsmoSTP(config-cs7-rt)# show running-config ... cs7 instance 0 ... route-table system - update route 3.2.1 7.255.7 linkset my-ass priority 5 + update route 3.2.1 7.255.7 linkset my-ass +... +OsmoSTP(config-cs7-rt)# remove route 3.2.1 7.255.7 +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority 6 +OsmoSTP(config-cs7-rt)# show running-config +... +cs7 instance 0 +... + route-table system + update route 3.2.1 7.255.7 linkset my-ass priority 6 ... OsmoSTP(config-cs7-rt)# remove route 3.2.1 7.255.7 OsmoSTP(config-cs7-rt)# show running-config @@ -601,25 +619,25 @@ cs7 instance 0 ... route-table system -... !update route 3.2.1 7.255.7 linkset my-ass priority 5 -OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority 5 qos-class 1 +... !update route 3.2.1 7.255.7 linkset my-ass priority 6 +OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority 6 qos-class 1 OsmoSTP(config-cs7-rt)# show running-config ... cs7 instance 0 ... route-table system - update route 3.2.1 7.255.7 linkset my-ass priority 5 qos-class 1 + update route 3.2.1 7.255.7 linkset my-ass priority 6 qos-class 1 ... cs7 instance 1 ... route-table system -... !update route 3.2.1 7.255.7 linkset my-ass priority 5 qos-class 1 +... !update route 3.2.1 7.255.7 linkset my-ass priority 6 qos-class 1 OsmoSTP(config-cs7-rt)# remove route 3.2.1 7.255.7 OsmoSTP(config-cs7-rt)# show running-config ... cs7 instance 0 ... route-table system -... !update route 3.2.1 7.255.7 linkset my-ass priority 5 qos-class 1 +... !update route 3.2.1 7.255.7 linkset my-ass priority 6 qos-class 1 OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority % Incomplete command (missing an argument?) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38390?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I4e283cc07b8e9ea2124ec9da18cbce77c3d866ee Gerrit-Change-Number: 38390 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: ss7 vty: Limit route priority range to 1-9
by laforge 15 Oct '24

15 Oct '24
Attention is currently required from: pespin. laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38426?usp=email ) Change subject: ss7 vty: Limit route priority range to 1-9 ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38426?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I36ceee5d7cb1b2287c4a2d7ad67f478843300a0b Gerrit-Change-Number: 38426 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 15 Oct 2024 15:42:19 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-sigtran[master]: ss7 vty: Set default route priority to 5
by laforge 15 Oct '24

15 Oct '24
Attention is currently required from: pespin. laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38390?usp=email ) Change subject: ss7 vty: Set default route priority to 5 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38390?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I4e283cc07b8e9ea2124ec9da18cbce77c3d866ee Gerrit-Change-Number: 38390 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 15 Oct 2024 15:42:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in libosmo-sigtran[master]: ss7 vty: Limit qos-class range to 0-7
by laforge 15 Oct '24

15 Oct '24
Attention is currently required from: pespin. laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38389?usp=email ) Change subject: ss7 vty: Limit qos-class range to 0-7 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38389?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I541723e4551977cb2b7afcac01e3bfee070e7bac Gerrit-Change-Number: 38389 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 15 Oct 2024 15:42:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libosmo-sigtran[master]: ss7 vty: Validate qos-class number being passed to 'update route'
by laforge 15 Oct '24

15 Oct '24
Attention is currently required from: pespin. laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38388?usp=email ) Change subject: ss7 vty: Validate qos-class number being passed to 'update route' ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38388?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Ib81499d5ac692e1de463efe931381bbb68fd1131 Gerrit-Change-Number: 38388 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 15 Oct 2024 15:41:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • ...
  • 164
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.