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

May 2023

  • 1 participants
  • 2583 discussions
[M] Change in libosmo-gprs[master]: sm: Fix encoding of dynamic IP address in PDPActCtxReq
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32582 ) Change subject: sm: Fix encoding of dynamic IP address in PDPActCtxReq ...................................................................... sm: Fix encoding of dynamic IP address in PDPActCtxReq Change-Id: I2d830604d9d9a3f6939926ab67967d5527fdf5c3 --- M src/sm/sm_pdu.c M tests/sm/sm_prim_test.ok 2 files changed, 38 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/82/32582/1 diff --git a/src/sm/sm_pdu.c b/src/sm/sm_pdu.c index e866a33..f8512c0 100644 --- a/src/sm/sm_pdu.c +++ b/src/sm/sm_pdu.c @@ -1,4 +1,4 @@ -/* SM PDUs, 3GPP TS 9.5 24.008 Session Management Messages */ +/* SM PDUs, 3GPP TS 24.008 Session Management Messages */ /* (C) 2023 by Sysmocom s.f.m.c. GmbH * * All Rights Reserved @@ -60,6 +60,7 @@ const struct osmo_sockaddr *pdp_addr_v6) { memset(out, 0, sizeof(*out)); + unsigned int len = 2; out->spare = 0x00; out->organization = GPRS_SM_PDP_ADDR_ORG_IETF; @@ -67,18 +68,34 @@ switch (pdp_addr_ietf_type) { case OSMO_GPRS_SM_PDP_ADDR_IETF_IPV6: - memcpy(out->addr6, pdp_addr_v6->u.sin6.sin6_addr.s6_addr, sizeof(out->addr6)); - return 2 + sizeof(out->addr6); + if (pdp_addr_v6) { + memcpy(out->addr6, pdp_addr_v6->u.sin6.sin6_addr.s6_addr, sizeof(out->addr6)); + len += sizeof(out->addr6); + } + break; case OSMO_GPRS_SM_PDP_ADDR_IETF_IPV4V6: - out->both.addr = pdp_addr_v4->u.sin.sin_addr.s_addr; - memcpy(out->both.addr6, pdp_addr_v6->u.sin6.sin6_addr.s6_addr, sizeof(out->both.addr6)); - return 2 + sizeof(out->both.addr) + sizeof(out->both.addr6); + if (pdp_addr_v4) { + out->both.addr = pdp_addr_v4->u.sin.sin_addr.s_addr; + len += sizeof(out->both.addr); + if (pdp_addr_v6) { + memcpy(out->both.addr6, pdp_addr_v6->u.sin6.sin6_addr.s6_addr, sizeof(out->both.addr6)); + len += sizeof(out->both.addr6); + } + } else if (pdp_addr_v6) { + memcpy(out->addr6, pdp_addr_v6->u.sin6.sin6_addr.s6_addr, sizeof(out->addr6)); + len += sizeof(out->addr6); + } + break; case OSMO_GPRS_SM_PDP_ADDR_IETF_IPV4: default: /* All other values shall be interpreted as IPv4 address in this version of the protocol */ - out->addr = pdp_addr_v4->u.sin.sin_addr.s_addr; - return 2 + sizeof(out->both.addr); + if (pdp_addr_v4) { + out->addr = pdp_addr_v4->u.sin.sin_addr.s_addr; + len += sizeof(out->both.addr); + } + break; } + return len; } int gprs_sm_pdp_addr_dec(const struct gprs_sm_pdp_addr *pdp_addr, @@ -153,7 +170,7 @@ return 0; } -/* Chapter 9.4.1: Attach request */ +/* Chapter 9.5.1: Activate PDP Context Request */ int gprs_sm_build_act_pdp_ctx_req(struct gprs_sm_entity *sme, struct msgb *msg) { @@ -180,8 +197,8 @@ l = msgb_put(msg, 1); /* len */ *l = gprs_sm_pdp_addr_enc_ietf((struct gprs_sm_pdp_addr *)msg->tail, sme->pdp_addr_ietf_type, - &sme->pdp_addr_v4, - &sme->pdp_addr_v6); + !osmo_sockaddr_is_any(&sme->pdp_addr_v4) ? &sme->pdp_addr_v4 : NULL, + !osmo_sockaddr_is_any(&sme->pdp_addr_v6) ? &sme->pdp_addr_v6 : NULL); msgb_put(msg, *l); /* 10.5.6.1 Access point name (Optional) */ diff --git a/tests/sm/sm_prim_test.ok b/tests/sm/sm_prim_test.ok index 0ea44bb..33f7291 100644 --- a/tests/sm/sm_prim_test.ok +++ b/tests/sm/sm_prim_test.ok @@ -1,6 +1,6 @@ ==== test_sm_prim_ms() [start] ==== test_sm_prim_gmm_down_cb(): Rx GMMSM-ESTABLISH.request sess_id=0 -test_sm_prim_gmm_down_cb(): Rx GMMSM-UNITDATA.request sess_id=0 SMPDU=[8a 41 06 03 01 00 06 01 21 00 00 00 00 28 04 27 01 00 ] +test_sm_prim_gmm_down_cb(): Rx GMMSM-UNITDATA.request sess_id=0 SMPDU=[8a 41 06 03 01 00 02 01 21 28 04 27 01 00 ] test_sm_prim_sndcp_up_cb(): Rx SNSM-ACTIVATE.indication test_sm_prim_up_cb(): Rx SMREG-PDP_ACTIVATE.confirm ==== test_sm_prim_ms() [end] ==== -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32582 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I2d830604d9d9a3f6939926ab67967d5527fdf5c3 Gerrit-Change-Number: 32582 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-gprs[master]: gmm: Implement GMMSM-UNITDATA.ind
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32581 ) Change subject: gmm: Implement GMMSM-UNITDATA.ind ...................................................................... gmm: Implement GMMSM-UNITDATA.ind Change-Id: Ib1ac220292c61419a65f27fa88a731357728459d --- M include/osmocom/gprs/gmm/gmm_private.h M src/gmm/gmm.c M src/gmm/gmm_prim.c M tests/gmm/gmm_prim_test.c M tests/gmm/gmm_prim_test.err M tests/gmm/gmm_prim_test.ok 6 files changed, 91 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/81/32581/1 diff --git a/include/osmocom/gprs/gmm/gmm_private.h b/include/osmocom/gprs/gmm/gmm_private.h index 6abf3be..df97e1d 100644 --- a/include/osmocom/gprs/gmm/gmm_private.h +++ b/include/osmocom/gprs/gmm/gmm_private.h @@ -106,6 +106,7 @@ struct gprs_gmm_entity *gprs_gmm_find_gmme_by_ptmsi(uint32_t ptmsi); struct gprs_gmm_entity *gprs_gmm_find_gmme_by_imsi(const char *imsi); struct gprs_gmm_entity *gprs_gmm_find_gmme_by_tlli(uint32_t tlli); +struct gprs_gmm_entity *gprs_gmm_find_gmme_by_sess_id(uint32_t id); uint32_t gprs_gmm_alloc_rand_tlli(void); int gprs_gmm_rx(struct gprs_gmm_entity *gmme, struct gsm48_hdr *gh, unsigned int len); int gprs_gmm_tx_att_req(struct gprs_gmm_entity *gmme, diff --git a/src/gmm/gmm.c b/src/gmm/gmm.c index 980f8f4..0070dda 100644 --- a/src/gmm/gmm.c +++ b/src/gmm/gmm.c @@ -236,6 +236,17 @@ return NULL; } +struct gprs_gmm_entity *gprs_gmm_find_gmme_by_sess_id(uint32_t id) +{ + struct gprs_gmm_entity *gmme; + + llist_for_each_entry(gmme, &g_gmm_ctx->gmme_list, list) { + if (gmme->sess_id == id) + return gmme; + } + return NULL; +} + uint32_t gprs_gmm_alloc_rand_tlli(void) { /* 3GPP TS 23.003 Table 1: Type of TLLI = Random TLLI_ @@ -754,10 +765,6 @@ int gprs_gmm_rx(struct gprs_gmm_entity *gmme, struct gsm48_hdr *gh, unsigned int len) { int rc = 0; - if (len < sizeof(struct gsm48_hdr)) { - LOGGMME(gmme, LOGL_ERROR, "Rx GMM message too short! len=%u\n", len); - return -EINVAL; - } switch (gh->msg_type) { case GSM48_MT_GMM_ATTACH_ACK: diff --git a/src/gmm/gmm_prim.c b/src/gmm/gmm_prim.c index 8f8d218..573b568 100644 --- a/src/gmm/gmm_prim.c +++ b/src/gmm/gmm_prim.c @@ -508,10 +508,29 @@ /* TS 24.007 9.5.1.5 GMMSM-Unitdata.request:*/ static int gprs_gmm_prim_handle_gmmsm_unitdata_req(struct osmo_gprs_gmm_prim *gmm_prim) { + struct osmo_gprs_llc_prim *llc_prim; int rc; + struct gprs_gmm_entity *gmme; - rc = gprs_gmm_prim_handle_unsupported(gmm_prim); + gmme = gprs_gmm_find_gmme_by_sess_id(gmm_prim->gmmsm.sess_id); + if (!gmme) { + LOGGMM(LOGL_ERROR, "No GMME with sess_id=%u found\n", + gmm_prim->gmmsm.sess_id); + return -ENOENT; + } + llc_prim = osmo_gprs_llc_prim_alloc_ll_unitdata_req( + gmme->tlli, OSMO_GPRS_LLC_SAPI_GMM, + gmm_prim->gmmsm.unitdata_req.smpdu, + gmm_prim->gmmsm.unitdata_req.smpdu_len); + llc_prim->ll.unitdata_req.radio_prio = gmme->radio_prio; + /* TODO: + llc_prim->ll.qos_params[3]; + llc_prim->ll.apply_gea; + llc_prim->ll.apply_gia; + */ + + rc = gprs_gmm_prim_call_llc_down_cb(llc_prim); return rc; } @@ -660,15 +679,39 @@ { struct gprs_gmm_entity *gmme; int rc = 0; + struct gsm48_hdr *gh = (struct gsm48_hdr *)llc_prim->ll.l3_pdu; + unsigned int len = llc_prim->ll.l3_pdu_len; + uint8_t pdisc; + struct osmo_gprs_gmm_prim *gmm_prim; + gmme = gprs_gmm_find_gmme_by_tlli(llc_prim->ll.tlli); if (!gmme) { LOGGMM(LOGL_NOTICE, "Rx %s: Unknown TLLI 0x%08x\n", osmo_gprs_llc_prim_name(llc_prim), llc_prim->ll.tlli); return -ENOENT; } - rc = gprs_gmm_rx(gmme, - (struct gsm48_hdr *)llc_prim->ll.l3_pdu, - llc_prim->ll.l3_pdu_len); + + if (len < sizeof(struct gsm48_hdr)) { + LOGGMME(gmme, LOGL_ERROR, "Rx GMM message too short! len=%u\n", len); + return -EINVAL; + } + + pdisc = gsm48_hdr_pdisc(gh); + + switch (pdisc) { + case GSM48_PDISC_MM_GPRS: + rc = gprs_gmm_rx(gmme, gh, len); + break; + case GSM48_PDISC_SM_GPRS: + /* Forward up to SM layer: */ + gmm_prim = gprs_gmm_prim_alloc_gmmsm_unitdata_ind(gmme->sess_id, + (uint8_t *)gh, + len); + rc = gprs_gmm_prim_call_up_cb(gmm_prim); + break; + default: + OSMO_ASSERT(0); + } return rc; } diff --git a/tests/gmm/gmm_prim_test.c b/tests/gmm/gmm_prim_test.c index acf1e22..7bc02b0 100644 --- a/tests/gmm/gmm_prim_test.c +++ b/tests/gmm/gmm_prim_test.c @@ -204,6 +204,12 @@ gmm_prim->gmmsm.establish_cnf.accepted, gmm_prim->gmmsm.establish_cnf.rej.cause); break; + case OSMO_PRIM(OSMO_GPRS_GMM_GMMSM_UNITDATA, PRIM_OP_INDICATION): + printf("%s(): Rx %s sess_id=%u sm_pdu=%s\n", __func__, pdu_name, + gmm_prim->gmmsm.sess_id, + osmo_hexdump(gmm_prim->gmmsm.unitdata_ind.smpdu, + gmm_prim->gmmsm.unitdata_ind.smpdu_len)); + break; //case OSMO_PRIM(OSMO_GPRS_GMM_GMMSM_DETACH, PRIM_OP_CONFIRM): // printf("%s(): Rx %s detach_type='%s'\n", __func__, pdu_name, // osmo_gprs_gmm_detach_ms_type_name(gmm_prim->gmmsm.detach_cnf.detach_type)); @@ -355,6 +361,7 @@ char *imei = "42342342342342"; char *imeisv = "4234234234234275"; uint32_t sess_id = 1234; + uint8_t sm_pdu[] = {GSM48_PDISC_SM_GPRS, 0x28, 0x29, 0x30}; /* fake SM PDU */ printf("==== %s() [start] ====\n", __func__); @@ -400,7 +407,18 @@ /* As a result, MS answers GMM Attach Complete */ /* As a result, MS submits GMMSM Establish.cnf */ - /* ... */ + /* SM layer submits Activate PDP Context Req: */ + gmm_prim = osmo_gprs_gmm_prim_alloc_gmmsm_unitdata_req(sess_id, sm_pdu, sizeof(sm_pdu)); + rc = osmo_gprs_gmm_prim_upper_down(gmm_prim); + OSMO_ASSERT(rc == 0); + /* As a result, GMM submits LLC-LL-UNITDATA.req */ + + /* Network answers with Activate PDP Ctx Accept, LLC submits the pdu up to GMM: */ + llc_prim = gprs_llc_prim_alloc_ll_unitdata_ind(rand_tlli, OSMO_GPRS_LLC_SAPI_GMM, sm_pdu, sizeof(sm_pdu)); + OSMO_ASSERT(llc_prim); + rc = osmo_gprs_gmm_prim_llc_lower_up(llc_prim); + OSMO_ASSERT(rc == 0); + /* As a result, GMM submits GMMSM-UNITDATA.ind */ /* DEACT: TODO */ diff --git a/tests/gmm/gmm_prim_test.err b/tests/gmm/gmm_prim_test.err index d589876..7aca515 100644 --- a/tests/gmm/gmm_prim_test.err +++ b/tests/gmm/gmm_prim_test.err @@ -46,3 +46,5 @@ DLGLOBAL INFO GMME(IMSI-1234567890:PTMSI-ea711b41:TLLI-ea711b41) Tx GMM ATTACH COMPL DLGLOBAL INFO GMM_MS{RegisteredInitiated}: Received Event ATTACH_ACCEPTED DLGLOBAL INFO GMM_MS{RegisteredInitiated}: state_chg to Registered +DLGLOBAL INFO Rx from upper layers: GMMSM-UNITDATA.request +DLGLOBAL INFO Rx from lower layers: LL-UNITDATA.indication diff --git a/tests/gmm/gmm_prim_test.ok b/tests/gmm/gmm_prim_test.ok index 156a282..e37507e 100644 --- a/tests/gmm/gmm_prim_test.ok +++ b/tests/gmm/gmm_prim_test.ok @@ -22,4 +22,6 @@ test_gmm_prim_down_cb(): Rx GMRR-ASSIGN.request old_tlli=0x80001234 new_tlli=0xea711b41 test_gmm_prim_llc_down_cb(): Rx LL-UNITDATA.request TLLI=0xea711b41 SAPI=GMM l3=[08 03 ] test_gmm_prim_up_cb(): Rx GMMSM-ESTABLISH.confirm sess_id=1234 accepted=1 rej_cause=0 +test_gmm_prim_llc_down_cb(): Rx LL-UNITDATA.request TLLI=0xea711b41 SAPI=GMM l3=[0a 28 29 30 ] +test_gmm_prim_up_cb(): Rx GMMSM-UNITDATA.indication sess_id=1234 sm_pdu=0a 28 29 30 ==== test_gmm_prim_ms_gmmsm() [end] ==== -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32581 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ib1ac220292c61419a65f27fa88a731357728459d Gerrit-Change-Number: 32581 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-gprs[master]: gmm: Rework sess_id to identify one GMME
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32580 ) Change subject: gmm: Rework sess_id to identify one GMME ...................................................................... gmm: Rework sess_id to identify one GMME The GMM layer doesn't really have to differentiate between SM connections, everything is sent over the LLC "GMM" SAPI. However, we still want to identify/related a given MS if there are multiple MS using the stack. Change-Id: Ib757f016824d918ce8b74ae0c2a652a6c1823556 --- M include/osmocom/gprs/gmm/gmm_ms_fsm.h M include/osmocom/gprs/gmm/gmm_private.h M src/gmm/gmm.c M src/gmm/gmm_ms_fsm.c M src/gmm/gmm_prim.c 5 files changed, 32 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/80/32580/1 diff --git a/include/osmocom/gprs/gmm/gmm_ms_fsm.h b/include/osmocom/gprs/gmm/gmm_ms_fsm.h index 516801e..078c535 100644 --- a/include/osmocom/gprs/gmm/gmm_ms_fsm.h +++ b/include/osmocom/gprs/gmm/gmm_ms_fsm.h @@ -48,9 +48,6 @@ bool with_imsi; bool explicit_att; /* true if by SMREG-ATTACH.req requested it */ bool implicit_att; /* true if GMMSM-ESTABLISH.req requested it */ - /* Session Ids waiting for attach to happen during implicit_att: */ - uint32_t sess_id[16]; - uint8_t num_sess_id; /* Retransmission of ATTACH REQUEST (T3310) */ uint8_t req_attempts; }; @@ -78,8 +75,7 @@ int gprs_gmm_ms_fsm_ctx_request_attach(struct gprs_gmm_ms_fsm_ctx *ctx, enum osmo_gprs_gmm_attach_type attach_type, bool attach_with_imsi, - bool explicit_attach, - uint32_t sess_id); + bool explicit_attach); int gprs_gmm_ms_fsm_ctx_request_detach(struct gprs_gmm_ms_fsm_ctx *ctx, enum osmo_gprs_gmm_detach_ms_type detach_type, diff --git a/include/osmocom/gprs/gmm/gmm_private.h b/include/osmocom/gprs/gmm/gmm_private.h index bdff1c1..6abf3be 100644 --- a/include/osmocom/gprs/gmm/gmm_private.h +++ b/include/osmocom/gprs/gmm/gmm_private.h @@ -20,6 +20,8 @@ /* 3GPP TS 44.064 § 8.3 TLLI assignment procedures */ #define GPRS_GMM_TLLI_UNASSIGNED (0xffffffff) +#define GPRS_GMM_SESS_ID_UNASSIGNED (0xffffffff) + extern int g_gmm_log_cat[_OSMO_GPRS_GMM_LOGC_MAX]; #define LOGGMM(lvl, fmt, args...) LOGP(g_gmm_log_cat[OSMO_GPRS_GMM_LOGC_GMM], lvl, fmt, ## args) @@ -53,6 +55,7 @@ struct llist_head list; /* item in (struct gprs_gmm_ctx)->gmme_list */ struct gprs_gmm_ms_fsm_ctx ms_fsm; + uint32_t sess_id; /* Used to identify the GMME in GMMSM SAP */ uint32_t ptmsi; uint32_t old_ptmsi; uint32_t tlli; diff --git a/src/gmm/gmm.c b/src/gmm/gmm.c index 8f54f04..980f8f4 100644 --- a/src/gmm/gmm.c +++ b/src/gmm/gmm.c @@ -149,6 +149,7 @@ return NULL; } + gmme->sess_id = GPRS_GMM_SESS_ID_UNASSIGNED; gmme->ptmsi = ptmsi; gmme->old_ptmsi = GSM_RESERVED_TMSI; gmme->old_tlli = GPRS_GMM_TLLI_UNASSIGNED; diff --git a/src/gmm/gmm_ms_fsm.c b/src/gmm/gmm_ms_fsm.c index 85aa6bf..6f82815 100644 --- a/src/gmm/gmm_ms_fsm.c +++ b/src/gmm/gmm_ms_fsm.c @@ -132,14 +132,11 @@ if (att.implicit_att) { /* Submit GMMSM-ESTABLISH-CNF as per TS 24.007 Annex C.3 */ - unsigned int i; - for (i = 0; i < att.num_sess_id; i++) { - rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, - att.sess_id[i], - false, cause); - if (rc < 0) - return; - } + rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, + ctx->gmme->sess_id, + false, cause); + if (rc < 0) + return; } break; case GPRS_GMM_MS_EV_ATTACH_ACCEPTED: @@ -153,12 +150,9 @@ } if (ctx->attach.implicit_att) { /* Submit GMMSM-ESTABLISH-CNF as per TS 24.007 Annex C.3 */ - unsigned int i; - for (i = 0; i < ctx->attach.num_sess_id; i++) { - rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, ctx->attach.sess_id[i], true, 0); - if (rc < 0) - return; - } + rc = gprs_gmm_submit_gmmsm_establish_cnf(ctx->gmme, ctx->gmme->sess_id, true, 0); + if (rc < 0) + return; } break; case GPRS_GMM_MS_EV_DETACH_REQUESTED: @@ -419,8 +413,7 @@ int gprs_gmm_ms_fsm_ctx_request_attach(struct gprs_gmm_ms_fsm_ctx *ctx, enum osmo_gprs_gmm_attach_type attach_type, bool attach_with_imsi, - bool explicit_attach, - uint32_t sess_id) + bool explicit_attach) { int rc; @@ -431,23 +424,6 @@ else ctx->attach.implicit_att = true; - if (!explicit_attach) { - unsigned int i; - bool found = false; - if (ctx->attach.num_sess_id == ARRAY_SIZE(ctx->attach.sess_id)) - return -ENOMEM; - for (i = 0; i < ctx->attach.num_sess_id; i++) { - if (sess_id == ctx->attach.sess_id[i]) { - found = true; - break; - } - } - if (!found) { - ctx->attach.sess_id[ctx->attach.num_sess_id] = sess_id; - ctx->attach.num_sess_id++; - } - } - rc = osmo_fsm_inst_dispatch(ctx->fi, GPRS_GMM_MS_EV_ATTACH_REQUESTED, NULL); return rc; } diff --git a/src/gmm/gmm_prim.c b/src/gmm/gmm_prim.c index 2d53a0a..8f8d218 100644 --- a/src/gmm/gmm_prim.c +++ b/src/gmm/gmm_prim.c @@ -389,7 +389,7 @@ rc = gprs_gmm_ms_fsm_ctx_request_attach(&gmme->ms_fsm, gmm_prim->gmmreg.attach_req.attach_type, gmm_prim->gmmreg.attach_req.attach_with_imsi, - true, 0); + true); return rc; } @@ -485,6 +485,8 @@ gmme = gprs_gmm_gmme_find_or_create_by_ptmsi_imsi(gmm_prim->gmmsm.establish_req.ptmsi, gmm_prim->gmmsm.establish_req.imsi); OSMO_ASSERT(gmme); + /* Identify this GMME with this sess_id in GMMSM SAP from now on: */ + gmme->sess_id = gmm_prim->gmmsm.sess_id; if (gmme->ms_fsm.fi->state == GPRS_GMM_MS_ST_REGISTERED) { rc = gprs_gmm_submit_gmmsm_establish_cnf(gmme, gmm_prim->gmmsm.sess_id, true, 0); @@ -499,8 +501,7 @@ rc = gprs_gmm_ms_fsm_ctx_request_attach(&gmme->ms_fsm, gmm_prim->gmmsm.establish_req.attach_type, gmm_prim->gmmsm.establish_req.attach_with_imsi, - false, - gmm_prim->gmmsm.sess_id); + false); return rc; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32580 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ib757f016824d918ce8b74ae0c2a652a6c1823556 Gerrit-Change-Number: 32580 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-gprs[master]: sm: Implement rx Act PDP Ctx Rej
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32583 ) Change subject: sm: Implement rx Act PDP Ctx Rej ...................................................................... sm: Implement rx Act PDP Ctx Rej Change-Id: Ib534ebc2a3a0674675621da2f8bd0de218a08ef0 --- M src/sm/sm.c 1 file changed, 64 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/83/32583/1 diff --git a/src/sm/sm.c b/src/sm/sm.c index 4fa35df..4e07f94 100644 --- a/src/sm/sm.c +++ b/src/sm/sm.c @@ -329,7 +329,8 @@ if (TLVP_PRESENT(&tp, GSM48_IE_GSM_PROTO_CONF_OPT)) { if (TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT) > ARRAY_SIZE(sme->pco)) { LOGSME(sme, LOGL_ERROR, - "Rx SM Activate PDP Context Accept: PCO size too big! %u\n", qos_len); + "Rx SM Activate PDP Context Accept: PCO size too big! %u\n", + TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT)); goto rejected; } sme->pco_len = TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT); @@ -349,6 +350,56 @@ return -EINVAL; /* TODO: what to do on error? */ } +/* 3GPP TS 24.008 § 9.5.3: Activate PDP Context rej */ +static int gprs_sm_rx_act_pdp_rej(struct gprs_sm_entity *sme, + struct gsm48_hdr *gh, + unsigned int len) +{ + struct tlv_parsed tp; + int rc; + enum gsm48_gsm_cause cause; + uint8_t *ofs = (uint8_t *)gh; + + ofs += sizeof(*gh); + //uint8_t transaction_id = gsm48_hdr_trans_id(gh); + + LOGSME(sme, LOGL_INFO, "Rx SM Activate PDP Context Reject\n"); + + if (len < (ofs + 1) - (uint8_t *)gh) + goto tooshort; + cause = *ofs++; + + if (len > ofs - (uint8_t *)gh) { + rc = gprs_sm_tlv_parse(&tp, ofs, len - (ofs - (uint8_t *)gh)); + if (rc < 0) { + LOGSME(sme, LOGL_ERROR, "Rx SM Activate PDP Context Reject: failed to parse TLVs %d\n", rc); + goto rejected; + } + + if (TLVP_PRESENT(&tp, GSM48_IE_GSM_PROTO_CONF_OPT)) { + if (TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT) > ARRAY_SIZE(sme->pco)) { + LOGSME(sme, LOGL_ERROR, + "Rx SM Activate PDP Context Reject: PCO size too big! %u\n", + TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT)); + goto rejected; + } + sme->pco_len = TLVP_LEN(&tp, GSM48_IE_GSM_PROTO_CONF_OPT); + if (sme->pco_len) + memcpy(sme->pco, TLVP_VAL(&tp, GSM48_IE_GSM_PROTO_CONF_OPT), sme->pco_len); + } + } + + rc = osmo_fsm_inst_dispatch(sme->ms_fsm.fi, GPRS_SM_MS_EV_RX_ACT_PDP_CTX_REJ, &cause); + if (rc < 0) + goto rejected; + return rc; + +tooshort: + LOGSME(sme, LOGL_ERROR, "Rx GMM message too short! len=%u\n", len); +rejected: + return -EINVAL; /* TODO: what to do on error? */ +} + /* Rx Session Management PDU */ int gprs_sm_rx(struct gprs_sm_entity *sme, struct gsm48_hdr *gh, unsigned int len) { @@ -362,6 +413,9 @@ case GSM48_MT_GSM_ACT_PDP_ACK: rc = gprs_sm_rx_act_pdp_ack(sme, gh, len); break; + case GSM48_MT_GSM_ACT_PDP_REJ: + rc = gprs_sm_rx_act_pdp_rej(sme, gh, len); + break; default: LOGSME(sme, LOGL_ERROR, "Rx SM message not implemented! type=%u len=%u\n", -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32583 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ib534ebc2a3a0674675621da2f8bd0de218a08ef0 Gerrit-Change-Number: 32583 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-gprs[master]: llc: use GRR instead of BSSGP to tx XID.req in MS mode
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32585 ) Change subject: llc: use GRR instead of BSSGP to tx XID.req in MS mode ...................................................................... llc: use GRR instead of BSSGP to tx XID.req in MS mode Change-Id: Ib2ada2cc7160202f9da5b177da8263076e1eef69 --- M src/llc/llc.c 1 file changed, 21 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/85/32585/1 diff --git a/src/llc/llc.c b/src/llc/llc.c index ef52ec3..4be7a9a 100644 --- a/src/llc/llc.c +++ b/src/llc/llc.c @@ -266,7 +266,10 @@ gprs_llc_encode_is_cmd_as_cr(is_cmd, &pdu_dec.flags); /* LLC payload is put directly below: */ - llc_prim = gprs_llc_prim_alloc_bssgp_dl_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); + if (g_llc_ctx->location == OSMO_GPRS_LLC_LOCATION_SGSN) + llc_prim = gprs_llc_prim_alloc_bssgp_dl_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); + else + llc_prim = gprs_llc_prim_alloc_grr_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); msg = llc_prim->oph.msg; msg->l3h = msg->tail; @@ -276,10 +279,15 @@ msgb_free(msg); return rc; } - llc_prim->bssgp.ll_pdu = msgb_l3(msg); - llc_prim->bssgp.ll_pdu_len = msgb_l3len(msg); + if (g_llc_ctx->location == OSMO_GPRS_LLC_LOCATION_MS) { + llc_prim->bssgp.ll_pdu = msgb_l3(msg); + llc_prim->bssgp.ll_pdu_len = msgb_l3len(msg); + } else { + llc_prim->grr.ll_pdu = msgb_l3(msg); + llc_prim->grr.ll_pdu_len = msgb_l3len(msg); + } - /* Send BSSGP-DL-UNITDATA.req */ + /* Send GRR-UNITDATA.req */ gprs_llc_prim_call_down_cb(llc_prim); return 0; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32585 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: Ib2ada2cc7160202f9da5b177da8263076e1eef69 Gerrit-Change-Number: 32585 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-gprs[master]: sm: Avoid freeing the SME object too quickly
by pespin 03 May '23

03 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32584 ) Change subject: sm: Avoid freeing the SME object too quickly ...................................................................... sm: Avoid freeing the SME object too quickly At that point in time we may still need it, for instance to send the primitive to the upper layers. Still, we want it to be t the correct state when that happens. Hence, delay freeing the object to happen in next loop iteration, so that it is still available to submit the primitive, and even skip freeing the object if the SM SAP user decides to re-activate the PDP context in a synchronous code path from the primitive callback. Change-Id: I28655fc6286c92403e3e461cb6433b8567e20fd1 --- M src/sm/sm_ms_fsm.c 1 file changed, 29 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/84/32584/1 diff --git a/src/sm/sm_ms_fsm.c b/src/sm/sm_ms_fsm.c index 14f5ee7..2ce6f8d 100644 --- a/src/sm/sm_ms_fsm.c +++ b/src/sm/sm_ms_fsm.c @@ -30,6 +30,8 @@ #define X(s) (1 << (s)) +#define TIMER_DELAY_FREE 0 + static const struct osmo_tdef_state_timeout sm_ms_fsm_timeouts[32] = { [GPRS_SM_MS_ST_PDP_INACTIVE] = {}, [GPRS_SM_MS_ST_PDP_ACTIVE_PENDING] = { .T = 3380 }, @@ -43,9 +45,13 @@ static void st_sm_ms_pdp_inactive_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state) { - /* PDP became inactive, there's no use in keeping it */ - struct gprs_sm_ms_fsm_ctx *ctx = (struct gprs_sm_ms_fsm_ctx *)fi->priv; - gprs_sm_entity_free(ctx->sme); + /* PDP became inactive, there's no use in keeping it. + * Schedule asynchronous release of PDP. It will automatically be + * aborted as a consequence of changing state if user decides to + * automatically activate the PDP ctx in this same code path as an + * answer to a primitive submitted to it. */ + fi->T = TIMER_DELAY_FREE; + osmo_timer_schedule(&fi->timer, 0, 0); } static void st_sm_ms_pdp_inactive(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -149,6 +155,9 @@ struct gprs_sm_ms_fsm_ctx *ctx = (struct gprs_sm_ms_fsm_ctx *)fi->priv; switch (fi->T) { + case TIMER_DELAY_FREE: + gprs_sm_entity_free(ctx->sme); + break; case 3380: ctx->act_pdp_ctx_attempts++; LOGPFSML(ctx->fi, LOGL_INFO, "T3380 timeout attempts=%u\n", ctx->act_pdp_ctx_attempts); -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32584 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I28655fc6286c92403e3e461cb6433b8567e20fd1 Gerrit-Change-Number: 32584 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bts[master]: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload
by dexter 03 May '23

03 May '23
Attention is currently required from: laforge, pespin, fixeria. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/31417 ) Change subject: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload ...................................................................... Patch Set 6: (2 comments) File src/common/l1sap.c: https://gerrit.osmocom.org/c/osmo-bts/+/31417/comment/dd2816c8_596bda49 PS5, Line 1260: if (OSMO_UNLIKELY((resp_msg->len != GSM_HR_BYTES + 1) > this alignment looks weird, given that the next line sees to be inside the OSMO_UNLIKELY macro. Yes, the alignment is indeed wrong. https://gerrit.osmocom.org/c/osmo-bts/+/31417/comment/6b715061_51845000 PS5, Line 1267: && bts_internal_flag_get(lchan->ts->trx->bts, BTS_INTERNAL_FLAG_SPEECH_H_V1_RTP_TS101318))) { > agreeing with pespin. […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31417 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I453562da412fde5b928bd2b588129c58ec8e2a7e Gerrit-Change-Number: 31417 Gerrit-PatchSet: 6 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 03 May 2023 11:16:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload
by dexter 03 May '23

03 May '23
Attention is currently required from: laforge, pespin, fixeria. Hello Jenkins Builder, laforge, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/31417 to look at the new patch set (#6). Change subject: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload ...................................................................... l1sap: Accept RFC5993 and TS 101.318 HR GSM payload Unfotunately there are two different RTP formats for HR GSM specified and it is unclear which should be used with GSM networks. Also esch BTS model may have a preference for either one or the other format. Lets set BTS feature flags to determine the preference for each BTS model and then lets use this information to convert incoming RTP packets into the prefered format. Doing so we will make sure that always both formats are accepted. Change-Id: I453562da412fde5b928bd2b588129c58ec8e2a7e Related: OS#5688 --- M include/osmo-bts/bts.h M src/common/bts.c M src/common/l1sap.c M src/osmo-bts-lc15/main.c M src/osmo-bts-oc2g/main.c M src/osmo-bts-sysmo/main.c M src/osmo-bts-trx/main.c M src/osmo-bts-virtual/main.c 8 files changed, 82 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/17/31417/6 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31417 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I453562da412fde5b928bd2b588129c58ec8e2a7e Gerrit-Change-Number: 31417 Gerrit-PatchSet: 6 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in libosmo-abis[master]: e1d: get rid of strange file descriptor registered check
by dexter 03 May '23

03 May '23
Attention is currently required from: tnt, pespin. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32569 ) Change subject: e1d: get rid of strange file descriptor registered check ...................................................................... Patch Set 2: (1 comment) File src/input/e1d.c: https://gerrit.osmocom.org/c/libosmo-abis/+/32569/comment/04d38554_0942eea4 PS1, Line 420: continue; > yes, that was my proposal. I have added the check that was in place before to libosmocore to speed up osmo_fd_is_registered(): I1ce894da39e3f2329c88666a5dda594b8bce4228 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I92c426271dc5455427471030fcf0749566e4c2ee Gerrit-Change-Number: 32569 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 03 May 2023 10:21:15 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-abis[master]: e1d: get rid of strange file descriptor registered check
by dexter 03 May '23

03 May '23
Attention is currently required from: tnt, pespin. Hello Jenkins Builder, tnt, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-abis/+/32569 to look at the new patch set (#2). Change subject: e1d: get rid of strange file descriptor registered check ...................................................................... e1d: get rid of strange file descriptor registered check When the line update happens the list.next member of the file descriptor is checked for NULL and != LLIST_POISON1. This directly tampers with the llist API and might be problematic. Also we can tell by the file descriptor number if the file descriptor is registered or not. An open file descriptor is always registered. Change-Id: I92c426271dc5455427471030fcf0749566e4c2ee Related: OS#5983 --- M src/input/e1d.c 1 file changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/69/32569/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32569 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I92c426271dc5455427471030fcf0749566e4c2ee Gerrit-Change-Number: 32569 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.