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 -----
  • 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

July 2025

  • 1 participants
  • 1492 discussions
[S] Change in osmo-ttcn3-hacks[master]: SGSN: Iu: use correct service request type
by daniel 15 Jul '25

15 Jul '25
Attention is currently required from: lynxis lazus. daniel has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?usp=email ) Change subject: SGSN: Iu: use correct service request type ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?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: Ia47edd8ca916cf377da875583a3c4eb6ff5f1f52 Gerrit-Change-Number: 40649 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Tue, 15 Jul 2025 15:37:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-sgsn[master]: routing area: introduce ran_type on the RA
by lynxis lazus 15 Jul '25

15 Jul '25
Attention is currently required from: lynxis lazus. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40688?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: routing area: introduce ran_type on the RA ...................................................................... routing area: introduce ran_type on the RA A Routing Area should be unique identified by the RAI. Following this, it is forbidden to have a RAI which is valid in both, GERAN and UTRAN. Change-Id: I59c35f1a4912ff11574bb31e4fe424816993548c --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c M tests/gprs_routing_area/gprs_routing_area_test.c 3 files changed, 74 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/88/40688/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40688?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I59c35f1a4912ff11574bb31e4fe424816993548c Gerrit-Change-Number: 40688 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: SGSN: Iu: use correct service request type
by pespin 15 Jul '25

15 Jul '25
Attention is currently required from: daniel, lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?usp=email ) Change subject: SGSN: Iu: use correct service request type ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?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: Ia47edd8ca916cf377da875583a3c4eb6ff5f1f52 Gerrit-Change-Number: 40649 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Tue, 15 Jul 2025 15:29:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: SGSN: Iu: use correct service request type
by lynxis lazus 15 Jul '25

15 Jul '25
Attention is currently required from: daniel, lynxis lazus, pespin. Hello Jenkins Builder, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+1 by pespin, Verified+1 by Jenkins Builder Change subject: SGSN: Iu: use correct service request type ...................................................................... SGSN: Iu: use correct service request type When the UE wants to transfer data, the Service Request must have the type data. Remove the default of f_service_request() to force explicit defining it. Change-Id: Ia47edd8ca916cf377da875583a3c4eb6ff5f1f52 --- M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests_Iu.ttcn 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/40649/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40649?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: Ia47edd8ca916cf377da875583a3c4eb6ff5f1f52 Gerrit-Change-Number: 40649 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-sgsn[master]: routing area: on alloc, check if RA already exists
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40691?usp=email ) Change subject: routing area: on alloc, check if RA already exists ...................................................................... routing area: on alloc, check if RA already exists If the RA is the same, return the RA, but if the ran type is different, return NULL. Change-Id: I6955a09d9d8f3ba4dc3a14d7ed5cd9798d929c61 --- M src/sgsn/gprs_routing_area.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/91/40691/1 diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 3c84008..5c465d9 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -80,7 +80,21 @@ struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type) { - struct sgsn_ra *ra; + struct sgsn_ra *ra = sgsn_ra_get_ra(rai); + + if (ra) { + if (ra->ran_type == ran_type) { + LOGP(DRA, LOGL_ERROR, "Trying to create an already existing RA %s with the same ran type %s. Using old RA.\n", + osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + + return ra; + } + + LOGP(DRA, LOGL_ERROR, "Failed to create an already existing RA %s with a different ran type %s.\n", + osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + return NULL; + } + ra = talloc_zero(sgsn->routing_area, struct sgsn_ra); if (!ra) return NULL; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40691?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I6955a09d9d8f3ba4dc3a14d7ed5cd9798d929c61 Gerrit-Change-Number: 40691 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[XS] Change in osmo-sgsn[master]: routing area: sgsn_ra_geran_page_ra: make argument rai const
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40693?usp=email ) Change subject: routing area: sgsn_ra_geran_page_ra: make argument rai const ...................................................................... routing area: sgsn_ra_geran_page_ra: make argument rai const The second argument mmctx can't made const because of the paging info, which uses non-const fields. Change-Id: I21d7e66e433f2b891c94bae91697aa46198fb20c --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/93/40693/1 diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index feb2733..ddfe41f 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -120,4 +120,4 @@ int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *rai, sgsn_ra_cb_t *cb, void *cb_data); /* Page the whole routing area for this mmctx */ -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); +int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index eb595e9..429ad68 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -384,7 +384,7 @@ return found ? 0 : -ENOENT; } -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) +int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40693?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I21d7e66e433f2b891c94bae91697aa46198fb20c Gerrit-Change-Number: 40693 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-sgsn[master]: routing area: add LOGRA() logging macro
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40692?usp=email ) Change subject: routing area: add LOGRA() logging macro ...................................................................... routing area: add LOGRA() logging macro Prepend the routing area in the log message. Change-Id: Ib287b70c34b21ce64bc864f69fcf6af5fa0698b9 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 24 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/92/40692/1 diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 018e986..feb2733 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -9,6 +9,18 @@ #include <osmocom/core/utils.h> #include <osmocom/gsm/gsm23003.h> +/* rai -> struct osmo_routing_area_id * */ +#define LOGRAI(level, rai, fmt, args...) \ + do {\ + char __log_rai_buf[32]; \ + osmo_rai_name2_buf(__log_rai_buf, sizeof(__log_rai_buf), rai); \ + LOGP(DRA, level, "RA(%s) " fmt, __log_rai_buf, ## args); \ + } while (0) + +/* ra -> struct sgsn_ra * */ +#define LOGRA(level, ra, fmt, args...) \ + LOGRAI(level, (&(ra)->rai), fmt, ## args) + struct sgsn_instance; struct sgsn_mm_ctx; diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 5c465d9..eb595e9 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -84,14 +84,14 @@ if (ra) { if (ra->ran_type == ran_type) { - LOGP(DRA, LOGL_ERROR, "Trying to create an already existing RA %s with the same ran type %s. Using old RA.\n", - osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + LOGRAI(LOGL_ERROR, rai, "Trying to create an already existing RA with the same ran type %s. Using old RA.\n", + get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); return ra; } - LOGP(DRA, LOGL_ERROR, "Failed to create an already existing RA %s with a different ran type %s.\n", - osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + LOGRAI(LOGL_ERROR, rai, "Failed to create an already existing RA with a different ran type %s.\n", + get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); return NULL; } @@ -311,8 +311,8 @@ if (cell && cell->ran_type == RA_TYPE_GERAN_Gb) { /* Cell already exist, update NSEI/BVCI */ if (cell->u.geran.bvci != bvci || cell->u.geran.nsei != nsei) { - LOGP(DRA, LOGL_INFO, "GERAN Cell changed DLCI. Old: nsei/bvci %05u/%05u New: nsei/bvci %05u/%05u\n", - cell->u.geran.nsei, cell->u.geran.bvci, nsei, bvci); + LOGRA(LOGL_INFO, ra, "GERAN Cell changed DLCI. Old: nsei/bvci %05u/%05u New: nsei/bvci %05u/%05u\n", + cell->u.geran.nsei, cell->u.geran.bvci, nsei, bvci); cell->u.geran.bvci = bvci; cell->u.geran.nsei = nsei; } @@ -321,7 +321,7 @@ if (cell && cell->ran_type != RA_TYPE_GERAN_Gb) { /* How can we have here a RA change? Must be a configuration error. */ - LOGP(DRA, LOGL_INFO, "CGI %s: RAN change detected to GERAN!", osmo_cgi_ps_name(cgi_ps)); + LOGRAI(LOGL_INFO, &cgi_ps->rai, "CGI %s: RAN change detected to GERAN!", osmo_cgi_ps_name(cgi_ps)); _sgsn_ra_cell_free(cell, false); cell = NULL; } @@ -333,10 +333,10 @@ * This should only happen when a Cell is changing routing areas */ cell = sgsn_ra_get_cell_by_lai(&cgi_ps->rai.lac, cgi_ps->cell_identity); if (cell) { - LOGP(DRA, LOGL_INFO, "CGI %s: changed Routing Area. Old: %s, New: %s\n", - osmo_cgi_ps_name(cgi_ps), - osmo_rai_name2_buf(old_ra, sizeof(old_ra), &cell->ra->rai), - osmo_rai_name2_buf(new_ra, sizeof(new_ra), &cgi_ps->rai)); + LOGRAI(LOGL_INFO, &cgi_ps->rai, "CGI %s: changed Routing Area. Old: %s, New: %s\n", + osmo_cgi_ps_name(cgi_ps), + osmo_rai_name2_buf(old_ra, sizeof(old_ra), &cell->ra->rai), + osmo_rai_name2_buf(new_ra, sizeof(new_ra), &cgi_ps->rai)); OSMO_ASSERT(cell->ra != ra); @@ -351,7 +351,7 @@ if (!cell) return -ENOMEM; - LOGP(DRA, LOGL_INFO, "New cell registered %s via nsei/bvci %05u/%05u\n", osmo_cgi_ps_name(cgi_ps), nsei, bvci); + LOGRA(LOGL_INFO, ra, "New cell registered %s via nsei/bvci %05u/%05u\n", osmo_cgi_ps_name(cgi_ps), nsei, bvci); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40692?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ib287b70c34b21ce64bc864f69fcf6af5fa0698b9 Gerrit-Change-Number: 40692 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-sgsn[master]: routing area: move cell.cell_id behind a geran union
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40690?usp=email ) Change subject: routing area: move cell.cell_id behind a geran union ...................................................................... routing area: move cell.cell_id behind a geran union To prepare for Iu support, use the SGSN RA cell for both, a GERAN Cell and a UTRAN Service Area. Change-Id: I0c24d98dd699748842dca271b93e58d27cf02285 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/90/40690/1 diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index a484a10..018e986 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -56,13 +56,13 @@ struct sgsn_ra *ra; enum sgsn_ra_ran_type ran_type; - - uint16_t cell_id; union { struct { uint16_t nsei; uint16_t bvci; + uint16_t cell_id; } geran; + struct { /* TODO: unused */ uint16_t rncid; diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 1c27310..3c84008 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -101,8 +101,8 @@ return NULL; cell->ra = ra; - cell->cell_id = cell_id; cell->ran_type = RA_TYPE_GERAN_Gb; + cell->u.geran.cell_id = cell_id; cell->u.geran.bvci = bvci; cell->u.geran.nsei = nsei; @@ -206,7 +206,10 @@ return NULL; llist_for_each_entry(cell, &ra->cells, list) { - if (cell->cell_id == cell_id) + if (cell->ran_type != RA_TYPE_GERAN_Gb) + continue; + + if (cell->u.geran.cell_id == cell_id) return cell; } @@ -229,7 +232,10 @@ continue; llist_for_each_entry(cell, &ra->cells, list) { - if (cell->cell_id == cell_id) + if (cell->ran_type != RA_TYPE_GERAN_Gb) + continue; + + if (cell->u.geran.cell_id == cell_id) return cell; } } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40690?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I0c24d98dd699748842dca271b93e58d27cf02285 Gerrit-Change-Number: 40690 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-sgsn[master]: use variable name rai for `struct osmo_routing_area_id`
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40689?usp=email ) Change subject: use variable name rai for `struct osmo_routing_area_id` ...................................................................... use variable name rai for `struct osmo_routing_area_id` Be consistent with variable naming if a single `struct osmo_routing_area_id *` area id is used. Change-Id: I946983d4857035e06c68af378654466b35025014 --- M include/osmocom/sgsn/gprs_routing_area.h M include/osmocom/sgsn/gprs_sndcp.h M include/osmocom/sgsn/gtp.h M src/sgsn/gprs_bssgp.c M src/sgsn/gprs_gmm.c M src/sgsn/gprs_routing_area.c M src/sgsn/gprs_sndcp.c M src/sgsn/sgsn_libgtp.c M tests/gprs_routing_area/gprs_routing_area_test.c 9 files changed, 57 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/89/40689/1 diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 6629169..a484a10 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -89,8 +89,8 @@ struct sgsn_ra_cell *sgsn_ra_get_cell_by_cgi(const struct osmo_cell_global_id *cgi); struct sgsn_ra_cell *sgsn_ra_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id); struct sgsn_ra_cell *sgsn_ra_get_cell_by_gb(uint16_t nsei, uint16_t bvci); -struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *ra_id); -struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *ra_id); +struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *rai); +struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *rai); /* @@ -108,4 +108,4 @@ int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *rai, sgsn_ra_cb_t *cb, void *cb_data); /* Page the whole routing area for this mmctx */ -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *ra_id, struct sgsn_mm_ctx *mmctx); +int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); diff --git a/include/osmocom/sgsn/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h index 058cb29..e576e1f 100644 --- a/include/osmocom/sgsn/gprs_sndcp.h +++ b/include/osmocom/sgsn/gprs_sndcp.h @@ -47,7 +47,7 @@ struct llist_head list; /* FIXME: move this RA_ID up to the LLME or even higher */ - struct osmo_routing_area_id ra_id; + struct osmo_routing_area_id rai; /* reference to the LLC Entity below this SNDCP entity */ struct gprs_llc_lle *lle; /* The NSAPI we shall use on top of LLC */ diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h index ed6cbf5..0f77a18 100644 --- a/include/osmocom/sgsn/gtp.h +++ b/include/osmocom/sgsn/gtp.h @@ -23,7 +23,7 @@ uint16_t nsapi, struct tlv_parsed *tp); -int sgsn_gtp_data_req(struct osmo_routing_area_id *ra_id, int32_t tlli, uint8_t nsapi, +int sgsn_gtp_data_req(struct osmo_routing_area_id *rai, int32_t tlli, uint8_t nsapi, struct msgb *msg, uint32_t npdu_len, uint8_t *npdu); int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx); int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx); diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c index e738f0b..58aeb75 100644 --- a/src/sgsn/gprs_bssgp.c +++ b/src/sgsn/gprs_bssgp.c @@ -54,7 +54,7 @@ int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph) { struct osmo_bssgp_prim *bp; - struct osmo_routing_area_id ra_id = {}; + struct osmo_routing_area_id rai = {}; bp = container_of(oph, struct osmo_bssgp_prim, oph); switch (oph->sap) { @@ -65,12 +65,12 @@ } break; case SAP_BSSGP_GMM: - gprs_rai_to_osmo(&ra_id, bp->ra_id); + gprs_rai_to_osmo(&rai, bp->ra_id); switch (oph->primitive) { case PRIM_BSSGP_GMM_SUSPEND: - return gprs_gmm_rx_suspend(&ra_id, bp->tlli); + return gprs_gmm_rx_suspend(&rai, bp->tlli); case PRIM_BSSGP_GMM_RESUME: - return gprs_gmm_rx_resume(&ra_id, bp->tlli, + return gprs_gmm_rx_resume(&rai, bp->tlli, bp->u.resume.suspend_ref); } break; diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index 1fa73b9..4c32fd8 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -1249,7 +1249,7 @@ uint8_t msnc_len, att_type, mi_len, ms_ra_acc_cap_len; uint16_t drx_par; char mi_log_string[32]; - struct osmo_routing_area_id ra_id; + struct osmo_routing_area_id rai; uint16_t cid = 0; enum gsm48_gmm_cause reject_cause; struct osmo_mobile_identity mi; @@ -1264,10 +1264,10 @@ if (!MSG_IU_UE_CTX(msg)) { /* Gb mode */ - bssgp_parse_cell_id2(&ra_id, &cid, msgb_bcid(msg), 8); + bssgp_parse_cell_id2(&rai, &cid, msgb_bcid(msg), 8); } else { #ifdef BUILD_IU - gprs_rai_to_osmo(&ra_id, &MSG_IU_UE_CTX(msg)->ra_id); + gprs_rai_to_osmo(&rai, &MSG_IU_UE_CTX(msg)->ra_id); #else LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); return -ENOTSUP; @@ -1330,7 +1330,7 @@ if (MSG_IU_UE_CTX(msg)) ctx = sgsn_mm_ctx_alloc_iu(MSG_IU_UE_CTX(msg)); else - ctx = sgsn_mm_ctx_alloc_gb(0, &ra_id); + ctx = sgsn_mm_ctx_alloc_gb(0, &rai); if (!ctx) { reject_cause = GMM_CAUSE_NET_FAIL; goto rejected; @@ -1348,7 +1348,7 @@ if (MSG_IU_UE_CTX(msg)) ctx = sgsn_mm_ctx_alloc_iu(MSG_IU_UE_CTX(msg)); else - ctx = sgsn_mm_ctx_alloc_gb(msgb_tlli(msg), &ra_id); + ctx = sgsn_mm_ctx_alloc_gb(msgb_tlli(msg), &rai); if (!ctx) { reject_cause = GMM_CAUSE_NET_FAIL; goto rejected; @@ -1372,7 +1372,7 @@ } msgid2mmctx(ctx, msg); /* Update MM Context with currient RA and Cell ID */ - ctx->ra = ra_id; + ctx->ra = rai; if (ctx->ran_type == MM_CTX_T_GERAN_Gb) ctx->gb.cell_id = cid; diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 23847f2..1c27310 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -111,20 +111,20 @@ return cell; } -struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *ra_id) +struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *rai) { struct sgsn_ra *ra; llist_for_each_entry(ra, &sgsn->routing_area->ra_list, list) - if (osmo_rai_cmp(&ra->rai, ra_id) == 0) + if (osmo_rai_cmp(&ra->rai, rai) == 0) return ra; return NULL; } -struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *ra_id) +struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *rai) { - struct sgsn_ra *ra = sgsn_ra_get_ra(ra_id); + struct sgsn_ra *ra = sgsn_ra_get_ra(rai); if (!ra) return ra; @@ -184,13 +184,13 @@ return ret; } -int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *ra_id, sgsn_ra_cb_t *cb, void *cb_data) +int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *rai, sgsn_ra_cb_t *cb, void *cb_data) { struct sgsn_ra *ra; - OSMO_ASSERT(ra_id); + OSMO_ASSERT(rai); OSMO_ASSERT(cb); - ra = sgsn_ra_get_ra(ra_id); + ra = sgsn_ra_get_ra(rai); if (!ra) return -ENOENT; @@ -364,7 +364,7 @@ return found ? 0 : -ENOENT; } -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *ra_id, struct sgsn_mm_ctx *mmctx) +int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; @@ -372,7 +372,7 @@ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS)); - ra = sgsn_ra_get_ra_geran(ra_id); + ra = sgsn_ra_get_ra_geran(rai); if (!ra) return -ENOENT; diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c index 636fe2e..f25969c 100644 --- a/src/sgsn/gprs_sndcp.c +++ b/src/sgsn/gprs_sndcp.c @@ -834,9 +834,9 @@ return -EIO; } /* FIXME: move this RA_ID up to the LLME or even higher */ - bssgp_parse_cell_id2(&sne->ra_id, NULL, msgb_bcid(msg), 8); + bssgp_parse_cell_id2(&sne->rai, NULL, msgb_bcid(msg), 8); - mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &sne->ra_id); + mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &sne->rai); if (!mmctx) { LOGP(DSNDCP, LOGL_ERROR, "Message for non-existing MM ctx " "(lle=%p, TLLI=%08x, SAPI=%u, NSAPI=%u)\n", @@ -895,7 +895,7 @@ struct msgb *msg, uint32_t npdu_len, uint8_t *npdu) { /* Hand it off N-PDU to the correct GTP tunnel + GGSN: */ - return sgsn_gtp_data_req(&sne->ra_id, sne->lle->llme->tlli, + return sgsn_gtp_data_req(&sne->rai, sne->lle->llme->tlli, sne->nsapi, msg, npdu_len, npdu); } diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index af64738..edfe250 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -144,7 +144,7 @@ uint16_t nsapi, struct tlv_parsed *tp) { - struct osmo_routing_area_id raid = {}; + struct osmo_routing_area_id rai = {}; struct sgsn_pdp_ctx *pctx; struct pdp_t *pdp; uint64_t imsi_ui64; @@ -273,10 +273,10 @@ /* Routing Area Identifier with LAC and RAC fixed values, as * requested in 29.006 7.3.1 */ - raid = mmctx->ra; - raid.lac.lac = 0xFFFE; - raid.rac = 0xFF; - osmo_routing_area_id_encode_buf(pdp->rai.v, pdp->rai.l, &raid); + rai = mmctx->ra; + rai.lac.lac = 0xFFFE; + rai.rac = 0xFF; + osmo_routing_area_id_encode_buf(pdp->rai.v, pdp->rai.l, &rai); /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; @@ -894,14 +894,14 @@ } /* Called by SNDCP when it has received/re-assembled a N-PDU */ -int sgsn_gtp_data_req(struct osmo_routing_area_id *ra_id, int32_t tlli, uint8_t nsapi, +int sgsn_gtp_data_req(struct osmo_routing_area_id *rai, int32_t tlli, uint8_t nsapi, struct msgb *msg, uint32_t npdu_len, uint8_t *npdu) { struct sgsn_mm_ctx *mmctx; struct sgsn_pdp_ctx *pdp; /* look-up the MM context for this message */ - mmctx = sgsn_mm_ctx_by_tlli(tlli, ra_id); + mmctx = sgsn_mm_ctx_by_tlli(tlli, rai); if (!mmctx) { LOGP(DGPRS, LOGL_ERROR, "Cannot find MM CTX for TLLI %08x\n", tlli); diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index 6021d81..f65559c 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -64,7 +64,7 @@ static void test_routing_area_create(void) { struct sgsn_ra *ra; - struct osmo_routing_area_id raid = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 23 @@ -75,7 +75,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -91,7 +91,7 @@ struct sgsn_ra *ra; struct sgsn_ra_cell *cell_a; - struct osmo_routing_area_id raid = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 24 @@ -105,7 +105,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -117,7 +117,7 @@ sgsn_ra_free(ra); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -137,7 +137,7 @@ { struct sgsn_ra *ra_a, *ra_b; struct sgsn_ra_cell *cell_a, *cell_b; - struct osmo_routing_area_id ra_id = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 24 @@ -147,11 +147,11 @@ uint16_t cell_id = 9999, cell_id_not_found = 44; struct osmo_cell_global_id_ps cgi_ps = { - .rai = ra_id, + .rai = rai, .cell_identity = cell_id, }; struct osmo_cell_global_id cgi = { - .lai = ra_id.lac, + .lai = rai.lac, .cell_identity = cell_id }; @@ -160,11 +160,11 @@ printf("Testing Routing Area find\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); - ra_b = sgsn_ra_get_ra(&ra_id); + ra_b = sgsn_ra_get_ra(&rai); OSMO_ASSERT(ra_a == ra_b); cell_a = sgsn_ra_cell_alloc_geran(ra_a, cell_id, nsei, bvci); @@ -194,7 +194,7 @@ cgi.cell_identity = cell_id_not_found; cgi_ps.cell_identity = cell_id_not_found; - ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -216,12 +216,12 @@ /* try to find for a different RAC */ cgi_ps.rai.rac = 45; - ra_id.rac = 46; + rai.rac = 46; cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(!cell_b); - ra_b = sgsn_ra_get_ra(&ra_id); + ra_b = sgsn_ra_get_ra(&rai); OSMO_ASSERT(!ra_b); /* try to find for different LAC */ @@ -239,7 +239,7 @@ { struct sgsn_ra *ra_a; struct sgsn_ra_cell *cell_a, *cell_b; - struct osmo_routing_area_id ra_id = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 24 @@ -249,11 +249,11 @@ uint16_t cell_id = 9999; struct osmo_cell_global_id_ps cgi_ps = { - .rai = ra_id, + .rai = rai, .cell_identity = cell_id, }; struct osmo_cell_global_id cgi = { - .lai = ra_id.lac, + .lai = rai.lac, .cell_identity = cell_id }; @@ -263,7 +263,7 @@ printf("Testing Routing Area BSSGP BVC RESET IND\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); OSMO_ASSERT(llist_count(&ra_a->cells) == 0); @@ -299,7 +299,7 @@ void test_routing_area_nsei_free(void) { struct sgsn_ra *ra_a; - struct osmo_routing_area_id ra_id = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 24 @@ -309,7 +309,7 @@ uint16_t cell_id = 9999; struct osmo_cell_global_id_ps cgi_ps = { - .rai = ra_id, + .rai = rai, .cell_identity = cell_id, }; @@ -375,7 +375,7 @@ void test_routing_area_paging(void) { struct sgsn_mm_ctx *mmctx; - struct osmo_routing_area_id ra_id = { + struct osmo_routing_area_id rai = { .lac = { .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, .lac = 24 @@ -385,7 +385,7 @@ uint16_t cell_id = 9999; struct osmo_cell_global_id_ps cgi_ps = { - .rai = ra_id, + .rai = rai, .cell_identity = cell_id, }; @@ -414,9 +414,9 @@ g_paging[1].valid = true; g_paging[1].paged = false; - mmctx = sgsn_mm_ctx_alloc_gb(0xc0001234, &ra_id); + mmctx = sgsn_mm_ctx_alloc_gb(0xc0001234, &rai); - sgsn_ra_geran_page_ra(&ra_id, mmctx); + sgsn_ra_geran_page_ra(&rai, mmctx); check_paging(); sgsn_mm_ctx_cleanup_free(mmctx); -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40689?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I946983d4857035e06c68af378654466b35025014 Gerrit-Change-Number: 40689 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[M] Change in osmo-sgsn[master]: routing area: introduce ran_type on the RA
by lynxis lazus 15 Jul '25

15 Jul '25
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40688?usp=email ) Change subject: routing area: introduce ran_type on the RA ...................................................................... routing area: introduce ran_type on the RA A Routing Area should be unique identified by the RAI. Following this, it is forbidden to have a RAI which is valid in both, GERAN and UTRAN. Change-Id: I59c35f1a4912ff11574bb31e4fe424816993548c --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c M tests/gprs_routing_area/gprs_routing_area_test.c 3 files changed, 73 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/88/40688/1 diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index caaed47..6629169 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -6,6 +6,7 @@ #include <stdint.h> #include <osmocom/core/linuxlist.h> +#include <osmocom/core/utils.h> #include <osmocom/gsm/gsm23003.h> struct sgsn_instance; @@ -16,18 +17,35 @@ struct llist_head ra_list; }; +enum sgsn_ra_ran_type { + RA_TYPE_GERAN_Gb, + RA_TYPE_UTRAN_Iu, +}; + +extern const struct value_string sgsn_ra_ran_type_names[]; + struct sgsn_ra { /* Entry in sgsn_ra_global->ra_list */ struct llist_head list; struct osmo_routing_area_id rai; - /* cells contains a list of sgsn_ra_cells which are alive */ - struct llist_head cells; -}; -enum sgsn_ra_ran_type { - RA_TYPE_GERAN_Gb, - RA_TYPE_UTRAN_Iu, + /* For GERAN: every PCU is connected to the SGSN. It allows the SGSN to know every single cell + * and for routing, the SGSN must know to which PCU a given cell is connected. + * It is possible that 2x PCU serves the same Routing Area + * + * For UTRAN: only the RNC (HNB via HNBGW) is communicating with the SGSN. + * The SGSN doesn't know every cell, because they aren't accepted individual by the SGSN. + * The SGSN only "knows" RAI/SAI if they has been used. In the future it would be a good idea to + * allow configuring RA in the vty/config as well. + * Similar to the GERAN Cell, but iu_client doesn't notify us for every given SAI, only for RAC. + * Further the SGSN doesn't get informed about Service Area and can't relate the SAI to a given UE. + * For UTRAN only do a LAC/RAC <> RNC relation and don't have a specific cell relation. + */ + enum sgsn_ra_ran_type ran_type; + + /* GERAN/UTRAN: cells contains a list of sgsn_ra_cells which are alive */ + struct llist_head cells; }; struct sgsn_ra_cell { @@ -55,7 +73,7 @@ void sgsn_ra_init(struct sgsn_instance *inst); -struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai); +struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type); void sgsn_ra_free(struct sgsn_ra *ra); struct sgsn_ra_cell *sgsn_ra_cell_alloc_geran(struct sgsn_ra *ra, uint16_t cell_id, uint16_t nsei, uint16_t bvci); void sgsn_ra_cell_free(struct sgsn_ra_cell *cell); @@ -72,6 +90,7 @@ struct sgsn_ra_cell *sgsn_ra_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id); struct sgsn_ra_cell *sgsn_ra_get_cell_by_gb(uint16_t nsei, uint16_t bvci); struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *ra_id); +struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *ra_id); /* diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 67b15ae..23847f2 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -23,6 +23,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/logging.h> #include <osmocom/core/rate_ctr.h> +#include <osmocom/core/utils.h> #include <osmocom/gsm/gsm48.h> #include <osmocom/sgsn/debug.h> #include <osmocom/sgsn/gprs_bssgp.h> @@ -31,6 +32,11 @@ #include <osmocom/sgsn/gprs_routing_area.h> +const struct value_string sgsn_ra_ran_type_names[] = { + { RA_TYPE_GERAN_Gb, "GERAN_Gb"}, + { RA_TYPE_UTRAN_Iu, "UTRAN_Iu"}, +}; + static void _sgsn_ra_cell_free(struct sgsn_ra_cell *cell, bool drop_empty_ra) { struct sgsn_ra *ra; @@ -72,7 +78,7 @@ talloc_free(ra); } -struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai) +struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type) { struct sgsn_ra *ra; ra = talloc_zero(sgsn->routing_area, struct sgsn_ra); @@ -81,6 +87,7 @@ INIT_LLIST_HEAD(&ra->cells); ra->rai = *rai; + ra->ran_type = ran_type; llist_add(&ra->list, &sgsn->routing_area->ra_list); return ra; } @@ -115,6 +122,19 @@ return NULL; } +struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *ra_id) +{ + struct sgsn_ra *ra = sgsn_ra_get_ra(ra_id); + + if (!ra) + return ra; + + if (ra->ran_type == RA_TYPE_GERAN_Gb) + return ra; + + return NULL; +} + struct sgsn_ra_cell *sgsn_ra_get_cell_by_gb(uint16_t nsei, uint16_t bvci) { struct sgsn_ra *ra; @@ -125,6 +145,9 @@ return NULL; llist_for_each_entry(ra, &sgsn->routing_area->ra_list, list) { + if (ra->ran_type != RA_TYPE_GERAN_Gb) + continue; + llist_for_each_entry(cell, &ra->cells, list) { if (cell->ran_type != RA_TYPE_GERAN_Gb) continue; @@ -174,10 +197,14 @@ return sgsn_ra_foreach_cell(ra, cb, cb_data); } +/* valid for GERAN */ struct sgsn_ra_cell *sgsn_ra_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id) { struct sgsn_ra_cell *cell; + if (ra->ran_type != RA_TYPE_GERAN_Gb) + return NULL; + llist_for_each_entry(cell, &ra->cells, list) { if (cell->cell_id == cell_id) return cell; @@ -186,6 +213,7 @@ return NULL; } +/* valid for GERAN */ struct sgsn_ra_cell *sgsn_ra_get_cell_by_lai(const struct osmo_location_area_id *lai, uint16_t cell_id) { struct sgsn_ra *ra; @@ -194,6 +222,9 @@ /* This is a little bit in-efficient. A more performance way, but more complex would * adding a llist for LAC on top of the routing areas */ llist_for_each_entry(ra, &sgsn->routing_area->ra_list, list) { + if (ra->ran_type != RA_TYPE_GERAN_Gb) + continue; + if (osmo_lai_cmp(&ra->rai.lac, lai) != 0) continue; @@ -206,7 +237,7 @@ return NULL; } -/*! Return the cell by searching for the RA, when found, search the cell within the RA +/*! Return the GERAN cell by searching for the RA, when found, search the cell within the RA * * \param cgi_ps * \return the cell or NULL if not found @@ -217,7 +248,7 @@ OSMO_ASSERT(cgi_ps); - ra = sgsn_ra_get_ra(&cgi_ps->rai); + ra = sgsn_ra_get_ra_geran(&cgi_ps->rai); if (!ra) return NULL; @@ -246,9 +277,10 @@ OSMO_ASSERT(cgi_ps); /* TODO: do we have to move all MS to GMM IDLE state when this happens for a alive cell which got reseted? */ - ra = sgsn_ra_get_ra(&cgi_ps->rai); + ra = sgsn_ra_get_ra_geran(&cgi_ps->rai); if (!ra) { - ra = sgsn_ra_alloc(&cgi_ps->rai); + /* TODO: check for UTRAN rai when introducing UTRAN support */ + ra = sgsn_ra_alloc(&cgi_ps->rai, RA_TYPE_GERAN_Gb); if (!ra) return -ENOMEM; ra_created = true; @@ -312,6 +344,9 @@ bool found = false; llist_for_each_entry_safe(ra, ra2, &sgsn->routing_area->ra_list, list) { + if (ra->ran_type != RA_TYPE_GERAN_Gb) + continue; + llist_for_each_entry_safe(cell, cell2, &ra->cells, list) { if (cell->ran_type != RA_TYPE_GERAN_Gb) continue; @@ -324,7 +359,6 @@ if (llist_empty(&ra->cells)) sgsn_ra_free(ra); - } return found ? 0 : -ENOENT; @@ -338,7 +372,7 @@ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS)); - ra = sgsn_ra_get_ra(ra_id); + ra = sgsn_ra_get_ra_geran(ra_id); if (!ra) return -ENOENT; diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index e1aec0f..6021d81 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -75,7 +75,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&raid); + ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -105,7 +105,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&raid); + ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -117,7 +117,7 @@ sgsn_ra_free(ra); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - ra = sgsn_ra_alloc(&raid); + ra = sgsn_ra_alloc(&raid, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -160,7 +160,7 @@ printf("Testing Routing Area find\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&ra_id); + ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -194,7 +194,7 @@ cgi.cell_identity = cell_id_not_found; cgi_ps.cell_identity = cell_id_not_found; - ra_a = sgsn_ra_alloc(&ra_id); + ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -263,7 +263,7 @@ printf("Testing Routing Area BSSGP BVC RESET IND\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&ra_id); + ra_a = sgsn_ra_alloc(&ra_id, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); OSMO_ASSERT(llist_count(&ra_a->cells) == 0); -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40688?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I59c35f1a4912ff11574bb31e4fe424816993548c Gerrit-Change-Number: 40688 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.