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
[M] Change in libosmocore[master]: rlp: Add support for 576bit RLP frames
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35134?usp=email ) Change subject: rlp: Add support for 576bit RLP frames ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35134?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Idfdcabb19fe8733fb9c5ee76a39b0bf4cdf60c2c Gerrit-Change-Number: 35134 Gerrit-PatchSet: 5 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Sun, 17 Dec 2023 11:03:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: early-IA: use the correct TRX
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: daniel, neels. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35095?usp=email ) Change subject: early-IA: use the correct TRX ...................................................................... Patch Set 3: (1 comment) Patchset: PS3: ping? This has been idle 2 weeks; let's ad the error report and get it merged. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35095?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: Id9a930e5c67122812b229dc27ea2bfe246b67611 Gerrit-Change-Number: 35095 Gerrit-PatchSet: 3 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Sun, 17 Dec 2023 10:48:38 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in ...osmo-epdg[master]: dia: 3gpp_ts29_273_s6b: add missing include of rfc4004
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35217?usp=email ) Change subject: dia: 3gpp_ts29_273_s6b: add missing include of rfc4004 ...................................................................... dia: 3gpp_ts29_273_s6b: add missing include of rfc4004 Erlang diameter compiler doesn't track includes of includes resulting in missing AVPs. It was missing MIP-Home-Agent-Address. Change-Id: I986154f057f84e131845f6aff79e3ec81aea6a81 --- M dia/diameter_3gpp_ts29_273_s6b.dia 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/dia/diameter_3gpp_ts29_273_s6b.dia b/dia/diameter_3gpp_ts29_273_s6b.dia index af1c561..5468458 100644 --- a/dia/diameter_3gpp_ts29_273_s6b.dia +++ b/dia/diameter_3gpp_ts29_273_s6b.dia @@ -42,6 +42,7 @@ @inherits diameter_3gpp_ts29_273 @inherits diameter_3gpp_ts32_299 @inherits diameter_etsi_es283_034 +@inherits diameter_rfc4004 @inherits diameter_rfc4006_cc @inherits diameter_rfc5447 @inherits diameter_rfc5580 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35217?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I986154f057f84e131845f6aff79e3ec81aea6a81 Gerrit-Change-Number: 35217 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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
[S] Change in ...osmo-epdg[master]: epdg_gtpc_s2b: fix encoding of the IP address
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35219?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: epdg_gtpc_s2b: fix encoding of the IP address ...................................................................... epdg_gtpc_s2b: fix encoding of the IP address Change-Id: I6a96f5d62fa0b327a462670e40cc6a42cf6b2d3c --- M src/epdg_gtpc_s2b.erl M src/gtp_utils.erl 2 files changed, 21 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index 152036f..fe07a42 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -318,7 +318,7 @@ instance = 0, interface_type = 31, %% "S2b-U ePDG GTP-U" key = Bearer#gtp_bearer.local_data_tei, - ipv4 = LocalAddr + ipv4 = gtp_utils:ip_to_bin(LocalAddr) } ], IEs = [#v2_recovery{restart_counter = RCnt}, @@ -328,7 +328,7 @@ instance = Bearer#gtp_bearer.ebi, interface_type = 30, %% "S2b ePDG GTP-C" key = LocalCtlTEI, - ipv4 = LocalAddr + ipv4 = gtp_utils:ip_to_bin(LocalAddr) }, #v2_access_point_name{instance = 0, apn = [Apn]}, #v2_selection_mode{mode = 0}, diff --git a/src/gtp_utils.erl b/src/gtp_utils.erl index b899530..85f69ef 100644 --- a/src/gtp_utils.erl +++ b/src/gtp_utils.erl @@ -35,7 +35,16 @@ -module(gtp_utils). -author('Alexander Couzens <lynxis(a)fe80.eu>'). --export([plmn_to_bin/3]). +-export([ip_to_bin/1, plmn_to_bin/3]). + +% ergw_aaa/src/ergw_aaa_3gpp_dict.erl +% under GPLv2+ +ip_to_bin(IP) when is_binary(IP) -> + IP; +ip_to_bin({A, B, C, D}) -> + <<A, B, C, D>>; +ip_to_bin({A, B, C, D, E, F, G, H}) -> + <<A:16, B:16, C:16, D:16, E:16, F:16, G:16, H:16>>. % ergw/apps/ergw/test/*.erl % under GPLv2+ -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35219?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I6a96f5d62fa0b327a462670e40cc6a42cf6b2d3c Gerrit-Change-Number: 35219 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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
[M] Change in ...osmo-epdg[master]: epdg_gtpc_s2b: add TLV Serving Network
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35218?usp=email ) Change subject: epdg_gtpc_s2b: add TLV Serving Network ...................................................................... epdg_gtpc_s2b: add TLV Serving Network The open5gs requires Serving Network TLV. Change-Id: I2a9459859fc660e6433cd8178ab9d1f92ae74fc0 --- M src/epdg_gtpc_s2b.erl A src/gtp_utils.erl 2 files changed, 63 insertions(+), 3 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index a5658f1..152036f 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -59,6 +59,9 @@ %% TODO: make APN configurable? get it from HSS? -define(APN, <<"internet">>). +-define(MCC, 901). +-define(MNC, 42). +-define(MNC_SIZE, 3). -record(gtp_state, { socket, @@ -330,7 +333,10 @@ #v2_access_point_name{instance = 0, apn = [Apn]}, #v2_selection_mode{mode = 0}, #v2_pdn_address_allocation{type = ipv4, address = <<0,0,0,0>>}, - #v2_bearer_context{group = BearersIE} + #v2_bearer_context{group = BearersIE}, + #v2_serving_network{ + plmn_id = gtp_utils:plmn_to_bin(?MCC, ?MNC, ?MNC_SIZE) + } ], #gtp{version = v2, type = create_session_request, tei = 0, seq_no = SeqNo, ie = IEs}. @@ -346,5 +352,3 @@ tei = RemoteCtlTEI, seq_no = Req#gtp.seq_no, ie = IEs}. - - diff --git a/src/gtp_utils.erl b/src/gtp_utils.erl new file mode 100644 index 0000000..b899530 --- /dev/null +++ b/src/gtp_utils.erl @@ -0,0 +1,45 @@ +% GTP utilities +% +% (C) 2023 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +% Author: Alexander Couzens <lynxis(a)fe80.eu> +% +% All Rights Reserved +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU Affero General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU Affero General Public License +% along with this program. If not, see <http://www.gnu.org/licenses/>. +% +% Additional Permission under GNU AGPL version 3 section 7: +% +% If you modify this Program, or any covered work, by linking or +% combining it with runtime libraries of Erlang/OTP as released by +% Ericsson on http://www.erlang.org (or a modified version of these +% libraries), containing parts covered by the terms of the Erlang Public +% License (http://www.erlang.org/EPLICENSE) the licensors of this +% Program grant you additional permission to convey the resulting work +% without the need to license the runtime libraries of Erlang/OTP under +% the GNU Affero General Public License. Corresponding Source for a +% non-source form of such a combination shall include the source code +% for the parts of the runtime libraries of Erlang/OTP used as well as +% that of the covered work. + +-module(gtp_utils). +-author('Alexander Couzens <lynxis(a)fe80.eu>'). + +-export([plmn_to_bin/3]). + +% ergw/apps/ergw/test/*.erl +% under GPLv2+ +plmn_to_bin(CC, NC, NCSize) -> + MCC = iolist_to_binary(io_lib:format("~3..0b", [CC])), + MNC = iolist_to_binary(io_lib:format("~*..0b", [NCSize, NC])), + {MCC, MNC}. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35218?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I2a9459859fc660e6433cd8178ab9d1f92ae74fc0 Gerrit-Change-Number: 35218 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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
[M] Change in ...osmo-epdg[master]: epdg_gtpc_s2b: add TLV Serving Network
by laforge 17 Dec '23

17 Dec '23
Attention is currently required from: lynxis lazus, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35218?usp=email ) Change subject: epdg_gtpc_s2b: add TLV Serving Network ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35218?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: I2a9459859fc660e6433cd8178ab9d1f92ae74fc0 Gerrit-Change-Number: 35218 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Sun, 17 Dec 2023 10:47:15 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in pysim[master]: USIM: add support for EG.ePDGIdEm (Emergency ePDG)
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35271?usp=email ) Change subject: USIM: add support for EG.ePDGIdEm (Emergency ePDG) ...................................................................... USIM: add support for EG.ePDGIdEm (Emergency ePDG) Change-Id: I71cb7a4b9323f57b96db2d9f12f1567eda63f742 --- M pySim/ts_31_102.py 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 28781e1..d1f0f36 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -1479,6 +1479,7 @@ EF_IPS(), EF_ePDGId(service=(106, 107)), # FIXME: from EF_ePDGSelection onwards + EF_ePDGId('6ff5', None, 'EF.ePDGIdEm', desc='Emergency ePDG Identifier', service=(110, 111)), EF_FromPreferred(service=114), EF_eAKA(), # FIXME: DF_SoLSA service=23 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35271?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: I71cb7a4b9323f57b96db2d9f12f1567eda63f742 Gerrit-Change-Number: 35271 Gerrit-PatchSet: 2 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: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: usim: Add EF.ePDGSelection + EF.ePDGSelectionEm support
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35272?usp=email ) Change subject: usim: Add EF.ePDGSelection + EF.ePDGSelectionEm support ...................................................................... usim: Add EF.ePDGSelection + EF.ePDGSelectionEm support Change-Id: I760a394ae1eac5f1175dc9b86c11b4a60671582e --- M pySim/ts_31_102.py 1 file changed, 23 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index d1f0f36..4ae74ec 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -884,6 +884,17 @@ super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs) self._tlv = EF_ePDGId.ePDGId +# TS 31.102 Section 4.2.104 +class EF_ePDGSelection(TransparentEF): + class ePDGSelection(BER_TLV_IE, tag=0x80, nested=[]): + _construct = GreedyRange(Struct('plmn'/BcdAdapter(Bytes(3)), + 'epdg_priority'/Int16ub, + 'epdg_fqdn_format'/Enum(Int8ub, operator_identified=0, location_based=1))) + + def __init__(self, fid='6ff4', sfid=None, name='EF.ePDGSelection', desc='ePDG Selection Information', **kwargs): + super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs) + self._tlv = EF_ePDGSelection.ePDGSelection + # TS 31.102 Section 4.2.106 class EF_FromPreferred(TransparentEF): def __init__(self, fid='6ff7', sfid=None, name='EF.FromPreferred', size=(1, 1), @@ -1478,8 +1489,10 @@ # EF_IWL (IMEI(SV) White List) EF_IPS(), EF_ePDGId(service=(106, 107)), - # FIXME: from EF_ePDGSelection onwards + EF_ePDGSelection(service=(106, 107)), EF_ePDGId('6ff5', None, 'EF.ePDGIdEm', desc='Emergency ePDG Identifier', service=(110, 111)), + EF_ePDGSelection('6ff6', None, 'EF.ePDGSelectionEm', + desc='ePDG Selection Information for Emergency Services', service=(110, 111)), EF_FromPreferred(service=114), EF_eAKA(), # FIXME: DF_SoLSA service=23 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35272?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: I760a394ae1eac5f1175dc9b86c11b4a60671582e Gerrit-Change-Number: 35272 Gerrit-PatchSet: 2 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: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: usim: ePDGId + ePDGSelection: Fix encoder/decoder + add test cases
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35273?usp=email ) Change subject: usim: ePDGId + ePDGSelection: Fix encoder/decoder + add test cases ...................................................................... usim: ePDGId + ePDGSelection: Fix encoder/decoder + add test cases Change-Id: Idca19b6fdabae6cc708e92c7714fa0903ea5a1ee --- M pySim/ts_31_102.py 1 file changed, 20 insertions(+), 3 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 4ae74ec..74a2c4c 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -873,9 +873,13 @@ # TS 31.102 Section 4.2.103 class EF_ePDGId(TransparentEF): - class ePDGId(BER_TLV_IE, tag=0x80, nested=[]): + _test_de_encode = [ + ( '801100657064672e6f736d6f636f6d2e6f7267', {'e_pdg_id': {"type_of_ePDG_address": "FQDN", "ePDG_address" : "epdg.osmocom.org" } } ), + ( '800501c0a8a001', {'e_pdg_id': {"type_of_ePDG_address": "IPv4", "ePDG_address" : "c0a8a001" } } ), + ] + class ePDGId(BER_TLV_IE, tag=0x80): _construct = Struct('type_of_ePDG_address'/Enum(Byte, FQDN=0, IPv4=1, IPv6=2), - 'ePDG_address'/Switch(this.type_of_address, + 'ePDG_address'/Switch(this.type_of_ePDG_address, {'FQDN': Utf8Adapter(GreedyBytes), 'IPv4': HexAdapter(GreedyBytes), 'IPv6': HexAdapter(GreedyBytes)})) @@ -886,7 +890,11 @@ # TS 31.102 Section 4.2.104 class EF_ePDGSelection(TransparentEF): - class ePDGSelection(BER_TLV_IE, tag=0x80, nested=[]): + _test_de_encode = [ + ( '80060001f1000100', {'e_pdg_selection': [{'plmn': '00101f', 'epdg_priority': 1, 'epdg_fqdn_format': 'operator_identified' }] }), + ( '800600011000a001', {'e_pdg_selection': [{'plmn': '001001', 'epdg_priority': 160, 'epdg_fqdn_format': 'location_based' }] }), + ] + class ePDGSelection(BER_TLV_IE, tag=0x80): _construct = GreedyRange(Struct('plmn'/BcdAdapter(Bytes(3)), 'epdg_priority'/Int16ub, 'epdg_fqdn_format'/Enum(Int8ub, operator_identified=0, location_based=1))) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35273?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: Idca19b6fdabae6cc708e92c7714fa0903ea5a1ee Gerrit-Change-Number: 35273 Gerrit-PatchSet: 2 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: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
[S] Change in pysim[master]: usim: Properly decode/encode IPv4 + IPv6 addresses
by laforge 17 Dec '23

17 Dec '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35277?usp=email ) Change subject: usim: Properly decode/encode IPv4 + IPv6 addresses ...................................................................... usim: Properly decode/encode IPv4 + IPv6 addresses use normal textual representation for IPv4 and IPv6 addresses Change-Id: I2c6c377f4502af37639e555826c85d5dcf602f9b --- M pySim/construct.py M pySim/ts_31_102.py 2 files changed, 42 insertions(+), 3 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/pySim/construct.py b/pySim/construct.py index af96b49..31caf0e 100644 --- a/pySim/construct.py +++ b/pySim/construct.py @@ -7,6 +7,7 @@ from pySim.utils import b2h, h2b, swap_nibbles import gsm0338 import codecs +import ipaddress """Utility code related to the integration of the 'construct' declarative parser.""" @@ -138,6 +139,32 @@ def _encode(self, obj, context, path): return obj.encode(self.codec, self.err) +class Ipv4Adapter(Adapter): + """ + Encoder converts from 4 bytes to string representation (A.B.C.D). + Decoder converts from string representation (A.B.C.D) to four bytes. + """ + def _decode(self, obj, context, path): + ia = ipaddress.IPv4Address(obj) + return ia.compressed + + def _encode(self, obj, context, path): + ia = ipaddress.IPv4Address(obj) + return ia.packed + +class Ipv6Adapter(Adapter): + """ + Encoder converts from 16 bytes to string representation. + Decoder converts from string representation to 16 bytes. + """ + def _decode(self, obj, context, path): + ia = ipaddress.IPv6Address(obj) + return ia.compressed + + def _encode(self, obj, context, path): + ia = ipaddress.IPv6Address(obj) + return ia.packed + def filter_dict(d, exclude_prefix='_'): """filter the input dict to ensure no keys starting with 'exclude_prefix' remain.""" diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 74a2c4c..87bd8c7 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -875,14 +875,15 @@ class EF_ePDGId(TransparentEF): _test_de_encode = [ ( '801100657064672e6f736d6f636f6d2e6f7267', {'e_pdg_id': {"type_of_ePDG_address": "FQDN", "ePDG_address" : "epdg.osmocom.org" } } ), - ( '800501c0a8a001', {'e_pdg_id': {"type_of_ePDG_address": "IPv4", "ePDG_address" : "c0a8a001" } } ), + ( '800501c0a8a001', {'e_pdg_id': {"type_of_ePDG_address": "IPv4", "ePDG_address" : "192.168.160.1" } } ), + ( '80110220010db8000000000000000000000023', {'e_pdg_id': {"type_of_ePDG_address": "IPv6", "ePDG_address" : "2001:db8::23" } } ), ] class ePDGId(BER_TLV_IE, tag=0x80): _construct = Struct('type_of_ePDG_address'/Enum(Byte, FQDN=0, IPv4=1, IPv6=2), 'ePDG_address'/Switch(this.type_of_ePDG_address, {'FQDN': Utf8Adapter(GreedyBytes), - 'IPv4': HexAdapter(GreedyBytes), - 'IPv6': HexAdapter(GreedyBytes)})) + 'IPv4': Ipv4Adapter(GreedyBytes), + 'IPv6': Ipv6Adapter(GreedyBytes)})) def __init__(self, fid='6ff3', sfid=None, name='EF.ePDGId', desc='Home ePDG Identifier', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35277?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: I2c6c377f4502af37639e555826c85d5dcf602f9b Gerrit-Change-Number: 35277 Gerrit-PatchSet: 2 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: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • ...
  • 161
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.