Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: [2/7] personalization: refactor ConfigurableParameter, Iccid, Imsi
......................................................................
[2/7] personalization: refactor ConfigurableParameter, Iccid, Imsi
Main points/rationales of the refactoring, details below:
1) common validation implementation
2) offer classmethods
The new features are optional, and will be heavily used by batch
personalization patches coming soon.
Implement Iccid and Imsi to use the new way, with a common abstract
DecimalParam implementation.
So far leave the other parameter classes working as they always did, to
follow suit in subsequent commits.
Details:
1) common validation implementation:
There are very common validation steps in the various parameter
implementations. It is more convenient and much more readable to
implement those once and set simple validation parameters per subclass.
So there now is a validate_val() classmethod, which subclasses can use
as-is to apply the validation parameters -- or subclasses can override
their cls.validate_val() for specialized validation.
(Those subclasses that this patch doesn't touch still override the
self.validate() instance method. Hence they still work as before this
patch, but don't use the new common features yet.)
2) offer stateless classmethods:
It is useful for...
- batch processing of multiple profiles (in upcoming patches) and
- user input validation
to be able to have classmethods that do what self.validate() and
self.apply() do, but do not modify any self.* members.
So far the paradigm was to create a class instance to keep state about
the value. This remains available, but in addition we make available the
paradigm of a singleton that is stateless (the classmethods).
Using self.validate() and self.apply() still work the same as before
this patch, i.e. via self.input_value and self.value -- but in addition,
there are now classmethods that don't touch self.* members.
Related: SYS#6768
Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
---
M pySim/esim/saip/personalization.py
1 file changed, 180 insertions(+), 34 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/39742/5
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
Gerrit-Change-Number: 39742
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/39742?usp=email )
Change subject: [2/7] personalization: refactor ConfigurableParameter, Iccid, Imsi
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
if there are only cosmetic comments that refer to changes from the previous patch, then i would appreciate a +1, ouch -- or let's have some comments on the actual functional changes in this patch, thanks
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
Gerrit-Change-Number: 39742
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 10 Mar 2025 12:33:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: fixeria.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/39741?usp=email )
Change subject: [1/7] personalization: refactor: drop ClassVarMeta use
......................................................................
Patch Set 4:
(2 comments)
File pySim/esim/saip/personalization.py:
https://gerrit.osmocom.org/c/pysim/+/39741/comment/98345a6c_03268920?usp=em… :
PS4, Line 61: @abc.abstractmethod
> Why are you removing this? The COMMIT_MSG says you're dropping `ClassVarMeta`, but you're also remov […]
i commented on this on the subsequent commit, TL;DR: no noticeable difference and no need to have it.
If you insist i can put back the @abc.abstractmethod decorator.
Can you explain why is @abstractmethod not a python built-in!?
(The ClassVarMeta is not something I am willing to bring back, see below.)
https://gerrit.osmocom.org/c/pysim/+/39741/comment/9830d14d_d5d00c50?usp=em… :
PS4, Line 147: class SdKeyScp80_01(SdKey, kvn=0x01, key_type=0x88, permitted_len=[16,24,32]): # AES key type
> IMO, the old approach is much more compact and thus more readable.
IMHO absolutely not.
All members in one line?
With future extensions in upcoming patches, it will look like this
class SdKeyScp81_01Psk(SdKeyScp81_01, is_abstract = False, name = 'SCP81.01-PSK',
key_id = 0x01, key_type = KeyType.tls_psk # 0x85, key_usage_qual = 0x3C):
pass
you cannot seriously prefer that.
So let's make it more readable
class SdKeyScp81_01Psk(SdKeyScp81_01,
is_abstract = False,
name = 'SCP81.01-PSK',
key_id = 0x01,
key_type = KeyType.tls_psk, # 0x85
key_usage_qual = 0x3C):
pass
Congratulations, that is almost standard python, but messed up. I prefer a million times:
class SdKeyScp81_01Psk(SdKeyScp81_01):
is_abstract = False
name = 'SCP81.01-PSK'
key_id = 0x01
key_type = KeyType.tls_psk # 0x85
key_usage_qual = 0x3C
It's standard, shorter, doesn't need messing with the builtin __new__() method.
Complete no-brainer to me.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39741?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I60ea8fd11fb438ec90ddb08b17b658cbb789c051
Gerrit-Change-Number: 39741
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 10 Mar 2025 12:21:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39718?usp=email )
Change subject: mgw: Move struct mgcp_request_data definition to header file
......................................................................
mgw: Move struct mgcp_request_data definition to header file
All the related handling structs are placed in the header file, let's
move them there. This will also allow accessing the rq object
information in other files.
Change-Id: I1b2831874c1aaad054ad19bf87646062ba9d4da4
---
M include/osmocom/mgcp/mgcp_protocol.h
M src/libosmo-mgcp/mgcp_protocol.c
2 files changed, 25 insertions(+), 25 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
daniel: Looks good to me, approved
diff --git a/include/osmocom/mgcp/mgcp_protocol.h b/include/osmocom/mgcp/mgcp_protocol.h
index 4fed248..dda0fb3 100644
--- a/include/osmocom/mgcp/mgcp_protocol.h
+++ b/include/osmocom/mgcp/mgcp_protocol.h
@@ -82,6 +82,31 @@
struct mgcp_parse_sdp sdp;
};
+/* Request data passed to the request handler */
+struct mgcp_request_data {
+ enum mgcp_verb verb;
+ /* Verb string (e.g. "MDCX") */
+ char name[4+1];
+
+ /* parsing results from the MGCP header (trans id, endpoint name ...) */
+ struct mgcp_parse_data *pdata;
+
+ /* pointer to endpoint resource (may be NULL for wildcarded requests) */
+ struct mgcp_endpoint *endp;
+
+ /* pointer to trunk resource */
+ struct mgcp_trunk *trunk;
+
+ /* set to true when the request has been classified as wildcarded */
+ bool wildcarded;
+
+ /* Set to true when the request is targeted at the "null" endpoint */
+ bool null_endp;
+
+ /* contains cause code in case of problems during endp/trunk resolution */
+ int mgcp_cause;
+};
+
/* Local connection options */
struct mgcp_lco {
char *string;
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 36d9ebf..74ed14e 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -89,31 +89,6 @@
LOGPTRUNK(trunk, cat, level, fmt, ## args); \
} while (0)
-/* Request data passed to the request handler */
-struct mgcp_request_data {
- enum mgcp_verb verb;
- /* Verb string (e.g. "MDCX") */
- char name[4+1];
-
- /* parsing results from the MGCP header (trans id, endpoint name ...) */
- struct mgcp_parse_data *pdata;
-
- /* pointer to endpoint resource (may be NULL for wildcarded requests) */
- struct mgcp_endpoint *endp;
-
- /* pointer to trunk resource */
- struct mgcp_trunk *trunk;
-
- /* set to true when the request has been classified as wildcarded */
- bool wildcarded;
-
- /* Set to true when the request is targeted at the "null" endpoint */
- bool null_endp;
-
- /* contains cause code in case of problems during endp/trunk resolution */
- int mgcp_cause;
-};
-
static struct msgb *handle_audit_endpoint(struct mgcp_request_data *data);
static struct msgb *handle_create_con(struct mgcp_request_data *data);
static struct msgb *handle_delete_con(struct mgcp_request_data *data);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39718?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I1b2831874c1aaad054ad19bf87646062ba9d4da4
Gerrit-Change-Number: 39718
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>