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

February 2024

  • 1 participants
  • 1748 discussions
[M] Change in osmocom-bb[master]: mobile: use osmo_csd_chan_mode_rate_desc[] from libosmogsm
by laforge 10 Feb '24

10 Feb '24
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35915?usp=email ) Change subject: mobile: use osmo_csd_chan_mode_rate_desc[] from libosmogsm ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35915?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I862329fbf19c515be88f2c23989b3991886a2cf4 Gerrit-Change-Number: 35915 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 10 Feb 2024 08:20:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: csd_v110: use osmo_csd_chan_mode_rate_desc[] from libosmogsm
by laforge 10 Feb '24

10 Feb '24
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35924?usp=email ) Change subject: csd_v110: use osmo_csd_chan_mode_rate_desc[] from libosmogsm ...................................................................... Patch Set 1: Code-Review+1 (1 comment) File src/common/csd_v110.c: https://gerrit.osmocom.org/c/osmo-bts/+/35924/comment/d36ac669_2bded9fc PS1, Line 37: if 0 : [GSM48_CMODE_DATA_14k5] = { : /* TCH/F14.4: 290 bits every 20 ms (14.5 kbit/s) */ : .fr = { .num_blocks = 1, .num_bits = 290 }, : }, : #endif to contrast my comment about l ibosmocore: here I don't object the table, as it's a local definition of an application. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35924?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: I1e16a1f8142ff3cf0e26e16316fde4c42082ad54 Gerrit-Change-Number: 35924 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 10 Feb 2024 08:20:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsm: add TCH block/lchan definitions for CSD
by laforge 10 Feb '24

10 Feb '24
Attention is currently required from: fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35914?usp=email ) Change subject: gsm: add TCH block/lchan definitions for CSD ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File src/gsm/gsm44021.c: https://gerrit.osmocom.org/c/libosmocore/+/35914/comment/efd82da4_dec8f4d7 PS2, Line 30: if 0 : [GSM48_CMODE_DATA_14k5] = { : /* TCH/F14.4: 290 bits every 20 ms (14.5 kbit/s) */ : .fr = { .num_frames = 1, .num_bits = 290 }, : }, : #endif i'm not quite sure I like that kind of commented-out data structure in libosmocore. After all, this data structure is describing bits from the specification, and whether or not other parts of libosmocore may or may not implement TCH/F14.4, the definitions stated here are still true, right? -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35914?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: Ie230e09d496c9b791981d8ee04902fc9966ed6d7 Gerrit-Change-Number: 35914 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 10 Feb 2024 08:19:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-msc[master]: pick up all *.vty in EXTRA_DIST
by laforge 10 Feb '24

10 Feb '24
Attention is currently required from: neels, osmith, pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/35872?usp=email ) Change subject: pick up all *.vty in EXTRA_DIST ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/35872?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Id28e020fc59b83d1b4cd0e5b72314a46bea62259 Gerrit-Change-Number: 35872 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sat, 10 Feb 2024 08:17:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in pysim[master]: Introduce code for ES2+ API client functionality
by laforge 09 Feb '24

09 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35935?usp=email ) Change subject: Introduce code for ES2+ API client functionality ...................................................................... Introduce code for ES2+ API client functionality Change-Id: Id652bb4c2df8893a824b8bb44beeafdfbb91de3f --- A contrib/es2p_client.py M contrib/jenkins.sh M pySim/esim/__init__.py A pySim/esim/es2p.py 4 files changed, 549 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/35/35935/1 diff --git a/contrib/es2p_client.py b/contrib/es2p_client.py new file mode 100755 index 0000000..1353006 --- /dev/null +++ b/contrib/es2p_client.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +# (C) 2024 by Harald Welte <laforge(a)osmocom.org> +# +# 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 Affero 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/>. + +import copy +import argparse +from pySim.esim import es2p + +EID_HELP='EID of the eUICC for which eSIM shall be made available' +ICCID_HELP='The ICCID of the eSIM that shall be made available' +MATCHID_HELP='MatchingID that shall be used by profile download' + +parser = argparse.ArgumentParser(description=""" +Utility to manuall issue requests against the ES2+ API of an SM-DP+ according to GSMA SGP.22.""") +parser.add_argument('--url', required=True, help='Base URL of ES2+ API endpoint') +parser.add_argument('--id', required=True, help='Entity identifier passed to SM-DP+') +parser.add_argument('--client-cert', help='X.509 client certificate used to authenticate to server') +parser.add_argument('--server-ca-cert', help="""X.509 CA certificates acceptable for the server side. In + production use cases, this would be the GSMA Root CA (CI) certificate.""") +subparsers = parser.add_subparsers(dest='command',help="The command (API function) to call") + +parser_dlo = subparsers.add_parser('download-order', help="ES2+ DownloadOrder function") +parser_dlo.add_argument('--eid', help=EID_HELP) +parser_dlo.add_argument('--iccid', help=ICCID_HELP) +parser_dlo.add_argument('--profileType', help='The profile type of which one eSIM shall be made available') + +parser_cfo = subparsers.add_parser('confirm-order', help="ES2+ ConfirmOrder function") +parser_cfo.add_argument('--iccid', required=True, help=ICCID_HELP) +parser_cfo.add_argument('--eid', help=EID_HELP) +parser_cfo.add_argument('--matchingId', help=MATCHID_HELP) +parser_cfo.add_argument('--confirmationCode', help='Confirmation code that shall be used by profile download') +parser_cfo.add_argument('--smdsAddress', help='SM-DS Address') +parser_cfo.add_argument('--releaseFlag', action='store_true', help='Shall the profile be immediately released?') + +parser_co = subparsers.add_parser('cancel-order', help="ES2+ CancelOrder function") +parser_co.add_argument('--iccid', required=True, help=ICCID_HELP) +parser_co.add_argument('--eid', help=EID_HELP) +parser_co.add_argument('--matchingId', help=MATCHID_HELP) +parser_co.add_argument('--finalProfileStatusIndicator', required=True, choices=['Available','Unavailable']) + +parser_rp = subparsers.add_parser('release-profile', help='ES2+ ReleaseProfile function') +parser_rp.add_argument('--iccid', required=True, help=ICCID_HELP) + +if __name__ == '__main__': + opts = parser.parse_args() + #print(opts) + + peer = es2p.Es2pApiClient(opts.url, opts.id, server_cert_verify=opts.server_ca_cert, client_cert=opts.client_cert) + + data = {} + for k, v in vars(opts).items(): + if k in ['url', 'id', 'client_cert', 'server_ca_cert', 'command']: + # remove keys from dict that shold not end up in JSON... + continue + if v is not None: + data[k] = v + + print(data) + if opts.command == 'download-order': + res = peer.call_downloadOrder(data) + elif opts.command == 'confirm-order': + res = peer.call_confirmOrder(data) + elif opts.command == 'cancel-order': + res = peer.call_cancelOrder(data) + elif opts.command == 'release-profile': + res = peer.call_releaseProfile(data) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 3f32e9e..a5993da 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -45,7 +45,8 @@ --disable E1102 \ --disable E0401 \ --enable W0301 \ - pySim tests/*.py *.py + pySim tests/*.py *.py \ + contrib/es2p_client.py ;; "docs") rm -rf docs/_build diff --git a/pySim/esim/__init__.py b/pySim/esim/__init__.py index dfacb83..1f7ea16 100644 --- a/pySim/esim/__init__.py +++ b/pySim/esim/__init__.py @@ -2,10 +2,10 @@ from typing import Optional from importlib import resources -import asn1tools def compile_asn1_subdir(subdir_name:str): """Helper function that compiles ASN.1 syntax from all files within given subdir""" + import asn1tools asn_txt = '' __ver = sys.version_info if (__ver.major, __ver.minor) >= (3, 9): diff --git a/pySim/esim/es2p.py b/pySim/esim/es2p.py new file mode 100644 index 0000000..32d1ef8 --- /dev/null +++ b/pySim/esim/es2p.py @@ -0,0 +1,458 @@ +"""GSMA eSIM RSP ES2+ interface according to SGP.22 v2.5""" + +# (C) 2024 by Harald Welte <laforge(a)osmocom.org> +# +# 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 Affero 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/>. + +import abc +import requests +import logging +import json +from datetime import datetime +import time +import base64 + +logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) + +class ApiParam(abc.ABC): + """A class reprsenting a single parameter in the ES2+ API.""" + @classmethod + def verify_decoded(cls, data): + """Verify the decoded reprsentation of a value. Should raise an exception if somthing is odd.""" + pass + + @classmethod + def verify_encoded(cls, data): + """Verify the encoded reprsentation of a value. Should raise an exception if somthing is odd.""" + pass + + @classmethod + def encode(cls, data): + """[Validate and] Encode the given value.""" + cls.verify_decoded(data) + encoded = cls._encode(data) + cls.verify_decoded(encoded) + return encoded + + @classmethod + def _encode(cls, data): + """encoder function, typically [but not always] overridden by derived class.""" + return data + + @classmethod + def decode(cls, data): + """[Validate and] Decode the given value.""" + cls.verify_encoded(data) + decoded = cls._decode(data) + cls.verify_decoded(decoded) + return decoded + + @classmethod + def _decode(cls, data): + """decoder function, typically [but not always] overridden by derived class.""" + return data + +class ApiParamString(ApiParam): + """Base class representing an API parameter of 'string' type.""" + pass + + +class ApiParamInteger(ApiParam): + """Base class representing an API parameter of 'integer' type.""" + @classmethod + def _decode(cls, data): + return int(data) + + @classmethod + def _encode(cls, data): + return str(data) + + @classmethod + def verify_decoded(cls, data): + if not isinstance(data, int): + raise TypeError('Expected an integer input data type') + + @classmethod + def verify_encoded(cls, data): + if not data.isdecimal(): + raise ValueError('integer (%s) contains non-decimal characters' % data) + assert str(int(data)) == data + +class ApiParamBoolean(ApiParam): + """Base class representing an API parameter of 'boolean' type.""" + @classmethod + def _encode(cls, data): + return bool(data) + +class ApiParamFqdn(ApiParam): + """String, as a list of domain labels concatenated using the full stop (dot, period) character as + separator between labels. Labels are restricted to the Alphanumeric mode character set defined in table 5 + of ISO/IEC 18004""" + @classmethod + def verify_encoded(cls, data): + # FIXME + pass + +class param: + class Iccid(ApiParamString): + """String representation of 19 or 20 digits, where the 20th digit MAY optionally be the padding + character F.""" + @classmethod + def _encode(cls, data): + data = str(data) + # SGP.22 version prior to 2.2 do not require support for 19-digit ICCIDs, so let's always + # encode it with padding F at the end. + if len(data) == 19: + data += 'F' + return data + + @classmethod + def verify_encoded(cls, data): + if len(data) not in [19, 20]: + raise ValueError('ICCID (%s) length (%u) invalid' % (data, len(data))) + + @classmethod + def _decode(cls, data): + # strip trailing padding (if it's 20 digits) + if len(data) == 20 and data[-1] in ['F', 'f']: + data = data[:-1] + return data + + @classmethod + def verify_decoded(cls, data): + data = str(data) + if len(data) not in [19, 20]: + raise ValueError('ICCID (%s) length (%u) invalid' % (data, len(data))) + if len(data) == 19: + decimal_part = data + else: + decimal_part = data[:-1] + final_part = data[-1:] + if final_part not in ['F', 'f'] and not final_part.isdecimal(): + raise ValueError('ICCID (%s) contains non-decimal characters' % data) + if not decimal_part.isdecimal(): + raise ValueError('ICCID (%s) contains non-decimal characters' % data) + + + class Eid(ApiParamString): + """String of 32 decimal characters""" + @classmethod + def verify_encoded(cls, data): + if len(data) != 32: + raise ValueError('EID length invalid: "%s" (%u)' % (data, len(data))) + + @classmethod + def verify_decoded(cls, data): + if not data.isdecimal(): + raise ValueError('EID (%s) contains non-decimal characters' % data) + + class ProfileType(ApiParamString): + pass + + class MatchingId(ApiParamString): + pass + + class ConfirmationCode(ApiParamString): + pass + + class SmdsAddress(ApiParamFqdn): + pass + + class SmdpAddress(ApiParamFqdn): + pass + + class ReleaseFlag(ApiParamBoolean): + pass + + class FinalProfileStatusIndicator(ApiParamString): + pass + + class Timestamp(ApiParamString): + """String format as specified by W3C: YYYY-MM-DDThh:mm:ssTZD""" + @classmethod + def _decode(cls, data): + return datetime.fromisoformat(data) + + @classmethod + def _encode(cls, data): + return datetime.toisoformat(data) + + class NotificationPointId(ApiParamInteger): + pass + + class NotificationPointStatus(ApiParam): + pass + + class ResultData(ApiParam): + @classmethod + def _decode(cls, data): + return base64.b64decode(data) + + @classmethod + def _encode(cls, data): + return base64.b64encode(data) + + class JsonResponseHeader(ApiParam): + """SGP.22 section 6.5.1.4.""" + @classmethod + def verify_decoded(cls, data): + fe_status = data.get('functionExecutionStatus') + if not fe_status: + raise ValueError('Missing mandatory functionExecutionStatus in header') + status = fe_status.get('status') + if not status: + raise ValueError('Missing mandatory status in header functionExecutionStatus') + if status not in ['Executed-Success', 'Executed-WithWarning', 'Failed', 'Expired']: + raise ValueError('Unknown/unspecified status "%s"' % status) + + +class HttpStatusError(Exception): + pass + +class HttpHeaderError(Exception): + pass + +class Es2PlusApiError(Exception): + """Exception representing an error at the ES2+ API level (status != Executed).""" + def __init__(self, func_ex_status: dict): + self.status = func_ex_status['status'] + sec = { + 'subjectCode': None, + 'reasonCode': None, + 'subjectIdentifier': None, + 'message': None, + } + actual_sec = func_ex_status.get('statusCodeData', None) + sec.update(actual_sec) + self.subject_code = sec['subjectCode'] + self.reason_code = sec['reasonCode'] + self.subject_id = sec['subjectIdentifier'] + self.message = sec['message'] + + def __str__(self): + return f'{self.status}("{self.subject_code}","{self.reason_code}","{self.subject_id}","{self.message}")' + +class Es2PlusApiFunction(abc.ABC): + """Base classs for representing an ES2+ API Function.""" + # the below class variables are expected to be overridden in derived classes + + path = None + # dictionary of input parameters. key is parameter name, value is ApiParam class + input_params = {} + # list of mandatory input parameters + input_mandatory = [] + # dictionary of output parameters. key is parameter name, value is ApiParam class + output_params = {} + # list of mandatory output parameters (for successful response) + output_mandatory = [] + # expected HTTP status code of the response + expected_http_status = 200 + + def __init__(self, url_prefix: str, func_req_id: str, session): + self.url_prefix = url_prefix + self.func_req_id = func_req_id + self.session = session + + def encode(self, data: dict, func_call_id: str) -> dict: + """Validate an encode input dict into JSON-serializable dict for request body.""" + output = { + 'header': { + 'functionRequesterIdentifier': self.func_req_id, + 'functionCallIdentifier': func_call_id + } + } + for p in self.input_mandatory: + if not p in data: + raise ValueError('Mandatory input parameter %s missing' % p) + for p, v in data.items(): + p_class = self.input_params.get(p) + if not p_class: + logger.warning('Unexpected/unsupported input parameter %s=%s', p, v) + output[p] = v + else: + output[p] = p_class.encode(v) + return output + + + def decode(self, data: dict) -> dict: + """[further] Decode and validate the JSON-Dict of the respnse body.""" + output = {} + # let's first do the header, it's special + if not 'header' in data: + raise ValueError('Mandatory output parameter "header" missing') + hdr_class = self.output_params.get('header') + output['header'] = hdr_class.decode(data['header']) + + if output['header']['functionExecutionStatus']['status'] not in ['Executed-Success','Executed-WithWarning']: + raise Es2PlusApiError(output['header']['functionExecutionStatus']) + # we can only expect mandatory parameters to be present in case of successful execution + for p in self.output_mandatory: + if p == 'header': + continue + if not p in data: + raise ValueError('Mandatory output parameter "%s" missing' % p) + for p, v in data.items(): + p_class = self.output_params.get(p) + if not p_class: + logger.warning('Unexpected/unsupported output parameter "%s"="%s"', p, v) + output[p] = v + else: + output[p] = p_class.decode(v) + return output + + def call(self, data: dict, func_call_id:str, timeout=10) -> dict: + """Make an API call to the ES2+ API endpoint represented by this object. + Input data is passed in `data` as json-serializable dict. Output data + is returned as json-deserialized dict.""" + url = self.url_prefix + self.path + encoded = json.dumps(self.encode(data, func_call_id)) + headers = { + 'Content-Type': 'application/json', + 'X-Admin-Protocol': 'gsma/rsp/v2.5.0', + } + + logger.debug("HTTP REQ %s - '%s'" % (url, encoded)) + response = self.session.post(url, data=encoded, headers=headers, timeout=timeout) + logger.debug("HTTP RSP-STS: [%u] hdr: %s" % (response.status_code, response.headers)) + logger.debug("HTTP RSP: %s" % (response.content)) + + if response.status_code != self.expected_http_status: + raise HttpStatusError(response) + if not response.headers.get('Content-Type').startswith(headers['Content-Type']): + raise HttpHeaderError(response) + if not response.headers.get('X-Admin-Protocol', 'gsma/rsp/v2.unknown').startswith('gsma/rsp/v2.'): + raise HttpHeaderError(response) + + return self.decode(response.json()) + + +# ES2+ DownloadOrder function (SGP.22 section 5.3.1) +class DownloadOrder(Es2PlusApiFunction): + path = '/gsma/rsp2/es2plus/downloadOrder' + input_params = { + 'eid': param.Eid, + 'iccid': param.Iccid, + 'profileType': param.ProfileType + } + output_params = { + 'header': param.JsonResponseHeader, + 'iccid': param.Iccid, + } + output_mandatory = ['header', 'iccid'] + +# ES2+ ConfirmOrder function (SGP.22 section 5.3.2) +class ConfirmOrder(Es2PlusApiFunction): + path = '/gsma/rsp2/es2plus/confirmOrder' + input_params = { + 'iccid': param.Iccid, + 'eid': param.Eid, + 'matchingId': param.MatchingId, + 'confirmationCode': param.ConfirmationCode, + 'smdsAddress': param.SmdsAddress, + 'releaseFlag': param.ReleaseFlag, + } + input_mandatory = ['iccid', 'releaseFlag'] + output_params = { + 'header': param.JsonResponseHeader, + 'eid': param.Eid, + 'matchingId': param.MatchingId, + 'smdpAddress': param.SmdpAddress, + } + output_mandatory = ['header', 'matchingId'] + +# ES2+ CancelOrder function (SGP.22 section 5.3.3) +class CancelOrder(Es2PlusApiFunction): + path = '/gsma/rsp2/es2plus/cancelOrder' + input_params = { + 'iccid': param.Iccid, + 'eid': param.Eid, + 'matchingId': param.MatchingId, + 'finalProfileStatusIndicator': param.FinalProfileStatusIndicator, + } + input_mandatory = ['finalProfileStatusIndicator', 'iccid'] + output_params = { + 'header': param.JsonResponseHeader, + } + output_mandatory = ['header'] + +# ES2+ ReleaseProfile function (SGP.22 section 5.3.4) +class ReleaseProfile(Es2PlusApiFunction): + path = '/gsma/rsp2/es2plus/releaseProfile' + input_params = { + 'iccid': param.Iccid, + } + input_mandatory = ['iccid'] + output_params = { + 'header': param.JsonResponseHeader, + } + output_mandatory = ['header'] + +# ES2+ HandleDownloadProgress function (SGP.22 section 5.3.5) +class HandleDownloadProgressInfo(Es2PlusApiFunction): + path = '/gsma/rsp2/es2plus/handleDownloadProgressInfo' + input_params = { + 'eid': param.Eid, + 'iccid': param.Iccid, + 'profileType': param.ProfileType, + 'timestamp': param.Timestamp, + 'notificationPointId': param.NotificationPointId, + 'notificationPointStatus': param.NotificationPointStatus, + 'resultData': param.ResultData, + } + input_mandatory = ['iccid', 'profileType', 'timestamp', 'notificationPointId', 'notificationPointStatus'] + expected_http_status = 204 + + +class Es2pApiClient: + """Main class representing a full ES2+ API client. Has one method for each API function.""" + def __init__(self, url_prefix:str, func_req_id:str, server_cert_verify: str = None, client_cert: str = None): + self.func_id = 0 + self.session = requests.Session() + if server_cert_verify: + self.session.verify = server_cert_verify + if client_cert: + self.session.cert = client_cert + + self.downloadOrder = DownloadOrder(url_prefix, func_req_id, self.session) + self.confirmOrder = ConfirmOrder(url_prefix, func_req_id, self.session) + self.cancelOrder = CancelOrder(url_prefix, func_req_id, self.session) + self.releaseProfile = ReleaseProfile(url_prefix, func_req_id, self.session) + self.handleDownloadProgressInfo = HandleDownloadProgressInfo(url_prefix, func_req_id, self.session) + + def _gen_func_id(self) -> str: + """Generate the next function call id.""" + self.func_id += 1 + return 'FCI-%u-%u' % (time.time(), self.func_id) + + + def call_downloadOrder(self, data: dict) -> dict: + """Perform ES2+ DownloadOrder function (SGP.22 section 5.3.1).""" + return self.downloadOrder.call(data, self._gen_func_id()) + + def call_confirmOrder(self, data: dict) -> dict: + """Perform ES2+ ConfirmOrder function (SGP.22 section 5.3.2).""" + return self.confirmOrder.call(data, self._gen_func_id()) + + def call_cancelOrder(self, data: dict) -> dict: + """Perform ES2+ CancelOrder function (SGP.22 section 5.3.3).""" + return self.cancelOrder.call(data, self._gen_func_id()) + + def call_releaseProfile(self, data: dict) -> dict: + """Perform ES2+ CancelOrder function (SGP.22 section 5.3.4).""" + return self.releaseProfile.call(data, self._gen_func_id()) + + def call_handleDownloadProgressInfo(self, data: dict) -> dict: + """Perform ES2+ HandleDownloadProgressInfo function (SGP.22 section 5.3.5).""" + return self.handleDownloadProgressInfo.call(data, self._gen_func_id()) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/35935?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: Id652bb4c2df8893a824b8bb44beeafdfbb91de3f Gerrit-Change-Number: 35935 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-epdg[master]: s2b: Fix FTEID interface in CreateSessionResponse
by pespin 09 Feb '24

09 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35934?usp=email ) Change subject: s2b: Fix FTEID interface in CreateSessionResponse ...................................................................... s2b: Fix FTEID interface in CreateSessionResponse Change-Id: Iac76804738cdf237024bd762d5ea3aaf9a2cb9c1 --- M src/epdg_gtpc_s2b.erl 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/34/35934/1 diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl index 05aed1b..2adda97 100644 --- a/src/epdg_gtpc_s2b.erl +++ b/src/epdg_gtpc_s2b.erl @@ -302,7 +302,7 @@ % Do GTP specific msg parsing here, pass only relevant fields: #{{v2_fully_qualified_tunnel_endpoint_identifier,1} := #v2_fully_qualified_tunnel_endpoint_identifier{ - interface_type = 30, %% "S2b ePDG GTP-C" + interface_type = 32, %% "S2b PGW GTP-C" key = RemoteTEIC, ipv4 = _IPc4, ipv6 = _IPc6}, {v2_pdn_address_allocation,0} := Paa, {v2_bearer_context,0} := #v2_bearer_context{instance = 0, group = BearerIE}} = Resp#gtp.ie, @@ -310,7 +310,7 @@ #{{v2_eps_bearer_id,0} := #v2_eps_bearer_id{instance = 0, eps_bearer_id = Ebi}, {v2_fully_qualified_tunnel_endpoint_identifier,4} := #v2_fully_qualified_tunnel_endpoint_identifier{ - interface_type = 31, %% "S2b-U ePDG GTP-U" + interface_type = 33, %% "S2b-U PGW GTP-U" key = RemoteTEID, ipv4 = IPu4, ipv6 = IPu6} } = BearerIE, Bearer = gtp_session_find_bearer_by_ebi(Sess0, Ebi), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35934?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: Iac76804738cdf237024bd762d5ea3aaf9a2cb9c1 Gerrit-Change-Number: 35934 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-epdg[master]: Expect NAI instead of Imsi in S6b AAR
by pespin 09 Feb '24

09 Feb '24
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35931?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: Expect NAI instead of Imsi in S6b AAR ...................................................................... Expect NAI instead of Imsi in S6b AAR Change-Id: I6599b84c2a0e1a758cb63bb9e419fa4c3cf4f4a6 --- M src/aaa_diameter_s6b_cb.erl M src/conv.erl 2 files changed, 22 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/31/35931/2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35931?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: I6599b84c2a0e1a758cb63bb9e419fa4c3cf4f4a6 Gerrit-Change-Number: 35931 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: epdg: Fix FTEID interface in CreateSessionResponse
by pespin 09 Feb '24

09 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35933?usp=email ) Change subject: epdg: Fix FTEID interface in CreateSessionResponse ...................................................................... epdg: Fix FTEID interface in CreateSessionResponse Change-Id: If7ce6580c4690473d9c34ca58f704c8ff535f166 --- M epdg/EPDG_Tests.ttcn 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/33/35933/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index e104cdc..89a85f1 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -454,9 +454,9 @@ /* Upon rx of CreateSession, emulate PGW asking the AAA server. */ f_S6b_AA_success(); - fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic_local, 1, + fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_PGW_GTPC, g_pars.teic_local, 1, f_inet_addr(mp_s2b_local_ip), omit); - fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, g_pars.bearer.teid_local, 4, + fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_PGW_GTPU, g_pars.bearer.teid_local, 4, f_inet_addr(mp_s2b_local_ip), omit); paa := ts_GTP2C_PdnAddrAlloc_v4(f_inet_addr(g_pars.ue_ip)); bctx_ies := ts_GTP2C_BcContextIE(ebi := g_pars.bearer.ebi, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35933?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: If7ce6580c4690473d9c34ca58f704c8ff535f166 Gerrit-Change-Number: 35933 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: Add support for M3UA-over-TCP, clarify default SCTP
by fixeria 09 Feb '24

09 Feb '24
fixeria has abandoned this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35792?usp=email ) Change subject: Add support for M3UA-over-TCP, clarify default SCTP ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35792?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I078da51abc3511a4854f9c8fbca8eafd2bed78da Gerrit-Change-Number: 35792 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: abandon
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: epdg: Fix UsernMame being NAI instead of IMSI in S6b AAR
by pespin 09 Feb '24

09 Feb '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35932?usp=email ) Change subject: epdg: Fix UsernMame being NAI instead of IMSI in S6b AAR ...................................................................... epdg: Fix UsernMame being NAI instead of IMSI in S6b AAR Change-Id: Ifa5b262db40b649c6dfe7b5ac43098208b3e8300 --- M epdg/EPDG_Tests.ttcn M library/DIAMETER_ts29_273_Templates.ttcn 2 files changed, 18 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/32/35932/1 diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn index a7c9509..e104cdc 100644 --- a/epdg/EPDG_Tests.ttcn +++ b/epdg/EPDG_Tests.ttcn @@ -37,6 +37,8 @@ integer mp_s6b_local_port := 3869; charstring mp_s6b_remote_ip := "127.0.0.1"; integer mp_s6b_remote_port := 3869; + /* 3GPP TS 23.003 clause 19: "nai.epc.mnc<MNC>.mcc<MCC>.3gppnetwork.org" */ + charstring mp_s6b_nai_realm := "nai.epc.mnc001.mcc01.3gppnetwork.org"; /* our emulated PGW (GTPv2C S2b) */ charstring mp_s2b_local_ip := "127.0.0.100"; @@ -332,6 +334,10 @@ return vc_conn; } +private function f_nai() runs on EPDG_ConnHdlr return charstring { + return hex2str(g_pars.imsi) & "@" & mp_s6b_nai_realm; +} + /* Diameter SWx MAR + MAA. */ private altstep as_DIA_SWx_MA_success() runs on EPDG_ConnHdlr { var PDU_DIAMETER rx_dia; @@ -390,7 +396,7 @@ */ f_epdg_connhldr_S6b_expect_eteid(ete_id); - S6b.send(ts_DIA_S6b_AAR(g_pars.imsi, + S6b.send(ts_DIA_S6b_AAR(f_nai(), int2oct(DIA_TS29_373_MIP6_Feature_Vector_GTPv2_SUPPORTED, 8), g_pars.apn, hbh_id := hbh_id, ete_id := ete_id)); diff --git a/library/DIAMETER_ts29_273_Templates.ttcn b/library/DIAMETER_ts29_273_Templates.ttcn index 71f6cfc..e3a6c2f 100644 --- a/library/DIAMETER_ts29_273_Templates.ttcn +++ b/library/DIAMETER_ts29_273_Templates.ttcn @@ -205,7 +205,7 @@ /* TS 29.273 9.2.2.5.1 AA-Request (AAR) */ template (value) PDU_DIAMETER -ts_DIA_S6b_AAR(template (value) hexstring imsi, +ts_DIA_S6b_AAR(template (value) charstring username_nai, template (value) MIPv6_NONE_MIP6_Feature_Vector mip6_feat_vec, template (value) charstring apn, template (value) octetstring sess_id := c_def_sess_id, @@ -227,7 +227,7 @@ ts_AVP_OriginRealm(orig_realm), ts_AVP_DestinationRealm(dest_realm), ts_AVP_AuthRequestType(AUTHORIZE_ONLY), - ts_AVP_UserNameImsi(valueof(imsi)), + ts_AVP_UserName(char2oct(valueof(username_nai))), ts_AVP_MIP6FeatureVector(mip6_feat_vec), ts_AVP_ServiceSelection(valueof(apn)) /* TODO: Lots other optional */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35932?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: Ifa5b262db40b649c6dfe7b5ac43098208b3e8300 Gerrit-Change-Number: 35932 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.