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

June 2023

  • 1 participants
  • 2480 discussions
[S] Change in pysim[master]: ts_31_103: enable encode tests for files containing sigle TLV IE
by laforge 26 Jun '23

26 Jun '23
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/33452 ) Change subject: ts_31_103: enable encode tests for files containing sigle TLV IE ...................................................................... ts_31_103: enable encode tests for files containing sigle TLV IE Now that we have fixed OS#6073 in the previous commit, we can enable the so-far disabled encoder tests for EF.{DOMAIN,IMPU,IMPI} and remove associated FIXMEs. Change-Id: I79bfc5b77122907d6cc2f75605f9331b5e650286 --- M pySim/ts_31_103.py 1 file changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/52/33452/1 diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py index 4a66c0d..f1c8dd7 100644 --- a/pySim/ts_31_103.py +++ b/pySim/ts_31_103.py @@ -80,8 +80,7 @@ # TS 31.103 Section 4.2.2 class EF_IMPI(TransparentEF): - # FIXME: re-encode fails with "string encoding failed, expected unicode string" - _test_decode = [ + _test_de_encode = [ ( '803137333830303630303030303031303140696d732e6d6e633030302e6d63633733382e336770706e6574776f726b2e6f7267', { "nai": "738006000000101(a)ims.mnc000.mcc738.3gppnetwork.org" } ), ] @@ -94,8 +93,7 @@ # TS 31.103 Section 4.2.3 class EF_DOMAIN(TransparentEF): - # FIXME: re-encode fails with "string encoding failed, expected unicode string" - _test_decode = [ + _test_de_encode = [ ( '8021696d732e6d6e633030302e6d63633733382e336770706e6574776f726b2e6f7267', { "domain": "ims.mnc000.mcc738.3gppnetwork.org" } ), ] @@ -108,8 +106,7 @@ # TS 31.103 Section 4.2.4 class EF_IMPU(LinFixedEF): - # FIXME: re-encode fails with "string encoding failed, expected unicode string" - _test_decode = [ + _test_de_encode = [ ( '80357369703a37333830303630303030303031303140696d732e6d6e633030302e6d63633733382e336770706e6574776f726b2e6f7267', { "impu": "sip:738006000000101@ims.mnc000.mcc738.3gppnetwork.org" } ), ] -- To view, visit https://gerrit.osmocom.org/c/pysim/+/33452 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I79bfc5b77122907d6cc2f75605f9331b5e650286 Gerrit-Change-Number: 33452 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: ASCI: Add decoding of mobile identity in TALKER INDICATION
by pespin 26 Jun '23

26 Jun '23
Attention is currently required from: jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33446 ) Change subject: ASCI: Add decoding of mobile identity in TALKER INDICATION ...................................................................... Patch Set 1: (2 comments) File src/gsm/gsm48.c: https://gerrit.osmocom.org/c/libosmocore/+/33446/comment/19df938c_4767779f PS1, Line 959: if (l3_len < sizeof(*gh) + 4 + 2) what are this offsets? https://gerrit.osmocom.org/c/libosmocore/+/33446/comment/4e9bfc30_1281350f PS1, Line 961: if (gh->data[0] != 3) what's this value about? -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33446 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I331fac82e3c15abb01f554b2e70576100f2eea2d Gerrit-Change-Number: 33446 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Mon, 26 Jun 2023 08:56:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: ASCI: Repeat UPLINK FREE messsage until uplink becomes busy
by jolly 26 Jun '23

26 Jun '23
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33449 ) Change subject: ASCI: Repeat UPLINK FREE messsage until uplink becomes busy ...................................................................... ASCI: Repeat UPLINK FREE messsage until uplink becomes busy According to TS 44.018 the UPLINK FREE message must be repeated when the uplink is marked as free. The BSC sends the UPLINK FREE message once and the BTS repeats it until UPLINK BUSY (uplink blocked by BSC) or VGCS UPLINK GRANT (talker accesses the uplink) is sent. It is important to stop sending UPLINK FREE message when a talker accesses the uplink and before the VGCS UPLINK GRANT message is sent, so that stopping must be controlled by the BTS. Related: OS#5781 Change-Id: Ia23c59f5e9a73bbc384fbc317a2cfcf707e3c28f --- M include/osmo-bts/asci.h M include/osmo-bts/lchan.h M src/common/l1sap.c M src/common/lchan.c 4 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/33449/1 diff --git a/include/osmo-bts/asci.h b/include/osmo-bts/asci.h index fae9dde..59b48b2 100644 --- a/include/osmo-bts/asci.h +++ b/include/osmo-bts/asci.h @@ -18,3 +18,24 @@ void vgcs_talker_reset(struct gsm_lchan *lchan); void vgcs_listener_reset(struct gsm_lchan *lchan); + +static inline bool vgcs_is_uplink_free(struct gsm_lchan *lchan) +{ + return lchan->asci.uplink_free; +} + +static inline void vgcs_uplink_free_get(struct gsm_lchan *lchan, uint8_t *msg) +{ + memcpy(msg, lchan->asci.uplink_free_msg, GSM_MACBLOCK_LEN); +} + +static inline void vgcs_uplink_free_set(struct gsm_lchan *lchan, uint8_t *msg) +{ + memcpy(lchan->asci.uplink_free_msg, msg, GSM_MACBLOCK_LEN); + lchan->asci.uplink_free = true; +} + +static inline void vgcs_uplink_free_reset(struct gsm_lchan *lchan) +{ + lchan->asci.uplink_free = false; +} diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h index f4da04d..a0e99bf 100644 --- a/include/osmo-bts/lchan.h +++ b/include/osmo-bts/lchan.h @@ -312,6 +312,9 @@ struct osmo_timer_list t3115; /* counts up to Ny2 */ unsigned int vgcs_ul_grant_count; + /* uplink free message */ + bool uplink_free; + uint8_t uplink_free_msg[GSM_MACBLOCK_LEN]; } asci; /* S counter for link loss */ int s; diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 85526e0..539e15b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1197,6 +1197,10 @@ memcpy(p + 2, si, GSM_MACBLOCK_LEN - 2); } else memcpy(p + 2, fill_frame, GSM_MACBLOCK_LEN - 2); + } else if (vgcs_is_uplink_free(lchan)) { + /* If UPLINK FREE message is stored, send it with every DCCH frame. */ + p = msgb_put(msg, GSM_MACBLOCK_LEN); + vgcs_uplink_free_get(lchan, p); } else if (L1SAP_IS_CHAN_SDCCH4(chan_nr) || L1SAP_IS_CHAN_SDCCH8(chan_nr) || (lchan->rsl_cmode == RSL_CMOD_SPD_SIGN && !lchan->ts->trx->bts->dtxd)) { /* @@ -1221,6 +1225,14 @@ check_for_ciph_cmd(pp_msg, lchan, chan_nr); if (dtxd_facch) dtx_dispatch(lchan, E_FACCH); + if (rsl_chan_rt_is_vgcs(lchan->rsl_chan_rt)) { + /* Check for UPLINK FREE messsage and store. */ + if (pp_msg->data[0] == GSM48_MT_RR_SH_UL_FREE << 2) + vgcs_uplink_free_set(lchan, pp_msg->data); + /* Keep UPLINK FREE message when sending short header messages. */ + else if ((pp_msg->data[0] & 0x03) != 0x00) + vgcs_uplink_free_reset(lchan); + } } msgb_free(pp_msg); } diff --git a/src/common/lchan.c b/src/common/lchan.c index 971f0a5..bd50349 100644 --- a/src/common/lchan.c +++ b/src/common/lchan.c @@ -221,6 +221,7 @@ handover_reset(lchan); vgcs_talker_reset(lchan); vgcs_listener_reset(lchan); + vgcs_uplink_free_reset(lchan); lchan->rel_act_kind = rel_kind; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33449 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ia23c59f5e9a73bbc384fbc317a2cfcf707e3c28f Gerrit-Change-Number: 33449 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bts[master]: ASCI: Add Notification/FACCH support
by jolly 26 Jun '23

26 Jun '23
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33448 ) Change subject: ASCI: Add Notification/FACCH support ...................................................................... ASCI: Add Notification/FACCH support When a VGCS/VBS call is established in a cell, NCH is used to notify about ongoing calls to idle subscribers. Additionally Notification/FACCH is used to notify subscribers in dedicated mode. This is performed by broadcasting this messages to all active dedicated channels. The mobile station can then indicate the call, so the user can join the call. More importaint is the notification of the calling subscriber's MS, which initiated the call. This is done on the early assigned channel. The MS must know on which channel the call is placed. After leaving the uplink, it must know where to access the uplink the next time. Change-Id: I3ed14fa54a907891e492a7ada8e745a2c56cd46d Related: OS#4851, OS#5781 --- M include/osmo-bts/notification.h M src/common/notification.c M src/common/rsl.c 3 files changed, 96 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/33448/1 diff --git a/include/osmo-bts/notification.h b/include/osmo-bts/notification.h index a3bb854..85ac2f1 100644 --- a/include/osmo-bts/notification.h +++ b/include/osmo-bts/notification.h @@ -57,3 +57,5 @@ void append_group_call_information(struct bitvec *bv, const uint8_t *gcr, const uint8_t *ch_desc, uint8_t ch_desc_len); int nch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf); +int facch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf, const uint8_t *group_call_ref, const uint8_t *chan_desc, + uint8_t chan_desc_len); diff --git a/src/common/notification.c b/src/common/notification.c index e02d7ce..08d3baa 100644 --- a/src/common/notification.c +++ b/src/common/notification.c @@ -223,3 +223,34 @@ return GSM_MACBLOCK_LEN; } + +int facch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf, const uint8_t *group_call_ref, const uint8_t *chan_desc, + uint8_t chan_desc_len) +{ + struct gsm48_hdr_sh *sh = (struct gsm48_hdr_sh *) out_buf; + unsigned int ro_len; + + *sh = (struct gsm48_hdr_sh) { + .rr_short_pd = GSM48_PDISC_SH_RR, + .msg_type = GSM48_MT_RR_SH_FACCH, + .l2_header = 0, + }; + + /* Pad remaining octets with constant '2B'O */ + ro_len = GSM_MACBLOCK_LEN - (sh->data - out_buf); + memset(sh->data, GSM_MACBLOCK_PADDING, ro_len); + + struct bitvec bv = { + .data_len = ro_len, + .data = sh->data, + }; + + /* 0 < Group Call information > */ + bitvec_set_bit(&bv, 0); + append_group_call_information(&bv, group_call_ref, chan_desc, chan_desc_len); + + /* TODO: Additions in Release 6 */ + /* TODO: Additions in Release 7 */ + + return GSM_MACBLOCK_LEN; +} diff --git a/src/common/rsl.c b/src/common/rsl.c index 9f615e6..98e3ba4 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -811,6 +811,45 @@ return 0; } +static int broadcast_facch(struct gsm_bts *bts, const uint8_t *group_call_ref, const uint8_t *chan_desc, + uint8_t chan_desc_len, int count) +{ + uint8_t notif[23]; + struct msgb *msg, *cmsg; + struct gsm_bts_trx *trx; + struct gsm_lchan *lchan; + int tn, ln, n; + int rc; + + rc = facch_gen_msg(bts, notif, group_call_ref, chan_desc, chan_desc_len); + if (rc < 0) + return rc; + + llist_for_each_entry(trx, &bts->trx_list, list) { + for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { + for (ln = 0; ln < ARRAY_SIZE(trx->ts[tn].lchan); ln++) { + lchan = &trx->ts[tn].lchan[ln]; + if (lchan->type != GSM_LCHAN_SDCCH + && lchan->type != GSM_LCHAN_TCH_F + && lchan->type != GSM_LCHAN_TCH_H) + continue; + if (lchan->state != LCHAN_S_ACTIVE) + continue; + msg = rsl_rll_simple(RSL_MT_UNIT_DATA_REQ, gsm_lchan2chan_nr(lchan), 0x00, 0); + msg->l3h = msg->tail; /* emulate rsl_rx_rll() behaviour */ + msgb_tl16v_put(msg, RSL_IE_L3_INFO, sizeof(notif), (uint8_t *) &notif); + for (n = 1; n < count; n++) { + cmsg = msgb_copy(msg, "FACCH copy"); + lapdm_rslms_recvmsg(cmsg, &lchan->lapdm_ch); + } + lapdm_rslms_recvmsg(msg, &lchan->lapdm_ch); + } + } + } + + return 0; +} + /* 8.5.10 NOTIFICATION COMMAND */ static int rsl_rx_notification_cmd(struct gsm_bts_trx *trx, struct msgb *msg) { @@ -841,6 +880,9 @@ rc = bts_asci_notification_add(trx->bts, TLVP_VAL(&tp, RSL_IE_GROUP_CALL_REF), TLVP_VAL(&tp, RSL_IE_CHAN_DESC), TLVP_LEN(&tp, RSL_IE_CHAN_DESC), (struct rsl_ie_nch_drx_info *) TLVP_VAL(&tp, RSL_IE_NCH_DRX_INFO)); + /* Broadcast to FACCH */ + broadcast_facch(trx->bts, TLVP_VAL(&tp, RSL_IE_GROUP_CALL_REF), TLVP_VAL(&tp, RSL_IE_CHAN_DESC), + TLVP_LEN(&tp, RSL_IE_CHAN_DESC), 3); break; case RSL_CMD_INDICATOR_STOP: if (!TLVP_PRES_LEN(&tp, RSL_IE_GROUP_CALL_REF, 5)) { -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33448 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I3ed14fa54a907891e492a7ada8e745a2c56cd46d Gerrit-Change-Number: 33448 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bts[master]: ASCI: Add function to reactivate channel
by jolly 26 Jun '23

26 Jun '23
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33447 ) Change subject: ASCI: Add function to reactivate channel ...................................................................... ASCI: Add function to reactivate channel Reactivation will modify parameters on an already activated channel. On a VGCS/VBS channel it can be used to prepare channel for assignment of the mobile station to it. During assignment the channel is reactivated. The timing advance of the mobile station is given. The uplink is activated and is waiting for the mobile station to establish, to complete the assignment. For reference see patent EP 1 858 275 A1. Change-Id: I77f413cf70c2f5f8e8f525686eee40548521c71b Related: OS#4851 --- M src/common/rsl.c 1 file changed, 56 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/33447/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index b421024..b63cb31 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1747,14 +1747,36 @@ struct tlv_parsed tp; const struct tlv_p_entry *ie; uint8_t type, cause; + bool reactivation = false; int rc; - if (lchan->state != LCHAN_S_NONE) { + if (rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)) < 0) { + LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "%s(): rsl_tlv_parse() failed\n", __func__); + return rsl_tx_chan_act_nack(lchan, RSL_ERR_PROTO); + } + + /* 9.3.3 Activation Type */ + if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) { + LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "missing Activation Type\n"); + return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR); + } + type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE); + if ((type & RSL_ACT_TYPE_REACT)) { + type -= RSL_ACT_TYPE_REACT; + reactivation = true; + } + + if (!reactivation && lchan->state != LCHAN_S_NONE) { LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "error: lchan is not available, but in state: %s.\n", gsm_lchans_name(lchan->state)); return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL); } + if (reactivation && lchan->state == LCHAN_S_NONE) { + LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "error: reactivation on inactive lchan.\n"); + return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL); + } + /* We need to pick the real TS here to check NM state: */ primary_ts = ts->vamos.is_shadow ? ts->vamos.peer : ts; if (primary_ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || @@ -1797,18 +1819,6 @@ .current = 0, }; - if (rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)) < 0) { - LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "%s(): rsl_tlv_parse() failed\n", __func__); - return rsl_tx_chan_act_nack(lchan, RSL_ERR_PROTO); - } - - /* 9.3.3 Activation Type */ - if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) { - LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, "missing Activation Type\n"); - return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR); - } - type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE); - /* 9.3.6 Channel Mode */ if (type != RSL_ACT_OSMO_PDCH) { if (rsl_handle_chan_mod_ie(lchan, &tp, &cause) != 0) @@ -2055,6 +2065,19 @@ else lchan->top_acch_active = false; + /* set ASCI channel into right state */ + if (reactivation && rsl_chan_rt_is_asci(lchan->rsl_chan_rt)) + vgcs_lchan_react(lchan); + + /* on reactivation, the channel is already activated */ + if (reactivation) { + rc = rsl_tx_chan_act_ack(lchan); + if (rc < 0) + LOGP(DRSL, LOGL_ERROR, "%s Cannot send act ack: %d\n", + gsm_ts_and_pchan_name(ts), rc); + return 0; + } + /* actually activate the channel in the BTS */ rc = l1sap_chan_act(lchan->ts->trx, dch->chan_nr); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33447 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I77f413cf70c2f5f8e8f525686eee40548521c71b Gerrit-Change-Number: 33447 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-bts[master]: Add test cases for rest octets of Paging Requests
by jolly 26 Jun '23

26 Jun '23
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/33450 ) Change subject: Add test cases for rest octets of Paging Requests ...................................................................... Add test cases for rest octets of Paging Requests The abstract representation of the rest octets are moved to the header file, so that the test case can include it. append_p*_rest_octets() function become externally available for test. Change-Id: Ifa5be8998b671160e38af1be707e040b00d407b8 Related: OS#5781 --- M include/osmo-bts/paging.h M src/common/paging.c M tests/paging/paging_test.c 3 files changed, 238 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/33450/1 diff --git a/include/osmo-bts/paging.h b/include/osmo-bts/paging.h index 9a30abb..a563925 100644 --- a/include/osmo-bts/paging.h +++ b/include/osmo-bts/paging.h @@ -7,6 +7,55 @@ struct paging_state; struct gsm_bts; +struct asci_notification; + +/* abstract representation of P1 rest octets; we only implement those parts we need for now */ +struct p1_rest_octets { + struct { + bool present; + uint8_t nln; + uint8_t nln_status; + } nln_pch; + bool packet_page_ind[2]; + bool r8_present; + struct { + bool prio_ul_access; + bool etws_present; + struct { + bool is_first; + uint8_t page_nr; + const uint8_t *page; + size_t page_bytes; + } etws; + } r8; +}; + +/* abstract representation of P2 rest octets; we only implement those parts we need for now */ +struct p2_rest_octets { + struct { + bool present; + uint8_t cn3; + } cneed; + struct { + bool present; + uint8_t nln; + uint8_t nln_status; + } nln_pch; +}; + +/* abstract representation of P3 rest octets; we only implement those parts we need for now */ +struct p3_rest_octets { + struct { + bool present; + uint8_t cn3; + uint8_t cn4; + } cneed; + struct { + bool present; + uint8_t nln; + uint8_t nln_status; + } nln_pch; +}; /* initialize paging code */ struct paging_state *paging_init(struct gsm_bts *bts, @@ -39,6 +88,12 @@ * PAGING COMMAND (from the PCU) */ int paging_add_macblock(struct paging_state *ps, const char *imsi, bool confirm, const uint8_t *macblock); +/* Paging rest octests */ +void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets *p1ro, + const struct asci_notification *notif); +void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro); +void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro); + /* generate paging message for given gsm time */ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt, int *is_empty); diff --git a/src/common/paging.c b/src/common/paging.c index d550e78..50db36a 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -318,54 +318,6 @@ #define L2_PLEN(len) (((len - 1) << 2) | 0x01) -/* abstract representation of P1 rest octets; we only implement those parts we need for now */ -struct p1_rest_octets { - struct { - bool present; - uint8_t nln; - uint8_t nln_status; - } nln_pch; - bool packet_page_ind[2]; - bool r8_present; - struct { - bool prio_ul_access; - bool etws_present; - struct { - bool is_first; - uint8_t page_nr; - const uint8_t *page; - size_t page_bytes; - } etws; - } r8; -}; - -/* abstract representation of P2 rest octets; we only implement those parts we need for now */ -struct p2_rest_octets { - struct { - bool present; - uint8_t cn3; - } cneed; - struct { - bool present; - uint8_t nln; - uint8_t nln_status; - } nln_pch; -}; - -/* abstract representation of P3 rest octets; we only implement those parts we need for now */ -struct p3_rest_octets { - struct { - bool present; - uint8_t cn3; - uint8_t cn4; - } cneed; - struct { - bool present; - uint8_t nln; - uint8_t nln_status; - } nln_pch; -}; - /* 3GPP TS 44.018 10.5.2.23 append a segment/page of an ETWS primary notification to given bitvec */ static void append_etws_prim_notif(struct bitvec *bv, bool is_first, uint8_t page_nr, const uint8_t *etws, ssize_t etws_len) @@ -392,8 +344,8 @@ } /* 3GPP TS 44.018 10.5.2.23 append P1 Rest Octets to given bit-vector */ -static void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets *p1ro, - const struct asci_notification *notif) +void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets *p1ro, + const struct asci_notification *notif) { /* Paging 1 RO (at least 10 bits before ETWS struct) */ if (p1ro->nln_pch.present) { @@ -438,7 +390,7 @@ } /* 3GPP TS 44.018 10.5.2.24 append P2 Rest Octets to given bit-vector */ -static void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro) +void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro) { /* {L | H <CN3: bit (2)>} */ if (p2ro->cneed.present) { @@ -459,7 +411,7 @@ } /* 3GPP TS 44.018 10.5.2.25 append P3 Rest Octets to given bit-vector */ -static void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro) +void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro) { /* {L | H <CN3: bit (2)> <CN3: bit (2)>} */ if (p3ro->cneed.present) { diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 6094d3d..1694b23 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -27,6 +27,7 @@ #include <osmo-bts/paging.h> #include <osmo-bts/gsm_data.h> #include <osmo-bts/l1sap.h> +#include <osmo-bts/notification.h> #include <unistd.h> @@ -178,6 +179,167 @@ } } +static void test_paging_rest_octets1(void) +{ + uint8_t out_buf[17]; + struct p1_rest_octets p1ro = {}; + struct asci_notification notif = {}; + + struct bitvec bv = { + .data_len = sizeof(out_buf), + .data = out_buf, + }; + + /* no rest */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + append_p1_rest_octets(&bv, &p1ro, NULL); + ASSERT_TRUE(out_buf[0] == 0x2b); + + /* add NLN */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p1ro.nln_pch.present = true; + p1ro.nln_pch.nln = 3; + p1ro.nln_pch.nln_status = 1; + append_p1_rest_octets(&bv, &p1ro, NULL); + ASSERT_TRUE(out_buf[0] == 0xfb); /* H 1 11 1 */ + p1ro.nln_pch.present = 0; + + /* add group callref */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + notif.group_call_ref[0] = 0x12; + notif.group_call_ref[1] = 0x34; + notif.group_call_ref[2] = 0x56; + notif.group_call_ref[3] = 0x78; + notif.group_call_ref[4] = 0x90; + notif.chan_desc.present = true; + notif.chan_desc.len = 3; + notif.chan_desc.value[0] = 0x20; + notif.chan_desc.value[1] = 0x40; + notif.chan_desc.value[2] = 0x80; + append_p1_rest_octets(&bv, &p1ro, &notif); + ASSERT_TRUE(out_buf[0] == 0x31); /* L L L H 0x123456789 */ + ASSERT_TRUE(out_buf[1] == 0x23); + ASSERT_TRUE(out_buf[2] == 0x45); + ASSERT_TRUE(out_buf[3] == 0x67); + ASSERT_TRUE(out_buf[4] == 0x89); + ASSERT_TRUE(out_buf[5] == 0x90); /* H 0x204080 0 */ + ASSERT_TRUE(out_buf[6] == 0x20); + ASSERT_TRUE(out_buf[7] == 0x40); + ASSERT_TRUE(out_buf[8] == 0x2b); + + /* add Packet Page Indication 1 */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p1ro.packet_page_ind[0] = true; + append_p1_rest_octets(&bv, &p1ro, NULL); + ASSERT_TRUE(out_buf[0] == 0x23); /* L L L L H L L L */ + p1ro.packet_page_ind[0] = false; + + /* add Packet Page Indication 2 */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p1ro.packet_page_ind[1] = true; + append_p1_rest_octets(&bv, &p1ro, NULL); + ASSERT_TRUE(out_buf[0] == 0x2f); /* L L L L L H L L */ + p1ro.packet_page_ind[1] = false; + + /* add ETWS */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p1ro.r8_present = true; + p1ro.r8.prio_ul_access = true; + p1ro.r8.etws_present = true; + p1ro.r8.etws.is_first = true; + p1ro.r8.etws.page_nr = 0x5; + uint8_t page[] = { 0x22, 0x44, 0x66 }; + p1ro.r8.etws.page_bytes = sizeof(page); + p1ro.r8.etws.page = page; + append_p1_rest_octets(&bv, &p1ro, NULL); + ASSERT_TRUE(out_buf[0] == 0x2b); /* L L L L L L L L */ + ASSERT_TRUE(out_buf[1] == 0xe5); /* H 1 1 0 0x5 */ + ASSERT_TRUE(out_buf[2] == 0x18); /* 0 len=24=0x18 */ + ASSERT_TRUE(out_buf[3] == 0x22); /* 0x224488 */ + ASSERT_TRUE(out_buf[4] == 0x44); + ASSERT_TRUE(out_buf[5] == 0x66); + p1ro.r8_present = false; +} + +static void test_paging_rest_octets2(void) +{ + uint8_t out_buf[11]; + struct p2_rest_octets p2ro = {}; + + struct bitvec bv = { + .data_len = sizeof(out_buf), + .data = out_buf, + }; + + /* nothing added */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + append_p2_rest_octets(&bv, &p2ro); + ASSERT_TRUE(out_buf[0] == 0x2b); /* L L */ + + /* add cneed */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p2ro.cneed.present = true; + p2ro.cneed.cn3 = 3; + append_p2_rest_octets(&bv, &p2ro); + ASSERT_TRUE(out_buf[0] == 0xeb); /* H 1 1 L */ + p2ro.cneed.present = false; + + /* add NLN */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p2ro.nln_pch.present = true; + p2ro.nln_pch.nln = 3; + p2ro.nln_pch.nln_status = 1; + append_p2_rest_octets(&bv, &p2ro); + ASSERT_TRUE(out_buf[0] == 0x7b); /* L H 1 11 1 */ + p2ro.nln_pch.present = 0; +} + +static void test_paging_rest_octets3(void) +{ + uint8_t out_buf[3]; + struct p3_rest_octets p3ro = {}; + + struct bitvec bv = { + .data_len = sizeof(out_buf), + .data = out_buf, + }; + + /* nothing added */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + append_p3_rest_octets(&bv, &p3ro); + ASSERT_TRUE(out_buf[0] == 0x2b); /* L L */ + + /* add cneed */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p3ro.cneed.present = true; + p3ro.cneed.cn3 = 3; + p3ro.cneed.cn4 = 3; + append_p3_rest_octets(&bv, &p3ro); + ASSERT_TRUE(out_buf[0] == 0xfb); /* H 1 1 1 1 L */ + p3ro.cneed.present = false; + + /* add NLN */ + memset(out_buf, GSM_MACBLOCK_PADDING, sizeof(out_buf)); + bv.cur_bit = 0; + p3ro.nln_pch.present = true; + p3ro.nln_pch.nln = 3; + p3ro.nln_pch.nln_status = 1; + append_p3_rest_octets(&bv, &p3ro); + ASSERT_TRUE(out_buf[0] == 0x7b); /* L H 1 11 1 */ + p3ro.nln_pch.present = 0; +} + int main(int argc, char **argv) { tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); @@ -200,6 +362,9 @@ test_paging_smoke(); test_paging_sleep(); test_is_ccch_for_agch(); + test_paging_rest_octets1(); + test_paging_rest_octets2(); + test_paging_rest_octets3(); printf("Success\n"); return 0; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33450 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ifa5be8998b671160e38af1be707e040b00d407b8 Gerrit-Change-Number: 33450 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: ASCI: Also display group/broadcast call message names
by pespin 26 Jun '23

26 Jun '23
Attention is currently required from: jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33444 ) Change subject: ASCI: Also display group/broadcast call message names ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33444 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I1874e61c24cd8e66b74171681d22f0bfe8069158 Gerrit-Change-Number: 33444 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Mon, 26 Jun 2023 08:53:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Allow 'configure <cr>' at VTY to enter config mode
by pespin 26 Jun '23

26 Jun '23
Attention is currently required from: jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33445 ) Change subject: Allow 'configure <cr>' at VTY to enter config mode ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33445 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I56d5d1bd5526603a397c62542e667c413f4952ca Gerrit-Change-Number: 33445 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Mon, 26 Jun 2023 08:53:15 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm0502: cosmetic: use ARRAY_SIZE in gsm0502_fn2ccch_block()
by laforge 26 Jun '23

26 Jun '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33422 ) Change subject: gsm0502: cosmetic: use ARRAY_SIZE in gsm0502_fn2ccch_block() ...................................................................... gsm0502: cosmetic: use ARRAY_SIZE in gsm0502_fn2ccch_block() Change-Id: Ideb9907fcb5eff74508f44714e478ec46d435a5d --- M src/gsm/gsm0502.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/gsm/gsm0502.c b/src/gsm/gsm0502.c index e9e612a..e4a761d 100644 --- a/src/gsm/gsm0502.c +++ b/src/gsm/gsm0502.c @@ -293,5 +293,5 @@ */ int gsm0502_fn2ccch_block(uint32_t fn) { - return ccch_block_table[fn % 51]; + return ccch_block_table[fn % ARRAY_SIZE(ccch_block_table)]; } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33422 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ideb9907fcb5eff74508f44714e478ec46d435a5d Gerrit-Change-Number: 33422 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmocore[master]: gsm0502: cosmetic: use ARRAY_SIZE in gsm0502_fn2ccch_block()
by laforge 26 Jun '23

26 Jun '23
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33422 ) Change subject: gsm0502: cosmetic: use ARRAY_SIZE in gsm0502_fn2ccch_block() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33422 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ideb9907fcb5eff74508f44714e478ec46d435a5d Gerrit-Change-Number: 33422 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 26 Jun 2023 08:38:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • ...
  • 248
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.