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
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu
by pespin 21 Oct '24

21 Oct '24
Attention is currently required from: fixeria, osmith, pespin. Hello Jenkins Builder, fixeria, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email to look at the new patch set (#5). The following approvals got outdated and were removed: Code-Review+1 by osmith, Verified+1 by Jenkins Builder Change subject: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu ...................................................................... ggsn: Introduce test TC_pdp4(6)_act_deact_mtu This tests so far only test retrieval of MTU over PCO, which is only used for IPv4 APNs. When IPv6 is in used, it is expected to be retrieved over IPv6 SLAAC RA. Such tests will be done in a follow-up patch once the related procedure is implemented in osmo-ggsn. Related: OS#6298 Related: SYS#7122 Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml M ggsn_tests/gen_links.sh M library/GTPv1C_Templates.ttcn M library/PCO_Types.ttcn 5 files changed, 155 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/38469/5 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 Gerrit-Change-Number: 38469 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Validate MTU sent during ICMPv6 RA
by pespin 21 Oct '24

21 Oct '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38475?usp=email ) Change subject: ggsn: Validate MTU sent during ICMPv6 RA ...................................................................... ggsn: Validate MTU sent during ICMPv6 RA Related: OS#6298 Related: SYS#7122 Change-Id: Ia5bbc5f9e42b02d1b9bd6c4190a2bd439663deeb --- M ggsn_tests/GGSN_Tests.ttcn M library/ICMPv6_Templates.ttcn 2 files changed, 48 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/75/38475/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 5983703..8b1a6e7 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -957,9 +957,14 @@ repeat; } /* We are waiting for RA, update ctx */ - if (match(icmp6, tr_ICMPv6_RA(?, 64))) { - ctx.ip6_prefix := icmp6.routerAdvertisement.options[0].prefixInformation.prefix; - log("RA with /64 prefix ", ctx.ip6_prefix); + if (match(icmp6, tr_ICMPv6_RA(?))) { + for (var integer i := 0; i < lengthof(icmp6.routerAdvertisement.options); i := i + 1) { + var OptionField opt := icmp6.routerAdvertisement.options[i]; + if (ischosen(opt.prefixInformation)) { + ctx.ip6_prefix := opt.prefixInformation.prefix; + log("RA with /64 prefix ", ctx.ip6_prefix); + } + } } } [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } @@ -976,8 +981,15 @@ } /* wait for GGSN to send us an ICMPv6 router advertisement */ - function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { - f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64)); + function f_wait_rtr_adv(PdpContext ctx, template integer mtu := *) runs on GT_CT { + var template (present) OptionField opt_prefix := tr_ICMP6_OptPrefix(?, 64); + var template (present) Options opts; + if (istemplatekind(mtu, "*")) { + opts := ( { opt_prefix }, { opt_prefix, tr_ICMP6_OptMTU(?) } ); + } else { + opts := { opt_prefix, tr_ICMP6_OptMTU(mtu) }; + } + f_wait_icmp6(ctx, tr_ICMPv6_RA(opts)); } /* Wait for ICMPv6 echo request from GTP */ @@ -1094,6 +1106,30 @@ f_shutdown_helper(); } + /* Test PDP context activation for dynamic IPv6 EUA with MTU in router solicitation/advertisement */ + testcase TC_pdp6_act_deact_mtu() runs on GT_CT { + f_init(); + if (m_ggsn_impl == GGSN_IMPL_OSMOCOM) { + f_vty_set_mtu(m_configured_mtu); + } else { + /* In GGSN_IMPL_OPEN5GS we expect open5gs-smfd to be + * configured with mtu value m_configured_mtu */ + } + + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), "1234", c_ApnInet6, valueof(t_EuaIPv6Dyn))); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx, m_configured_mtu); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + if (m_ggsn_impl == GGSN_IMPL_OSMOCOM) { + f_vty_set_mtu(-1); + } + f_shutdown_helper(); + } + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. Test we can send ICMPv6 ping over GTPU to DNS server. */ testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { @@ -1752,6 +1788,10 @@ " vs exp ", tr_PCO_P_UV_U16(m_configured_mtu))); } + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx, m_configured_mtu); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + f_pdp_ctx_del(ctx, '1'B); if (m_ggsn_impl == GGSN_IMPL_OSMOCOM) { f_vty_set_mtu(-1); @@ -2387,6 +2427,7 @@ execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_mtu()); execute(TC_pdp6_act_deact_gtpu_access()); execute(TC_pdp6_act_deact_gtpu_access_ll_saddr()); execute(TC_pdp6_act_deact_gtpu_access_wrong_ll_saddr()); diff --git a/library/ICMPv6_Templates.ttcn b/library/ICMPv6_Templates.ttcn index 687aad4..a77fb62 100644 --- a/library/ICMPv6_Templates.ttcn +++ b/library/ICMPv6_Templates.ttcn @@ -114,7 +114,7 @@ } /* template for receiving/matching an ICMPv6 router advertisement */ - template (present) PDU_ICMPv6 tr_ICMPv6_RA(template (present) OCT16 prefix, template (present) INT1 prefix_len) := { + template (present) PDU_ICMPv6 tr_ICMPv6_RA(template (present) Options options := ?) := { routerAdvertisement := { typeField := 134, code := 0, @@ -126,9 +126,7 @@ routerLifetime := ?, reachableTime := ?, retransTimer := ?, - options := ({ tr_ICMP6_OptPrefix(prefix, prefix_len) }, - { tr_ICMP6_OptPrefix(prefix, prefix_len), tr_ICMP6_OptMTU } - ) + options := options } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38475?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia5bbc5f9e42b02d1b9bd6c4190a2bd439663deeb Gerrit-Change-Number: 38475 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu
by osmith 21 Oct '24

21 Oct '24
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email ) Change subject: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu ...................................................................... Patch Set 4: Code-Review+1 (1 comment) File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/ad2efbbd_5621… : PS3, Line 2360: execute(TC_pdp4_act_deact_mtu()); > the test is expected to be run for open5gs too (it supports sending MTU), but it's true I need to wr […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 Gerrit-Change-Number: 38469 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Oct 2024 09:33:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu
by pespin 21 Oct '24

21 Oct '24
Attention is currently required from: fixeria, pespin. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Verified+1 by Jenkins Builder Change subject: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu ...................................................................... ggsn: Introduce test TC_pdp4(6)_act_deact_mtu This tests so far only test retrieval of MTU over PCO, which is only used for IPv4 APNs. When IPv6 is in used, it is expected to be retrieved over IPv6 SLAAC RA. Such tests will be done in a follow-up patch once the related procedure is implemented in osmo-ggsn. Related: OS#6298 Related: SYS#7122 Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M library/GTPv1C_Templates.ttcn M library/PCO_Types.ttcn 4 files changed, 153 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/38469/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 Gerrit-Change-Number: 38469 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu
by osmith 21 Oct '24

21 Oct '24
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email ) Change subject: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu ...................................................................... Patch Set 3: (3 comments) File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/5dc9e721_d0b4… : PS3, Line 248: f_vty_transceive(GGSNVTY, "apn internet"); > Hmm I copied this from f_vty_set_gpdu_txseq(), which seems to be executed on all tests, are you sure […] Looking at the configs again, the APNs have "no shutdown" at the end to enable them. Looks like osmo-ggsn doesn't fail if you run "mtu ..." on an apn that was not previously defined, so the additional ifs then are not strictly needed. https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/ef7ea30c_c0fc… : PS3, Line 252: f_vty_transceive(GGSNVTY, "apn inet6"); > if (m_ggsn_conf == GGSN_CONF_ALL || m_ggsn_conf == GGSN_CONF_V6_ONLY) { not needed https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/3f9ffea0_cdf0… : PS3, Line 256: f_vty_transceive(GGSNVTY, "apn inet46"); > if (m_ggsn_conf == GGSN_CONF_ALL || m_ggsn_conf == GGSN_CONF_V4V6_ONLY) { not needed -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 Gerrit-Change-Number: 38469 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Oct 2024 09:07:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu
by pespin 21 Oct '24

21 Oct '24
Attention is currently required from: osmith. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email ) Change subject: ggsn: Introduce test TC_pdp4(6)_act_deact_mtu ...................................................................... Patch Set 3: (3 comments) File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/9d88e1e9_a67c… : PS3, Line 248: f_vty_transceive(GGSNVTY, "apn internet"); > "apn internet" is in "all" and "v4_only" configs, see the confmerge files here: […] Hmm I copied this from f_vty_set_gpdu_txseq(), which seems to be executed on all tests, are you sure about what you say? Maybe it needs to be fixed there too? https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/c1b0d58b_be7f… : PS3, Line 2360: execute(TC_pdp4_act_deact_mtu()); > wrap in `if (m_ggsn_impl == GGSN_IMPL_OSMOCOM) {`, and same below for `TC_pdp46_act_deact_mtu`, sinc […] the test is expected to be run for open5gs too (it supports sending MTU), but it's true I need to wrap the vty functions in GGSN_IMPL_OSMOCOM. File library/GTPv1C_Templates.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469/comment/80fc9502_4f12… : PS3, Line 1229: > unrelated change Acknowledged -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I2ceb76a3a07b44f69937c9f5a040482320bca377 Gerrit-Change-Number: 38469 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Oct 2024 09:01:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
1 0
0 0
[XS] Change in libgtpnl[master]: build: fix bashims in configure.ac
by pespin 21 Oct '24

21 Oct '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/libgtpnl/+/38474?usp=email ) Change subject: build: fix bashims in configure.ac ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libgtpnl/+/38474?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libgtpnl Gerrit-Branch: master Gerrit-Change-Id: I2c0a62ab80f480502dd2a1bcf4aef71e70152ea6 Gerrit-Change-Number: 38474 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Oct 2024 08:51:19 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in libgtpnl[master]: Revert `configure: regular_C(PP)FLAGS -> C(PP)FLAGS`
by pespin 21 Oct '24

21 Oct '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/libgtpnl/+/38473?usp=email ) Change subject: Revert `configure: regular_C(PP)FLAGS -> C(PP)FLAGS` ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libgtpnl/+/38473?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libgtpnl Gerrit-Branch: master Gerrit-Change-Id: I5cc30885cec564346997269b51decbbe49548ddf Gerrit-Change-Number: 38473 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Oct 2024 08:51:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-ggsn[master]: Move apn allocation code out of vty file
by pespin 21 Oct '24

21 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38454?usp=email ) Change subject: Move apn allocation code out of vty file ...................................................................... Move apn allocation code out of vty file The details of creation of data structures don't belong on the vty file. While at it, split allocation code into its own function to quickly find out where the allocation of the object happens. Change-Id: If15a4158dd6599341017efd24dbf67ca565a7c34 --- M ggsn/ggsn.c M ggsn/ggsn_vty.c 2 files changed, 36 insertions(+), 30 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index a6cfc58..9e33b50 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -94,6 +94,42 @@ } } +static struct apn_ctx *apn_alloc(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + apn = talloc_zero(ggsn, struct apn_ctx); + OSMO_ASSERT(apn); + + apn->ggsn = ggsn; + apn->cfg.name = talloc_strdup(apn, name); + apn->cfg.shutdown = true; + apn->cfg.tx_gpdu_seq = true; + INIT_LLIST_HEAD(&apn->cfg.name_list); + + llist_add_tail(&apn->list, &ggsn->apn_list); + return apn; +} + +struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn; + + llist_for_each_entry(apn, &ggsn->apn_list, list) { + if (!strcmp(apn->cfg.name, name)) + return apn; + } + return NULL; +} + +struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) +{ + struct apn_ctx *apn = ggsn_find_apn(ggsn, name); + if (!apn) + apn = apn_alloc(ggsn, name); + return apn; +} + int apn_stop(struct apn_ctx *apn) { LOGPAPN(LOGL_NOTICE, apn, "Stopping\n"); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index da67591..82eff3e 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -90,36 +90,6 @@ return ggsn; } -struct apn_ctx *ggsn_find_apn(struct ggsn_ctx *ggsn, const char *name) -{ - struct apn_ctx *apn; - - llist_for_each_entry(apn, &ggsn->apn_list, list) { - if (!strcmp(apn->cfg.name, name)) - return apn; - } - return NULL; -} - -struct apn_ctx *ggsn_find_or_create_apn(struct ggsn_ctx *ggsn, const char *name) -{ - struct apn_ctx *apn = ggsn_find_apn(ggsn, name); - if (apn) - return apn; - - apn = talloc_zero(ggsn, struct apn_ctx); - if (!apn) - return NULL; - apn->ggsn = ggsn; - apn->cfg.name = talloc_strdup(apn, name); - apn->cfg.shutdown = true; - apn->cfg.tx_gpdu_seq = true; - INIT_LLIST_HEAD(&apn->cfg.name_list); - - llist_add_tail(&apn->list, &ggsn->apn_list); - return apn; -} - /* GGSN Node */ static struct cmd_node ggsn_node = { -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38454?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: If15a4158dd6599341017efd24dbf67ca565a7c34 Gerrit-Change-Number: 38454 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ggsn[master]: Move ggsn allocation code out of vty file
by pespin 21 Oct '24

21 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38455?usp=email ) Change subject: Move ggsn allocation code out of vty file ...................................................................... Move ggsn allocation code out of vty file The details of creation of data structures don't belong on the vty file. While at it, split allocation code into its own function to quickly find out where the allocation of the object happens. Change-Id: Iaa4cd86c44957321c238d268ea62daafa1b79c69 --- M ggsn/ggsn.c M ggsn/ggsn_vty.c 2 files changed, 36 insertions(+), 33 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9e33b50..8fa0f74 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -879,6 +879,42 @@ return sgsn_peer_handle_recovery(sgsn, pdp, recovery); } +static struct ggsn_ctx *ggsn_alloc(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn; + + ggsn = talloc_zero(ctx, struct ggsn_ctx); + OSMO_ASSERT(ggsn); + + ggsn->cfg.name = talloc_strdup(ggsn, name); + ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); + ggsn->cfg.shutdown = true; + INIT_LLIST_HEAD(&ggsn->apn_list); + INIT_LLIST_HEAD(&ggsn->sgsn_list); + + llist_add_tail(&ggsn->list, &g_ggsn_list); + return ggsn; +} + +struct ggsn_ctx *ggsn_find(const char *name) +{ + struct ggsn_ctx *ggsn; + + llist_for_each_entry(ggsn, &g_ggsn_list, list) { + if (!strcmp(ggsn->cfg.name, name)) + return ggsn; + } + return NULL; +} + +struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) +{ + struct ggsn_ctx *ggsn = ggsn_find(name); + if (!ggsn) + ggsn = ggsn_alloc(ctx, name); + return ggsn; +} + /* Start a given GGSN */ int ggsn_start(struct ggsn_ctx *ggsn) { diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 82eff3e..68d2cdc 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -57,39 +57,6 @@ APN_NODE, }; -struct ggsn_ctx *ggsn_find(const char *name) -{ - struct ggsn_ctx *ggsn; - - llist_for_each_entry(ggsn, &g_ggsn_list, list) { - if (!strcmp(ggsn->cfg.name, name)) - return ggsn; - } - return NULL; -} - -struct ggsn_ctx *ggsn_find_or_create(void *ctx, const char *name) -{ - struct ggsn_ctx *ggsn; - - ggsn = ggsn_find(name); - if (ggsn) - return ggsn; - - ggsn = talloc_zero(ctx, struct ggsn_ctx); - if (!ggsn) - return NULL; - - ggsn->cfg.name = talloc_strdup(ggsn, name); - ggsn->cfg.state_dir = talloc_strdup(ggsn, "/tmp"); - ggsn->cfg.shutdown = true; - INIT_LLIST_HEAD(&ggsn->apn_list); - INIT_LLIST_HEAD(&ggsn->sgsn_list); - - llist_add_tail(&ggsn->list, &g_ggsn_list); - return ggsn; -} - /* GGSN Node */ static struct cmd_node ggsn_node = { -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38455?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: Iaa4cd86c44957321c238d268ea62daafa1b79c69 Gerrit-Change-Number: 38455 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • ...
  • 164
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.