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

July 2023

  • 1 participants
  • 3051 discussions
[M] Change in osmo-tetra[master]: Added calls to stub decryption functions for MAC resources
by Jenkins Builder 27 Jul '23

27 Jul '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-tetra/+/33953 ) Change subject: Added calls to stub decryption functions for MAC resources ...................................................................... Patch Set 1: (4 comments) File src/tetra_upper_mac.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-10084): https://gerrit.osmocom.org/c/osmo-tetra/+/33953/comment/b090459d_6315da51 PS1, Line 207: if (!rsd.is_encrypted) { braces {} are not necessary for any arm of this statement Robot Comment from checkpatch (run ID jenkins-gerrit-lint-10084): https://gerrit.osmocom.org/c/osmo-tetra/+/33953/comment/f1b80714_d410025f PS1, Line 230: if (rsd.is_encrypted) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-10084): https://gerrit.osmocom.org/c/osmo-tetra/+/33953/comment/cec00a51_4e6c317c PS1, Line 360: if (fragslots[slot].encryption && fragslots[slot].key) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-10084): https://gerrit.osmocom.org/c/osmo-tetra/+/33953/comment/dd779ec2_d8813bd1 PS1, Line 490: if (REASSEMBLE_FRAGMENTS) { braces {} are not necessary for single statement blocks -- To view, visit https://gerrit.osmocom.org/c/osmo-tetra/+/33953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Change-Id: I92d718789d6b7e84c1901d09165fce59cdf8c1ca Gerrit-Change-Number: 33953 Gerrit-PatchSet: 1 Gerrit-Owner: wbokslag <w.bokslag(a)midnightblue.nl> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 27 Jul 2023 08:28:00 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-tetra[master]: Added calls to stub decryption functions for MAC resources
by wbokslag 27 Jul '23

27 Jul '23
wbokslag has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-tetra/+/33953 ) Change subject: Added calls to stub decryption functions for MAC resources ...................................................................... Added calls to stub decryption functions for MAC resources The tcs (Tetra Crypto State) struct now maintains information relevant for decryption, such as the current network, colour code, hyperframe, etcetera. Also, the upper mac now calls a stub decryption function when receiving an encrypted resource. Change-Id: I92d718789d6b7e84c1901d09165fce59cdf8c1ca --- M src/lower_mac/tetra_lower_mac.c M src/tetra_upper_mac.c M src/tetra_upper_mac.h 3 files changed, 106 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/53/33953/1 diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 907f1dc..31a8b60 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -40,6 +40,7 @@ #include <tetra_prim.h> #include "tetra_upper_mac.h" #include <lower_mac/viterbi.h> +#include <crypto/tetra_crypto.h> struct tetra_blk_param { const char *name; @@ -299,6 +300,12 @@ /* update the PHY layer time */ memcpy(&t_phy_state.time, &tcd->time, sizeof(t_phy_state.time)); tup->lchan = TETRA_LC_BSCH; + + /* Update colour code and network info for crypto IV generation */ + tcs->cc = tcd->colour_code; + if (tcs->mcc != tcd->mcc || tcs->mnc != tcd->mnc) + update_current_network(tcd->mcc, tcd->mnc); + break; case TPSAP_T_SB2: case TPSAP_T_NDB: diff --git a/src/tetra_upper_mac.c b/src/tetra_upper_mac.c index ef5ce39..c7aec3c 100644 --- a/src/tetra_upper_mac.c +++ b/src/tetra_upper_mac.c @@ -27,6 +27,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> +#include "crypto/tetra_crypto.h" #include "tetra_common.h" #include "tetra_prim.h" #include "tetra_upper_mac.h" @@ -114,6 +115,19 @@ sid.mle_si.bs_service_details & (1 << i) ? 1 : 0); memcpy(&tms->last_sid, &sid, sizeof(sid)); + + /* Update crypto state */ + tcs->la = sid.mle_si.la; + tcs->cn = sid.main_carrier; /* FIXME this won't work when not tuned to the main carier */ + if (sid.cck_valid_no_hf) { + if (sid.cck_id != tcs->cck_id) { + tcs->cck_id = sid.cck_id; + update_current_cck(); + } + } else { + tcs->hn = sid.hyperframe_number; + } + return -1; /* FIXME check this indeed fills slot */ } @@ -144,6 +158,7 @@ struct msgb *msg = tmvp->oph.msg; struct tetra_resrc_decoded rsd; struct msgb *fragmsgb; + struct tetra_key *key = 0; int tmpdu_offset, slot; int pdu_bits; /* Full length of pdu, including fill bits */ @@ -151,12 +166,12 @@ tmpdu_offset = macpdu_decode_resource(&rsd, msg->l1h, 0); if (rsd.macpdu_length == MACPDU_LEN_2ND_STOLEN) { - pdu_bits = -1; /* Fills slot */ - printf("WARNING pdu with MACPDU_LEN_2ND_STOLEN, not implemented\n"); + pdu_bits = -1; /* Fills slot */ + tms->cur_burst.blk2_stolen = true; /* Next block is also stolen */ } else if (rsd.macpdu_length == MACPDU_LEN_START_FRAG) { - pdu_bits = -1; /* Fills slot */ + pdu_bits = -1; /* Fills slot */ } else { - pdu_bits = rsd.macpdu_length * 8; /* Length given */ + pdu_bits = rsd.macpdu_length * 8; /* Length given */ msg->tail = msg->head + pdu_bits; } @@ -166,14 +181,35 @@ msg->tail -= num_fill_bits; } + /* Decrypt buffer if encrypted and key available */ + if (rsd.is_encrypted && tcdb->num_keys) { + decrypt_identity(&rsd.addr); + key = get_tea_key(rsd.addr.ssi); + + if (key) { + rsd.is_encrypted = !decrypt_mac_element(tmvp, key, msgb_l1len(msg), tmpdu_offset); + if (rsd.chan_alloc_pres) { + // Re-decode the channel allocation element to get accurate L2 start + tmpdu_offset += macpdu_decode_chan_alloc(&rsd.cad, msg->l1h + tmpdu_offset); + } + } + } + /* We now have accurate length and start of TM-SDU, set LLC start in msg->l2h */ msg->l2h = msg->l1h + tmpdu_offset; - printf("RESOURCE Encr=%u len_field=%d l1_len=%d l2_len %d Addr=%s", - rsd.encryption_mode, rsd.macpdu_length, msgb_l1len(msg), msgb_l2len(msg), + printf("RESOURCE Encr=%u%s len_field=%d l1_len=%d l2_len=%d Addr=%s", + rsd.encryption_mode, + rsd.encryption_mode && !rsd.is_encrypted ? " DECRYPTED" : "", + rsd.macpdu_length, msgb_l1len(msg), msgb_l2len(msg), tetra_addr_dump(&rsd.addr)); - if (rsd.chan_alloc_pres) - printf(" ChanAlloc=%s", tetra_alloc_dump(&rsd.cad, tms)); + if (rsd.chan_alloc_pres) { + if (!rsd.is_encrypted) { + printf(" ChanAlloc=%s", tetra_alloc_dump(&rsd.cad, tms)); + } else { + printf(" ChanAlloc=ENCRYPTED"); + } + } if (rsd.slot_granting.pres) printf(" SlotGrant=%u/%u", rsd.slot_granting.nr_slots, @@ -183,16 +219,22 @@ pdu_bits = -1; /* No more PDUs in slot */ goto out; } + tms->ssi = rsd.addr.ssi; + tms->usage_marker = rsd.addr.usage_marker; + tms->addr_type = rsd.addr.type; + if (msgb_l2len(msg) == 0) { goto out; /* No l2 data */ } + if (rsd.is_encrypted) { + goto out; /* Can't parse any further */ + } + printf(": %s\n", osmo_ubit_dump(msg->l2h, msgb_l2len(msg))); if (rsd.macpdu_length != MACPDU_LEN_START_FRAG || !REASSEMBLE_FRAGMENTS) { /* Non-fragmented resource (or no reassembly desired) */ - if (!rsd.is_encrypted) { - rx_tm_sdu(tms, msg, msgb_l2len(msg)); - } + rx_tm_sdu(tms, msg, msgb_l2len(msg)); } else { /* Fragmented resource */ slot = tmvp->u.unitdata.tdma_time.tn; @@ -205,6 +247,7 @@ fragmsgb = fragslots[slot].msgb; /* Copy l2 part to fragmsgb. l3h is constructed once all fragments are merged */ + fragmsgb = fragslots[slot].msgb; fragmsgb->l1h = msgb_put(fragmsgb, msgb_l1len(msg)); fragmsgb->l2h = fragmsgb->l1h + tmpdu_offset; fragmsgb->l3h = 0; @@ -215,10 +258,9 @@ fragslots[slot].num_frags = 1; fragslots[slot].length = msgb_l2len(msg); fragslots[slot].encryption = rsd.encryption_mode > 0; + fragslots[slot].key = key; } - tms->ssi = rsd.addr.ssi; - out: printf("\n"); return pdu_bits; @@ -243,6 +285,7 @@ static int rx_macfrag(struct tetra_tmvsap_prim *tmvp, struct tetra_mac_state *tms) { struct msgb *msg = tmvp->oph.msg; + struct msgb *fragmsgb; int slot = tmvp->u.unitdata.tdma_time.tn; uint8_t *bits = msg->l1h; uint8_t fillbits_present; @@ -258,11 +301,16 @@ /* MAC-FRAG will always fill remainder of the slot, but fill bits may be present */ if (fillbits_present) { int num_fill_bits = get_num_fill_bits(msg->l1h, msgb_l1len(msg)); - msgb_get(msg, num_fill_bits); + msg->tail -= num_fill_bits; + } + + /* Decrypt (if required) */ + fragmsgb = fragslots[slot].msgb; + if (fragslots[slot].encryption && fragslots[slot].key) { + decrypt_mac_element(tmvp, fragslots[slot].key, msgb_l1len(msg), n); } /* Add frag to fragslot buffer */ - struct msgb *fragmsgb = fragslots[slot].msgb; append_frag_bits(slot, msg->l2h, msgb_l2len(msg)); printf("FRAG-CONT slot=%d added=%d msgb=%s\n", slot, msgb_l2len(msg), osmo_ubit_dump(fragmsgb->l2h, msgb_l2len(fragmsgb))); } else { @@ -308,6 +356,11 @@ msg->tail -= num_fill_bits; } + /* Decrypt (if required) */ + if (fragslots[slot].encryption && fragslots[slot].key) { + decrypt_mac_element(tmvp, fragslots[slot].key, msgb_l1len(msg), n); + } + /* Parse chanalloc element (if present) and update l2 offsets */ if (chanalloc_present) { m = macpdu_decode_chan_alloc(&rsd.cad, bits + n); n = n + m; @@ -317,7 +370,7 @@ printf("FRAG-END slot=%d added=%d msgb=%s\n", slot, msgb_l2len(msg), osmo_ubit_dump(fragmsgb->l2h, msgb_l2len(fragmsgb))); /* Message is completed inside fragmsgb now */ - if (!fragslots[slot].encryption) { + if (!fragslots[slot].encryption || fragslots[slot].key) { rx_tm_sdu(tms, fragmsgb, fragslots[slot].length); } } else { @@ -343,17 +396,17 @@ { uint8_t slot_granting = *(msg->l1h + 17); if (slot_granting) - tmpdu_offset = 17+1+8; + tmpdu_offset = 17 + 1 + 8; else - tmpdu_offset = 17+1; + tmpdu_offset = 17 + 1; } #endif printf("SUPPLEMENTARY MAC-D-BLOCK "); //if (sud.encryption_mode == 0) - msg->l2h = msg->l1h + tmpdu_offset; - rx_tm_sdu(tms, msg, 100); + msg->l2h = msg->l1h + tmpdu_offset; + rx_tm_sdu(tms, msg, 100); printf("\n"); return -1; /* TODO FIXME check length */ @@ -385,10 +438,15 @@ printf("UL_USAGE: %s ", tetra_get_ul_usage_name(aad.ul_usage)); /* save the state whether the current burst is traffic or not */ - if (aad.dl_usage > 3) + if (aad.dl_usage > 3) { tms->cur_burst.is_traffic = aad.dl_usage; - else + } else { tms->cur_burst.is_traffic = 0; + } + + /* Reset slot stealing flags */ + tms->cur_burst.blk1_stolen = false; + tms->cur_burst.blk2_stolen = false; printf("\n"); } @@ -426,9 +484,12 @@ if (gsmtap_msg) tetra_gsmtap_sendmsg(gsmtap_msg); - /* age out old fragments */ - if (REASSEMBLE_FRAGMENTS && tup->tdma_time.fn == 18) { - age_fragslots(); + if (tup->tdma_time.fn == 18) { + /* age out old event labels and fragments*/ + // age_event_labels(); + if (REASSEMBLE_FRAGMENTS) { + age_fragslots(); + } } len_parsed = -1; /* Default for cases where slot is filled or otherwise irrelevant */ diff --git a/src/tetra_upper_mac.h b/src/tetra_upper_mac.h index d7a420d..e399729 100644 --- a/src/tetra_upper_mac.h +++ b/src/tetra_upper_mac.h @@ -14,6 +14,7 @@ int num_frags; /* Maintains the number of fragments appended in the msgb */ int length; /* Maintains the number of bits appended in the msgb */ bool encryption; /* Set to true if the fragments were received encrypted */ + struct tetra_key *key; /* Holds pointer to the key to be used for this slot */ struct msgb *msgb; /* Message buffer in which fragments are appended */ }; -- To view, visit https://gerrit.osmocom.org/c/osmo-tetra/+/33953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-Change-Id: I92d718789d6b7e84c1901d09165fce59cdf8c1ca Gerrit-Change-Number: 33953 Gerrit-PatchSet: 1 Gerrit-Owner: wbokslag <w.bokslag(a)midnightblue.nl> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-pcu[master]: gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB wh...
by osmith 27 Jul '23

27 Jul '23
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33924 ) Change subject: gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I5ef4dcb0c5eac07a892114897f9e4f565b1dcc2c Gerrit-Change-Number: 33924 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:41:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[XL] Change in osmo-pcu[master]: Split rlc_{dl_,ul_,}window out of rlc.{h,cpp}
by osmith 27 Jul '23

27 Jul '23
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33939 ) Change subject: Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If21b6f48ef190a718502389cbfde8cbdfc8d7f7a Gerrit-Change-Number: 33939 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:40:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: pcu: Introduce test TC_ul_tbf_bsn_wraparound_gprs
by osmith 27 Jul '23

27 Jul '23
Attention is currently required from: pespin, fixeria. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33923 ) Change subject: pcu: Introduce test TC_ul_tbf_bsn_wraparound_gprs ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I253e3607b75dd1a850c53f284fadf753dd49c247 Gerrit-Change-Number: 33923 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:38:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-pcu[master]: gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB wh...
by laforge 27 Jul '23

27 Jul '23
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33924 ) Change subject: gprs_rlc_ul_window: Mark received BSNs falling out of the V(N)/RBB when V(R) is raised ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I5ef4dcb0c5eac07a892114897f9e4f565b1dcc2c Gerrit-Change-Number: 33924 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:07:23 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[XL] Change in osmo-pcu[master]: Split rlc_{dl_,ul_,}window out of rlc.{h,cpp}
by laforge 27 Jul '23

27 Jul '23
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33939 ) Change subject: Split rlc_{dl_,ul_,}window out of rlc.{h,cpp} ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If21b6f48ef190a718502389cbfde8cbdfc8d7f7a Gerrit-Change-Number: 33939 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:06:54 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: pcu: Introduce test TC_ul_tbf_bsn_wraparound_gprs
by laforge 27 Jul '23

27 Jul '23
Attention is currently required from: osmith, pespin, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33923 ) Change subject: pcu: Introduce test TC_ul_tbf_bsn_wraparound_gprs ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I253e3607b75dd1a850c53f284fadf753dd49c247 Gerrit-Change-Number: 33923 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 27 Jul 2023 07:06:07 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTP_Templates: add template tr_RANTransparentContainer_RAN_INFO_REQ
by laforge 27 Jul '23

27 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33936 ) Change subject: GTP_Templates: add template tr_RANTransparentContainer_RAN_INFO_REQ ...................................................................... GTP_Templates: add template tr_RANTransparentContainer_RAN_INFO_REQ We have a ts_RANTransparentContainer_RAN_INFO_REQ but no coresponding tr_RANTransparentContainer_RAN_INFO_REQ template yet. Related: OS#5760 Change-Id: I83b0134c9406526c2fe5b6e97e160b8b28295d20 --- M library/GTP_Templates.ttcn 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 198a3b8..f6fda36 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -1129,6 +1129,13 @@ pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu } } + template RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { + type_gtpc := '90'O, + lengthf := ?, + rANTransparentContainerField := { + pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu + } + } /* RAN_Information */ template ApplContainer_or_ApplErrContainer_NACC_GTPC -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33936 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I83b0134c9406526c2fe5b6e97e160b8b28295d20 Gerrit-Change-Number: 33936 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: S1AP_Emulation: improve accessibility of unit-data
by laforge 27 Jul '23

27 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33898 ) Change subject: S1AP_Emulation: improve accessibility of unit-data ...................................................................... S1AP_Emulation: improve accessibility of unit-data When S1AP unit-data is passed around, there is always the problem that it is routed to the MTC_CT. The reason for this is that S1AP_Emulation cannot determine a specific receiver component because unit-data does not contain any addressing fields that would identifiy a specific eNB or UE. Unfortunately it can be a huge problem when developing test fixtures that use unit-data from inside a ConnHdlr component. It is no problem to send unit-data using S1AP.send(), but it is impossible to receive unit-data through the same path. The solution that is proposed in this patch uses a mechanism that allows to create an expectation for a specific procedureCode. When the S1AP_Emulation sees a messages with the expected procedureCode, it will forward it to the ConnHdlr component. Related: OS#5760 Change-Id: I041b45b247e365b0d4ee8645c07dc5f26007af82 --- M library/S1AP_Emulation.ttcn 1 file changed, 110 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/S1AP_Emulation.ttcn b/library/S1AP_Emulation.ttcn index 38c738b..bb3a2a4 100644 --- a/library/S1AP_Emulation.ttcn +++ b/library/S1AP_Emulation.ttcn @@ -15,7 +15,9 @@ * * If a pre-existing component wants to register to handle a future inbound UE * association, it can do so by registering an "expect" with the expected - * MME_UE_S1AP_ID/ENB_UE_S1AP_ID identifiers. + * MME_UE_S1AP_ID/ENB_UE_S1AP_ID identifiers. It is also possible to register + * an expect for a specific procedureCode, in case the expected message is non + * UE related (unit-data). * * Inbound non-UE related S1AP messages (such as RESET, SETUP, OVERLOAD) are * dispatched to the S1apOps.unitdata_cb() callback, which is registered with @@ -107,6 +109,8 @@ var AssociationData S1apAssociationTable[16]; /* pending expected S1AP Association (UE oriented) */ var ExpectData S1apExpectTable[8]; + /* pending expected S1AP PDU */ + var ExpectDataProc S1apExpectTableProc[8]; /* procedure based port to register for incoming connections */ port S1APEM_PROC_PT S1AP_PROC; /* test port for unit data messages */ @@ -367,6 +371,32 @@ } } +private function SendToS1apExpectTableProc(S1AP_PDU msg) runs on S1AP_Emulation_CT { + var integer procedureCode; + var S1AP_ConnHdlr vc_conn; + + if (ispresent(msg.initiatingMessage.procedureCode)) { + procedureCode := msg.initiatingMessage.procedureCode; + } else if (ispresent(msg.unsuccessfulOutcome.procedureCode)) { + procedureCode := msg.unsuccessfulOutcome.procedureCode; + } else if (ispresent(msg.successfulOutcome.procedureCode)) { + procedureCode := msg.successfulOutcome.procedureCode; + } else { + return; + } + + for (var integer i := 0; i < sizeof(S1apExpectTableProc); i := i+1) { + if (S1apExpectTableProc[i].procedureCode == procedureCode) { + vc_conn := S1apExpectTableProc[i].vc_conn; + if (vc_conn != null) { + S1AP_CLIENT.send(msg) to vc_conn; + } + } + } + + return; +} + function main(S1APOps ops, S1AP_conn_parameters p, charstring id) runs on S1AP_Emulation_CT { var Result res; g_pars := p; @@ -397,6 +427,7 @@ var PDU_NAS_EPS nas; var MME_UE_S1AP_ID mme_id; var ENB_UE_S1AP_ID enb_id; + var integer procedureCode; var S1AP_RecvFrom mrf; var S1AP_PDU msg; var S1APEM_Config s1cfg; @@ -448,6 +479,7 @@ [] S1AP.receive(tr_S1AP_RecvFrom_R(?)) -> value mrf { if (match(mrf.msg, tr_S1AP_nonUErelated)) { /* non-UE-related S1AP message */ + SendToS1apExpectTableProc(mrf.msg); var template S1AP_PDU resp := ops.unitdata_cb.apply(mrf.msg); if (isvalue(resp)) { S1AP.send(t_S1AP_Send(g_s1ap_conn_id, valueof(resp))); @@ -491,6 +523,10 @@ f_create_expect(mme_id, enb_id, vc_conn); S1AP_PROC.reply(S1APEM_register:{mme_id, enb_id, vc_conn}) to vc_conn; } + [] S1AP_PROC.getcall(S1APEM_register_proc:{?,?}) -> param(procedureCode, vc_conn) { + f_create_expect_proc(procedureCode, vc_conn); + S1AP_PROC.reply(S1APEM_register_proc:{procedureCode, vc_conn}) to vc_conn; + } } } @@ -504,10 +540,19 @@ S1AP_ConnHdlr vc_conn } +/* represents a single S1AP PDU that we expect. When a matching PDU is seen, it is forwarded to the registered + * component */ +type record ExpectDataProc { + integer procedureCode optional, + S1AP_ConnHdlr vc_conn /* component handling this UE connection */ +}; + signature S1APEM_register(in MME_UE_S1AP_ID mme_id, in ENB_UE_S1AP_ID enb_id, in S1AP_ConnHdlr hdlr); +signature S1APEM_register_proc(in integer procedureCode, in S1AP_ConnHdlr hdlr); type port S1APEM_PROC_PT procedure { inout S1APEM_register; + inout S1APEM_register_proc; } with { extension "internal" }; /* Function that can be used as create_cb and will use the expect table */ @@ -573,6 +618,39 @@ } } +private function f_create_expect_proc(integer procedureCode, S1AP_ConnHdlr hdlr) runs on S1AP_Emulation_CT { + var integer i; + + /* Check an entry like this is not already presnt */ + for (i := 0; i < sizeof(S1apExpectTableProc); i := i+1) { + if (S1apExpectTableProc[i].vc_conn == null) { + continue; + } + if (S1apExpectTableProc[i].procedureCode == procedureCode) { + setverdict(fail, "procedureCode ", procedureCode, " already present"); + mtc.stop; + } + } + for (i := 0; i < sizeof(S1apExpectTableProc); i := i+1) { + if (S1apExpectTableProc[i].vc_conn == null) { + S1apExpectTableProc[i].procedureCode := procedureCode; + S1apExpectTableProc[i].vc_conn := hdlr; + log("Created Expect[", i, "] for PDU:", procedureCode, " to be handled at ", hdlr); + return; + } + } + testcase.stop("No space left in S1apExpectTableProc") +} + +/* client/conn_hdlr side function to use procedure port to create expect (PDU) in emulation */ +function f_create_s1ap_expect_proc(integer procedureCode, S1AP_ConnHdlr hdlr) runs on S1AP_ConnHdlr +{ + S1AP_PROC.call(S1APEM_register_proc:{procedureCode, self}) { + [] S1AP_PROC.getreply(S1APEM_register_proc:{?,?}) {}; + } + + log(procedureCode); +} private function f_expect_table_init() runs on S1AP_Emulation_CT { @@ -582,6 +660,11 @@ S1apExpectTable[i].enb_id := omit; S1apExpectTable[i].vc_conn := null; } + + for (i := 0; i < sizeof(S1apExpectTableProc); i := i + 1) { + S1apExpectTableProc[i].procedureCode := omit; + S1apExpectTableProc[i].vc_conn := null; + } } function DummyUnitdataCallback(S1AP_PDU msg) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33898 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I041b45b247e365b0d4ee8645c07dc5f26007af82 Gerrit-Change-Number: 33898 Gerrit-PatchSet: 7 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-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • ...
  • 306
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.