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

December 2023

  • 1 participants
  • 1601 discussions
[XL] Change in osmo-ttcn3-hacks[master]: Split Diameter TS 29.272 templates into its own file
by pespin 21 Dec '23

21 Dec '23
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35405?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: Split Diameter TS 29.272 templates into its own file ...................................................................... Split Diameter TS 29.272 templates into its own file This allows more easily finding, understanding and using the tons of templates coming from different specs. Change-Id: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4 --- M dia2gsup/DIA2GSUP_Tests.ttcn M dia2gsup/gen_links.sh M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M hss/HSS_Tests.ttcn M hss/gen_links.sh M library/DIAMETER_Templates.ttcn A library/DIAMETER_ts29_272_Templates.ttcn M mme/MME_Tests.ttcn M mme/gen_links.sh M pgw/PGW_Tests.ttcn M pgw/gen_links.sh 12 files changed, 660 insertions(+), 616 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/35405/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35405?usp=email 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: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4 Gerrit-Change-Number: 35405 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[XL] Change in osmo-ttcn3-hacks[master]: Split Diameter TS 29.272 templates into its own file
by pespin 21 Dec '23

21 Dec '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35405?usp=email ) Change subject: Split Diameter TS 29.272 templates into its own file ...................................................................... Split Diameter TS 29.272 templates into its own file This allows more easily finding, understanding and using the tons of templates coming from different specs. Change-Id: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4 --- M dia2gsup/DIA2GSUP_Tests.ttcn M dia2gsup/gen_links.sh M hss/HSS_Tests.ttcn M hss/gen_links.sh M library/DIAMETER_Templates.ttcn A library/DIAMETER_ts29_272_Templates.ttcn M mme/MME_Tests.ttcn M mme/gen_links.sh 8 files changed, 654 insertions(+), 614 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/35405/1 diff --git a/dia2gsup/DIA2GSUP_Tests.ttcn b/dia2gsup/DIA2GSUP_Tests.ttcn index e12f17b..6e59460 100644 --- a/dia2gsup/DIA2GSUP_Tests.ttcn +++ b/dia2gsup/DIA2GSUP_Tests.ttcn @@ -11,6 +11,7 @@ import from DIAMETER_Types all; import from DIAMETER_Templates all; +import from DIAMETER_ts29_272_Templates all; import from DIAMETER_Emulation all; type component MTC_CT { diff --git a/dia2gsup/gen_links.sh b/dia2gsup/gen_links.sh index d0002eb..52939f6 100755 --- a/dia2gsup/gen_links.sh +++ b/dia2gsup/gen_links.sh @@ -36,7 +36,8 @@ FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="Osmocom_CTRL_Types.ttcn " FILES+="L3_Common.ttcn " -FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn " +FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " +FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn " FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp " FILES+="GSUP_Types.ttcn GSUP_Emulation.ttcn " diff --git a/hss/HSS_Tests.ttcn b/hss/HSS_Tests.ttcn index bd493c4..a5503a7 100644 --- a/hss/HSS_Tests.ttcn +++ b/hss/HSS_Tests.ttcn @@ -7,6 +7,7 @@ import from DIAMETER_Types all; import from DIAMETER_Templates all; +import from DIAMETER_ts29_272_Templates all; import from DIAMETER_Emulation all; type record of hexstring SubscriberConfigs; diff --git a/hss/gen_links.sh b/hss/gen_links.sh index b97d53f..7160832 100755 --- a/hss/gen_links.sh +++ b/hss/gen_links.sh @@ -23,7 +23,8 @@ DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " -FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn " +FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " +FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn " gen_links $DIR $FILES ignore_pp_results diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 9a3e739..05a6ea7 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -102,28 +102,10 @@ DIAMETER_ERROR_EAP_CODE_UNKNOWN (5048) }; -/* 3GPP TS 29.272 section 7.4. Errors in Experimental-Result-Code */ -type enumerated DIAMETER_ExperimentalResultcode { - /* transient */ - DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), - DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4182), - /* permanent */ - DIAMETER_ERROR_USER_UNKNOWN (5001), - DIAMETER_AUTHORIZATION_REJECTED (5003), - DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5004), - DIAMETER_MISSING_AVP (5005), - DIAMETER_ERROR_UNKNOWN_EPS_SUBSCRIPTION (5420), - DIAMETER_ERROR_RAT_NOT_ALLOWED (5421), - DIAMETER_ERROR_EQUIPMENT_UNKNOWN (5422), - DIAMETER_ERROR_UNKOWN_SERVING_NODE (5423) -} - /* Gy : 3GPP TS 32.299 7.1.6, RFC4006 3.1 */ const uint32_t c_DIAMETER_CREDIT_CONTROL_AID := 4; -/* 3GPP TS 29.272 Section 7.1.8 */ + const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238; -const uint32_t c_DIAMETER_3GPP_S6_AID := 16777251; -const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252; const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308; const octetstring c_def_sess_id := char2oct("ttcn3.session"); @@ -667,196 +649,6 @@ template (present) GenericAVP tr_AVP_UserNameImsi(template (present) hexstring imsi := ?) := tr_AVP_UserName(char2oct_tmpl(hex2str_tmpl(imsi))); - -/* TS 29.272 7.3.53 RAND */ -template (value) GenericAVP ts_AVP_RAND(template (value) octetstring rand) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_RAND), - avp_data := { - avp_AAA_3GPP_RAND := rand - } - } -} - -/* TS 29.272 7.3.54 XRES */ -template (value) GenericAVP ts_AVP_XRES(template (value) octetstring xres) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_XRES), - avp_data := { - avp_AAA_3GPP_XRES := xres - } - } -} - -/* TS 29.272 7.3.55 XRES */ -template (value) GenericAVP ts_AVP_AUTN(template (value) octetstring autn) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AUTN), - avp_data := { - avp_AAA_3GPP_AUTN := autn - } - } -} - -/* TS 29.272 7.3.56 KASME */ -template (value) GenericAVP ts_AVP_KASME(template (value) octetstring kasme) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), - avp_data := { - avp_AAA_3GPP_KASME := kasme - } - } -} - -/* TS 29.272 7.3.23 Item-Number */ -template (value) GenericAVP ts_AVP_ItemNumber(uint32_t num) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), - avp_data := { - avp_AAA_3GPP_Item_Number := int2oct(num, 4) - } - } -} - -/* TS 29.272 7.3.18 E-UTRAN Vector */ -template (value) GenericAVP ts_AVP_EutranVec(uint32_t item_num, octetstring rand, octetstring xres, - octetstring autn, octetstring kasme) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_E_UTRAN_Vector), - avp_data := { - avp_AAA_3GPP_E_UTRAN_Vector := { - ts_AVP_ItemNumber(item_num), - ts_AVP_RAND(rand), - ts_AVP_XRES(xres), - ts_AVP_AUTN(autn), - ts_AVP_KASME(kasme) - } - } - } -} - -/* TS 29.272 7.3.2 Subscription-Data */ -template (value) GenericAVP ts_AVP_3GPP_SubscriptionData(template (value) AVP_list content) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), - avp_data := { - avp_AAA_3GPP_Subscription_Data := content - } - } -} -template (present) GenericAVP -tr_AVP_3GPP_SubscriptionData(template (present) AVP_list content := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), - avp_data := { - avp_AAA_3GPP_Subscription_Data := content - } - } -} - - -/* TS 29.272 7.3.17 Authentication-Info */ -template (value) GenericAVP ts_AVP_3GPP_AuthInfo(template (value) AVP_list content) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), - avp_data := { - avp_AAA_3GPP_Authentication_Info := content - } - } -} -template (present) GenericAVP -tr_AVP_3GPP_AuthInfo(template (present) AVP_list content := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), - avp_data := { - avp_AAA_3GPP_Authentication_Info := content - } - } -} - -/* TS 29.272 7.3.9 Visited-PLMN-Id */ -template (value) GenericAVP ts_AVP_3GPP_VisitedPlmnId(template (value) octetstring id) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), - avp_data := { - avp_AAA_3GPP_Visited_PLMN_Id := id - } - } -} -template (present) GenericAVP tr_AVP_3GPP_VisitedPlmnId(template (present) octetstring id := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), - avp_data := { - avp_AAA_3GPP_Visited_PLMN_Id := id - } - } -} - -/* TS 29.272 7.3.13 RAT-Type */ -template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) PCC_3GPP_RAT_Type rat_type) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), - avp_data := { - avp_PCC_3GPP_RAT_Type := rat_type - } - } -} -template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) PCC_3GPP_RAT_Type rat_type := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), - avp_data := { - avp_PCC_3GPP_RAT_Type := rat_type - } - } -} - -template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) GI_3GPP_3GPP_RAT_Type rat_type := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type), - avp_data := { - avp_GI_3GPP_3GPP_RAT_Type := rat_type - } - } -} - -/* TS 29.272 7.3.7 ULR-Flags */ -template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 flags) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), - avp_data := { - avp_AAA_3GPP_ULR_Flags := flags - } - } -} -template (present) GenericAVP tr_AVP_3GPP_UlrFlags(template (present) UINT32 flags := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), - avp_data := { - avp_AAA_3GPP_ULR_Flags := flags - } - } -} - -/* TS 29.272 7.3.8 ULA-Flags */ -template (value) GenericAVP ts_AVP_3GPP_UlaFlags(template (value) UINT32 flags) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), - avp_data := { - avp_AAA_3GPP_ULA_Flags := flags - } - } -} -template (present) GenericAVP tr_AVP_3GPP_UlaFlags(template (present) UINT32 flags := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), - avp_data := { - avp_AAA_3GPP_ULA_Flags := flags - } - } -} - - - template (value) GenericAVP ts_AVP_NumOfReqVectors(template (value) UINT32 num_req := '00000004'O) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Number_Of_Requested_Vectors), @@ -889,61 +681,6 @@ } } - -/* TS 29.272 7.3.27 Context-Identifier */ -template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t ctx := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), - avp_data := { - avp_AAA_3GPP_Context_Identifier := int2oct_tmpl(ctx, 4) - } - } -} -template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), - avp_data := { - avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) - } - } -} - -/* Ts 29.272 7.3.29 Subscriber-Status */ -template (present) GenericAVP tr_AVP_3GPP_SubscriberStatus(template (present) AAA_3GPP_Subscriber_Status sts) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), - avp_data := { - avp_AAA_3GPP_Subscriber_Status := sts - } - } -} -template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), - avp_data := { - avp_AAA_3GPP_Subscriber_Status := sts - } - } -} - -/* Ts 29.272 7.3.30 Operator-Determined-Barring */ -template (present) GenericAVP tr_AVP_3GPP_OperatorDeterminedBarring(template (present) uint32_t val := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), - avp_data := { - avp_AAA_3GPP_Operator_Determined_Barring := int2oct_tmpl(val, 4) - } - } -} -template (value) GenericAVP ts_AVP_3GPP_OperatorDeterminedBarring(uint32_t val) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), - avp_data := { - avp_AAA_3GPP_Operator_Determined_Barring := int2oct(val, 4) - } - } -} - template (present) GenericAVP tr_AVP_3GPP_SubscrRauTauTmr(template (present) uint32_t tmr := ?) := { avp := { avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer), @@ -962,73 +699,6 @@ } } -/* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */ -template (present) GenericAVP tr_AVP_3GPP_AllApnConfigsIncl(template (present) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), - avp_data := { - avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind - } - } -} -template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), - avp_data := { - avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind - } - } -} - -/* TS 29.272 7.3.34 APN-Configuration-Profile */ -template (present) GenericAVP tr_AVP_3GPP_ApnConfigProfile(template (present) AVP_list content := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), - avp_data := { - avp_AAA_3GPP_APN_Configuration_Profile := content - } - } -} -template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), - avp_data := { - avp_AAA_3GPP_APN_Configuration_Profile := content - } - } -} - -/* TS 29.272 7.3.35 APN-Configuration */ -template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t ctx := ?, - template (present) AAA_3GPP_PDN_Type pdn_type := ?, - template (present) charstring apn := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), - avp_data := { - avp_AAA_3GPP_APN_Configuration := superset( - tr_AVP_3GPP_ContextId(ctx), - tr_AVP_3GPP_PdnType(pdn_type), - tr_AVP_ServiceSelection(apn), - tr_AVP_3GPP_EpsSubscrQosProfile(?, ?) - ) - } - } -} -template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, - charstring apn) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), - avp_data := { - avp_AAA_3GPP_APN_Configuration := { - ts_AVP_3GPP_ContextId(ctx), - ts_AVP_3GPP_PdnType(pdn_type), - ts_AVP_ServiceSelection(apn), - ts_AVP_3GPP_EpsSubscrQosProfile(1, 1) - } - } - } -} - /* Service-Selection, TS 29.272 7.3.36, TS 29.273 5.2.3.5, (RFC 5778) */ template (present) GenericAVP tr_AVP_ServiceSelection(template (present) charstring apn := ?) := { avp := { @@ -1179,67 +849,6 @@ } } - -/* TS 29.272 7.3.41 AMBR */ -template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), - avp_data := { - avp_AAA_3GPP_AMBR := { - tr_AVP_3GPP_MaxReqBwUL(ul), - tr_AVP_3GPP_MaxReqBwDL(dl) - } - } - } -} -template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), - avp_data := { - avp_AAA_3GPP_AMBR := { - ts_AVP_3GPP_MaxReqBwUL(ul), - ts_AVP_3GPP_MaxReqBwDL(dl) - } - } - } -} - -template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), - avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4) - } - } -} - -template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), - avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) - } - } -} - -template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), - avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4) - } - } -} - -template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), - avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) - } - } -} - template (present) GenericAVP tr_AVP_3GPP_Reporting_Reason(template (present) DCA_3GPP_Reporting_Reason r := ?) := { avp := { avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Reporting_Reason), @@ -1402,24 +1011,6 @@ } } -/* TS 29.272 7.3.62 PDN-Type */ -template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := { - avp := { - avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), - avp_data := { - avp_AAA_3GPP_PDN_Type := pdn_type - } - } -} -template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { - avp := { - avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), - avp_data := { - avp_AAA_3GPP_PDN_Type := pdn_type - } - } -} - /* RFC4006 8.16 Multiple-Services-Credit-Control AVP */ template (value) GenericAVP ts_AVP_Multiple_Services_Credit_Control(template (value) AVP_list content) := { avp := { @@ -1616,207 +1207,6 @@ return diam_pdu; } - -template (value) PDU_DIAMETER -ts_DIA_AIR(/* template (value) */ hexstring imsi, - template (value) octetstring mcc_mnc := '111F11'O, - template (value) octetstring sess_id := c_def_sess_id, - template (value) charstring orig_host := "ttcn3.localdomain", - template (value) charstring orig_realm := "localdomain", - template (value) charstring dest_realm := "localdomain", - template (value) UINT32 hbh_id := '00000000'O, - template (value) UINT32 ete_id := '00000000'O) := - ts_DIAMETER(flags := '11000000'B, - cmd_code := Authentication_Information, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := { - ts_AVP_SessionId(sess_id), - ts_AVP_DestinationRealm(dest_realm), - ts_AVP_OriginHost(orig_host), - ts_AVP_OriginRealm(orig_realm), - ts_AVP_UserNameImsi(imsi), - /* Requested EUTRAN Auth Info */ - ts_AVP_RequestedEutranAuthInfo, - ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), - ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) - }); -template (present) PDU_DIAMETER -tr_DIA_AIR(/* template (present) */ hexstring imsi, - template (present) octetstring sess_id := ?, - template (present) charstring dest_realm := ?, - template (present) UINT32 hbh_id := ?, - template (present) UINT32 ete_id := ?) := - tr_DIAMETER(flags := '1???????'B, - cmd_code := Authentication_Information, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, ete_id := ete_id, - avps := superset( - tr_AVP_SessionId(sess_id), - tr_AVP_DestinationRealm(dest_realm), - tr_AVP_UserNameImsi(imsi), - tr_AVP_3GPP_VisitedPlmnId - )); - -/* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ -template (value) PDU_DIAMETER -ts_DIA_AIA(template (value) AVP_list auth_info_contents, - template (value) octetstring sess_id := c_def_sess_id, - template (value) charstring orig_host := "hss.localdomain", - template (value) charstring orig_realm := "localdomain", - template (value) UINT32 hbh_id := '00000000'O, - template (value) UINT32 ete_id := '00000000'O) := - ts_DIAMETER(flags := '01000000'B, - cmd_code := Authentication_Information, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := { - ts_AVP_SessionId(sess_id), - ts_AVP_ResultCode(DIAMETER_SUCCESS), - ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), - ts_AVP_OriginHost(orig_host), - ts_AVP_OriginRealm(orig_realm), - ts_AVP_3GPP_AuthInfo(auth_info_contents) - }); -template (present) PDU_DIAMETER -tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, - template (present) octetstring sess_id := ?, - template (present) charstring orig_host := ?, - template (present) charstring orig_realm := ?, - template (present) UINT32 hbh_id := ?, - template (present) UINT32 ete_id := ?) := - tr_DIAMETER(flags := '0???????'B, - cmd_code := Authentication_Information, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := superset( - tr_AVP_SessionId(sess_id), - tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), - tr_AVP_OriginHost(orig_host), - tr_AVP_OriginRealm(orig_realm), - tr_AVP_ResultCode(DIAMETER_SUCCESS), - tr_AVP_3GPP_AuthInfo(auth_info_contents) - )); -template (present) PDU_DIAMETER -tr_DIA_AIA_ERR(template (present) GenericAVP err_avp := ?, - template (present) octetstring sess_id := ?, - template (present) charstring orig_host := ?, - template (present) charstring orig_realm := ?, - template (present) UINT32 hbh_id := ?, - template (present) UINT32 ete_id := ?) := - tr_DIAMETER(flags := '0???????'B, - cmd_code := Authentication_Information, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := superset( - tr_AVP_SessionId(sess_id), - tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), - tr_AVP_OriginHost(orig_host), - tr_AVP_OriginRealm(orig_realm), - err_avp - )); - - -/* TS 29.272 7.2.3 Update Location Request */ -template (value) PDU_DIAMETER -ts_DIA_ULR(/* template (value) */ hexstring imsi, - template (value) octetstring mcc_mnc := '111F11'O, - template (value) octetstring sess_id := c_def_sess_id, - template (value) charstring orig_host := "ttcn3.localdomain", - template (value) charstring orig_realm := "localdomain", - template (value) charstring dest_realm := "localdomain", - template (value) UINT32 hbh_id := '00000000'O, - template (value) UINT32 ete_id := '00000000'O) := - ts_DIAMETER(flags := '11000000'B, - cmd_code := Update_Location, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := { - ts_AVP_SessionId(sess_id), - ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), - ts_AVP_UserNameImsi(imsi), - ts_AVP_3GPP_UlrFlags('00000000'O), - ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), - ts_AVP_PCC_3GPP_RatType(EUTRAN), - ts_AVP_OriginHost(orig_host), - ts_AVP_OriginRealm(orig_realm), - ts_AVP_DestinationRealm(dest_realm) - }); -template (present) PDU_DIAMETER -tr_DIA_ULR(/* template (present) */ hexstring imsi, - template (present) octetstring sess_id := ?, - template (present) charstring orig_host := ?, - template (present) charstring orig_realm := ?, - template (present) charstring dest_realm := ?, - template (present) UINT32 hbh_id := ?, - template (present) UINT32 ete_id := ?) := - tr_DIAMETER(flags := '11000000'B, - cmd_code := Update_Location, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := superset( - tr_AVP_SessionId(sess_id), - tr_AVP_AuthSessionState, - tr_AVP_OriginHost(orig_host), - tr_AVP_OriginRealm(orig_realm), - tr_AVP_DestinationRealm(dest_realm), - tr_AVP_UserNameImsi(imsi), - tr_AVP_PCC_3GPP_RatType, - tr_AVP_3GPP_UlrFlags, - tr_AVP_3GPP_VisitedPlmnId - )); - -template (value) PDU_DIAMETER -ts_DIA_ULA(template (value) AVP_list sub_data, - template (value) octetstring sess_id := c_def_sess_id, - template (value) charstring orig_host := "hss.localdomain", - template (value) charstring orig_realm := "localdomain", - template (value) UINT32 hbh_id := '00000000'O, - template (value) UINT32 ete_id := '00000000'O) := - ts_DIAMETER(flags:='01000000'B, - cmd_code := Update_Location, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := { - ts_AVP_SessionId(sess_id), - ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ - ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), - ts_AVP_OriginHost(orig_host), - ts_AVP_OriginRealm(orig_realm), - ts_AVP_3GPP_UlaFlags('00000002'O), - ts_AVP_3GPP_SubscriptionData(sub_data) - }); -template (present) PDU_DIAMETER -tr_DIA_ULA(template (present) AVP_list sub_data := ?, - template (present) octetstring sess_id := ?, - template (present) charstring orig_host := ?, - template (present) charstring orig_realm := ?, - template (present) UINT32 hbh_id := ?, - template (present) UINT32 ete_id := ?) := - tr_DIAMETER(flags := '0???????'B, - cmd_code := Update_Location, - app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), - hbh_id := hbh_id, - ete_id := ete_id, - avps := superset( - tr_AVP_SessionId(sess_id), - tr_AVP_ResultCode(DIAMETER_SUCCESS), - tr_AVP_AuthSessionState, - tr_AVP_OriginHost(orig_host), - tr_AVP_OriginRealm(orig_realm), - tr_AVP_3GPP_UlaFlags, - tr_AVP_3GPP_SubscriptionData(sub_data) - )); - - - /* RFC 4006 3.1. Credit-Control-Request (CCR) Command */ template (present) PDU_DIAMETER tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) diff --git a/library/DIAMETER_ts29_272_Templates.ttcn b/library/DIAMETER_ts29_272_Templates.ttcn new file mode 100644 index 0000000..725e9ac --- /dev/null +++ b/library/DIAMETER_ts29_272_Templates.ttcn @@ -0,0 +1,632 @@ +module DIAMETER_ts29_272_Templates { + +/* (C) 2023 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Templates for AVPs and messages for TS 29.272 + */ + +import from General_Types all; +import from DIAMETER_Types all; +import from DIAMETER_Templates all; +import from Osmocom_Types all; +import from Misc_Helpers all; + +/******************************* + * S6a 3GPP TS 29.272 section 7 + *******************************/ + +/* 3GPP TS 29.272 Section 7.1.8 */ +const uint32_t c_DIAMETER_3GPP_S6_AID := 16777251; /* S6a/S6d */ +const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252; + +/* 3GPP TS 29.272 section 7.4. Errors in Experimental-Result-Code */ +type enumerated DIAMETER_ExperimentalResultcode { + /* transient */ + DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), + DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4182), + /* permanent */ + DIAMETER_ERROR_USER_UNKNOWN (5001), + DIAMETER_AUTHORIZATION_REJECTED (5003), + DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5004), + DIAMETER_MISSING_AVP (5005), + DIAMETER_ERROR_UNKNOWN_EPS_SUBSCRIPTION (5420), + DIAMETER_ERROR_RAT_NOT_ALLOWED (5421), + DIAMETER_ERROR_EQUIPMENT_UNKNOWN (5422), + DIAMETER_ERROR_UNKOWN_SERVING_NODE (5423) +} + +/* TS 29.272 7.3.53 RAND */ +template (value) GenericAVP ts_AVP_RAND(template (value) octetstring rand) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_RAND), + avp_data := { + avp_AAA_3GPP_RAND := rand + } + } +} + +/* TS 29.272 7.3.54 XRES */ +template (value) GenericAVP ts_AVP_XRES(template (value) octetstring xres) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_XRES), + avp_data := { + avp_AAA_3GPP_XRES := xres + } + } +} + +/* TS 29.272 7.3.55 XRES */ +template (value) GenericAVP ts_AVP_AUTN(template (value) octetstring autn) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AUTN), + avp_data := { + avp_AAA_3GPP_AUTN := autn + } + } +} + +/* TS 29.272 7.3.56 KASME */ +template (value) GenericAVP ts_AVP_KASME(template (value) octetstring kasme) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), + avp_data := { + avp_AAA_3GPP_KASME := kasme + } + } +} + +/* TS 29.272 7.3.23 Item-Number */ +template (value) GenericAVP ts_AVP_ItemNumber(uint32_t num) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), + avp_data := { + avp_AAA_3GPP_Item_Number := int2oct(num, 4) + } + } +} + +/* TS 29.272 7.3.18 E-UTRAN Vector */ +template (value) GenericAVP ts_AVP_EutranVec(uint32_t item_num, octetstring rand, octetstring xres, + octetstring autn, octetstring kasme) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_E_UTRAN_Vector), + avp_data := { + avp_AAA_3GPP_E_UTRAN_Vector := { + ts_AVP_ItemNumber(item_num), + ts_AVP_RAND(rand), + ts_AVP_XRES(xres), + ts_AVP_AUTN(autn), + ts_AVP_KASME(kasme) + } + } + } +} + +/* TS 29.272 7.3.2 Subscription-Data */ +template (value) GenericAVP ts_AVP_3GPP_SubscriptionData(template (value) AVP_list content) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), + avp_data := { + avp_AAA_3GPP_Subscription_Data := content + } + } +} +template (present) GenericAVP +tr_AVP_3GPP_SubscriptionData(template (present) AVP_list content := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), + avp_data := { + avp_AAA_3GPP_Subscription_Data := content + } + } +} + + +/* TS 29.272 7.3.17 Authentication-Info */ +template (value) GenericAVP ts_AVP_3GPP_AuthInfo(template (value) AVP_list content) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), + avp_data := { + avp_AAA_3GPP_Authentication_Info := content + } + } +} +template (present) GenericAVP +tr_AVP_3GPP_AuthInfo(template (present) AVP_list content := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), + avp_data := { + avp_AAA_3GPP_Authentication_Info := content + } + } +} + +/* TS 29.272 7.3.9 Visited-PLMN-Id */ +template (value) GenericAVP ts_AVP_3GPP_VisitedPlmnId(template (value) octetstring id) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), + avp_data := { + avp_AAA_3GPP_Visited_PLMN_Id := id + } + } +} +template (present) GenericAVP tr_AVP_3GPP_VisitedPlmnId(template (present) octetstring id := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), + avp_data := { + avp_AAA_3GPP_Visited_PLMN_Id := id + } + } +} + +/* TS 29.272 7.3.13 RAT-Type */ +template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) PCC_3GPP_RAT_Type rat_type) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), + avp_data := { + avp_PCC_3GPP_RAT_Type := rat_type + } + } +} +template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) PCC_3GPP_RAT_Type rat_type := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), + avp_data := { + avp_PCC_3GPP_RAT_Type := rat_type + } + } +} + +template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) GI_3GPP_3GPP_RAT_Type rat_type := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type), + avp_data := { + avp_GI_3GPP_3GPP_RAT_Type := rat_type + } + } +} + +/* TS 29.272 7.3.7 ULR-Flags */ +template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 flags) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), + avp_data := { + avp_AAA_3GPP_ULR_Flags := flags + } + } +} +template (present) GenericAVP tr_AVP_3GPP_UlrFlags(template (present) UINT32 flags := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), + avp_data := { + avp_AAA_3GPP_ULR_Flags := flags + } + } +} + +/* TS 29.272 7.3.8 ULA-Flags */ +template (value) GenericAVP ts_AVP_3GPP_UlaFlags(template (value) UINT32 flags) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), + avp_data := { + avp_AAA_3GPP_ULA_Flags := flags + } + } +} +template (present) GenericAVP tr_AVP_3GPP_UlaFlags(template (present) UINT32 flags := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), + avp_data := { + avp_AAA_3GPP_ULA_Flags := flags + } + } +} + + +/* TS 29.272 7.3.27 Context-Identifier */ +template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t ctx := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), + avp_data := { + avp_AAA_3GPP_Context_Identifier := int2oct_tmpl(ctx, 4) + } + } +} +template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), + avp_data := { + avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) + } + } +} + +/* Ts 29.272 7.3.29 Subscriber-Status */ +template (present) GenericAVP tr_AVP_3GPP_SubscriberStatus(template (present) AAA_3GPP_Subscriber_Status sts) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), + avp_data := { + avp_AAA_3GPP_Subscriber_Status := sts + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), + avp_data := { + avp_AAA_3GPP_Subscriber_Status := sts + } + } +} + +/* Ts 29.272 7.3.30 Operator-Determined-Barring */ +template (present) GenericAVP tr_AVP_3GPP_OperatorDeterminedBarring(template (present) uint32_t val := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), + avp_data := { + avp_AAA_3GPP_Operator_Determined_Barring := int2oct_tmpl(val, 4) + } + } +} +template (value) GenericAVP ts_AVP_3GPP_OperatorDeterminedBarring(uint32_t val) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), + avp_data := { + avp_AAA_3GPP_Operator_Determined_Barring := int2oct(val, 4) + } + } +} + +/* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */ +template (present) GenericAVP tr_AVP_3GPP_AllApnConfigsIncl(template (present) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), + avp_data := { + avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind + } + } +} +template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), + avp_data := { + avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind + } + } +} + +/* TS 29.272 7.3.34 APN-Configuration-Profile */ +template (present) GenericAVP tr_AVP_3GPP_ApnConfigProfile(template (present) AVP_list content := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), + avp_data := { + avp_AAA_3GPP_APN_Configuration_Profile := content + } + } +} +template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), + avp_data := { + avp_AAA_3GPP_APN_Configuration_Profile := content + } + } +} + +/* TS 29.272 7.3.35 APN-Configuration */ +template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t ctx := ?, + template (present) AAA_3GPP_PDN_Type pdn_type := ?, + template (present) charstring apn := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), + avp_data := { + avp_AAA_3GPP_APN_Configuration := superset( + tr_AVP_3GPP_ContextId(ctx), + tr_AVP_3GPP_PdnType(pdn_type), + tr_AVP_ServiceSelection(apn), + tr_AVP_3GPP_EpsSubscrQosProfile(?, ?) + ) + } + } +} +template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, + charstring apn) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), + avp_data := { + avp_AAA_3GPP_APN_Configuration := { + ts_AVP_3GPP_ContextId(ctx), + ts_AVP_3GPP_PdnType(pdn_type), + ts_AVP_ServiceSelection(apn), + ts_AVP_3GPP_EpsSubscrQosProfile(1, 1) + } + } + } +} + + +/* TS 29.272 7.3.41 AMBR */ +template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), + avp_data := { + avp_AAA_3GPP_AMBR := { + tr_AVP_3GPP_MaxReqBwUL(ul), + tr_AVP_3GPP_MaxReqBwDL(dl) + } + } + } +} +template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), + avp_data := { + avp_AAA_3GPP_AMBR := { + ts_AVP_3GPP_MaxReqBwUL(ul), + ts_AVP_3GPP_MaxReqBwDL(dl) + } + } + } +} + +template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4) + } + } +} + +template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) + } + } +} + +template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4) + } + } +} + +template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) + } + } +} + +/* TS 29.272 7.3.62 PDN-Type */ +template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), + avp_data := { + avp_AAA_3GPP_PDN_Type := pdn_type + } + } +} +template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), + avp_data := { + avp_AAA_3GPP_PDN_Type := pdn_type + } + } +} + + +/* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ +template (value) PDU_DIAMETER +ts_DIA_AIA(template (value) AVP_list auth_info_contents, + template (value) octetstring sess_id := c_def_sess_id, + template (value) charstring orig_host := "hss.localdomain", + template (value) charstring orig_realm := "localdomain", + template (value) UINT32 hbh_id := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + ts_DIAMETER(flags := '01000000'B, + cmd_code := Authentication_Information, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := { + ts_AVP_SessionId(sess_id), + ts_AVP_ResultCode(DIAMETER_SUCCESS), + ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), + ts_AVP_OriginHost(orig_host), + ts_AVP_OriginRealm(orig_realm), + ts_AVP_3GPP_AuthInfo(auth_info_contents) + }); +template (present) PDU_DIAMETER +tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, + template (present) octetstring sess_id := ?, + template (present) charstring orig_host := ?, + template (present) charstring orig_realm := ?, + template (present) UINT32 hbh_id := ?, + template (present) UINT32 ete_id := ?) := + tr_DIAMETER(flags := '0???????'B, + cmd_code := Authentication_Information, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := superset( + tr_AVP_SessionId(sess_id), + tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), + tr_AVP_OriginHost(orig_host), + tr_AVP_OriginRealm(orig_realm), + tr_AVP_ResultCode(DIAMETER_SUCCESS), + tr_AVP_3GPP_AuthInfo(auth_info_contents) + )); +template (present) PDU_DIAMETER +tr_DIA_AIA_ERR(template (present) GenericAVP err_avp := ?, + template (present) octetstring sess_id := ?, + template (present) charstring orig_host := ?, + template (present) charstring orig_realm := ?, + template (present) UINT32 hbh_id := ?, + template (present) UINT32 ete_id := ?) := + tr_DIAMETER(flags := '0???????'B, + cmd_code := Authentication_Information, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := superset( + tr_AVP_SessionId(sess_id), + tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), + tr_AVP_OriginHost(orig_host), + tr_AVP_OriginRealm(orig_realm), + err_avp + )); + + +/* TS 29.272 7.2.3 Update Location Request */ +template (value) PDU_DIAMETER +ts_DIA_ULR(/* template (value) */ hexstring imsi, + template (value) octetstring mcc_mnc := '111F11'O, + template (value) octetstring sess_id := c_def_sess_id, + template (value) charstring orig_host := "ttcn3.localdomain", + template (value) charstring orig_realm := "localdomain", + template (value) charstring dest_realm := "localdomain", + template (value) UINT32 hbh_id := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + ts_DIAMETER(flags := '11000000'B, + cmd_code := Update_Location, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := { + ts_AVP_SessionId(sess_id), + ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), + ts_AVP_UserNameImsi(imsi), + ts_AVP_3GPP_UlrFlags('00000000'O), + ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), + ts_AVP_PCC_3GPP_RatType(EUTRAN), + ts_AVP_OriginHost(orig_host), + ts_AVP_OriginRealm(orig_realm), + ts_AVP_DestinationRealm(dest_realm) + }); +template (present) PDU_DIAMETER +tr_DIA_ULR(/* template (present) */ hexstring imsi, + template (present) octetstring sess_id := ?, + template (present) charstring orig_host := ?, + template (present) charstring orig_realm := ?, + template (present) charstring dest_realm := ?, + template (present) UINT32 hbh_id := ?, + template (present) UINT32 ete_id := ?) := + tr_DIAMETER(flags := '11000000'B, + cmd_code := Update_Location, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := superset( + tr_AVP_SessionId(sess_id), + tr_AVP_AuthSessionState, + tr_AVP_OriginHost(orig_host), + tr_AVP_OriginRealm(orig_realm), + tr_AVP_DestinationRealm(dest_realm), + tr_AVP_UserNameImsi(imsi), + tr_AVP_PCC_3GPP_RatType, + tr_AVP_3GPP_UlrFlags, + tr_AVP_3GPP_VisitedPlmnId + )); + +template (value) PDU_DIAMETER +ts_DIA_ULA(template (value) AVP_list sub_data, + template (value) octetstring sess_id := c_def_sess_id, + template (value) charstring orig_host := "hss.localdomain", + template (value) charstring orig_realm := "localdomain", + template (value) UINT32 hbh_id := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + ts_DIAMETER(flags:='01000000'B, + cmd_code := Update_Location, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := { + ts_AVP_SessionId(sess_id), + ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ + ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), + ts_AVP_OriginHost(orig_host), + ts_AVP_OriginRealm(orig_realm), + ts_AVP_3GPP_UlaFlags('00000002'O), + ts_AVP_3GPP_SubscriptionData(sub_data) + }); +template (present) PDU_DIAMETER +tr_DIA_ULA(template (present) AVP_list sub_data := ?, + template (present) octetstring sess_id := ?, + template (present) charstring orig_host := ?, + template (present) charstring orig_realm := ?, + template (present) UINT32 hbh_id := ?, + template (present) UINT32 ete_id := ?) := + tr_DIAMETER(flags := '0???????'B, + cmd_code := Update_Location, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := superset( + tr_AVP_SessionId(sess_id), + tr_AVP_ResultCode(DIAMETER_SUCCESS), + tr_AVP_AuthSessionState, + tr_AVP_OriginHost(orig_host), + tr_AVP_OriginRealm(orig_realm), + tr_AVP_3GPP_UlaFlags, + tr_AVP_3GPP_SubscriptionData(sub_data) + )); + +/* TS 29.272 7.2.5 Authentication-Information-Request */ +template (value) PDU_DIAMETER +ts_DIA_AIR(/* template (value) */ hexstring imsi, + template (value) octetstring mcc_mnc := '111F11'O, + template (value) octetstring sess_id := c_def_sess_id, + template (value) charstring orig_host := "ttcn3.localdomain", + template (value) charstring orig_realm := "localdomain", + template (value) charstring dest_realm := "localdomain", + template (value) UINT32 hbh_id := '00000000'O, + template (value) UINT32 ete_id := '00000000'O) := + ts_DIAMETER(flags := '11000000'B, + cmd_code := Authentication_Information, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, + ete_id := ete_id, + avps := { + ts_AVP_SessionId(sess_id), + ts_AVP_DestinationRealm(dest_realm), + ts_AVP_OriginHost(orig_host), + ts_AVP_OriginRealm(orig_realm), + ts_AVP_UserNameImsi(imsi), + /* Requested EUTRAN Auth Info */ + ts_AVP_RequestedEutranAuthInfo, + ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), + ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) + }); +template (present) PDU_DIAMETER +tr_DIA_AIR(/* template (present) */ hexstring imsi, + template (present) octetstring sess_id := ?, + template (present) charstring dest_realm := ?, + template (present) UINT32 hbh_id := ?, + template (present) UINT32 ete_id := ?) := + tr_DIAMETER(flags := '1???????'B, + cmd_code := Authentication_Information, + app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), + hbh_id := hbh_id, ete_id := ete_id, + avps := superset( + tr_AVP_SessionId(sess_id), + tr_AVP_DestinationRealm(dest_realm), + tr_AVP_UserNameImsi(imsi), + tr_AVP_3GPP_VisitedPlmnId + )); + +} \ No newline at end of file diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index 973c097..7f714fc 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -27,6 +27,7 @@ import from DIAMETER_Types all; import from DIAMETER_Templates all; +import from DIAMETER_ts29_272_Templates all; import from DIAMETER_Emulation all; import from SGsAP_Types all; diff --git a/mme/gen_links.sh b/mme/gen_links.sh index f10a161..32c782f 100755 --- a/mme/gen_links.sh +++ b/mme/gen_links.sh @@ -75,7 +75,8 @@ FILES+="L3_Templates.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn " FILES+="S1AP_CodecPort.ttcn S1AP_CodecPort_CtrlFunctDef.cc S1AP_CodecPort_CtrlFunct.ttcn S1AP_Emulation.ttcn " FILES+="NAS_Templates.ttcn GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " -FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn " +FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " +FILES+="DIAMETER_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn " FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn Osmocom_Gb_Types.ttcn " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35405?usp=email 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: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4 Gerrit-Change-Number: 35405 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ci[master]: OBS: srcpkg Dockerfile: add lsb-release, quilt
by pespin 21 Dec '23

21 Dec '23
Attention is currently required from: osmith. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/35404?usp=email ) Change subject: OBS: srcpkg Dockerfile: add lsb-release, quilt ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/35404?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I82f64de70b9d099ac404530ca74c771d66b306d8 Gerrit-Change-Number: 35404 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 21 Dec 2023 14:41:07 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: mme: Fix TEID values used in test
by pespin 21 Dec '23

21 Dec '23
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35394?usp=email ) Change subject: mme: Fix TEID values used in test ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: Yeah, I meant fixing in the meaning of repairing the problem. I'd have used "hardcode" or alike instead if I wanted to use the other meaning, but I agree in this case the term can have both meanings. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35394?usp=email 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: I5a32491a00eb6bad505e4bcf9a88017382073138 Gerrit-Change-Number: 35394 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Thu, 21 Dec 2023 14:39:28 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: OBS: srcpkg Dockerfile: add lsb-release, quilt
by osmith 21 Dec '23

21 Dec '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/35404?usp=email ) Change subject: OBS: srcpkg Dockerfile: add lsb-release, quilt ...................................................................... OBS: srcpkg Dockerfile: add lsb-release, quilt Wireshark with Osmocom patches on top of wireshark.git master failed to build. I've reworked the packaging to use the "debian" dir from upstream instead of having our own (now outdated) copy: https://gitea.osmocom.org/osmocom/wireshark/commits/branch/osmith/deb-packaโ€ฆ Add the additional dependencies that are now required to build the wireshark source package to the Dockerfile. Related: OS#2537 Change-Id: I82f64de70b9d099ac404530ca74c771d66b306d8 --- M scripts/obs/data/build_srcpkg.Dockerfile 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/04/35404/1 diff --git a/scripts/obs/data/build_srcpkg.Dockerfile b/scripts/obs/data/build_srcpkg.Dockerfile index 5475a94..80488ea 100644 --- a/scripts/obs/data/build_srcpkg.Dockerfile +++ b/scripts/obs/data/build_srcpkg.Dockerfile @@ -16,10 +16,12 @@ git-review \ gnupg2 \ libxml2-utils \ + lsb-release \ meson \ osc \ python3-packaging \ python3-setuptools \ + quilt \ rebar3 \ sed \ && \ -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/35404?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I82f64de70b9d099ac404530ca74c771d66b306d8 Gerrit-Change-Number: 35404 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: transport: Extend the documentation for each transport driver
by laforge 21 Dec '23

21 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34962?usp=email ) ( 4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: transport: Extend the documentation for each transport driver ...................................................................... transport: Extend the documentation for each transport driver This driver description we add to the code is automatically added to the respective user manual sections. Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629 --- M pySim/transport/calypso.py M pySim/transport/modem_atcmd.py M pySim/transport/pcsc.py M pySim/transport/serial.py 4 files changed, 28 insertions(+), 4 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py index dd30f80..7544d2e 100644 --- a/pySim/transport/calypso.py +++ b/pySim/transport/calypso.py @@ -167,6 +167,9 @@ @staticmethod def argparse_add_reader_args(arg_parser: argparse.ArgumentParser): - osmobb_group = arg_parser.add_argument_group('OsmocomBB Reader') + osmobb_group = arg_parser.add_argument_group('OsmocomBB Reader', """Use an OsmocomBB compatible phone +to access the SIM inserted to the phone SIM slot. This will require you to run the OsmocomBB firmware inside +the phone (can be ram-loaded). It also requires that you run the ``osmocon`` program, which provides a unix +domain socket to which this reader driver can attach.""") osmobb_group.add_argument('--osmocon', dest='osmocon_sock', metavar='PATH', default=None, help='Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)') diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py index 88e6253..a05d6c4 100644 --- a/pySim/transport/modem_atcmd.py +++ b/pySim/transport/modem_atcmd.py @@ -180,7 +180,9 @@ @staticmethod def argparse_add_reader_args(arg_parser: argparse.ArgumentParser): - modem_group = arg_parser.add_argument_group('AT Command Modem Reader') + modem_group = arg_parser.add_argument_group('AT Command Modem Reader', """Talk to a SIM Card inside a +mobile phone or cellular modem which is attached to this computer and offers an AT command interface including +the AT+CSIM interface for Generic SIM access as specified in 3GPP TS 27.007.""") modem_group.add_argument('--modem-device', dest='modem_dev', metavar='DEV', default=None, help='Serial port of modem for Generic SIM Access (3GPP TS 27.007)') modem_group.add_argument('--modem-baud', type=int, metavar='BAUD', default=115200, diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index 8a99e9f..a6714d5 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -114,7 +114,12 @@ @staticmethod def argparse_add_reader_args(arg_parser: argparse.ArgumentParser): - pcsc_group = arg_parser.add_argument_group('PC/SC Reader') + pcsc_group = arg_parser.add_argument_group('PC/SC Reader', + """Use a PC/SC card reader to talk to the SIM card. PC/SC is a standard API for how applications +access smart card readers, and is available on a variety of operating systems, such as Microsoft +Windows, MacOS X and Linux. Most vendors of smart card readers provide drivers that offer a PC/SC +interface, if not even a generic USB CCID driver is used. You can use a tool like ``pcsc_scan -r`` +to obtain a list of readers available on your system. """) dev_group = pcsc_group.add_mutually_exclusive_group() dev_group.add_argument('-p', '--pcsc-device', type=int, dest='pcsc_dev', metavar='PCSC', default=None, help='Number of PC/SC reader to use for SIM access') diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index fbf907f..06a082a 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -244,7 +244,9 @@ @staticmethod def argparse_add_reader_args(arg_parser: argparse.ArgumentParser): - serial_group = arg_parser.add_argument_group('Serial Reader') + serial_group = arg_parser.add_argument_group('Serial Reader', """Use a simple/ultra-low-cost serial reader +attached to a (physical or USB/virtual) RS232 port. This doesn't work with all RS232-attached smart card +readers, only with the very primitive readers following the ancient `Phoenix` or `Smart Mouse` design.""") serial_group.add_argument('-d', '--device', metavar='DEV', default='/dev/ttyUSB0', help='Serial Device for SIM access') serial_group.add_argument('-b', '--baud', dest='baudrate', type=int, metavar='BAUD', default=9600, -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34962?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629 Gerrit-Change-Number: 34962 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: transport: Move printing of reader number/name to generic code
by laforge 21 Dec '23

21 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34961?usp=email ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: transport: Move printing of reader number/name to generic code ...................................................................... transport: Move printing of reader number/name to generic code Let's avoid copy+pasting print statements everywhere. The instances do already have a __str__ method for the purpose of printing their name in a generic way. Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844 --- M pySim/transport/__init__.py M pySim/transport/calypso.py M pySim/transport/modem_atcmd.py M pySim/transport/pcsc.py M pySim/transport/serial.py 5 files changed, 24 insertions(+), 19 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index d075878..59d4554 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -3,6 +3,7 @@ """ pySim: PCSC reader transport link base """ +import os import abc import argparse from typing import Optional, Tuple @@ -300,4 +301,10 @@ print("No reader/driver specified; falling back to default (Serial reader)") from pySim.transport.serial import SerialSimLink sl = SerialSimLink(opts, **kwargs) + + if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": + print("Using %s reader interface" % (sl.name)) + else: + print("Using reader %s" % sl) + return sl diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py index 01bbe23..dd30f80 100644 --- a/pySim/transport/calypso.py +++ b/pySim/transport/calypso.py @@ -76,14 +76,11 @@ class CalypsoSimLink(LinkBase): """Transport Link for Calypso based phones.""" + name = 'Calypso-based (OsmocomBB) reader' def __init__(self, opts: argparse.Namespace = argparse.Namespace(osmocon_sock="/tmp/osmocom_l2"), **kwargs): sock_path = opts.osmocon_sock super().__init__(**kwargs) - if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": - print("Using Calypso-based (OsmocomBB) reader interface") - else: - print("Using Calypso-based (OsmocomBB) reader at socket %s" % sock_path) # Make sure that a given socket path exists if not os.path.exists(sock_path): raise ReaderError( diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py index 9a4f0a5..88e6253 100644 --- a/pySim/transport/modem_atcmd.py +++ b/pySim/transport/modem_atcmd.py @@ -21,7 +21,6 @@ import time import re import argparse -import os from typing import Optional from pySim.utils import Hexstr, ResTuple @@ -34,16 +33,13 @@ class ModemATCommandLink(LinkBase): """Transport Link for 3GPP TS 27.007 compliant modems.""" + name = "modem for Generic SIM Access (3GPP TS 27.007)" def __init__(self, opts: argparse.Namespace = argparse.Namespace(modem_dev='/dev/ttyUSB0', modem_baud=115200), **kwargs): device = opts.modem_dev baudrate = opts.modem_baud super().__init__(**kwargs) - if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": - print("Using modem for Generic SIM Access (3GPP TS 27.007)") - else: - print("Using modem for Generic SIM Access (3GPP TS 27.007) at port %s" % device) self._sl = serial.Serial(device, baudrate, timeout=5) self._echo = False # this will be auto-detected by _check_echo() self._device = device diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index b1c424f..8a99e9f 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -18,7 +18,6 @@ # import argparse -import os import re from typing import Optional, Union @@ -34,6 +33,7 @@ class PcscSimLink(LinkBase): """ pySim: PCSC reader transport link.""" + name = 'PC/SC' def __init__(self, opts: argparse.Namespace = argparse.Namespace(pcsc_dev=0), **kwargs): super().__init__(**kwargs) @@ -57,11 +57,6 @@ self._con = self._reader.createConnection() - if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": - print("Using PC/SC reader interface") - else: - print("Using PC/SC reader %s" % self) - def __del__(self): try: # FIXME: this causes multiple warnings in Python 3.5.3 diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index e6803be..fbf907f 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -29,14 +29,11 @@ class SerialSimLink(LinkBase): """ pySim: Transport Link for serial (RS232) based readers included with simcard""" + name = 'Serial' def __init__(self, opts = argparse.Namespace(device='/dev/ttyUSB0', baudrate=9600), rst: str = '-rts', debug: bool = False, **kwargs): super().__init__(**kwargs) - if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": - print("Using serial reader interface") - else: - print("Using serial reader interface at port %s" % opts.device) if not os.path.exists(opts.device): raise ValueError("device file %s does not exist -- abort" % opts.device) self._sl = serial.Serial( -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34961?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844 Gerrit-Change-Number: 34961 Gerrit-PatchSet: 6 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in pysim[master]: transport/pcsc: Allow opening PC/SC readers by a regex of their name
by laforge 21 Dec '23

21 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34960?usp=email ) Change subject: transport/pcsc: Allow opening PC/SC readers by a regex of their name ...................................................................... transport/pcsc: Allow opening PC/SC readers by a regex of their name Opening PC/SC readers by index/number is very error-prone as the order is never deterministic in any system with multiple (hot-plugged, USB) readers. Instead, let's offer the alternative of specifying a regular expression to match the reader name (similar to remsim-bankd). Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78 --- M pySim/transport/__init__.py M pySim/transport/pcsc.py 2 files changed, 45 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index e0e1e62..d075878 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -287,7 +287,7 @@ """ Init card reader driver """ - if opts.pcsc_dev is not None: + if opts.pcsc_dev is not None or opts.pcsc_regex is not None: from pySim.transport.pcsc import PcscSimLink sl = PcscSimLink(opts, **kwargs) elif opts.osmocon_sock is not None: diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index 6afcdac..b1c424f 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2009-2010 Sylvain Munaut <tnt(a)246tNt.com> -# Copyright (C) 2010 Harald Welte <laforge(a)gnumonks.org> +# Copyright (C) 2010-2023 Harald Welte <laforge(a)gnumonks.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,8 @@ import argparse import os -from typing import Optional +import re +from typing import Optional, Union from smartcard.CardConnection import CardConnection from smartcard.CardRequest import CardRequest @@ -36,16 +37,30 @@ def __init__(self, opts: argparse.Namespace = argparse.Namespace(pcsc_dev=0), **kwargs): super().__init__(**kwargs) + self._reader = None + r = readers() + if opts.pcsc_dev is not None: + # actual reader index number (integer) + reader_number = opts.pcsc_dev + if reader_number >= len(r): + raise ReaderError('No reader found for number %d' % reader_number) + self._reader = r[reader_number] + else: + # reader regex string + cre = re.compile(opts.pcsc_regex) + for reader in r: + if cre.search(reader.name): + self._reader = reader + break + if not self._reader: + raise ReaderError('No matching reader found for regex %s' % opts.pcsc_regex) + + self._con = self._reader.createConnection() + if os.environ.get('PYSIM_INTEGRATION_TEST') == "1": print("Using PC/SC reader interface") else: - print("Using PC/SC reader number %u" % opts.pcsc_dev) - r = readers() - if opts.pcsc_dev >= len(r): - raise ReaderError('No reader found for number %d' % opts.pcsc_dev) - self._reader = r[opts.pcsc_dev] - self._con = self._reader.createConnection() - self._reader_number = opts.pcsc_dev + print("Using PC/SC reader %s" % self) def __del__(self): try: @@ -100,10 +115,13 @@ return i2h(data), i2h(sw) def __str__(self) -> str: - return "PCSC:%u[%s]" % (self._reader_number, self._reader) + return "PCSC[%s]" % (self._reader) @staticmethod def argparse_add_reader_args(arg_parser: argparse.ArgumentParser): pcsc_group = arg_parser.add_argument_group('PC/SC Reader') - pcsc_group.add_argument('-p', '--pcsc-device', type=int, dest='pcsc_dev', metavar='PCSC', default=None, - help='PC/SC reader number to use for SIM access') + dev_group = pcsc_group.add_mutually_exclusive_group() + dev_group.add_argument('-p', '--pcsc-device', type=int, dest='pcsc_dev', metavar='PCSC', default=None, + help='Number of PC/SC reader to use for SIM access') + dev_group.add_argument('--pcsc-regex', type=str, dest='pcsc_regex', metavar='REGEX', default=None, + help='Regex matching PC/SC reader to use for SIM access') -- To view, visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78 Gerrit-Change-Number: 34960 Gerrit-PatchSet: 5 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bts[master]: gsmtap-rlp: Add support for skipping generating NULL frames
by laforge 21 Dec '23

21 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35133?usp=email ) Change subject: gsmtap-rlp: Add support for skipping generating NULL frames ...................................................................... gsmtap-rlp: Add support for skipping generating NULL frames If there's nothing to transmit over a CSD NT channel, both ends generate NULL frames. Let's add an option to suppress GSMTAP output for those, creating pcap files with less noise. Change-Id: I85a2159cfaa01bfb4205c1462e3a9dbda68e4bad Depends: libosmocore.git I2d9bd8eb4f0cd0f72c436996767b199429596917 --- M TODO-RELEASE M include/osmo-bts/bts.h M src/common/l1sap.c M src/common/vty.c M tests/osmo-bts.vty 5 files changed, 38 insertions(+), 5 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve diff --git a/TODO-RELEASE b/TODO-RELEASE index 1ed7b53..2bbfab5 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmogsm >1.9.0 added new PRIM_INFO to include/osmocom/gsm/l1sap.h +libosmogsm >1.9.0 use of RLP code in libosmogsm diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index b12125c..c3e5dce 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -378,6 +378,7 @@ uint32_t sapi_mask; uint8_t sapi_acch; bool rlp; + bool rlp_skip_null; } gsmtap; struct osmux_state osmux; diff --git a/src/common/l1sap.c b/src/common/l1sap.c index c579af5..e9095de 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -33,6 +33,7 @@ #include <osmocom/gsm/l1sap.h> #include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/rsl.h> +#include <osmocom/gsm/rlp.h> #include <osmocom/core/gsmtap.h> #include <osmocom/core/gsmtap_util.h> #include <osmocom/core/utils.h> @@ -1855,6 +1856,7 @@ { struct gsm_bts_trx *trx = lchan->ts->trx; struct gsmtap_inst *inst = trx->bts->gsmtap.inst; + struct osmo_rlp_frame_decoded rlpf; pbit_t *rlp_buf; int byte_len; @@ -1908,6 +1910,12 @@ byte_len = osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1); } + if (trx->bts->gsmtap.rlp_skip_null) { + int rc = osmo_rlp_decode(&rlpf, 0, rlp_buf, byte_len); + if (rc == 0 && rlpf.ftype == OSMO_RLP_FT_U && rlpf.u_ftype == OSMO_RLP_U_FT_NULL) + return; + } + gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn | is_uplink ? GSMTAP_ARFCN_F_UPLINK : 0, lchan->ts->nr, lchan->type == GSM_LCHAN_TCH_H ? GSMTAP_CHANNEL_VOICE_H : GSMTAP_CHANNEL_VOICE_F, diff --git a/src/common/vty.c b/src/common/vty.c index b5ab132..2bc5bf8 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -447,8 +447,12 @@ sapi_buf = osmo_str_tolower(get_value_string(gsmtap_sapi_names, GSMTAP_CHANNEL_ACCH)); vty_out(vty, " gsmtap-sapi %s%s", sapi_buf, VTY_NEWLINE); } - if (bts->gsmtap.rlp) - vty_out(vty, " gsmtap-rlp%s", VTY_NEWLINE); + if (bts->gsmtap.rlp) { + if (bts->gsmtap.rlp_skip_null) + vty_out(vty, " gsmtap-rlp skip-null%s", VTY_NEWLINE); + else + vty_out(vty, " gsmtap-rlp%s", VTY_NEWLINE); + } vty_out(vty, " min-qual-rach %d%s", bts->min_qual_rach, VTY_NEWLINE); vty_out(vty, " min-qual-norm %d%s", bts->min_qual_norm, @@ -2389,11 +2393,16 @@ } DEFUN(cfg_bts_gsmtap_rlp, cfg_bts_gsmtap_rlp_cmd, - "gsmtap-rlp", - "Enable generation of GSMTAP frames for RLP (non-transparent CSD)\n") + "gsmtap-rlp [skip-null]", + "Enable generation of GSMTAP frames for RLP (non-transparent CSD)\n" + "Skip the generation of GSMTAP for RLP NULL frames\n") { struct gsm_bts *bts = vty->index; bts->gsmtap.rlp = true; + if (argc >= 1 && !strcmp(argv[0], "skip-null")) + bts->gsmtap.rlp_skip_null = true; + else + bts->gsmtap.rlp_skip_null = false; return CMD_SUCCESS; } diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty index a7be40c..97629d0 100644 --- a/tests/osmo-bts.vty +++ b/tests/osmo-bts.vty @@ -262,7 +262,7 @@ gsmtap-sapi (enable-all|disable-all) gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) no gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) - gsmtap-rlp + gsmtap-rlp [skip-null] no gsmtap-rlp osmux trx <0-254> -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35133?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I85a2159cfaa01bfb4205c1462e3a9dbda68e4bad Gerrit-Change-Number: 35133 Gerrit-PatchSet: 7 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bts[master]: Add GSMTAP encapsulation of RLP frames in CSD NT mode
by laforge 21 Dec '23

21 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email ) Change subject: Add GSMTAP encapsulation of RLP frames in CSD NT mode ...................................................................... Add GSMTAP encapsulation of RLP frames in CSD NT mode In CSD (Circuit Switched Data) NT (Non-Transparent) mode, there are RLP (Radio Link Protocol) frames inside the modified V.110. wireshark alrady has a dissector for this, and we've introduced a GSMTAP type for RLP some time ago. So with this patch, we now generate such GSMTAP RLP frames. Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219 --- M include/osmo-bts/bts.h M include/osmo-bts/lchan.h M src/common/l1sap.c M src/common/vty.c M tests/osmo-bts.vty 5 files changed, 127 insertions(+), 4 deletions(-) Approvals: laforge: Looks good to me, approved; Verified fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 60e308c..b12125c 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -377,6 +377,7 @@ char *local_host; uint32_t sapi_mask; uint8_t sapi_acch; + bool rlp; } gsmtap; struct osmux_state osmux; diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h index 92973a7..585483b 100644 --- a/include/osmo-bts/lchan.h +++ b/include/osmo-bts/lchan.h @@ -287,7 +287,11 @@ } dtx_fr_hr_efr; uint8_t last_cmr; uint32_t last_fn; - + struct { + /* buffers to re-combine RLP frame from multiple Um blocks */ + uint8_t rlp_buf_ul[576/8]; /* maximum size of RLP frame */ + uint8_t rlp_buf_dl[576/8]; /* maximum size of RLP frame */ + } csd; } tch; /* 3GPP TS 48.058 ยง 9.3.37: [0; 255] ok, -1 means invalid*/ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 90a61e2..c579af5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1848,19 +1848,88 @@ return 1; } -static void send_ul_rtp_packet_data(struct gsm_lchan *lchan, uint32_t fn, +/* process one MAC block of unpacked bits of a non-transparent CSD channel */ +static void gsmtap_csd_rlp_process(struct gsm_lchan *lchan, bool is_uplink, + const struct ph_tch_param *tch_ind, + const uint8_t *data, unsigned int data_len) +{ + struct gsm_bts_trx *trx = lchan->ts->trx; + struct gsmtap_inst *inst = trx->bts->gsmtap.inst; + pbit_t *rlp_buf; + int byte_len; + + if (!inst || !trx->bts->gsmtap.rlp) + return; + + if (lchan->csd_mode != LCHAN_CSD_M_NT) + return; + + if (is_uplink) + rlp_buf = lchan->tch.csd.rlp_buf_ul; + else + rlp_buf = lchan->tch.csd.rlp_buf_dl; + + /* TCH/F 9.6: 4x60bit block => 240bit RLP frame + * TCH/F 4.8: 2x 2x60bit blocks starting at B0/B2/B4 => 240bit RLP frame + * TCH/H 4.8: 4x60bit block => 240bit RLP frame + * TCH/F 2.4: 2x36bit blocks => transparent only + * TCH/H 2.4: 4x36bit blocks => transparent only + * TCH/F 14.4: 2x 290 bit block (starting with M1=0) => 576-bit RLP frame + */ + + if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == GSM48_CMODE_DATA_6k0) { + /* in this mode we have 120bit MAC blocks; two of them need to be concatenated + * to render a 240-bit RLP frame. The fist block is present in B0/B2/B4. + * The E7 bit is used to indicate the Frame MF0a */ + OSMO_ASSERT(data_len == 120); + ubit_t e7 = data[4*7+3]; + if (e7 == 0) { + osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1); + return; + } else { + osmo_ubit2pbit_ext(rlp_buf, 120, data, 0, data_len, 1); + byte_len = 240/8; + } + } else if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == GSM48_CMODE_DATA_14k5) { + /* in this mode we have 290bit MAC blocks containing M1, M2 and 288 data bits; + * two of them need to be concatenated to render a + * 576-bit RLP frame. The start of a RLP frame is + * denoted by a block with M1-bit set to 0. */ + OSMO_ASSERT(data_len == 290); + ubit_t m1 = data[0]; + if (m1 == 0) { + osmo_ubit2pbit_ext(rlp_buf, 0, data, 2, data_len, 1); + return; + } else { + osmo_ubit2pbit_ext(rlp_buf, 288, data, 2, data_len, 1); + byte_len = 576/8; + } + } else { + byte_len = osmo_ubit2pbit_ext(rlp_buf, 0, data, 0, data_len, 1); + } + + gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP, trx->arfcn | is_uplink ? GSMTAP_ARFCN_F_UPLINK : 0, + lchan->ts->nr, + lchan->type == GSM_LCHAN_TCH_H ? GSMTAP_CHANNEL_VOICE_H : GSMTAP_CHANNEL_VOICE_F, + lchan->nr, tch_ind->fn, tch_ind->rssi, 0, rlp_buf, byte_len); + +} + +static void send_ul_rtp_packet_data(struct gsm_lchan *lchan, const struct ph_tch_param *tch_ind, const uint8_t *data, uint16_t data_len) { uint8_t rtp_pl[RFC4040_RTP_PLEN]; int rc; + gsmtap_csd_rlp_process(lchan, true, tch_ind, data, data_len); + rc = csd_v110_rtp_encode(lchan, &rtp_pl[0], data, data_len); if (rc < 0) return; osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, &rtp_pl[0], sizeof(rtp_pl), - fn_ms_adj(fn, lchan), + fn_ms_adj(tch_ind->fn, lchan), lchan->rtp_tx_marker); /* Only clear the marker bit once we have sent a RTP packet with it */ lchan->rtp_tx_marker = false; @@ -2000,7 +2069,7 @@ send_ul_rtp_packet_speech(lchan, fn, msg->data, msg->len); break; case RSL_CMOD_SPD_DATA: - send_ul_rtp_packet_data(lchan, fn, msg->data, msg->len); + send_ul_rtp_packet_data(lchan, tch_ind, msg->data, msg->len); break; case RSL_CMOD_SPD_SIGN: return 0; /* drop stale TCH.ind */ @@ -2309,6 +2378,10 @@ int rc = csd_v110_rtp_decode(lchan, msg->tail, rtp_pl, rtp_pl_len); if (rc > 0) { + /* 'fake' tch_ind containing all-zero so gsmtap code can be shared + * between UL and DL */ + static const struct ph_tch_param fake_tch_ind = {}; + gsmtap_csd_rlp_process(lchan, false, &fake_tch_ind, msg->tail, rc); msgb_put(msg, rc); } else { msgb_free(msg); @@ -2420,6 +2493,10 @@ lchan->ecu_state = NULL; } + /* reset CSD RLP buffers to avoid any user plane data leaking from + * one previous lchan into a later one */ + memset(&lchan->tch.csd, 0, sizeof(lchan->tch.csd)); + return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_DEACTIVATE, 0); } diff --git a/src/common/vty.c b/src/common/vty.c index 014042d..b5ab132 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -447,6 +447,8 @@ sapi_buf = osmo_str_tolower(get_value_string(gsmtap_sapi_names, GSMTAP_CHANNEL_ACCH)); vty_out(vty, " gsmtap-sapi %s%s", sapi_buf, VTY_NEWLINE); } + if (bts->gsmtap.rlp) + vty_out(vty, " gsmtap-rlp%s", VTY_NEWLINE); vty_out(vty, " min-qual-rach %d%s", bts->min_qual_rach, VTY_NEWLINE); vty_out(vty, " min-qual-norm %d%s", bts->min_qual_norm, @@ -2386,6 +2388,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_gsmtap_rlp, cfg_bts_gsmtap_rlp_cmd, + "gsmtap-rlp", + "Enable generation of GSMTAP frames for RLP (non-transparent CSD)\n") +{ + struct gsm_bts *bts = vty->index; + bts->gsmtap.rlp = true; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_no_gsmtap_rlp, cfg_bts_no_gsmtap_rlp_cmd, + "no gsmtap-rlp", + NO_STR "Disable generation of GSMTAP frames for RLP (non-transparent CSD)\n") +{ + struct gsm_bts *bts = vty->index; + bts->gsmtap.rlp = false; + return CMD_SUCCESS; +} + static struct cmd_node phy_node = { PHY_NODE, "%s(phy)# ", @@ -2757,6 +2777,8 @@ install_element(BTS_NODE, &cfg_bts_gsmtap_sapi_all_cmd); install_element(BTS_NODE, &cfg_bts_gsmtap_sapi_cmd); install_element(BTS_NODE, &cfg_bts_no_gsmtap_sapi_cmd); + install_element(BTS_NODE, &cfg_bts_gsmtap_rlp_cmd); + install_element(BTS_NODE, &cfg_bts_no_gsmtap_rlp_cmd); /* Osmux Node */ install_element(BTS_NODE, &cfg_bts_osmux_cmd); diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty index 8c58aca..a7be40c 100644 --- a/tests/osmo-bts.vty +++ b/tests/osmo-bts.vty @@ -262,6 +262,8 @@ gsmtap-sapi (enable-all|disable-all) gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) no gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch) + gsmtap-rlp + no gsmtap-rlp osmux trx <0-254> ... @@ -285,6 +287,7 @@ gsmtap-remote-host Enable GSMTAP Um logging (see also 'gsmtap-sapi') gsmtap-local-host Enable local bind for GSMTAP Um logging (see also 'gsmtap-sapi') gsmtap-sapi Enable/disable sending of UL/DL messages over GSMTAP + gsmtap-rlp Enable generation of GSMTAP frames for RLP (non-transparent CSD) osmux Configure Osmux trx Select a TRX to configure ... -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35124?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I6a258458822bcb3fe7290a9b9b3d104beecda219 Gerrit-Change-Number: 35124 Gerrit-PatchSet: 8 Gerrit-Owner: laforge <laforge(a)osmocom.org> 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-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • ...
  • 161
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.