lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40689?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )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(-)
Approvals: Jenkins Builder: Verified daniel: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 020ee17..f6f6173 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 e215a68..4bb1fb8 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -112,20 +112,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; @@ -185,13 +185,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;
@@ -365,7 +365,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; @@ -373,7 +373,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 f1d5c16..c43c771 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_alive_list) == 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);