jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/onomondo-ipa/+/43031?usp=email )


Change subject: V1.2: Add setDefaultDpAddress function
......................................................................

V1.2: Add setDefaultDpAddress function

Add setDefaultDpAddress to EuiccResultData. Implement the SGP.32
function SetDefaultDpAddress and handle the setDefaultDpAddress PSMO.

The IoT eUICC emulation uses the non-IoT eUICC SGP.22 function
SetDefaultDpAddress.

Reference: SGP.32 Section 2.11.1.1.3

Related: SYS#8101
Change-Id: I514b03240289469142e6a41a7290a4afce199318
---
M asn1/SGP32Definitions.asn
M src/ipa/libasn/CMakeLists.txt
M src/ipa/libasn/EuiccResultData.c
M src/ipa/libasn/EuiccResultData.h
M src/ipa/libasn/Psmo.c
M src/ipa/libasn/Psmo.h
A src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.c
A src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.h
A src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.c
A src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.h
M src/ipa/libasn/SetDefaultDpAddressResponse.c
M src/ipa/libasn/SetDefaultDpAddressResponse.h
M src/ipa/libipa/CMakeLists.txt
M src/ipa/libipa/es10b_load_euicc_pkg.c
A src/ipa/libipa/es10c_set_def_dp_addr.c
A src/ipa/libipa/es10c_set_def_dp_addr.h
16 files changed, 404 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/onomondo-ipa refs/changes/31/43031/1

diff --git a/asn1/SGP32Definitions.asn b/asn1/SGP32Definitions.asn
index c37ac17..0e3723c 100644
--- a/asn1/SGP32Definitions.asn
+++ b/asn1/SGP32Definitions.asn
@@ -104,7 +104,8 @@
     smdpAddress [2] UTF8String OPTIONAL
   },
   setFallbackAttribute [8] SEQUENCE {iccid [APPLICATION 26] Iccid},
-  unsetFallbackAttribute [9] SEQUENCE {}
+  unsetFallbackAttribute [9] SEQUENCE {},
+  setDefaultDpAddress [101] SGP32-SetDefaultDpAddressRequest -- Tag 'BF65'
 }
 -- ASN1STOP

@@ -181,7 +182,8 @@
     unknownOrDamagedCommand(2),
     interruption(3),
     undefinedError(127)
-  }
+  },
+  setDefaultDpAddressResult [101] SetDefaultDpAddressResponse
 }
 EuiccPackageErrorSigned ::= SEQUENCE {
   euiccPackageErrorDataSigned EuiccPackageErrorDataSigned,
@@ -542,6 +544,16 @@
 }
 -- ASN1STOP

+-- Section 5.9.25
+-- ASN1START
+SGP32-SetDefaultDpAddressRequest ::= [101] SEQUENCE { -- Tag 'BF65'
+  defaultDpAddress UTF8String -- Default SM-DP+ address as an FQDN
+}
+SGP32-SetDefaultDpAddressResponse ::= [101] SEQUENCE { -- Tag 'BF65'
+  setDefaultDpAddressResult INTEGER { ok (0), undefinedError (127)}
+}
+-- ASN1STOP
+
 -- Section 5.14.2
 -- ASN1START
 SGP32-PrepareDownloadResponse ::= [33] CHOICE { -- Tag 'BF21'
diff --git a/src/ipa/libasn/CMakeLists.txt b/src/ipa/libasn/CMakeLists.txt
index 68338fb..bd8ed73 100644
--- a/src/ipa/libasn/CMakeLists.txt
+++ b/src/ipa/libasn/CMakeLists.txt
@@ -818,6 +818,10 @@
 SGP32-RetrieveNotificationsListRequest.h
 SGP32-RetrieveNotificationsListResponse.c
 SGP32-RetrieveNotificationsListResponse.h
+SGP32-SetDefaultDpAddressRequest.c
+SGP32-SetDefaultDpAddressRequest.h
+SGP32-SetDefaultDpAddressResponse.c
+SGP32-SetDefaultDpAddressResponse.h
 SkipCerts.c
 SkipCerts.h
 SmdpSigned2.c
diff --git a/src/ipa/libasn/EuiccResultData.c b/src/ipa/libasn/EuiccResultData.c
index 15fc272..5a0376c 100644
--- a/src/ipa/libasn/EuiccResultData.c
+++ b/src/ipa/libasn/EuiccResultData.c
@@ -11,7 +11,7 @@
        { 0, 0 },
        -1};
 asn_per_constraints_t asn_PER_type_EuiccResultData_constr_1 CC_NOTUSED = {
-       { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  13 }   /* (0..13,...) 
*/,
+       { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  14 }   /* (0..14,...) 
*/,
        { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
        0, 0    /* No PER value map */
 };
@@ -142,9 +142,18 @@
                0, 0, /* No default value */
                "processingTerminated"
                },
+       { ATF_NOFLAGS, 0, offsetof(struct EuiccResultData, 
choice.setDefaultDpAddressResult),
+               (ASN_TAG_CLASS_CONTEXT | (101 << 2)),
+               -1,     /* IMPLICIT tag at current level */
+               &asn_DEF_SetDefaultDpAddressResponse,
+               0,
+               { 0, 0, 0 },
+               0, 0, /* No default value */
+               "setDefaultDpAddressResult"
+               },
 };
-static const unsigned asn_MAP_EuiccResultData_to_canonical_1[] = { 13, 0, 1, 
2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 3 };
-static const unsigned asn_MAP_EuiccResultData_from_canonical_1[] = { 1, 2, 3, 
13, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0 };
+static const unsigned asn_MAP_EuiccResultData_to_canonical_1[] = { 13, 0, 1, 
2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 3, 14 };
+static const unsigned asn_MAP_EuiccResultData_from_canonical_1[] = { 1, 2, 3, 
13, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 14 };
 static const asn_TYPE_tag2member_t asn_MAP_EuiccResultData_tag2el_1[] = {
     { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 13, 0, 0 }, /* 
processingTerminated */
     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* enableResult */
@@ -159,7 +168,8 @@
     { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 10, 0, 0 }, /* rollbackResult */
     { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 11, 0, 0 }, /* 
setFallbackAttributeResult */
     { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 12, 0, 0 }, /* 
unsetFallbackAttributeResult */
-    { (ASN_TAG_CLASS_CONTEXT | (45 << 2)), 3, 0, 0 } /* listProfileInfoResult 
*/
+    { (ASN_TAG_CLASS_CONTEXT | (45 << 2)), 3, 0, 0 }, /* listProfileInfoResult 
*/
+    { (ASN_TAG_CLASS_CONTEXT | (101 << 2)), 14, 0, 0 } /* 
setDefaultDpAddressResult */
 };
 asn_CHOICE_specifics_t asn_SPC_EuiccResultData_specs_1 = {
        sizeof(struct EuiccResultData),
@@ -167,10 +177,10 @@
        offsetof(struct EuiccResultData, present),
        sizeof(((struct EuiccResultData *)0)->present),
        asn_MAP_EuiccResultData_tag2el_1,
-       14,     /* Count of tags in the map */
+       15,     /* Count of tags in the map */
        asn_MAP_EuiccResultData_to_canonical_1,
        asn_MAP_EuiccResultData_from_canonical_1,
-       14      /* Extensions start */
+       15      /* Extensions start */
 };
 asn_TYPE_descriptor_t asn_DEF_EuiccResultData = {
        "EuiccResultData",
@@ -182,7 +192,7 @@
        0,      /* No tags (count) */
        { &asn_OER_type_EuiccResultData_constr_1, 
&asn_PER_type_EuiccResultData_constr_1, CHOICE_constraint },
        asn_MBR_EuiccResultData_1,
-       14,     /* Elements count */
+       15,     /* Elements count */
        &asn_SPC_EuiccResultData_specs_1        /* Additional specs */
 };

diff --git a/src/ipa/libasn/EuiccResultData.h b/src/ipa/libasn/EuiccResultData.h
index 79197a6..aa7069b 100644
--- a/src/ipa/libasn/EuiccResultData.h
+++ b/src/ipa/libasn/EuiccResultData.h
@@ -26,6 +26,7 @@
 #include "SetFallbackAttributeResult.h"
 #include "UnsetFallbackAttributeResult.h"
 #include <NativeInteger.h>
+#include "SetDefaultDpAddressResponse.h"
 #include <constr_CHOICE.h>

 #ifdef __cplusplus
@@ -48,7 +49,8 @@
        EuiccResultData_PR_rollbackResult,
        EuiccResultData_PR_setFallbackAttributeResult,
        EuiccResultData_PR_unsetFallbackAttributeResult,
-       EuiccResultData_PR_processingTerminated
+       EuiccResultData_PR_processingTerminated,
+       EuiccResultData_PR_setDefaultDpAddressResult
        /* Extensions may appear below */

 } EuiccResultData_PR;
@@ -77,6 +79,7 @@
                SetFallbackAttributeResult_t     setFallbackAttributeResult;
                UnsetFallbackAttributeResult_t   unsetFallbackAttributeResult;
                long     processingTerminated;
+               SetDefaultDpAddressResponse_t    setDefaultDpAddressResult;
                /*
                 * This type is extensible,
                 * possible extensions are below.
@@ -90,7 +93,7 @@
 /* Implementation */
 extern asn_TYPE_descriptor_t asn_DEF_EuiccResultData;
 extern asn_CHOICE_specifics_t asn_SPC_EuiccResultData_specs_1;
-extern asn_TYPE_member_t asn_MBR_EuiccResultData_1[14];
+extern asn_TYPE_member_t asn_MBR_EuiccResultData_1[15];
 extern asn_per_constraints_t asn_PER_type_EuiccResultData_constr_1;

 #ifdef __cplusplus
diff --git a/src/ipa/libasn/Psmo.c b/src/ipa/libasn/Psmo.c
index 144a95a..e6bb849 100644
--- a/src/ipa/libasn/Psmo.c
+++ b/src/ipa/libasn/Psmo.c
@@ -11,7 +11,7 @@
        { 0, 0 },
        -1};
 asn_per_constraints_t asn_PER_type_Psmo_constr_1 CC_NOTUSED = {
-       { APC_CONSTRAINED | APC_EXTENSIBLE,  3,  3,  0,  7 }    /* (0..7,...) 
*/,
+       { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  8 }    /* (0..8,...) 
*/,
        { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
        0, 0    /* No PER value map */
 };
@@ -393,9 +393,18 @@
                0, 0, /* No default value */
                "unsetFallbackAttribute"
                },
+       { ATF_NOFLAGS, 0, offsetof(struct Psmo, choice.setDefaultDpAddress),
+               (ASN_TAG_CLASS_CONTEXT | (101 << 2)),
+               -1,     /* IMPLICIT tag at current level */
+               &asn_DEF_SGP32_SetDefaultDpAddressRequest,
+               0,
+               { 0, 0, 0 },
+               0, 0, /* No default value */
+               "setDefaultDpAddress"
+               },
 };
-static const unsigned asn_MAP_Psmo_to_canonical_1[] = { 0, 1, 2, 4, 5, 6, 7, 3 
};
-static const unsigned asn_MAP_Psmo_from_canonical_1[] = { 0, 1, 2, 7, 3, 4, 5, 
6 };
+static const unsigned asn_MAP_Psmo_to_canonical_1[] = { 0, 1, 2, 4, 5, 6, 7, 
3, 8 };
+static const unsigned asn_MAP_Psmo_from_canonical_1[] = { 0, 1, 2, 7, 3, 4, 5, 
6, 8 };
 static const asn_TYPE_tag2member_t asn_MAP_Psmo_tag2el_1[] = {
     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 0, 0, 0 }, /* enable */
     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 1, 0, 0 }, /* disable */
@@ -404,7 +413,8 @@
     { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 5, 0, 0 }, /* 
configureImmediateEnable */
     { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 6, 0, 0 }, /* setFallbackAttribute */
     { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 7, 0, 0 }, /* unsetFallbackAttribute 
*/
-    { (ASN_TAG_CLASS_CONTEXT | (45 << 2)), 3, 0, 0 } /* listProfileInfo */
+    { (ASN_TAG_CLASS_CONTEXT | (45 << 2)), 3, 0, 0 }, /* listProfileInfo */
+    { (ASN_TAG_CLASS_CONTEXT | (101 << 2)), 8, 0, 0 } /* setDefaultDpAddress */
 };
 asn_CHOICE_specifics_t asn_SPC_Psmo_specs_1 = {
        sizeof(struct Psmo),
@@ -412,10 +422,10 @@
        offsetof(struct Psmo, present),
        sizeof(((struct Psmo *)0)->present),
        asn_MAP_Psmo_tag2el_1,
-       8,      /* Count of tags in the map */
+       9,      /* Count of tags in the map */
        asn_MAP_Psmo_to_canonical_1,
        asn_MAP_Psmo_from_canonical_1,
-       8       /* Extensions start */
+       9       /* Extensions start */
 };
 asn_TYPE_descriptor_t asn_DEF_Psmo = {
        "Psmo",
@@ -427,7 +437,7 @@
        0,      /* No tags (count) */
        { &asn_OER_type_Psmo_constr_1, &asn_PER_type_Psmo_constr_1, 
CHOICE_constraint },
        asn_MBR_Psmo_1,
-       8,      /* Elements count */
+       9,      /* Elements count */
        &asn_SPC_Psmo_specs_1   /* Additional specs */
 };

diff --git a/src/ipa/libasn/Psmo.h b/src/ipa/libasn/Psmo.h
index c5e3e10..e00f820 100644
--- a/src/ipa/libasn/Psmo.h
+++ b/src/ipa/libasn/Psmo.h
@@ -13,6 +13,7 @@

 /* Including external dependencies */
 #include "ProfileInfoListRequest.h"
+#include "SGP32-SetDefaultDpAddressRequest.h"
 #include "Iccid.h"
 #include <NULL.h>
 #include <constr_SEQUENCE.h>
@@ -34,7 +35,8 @@
        Psmo_PR_getRAT,
        Psmo_PR_configureImmediateEnable,
        Psmo_PR_setFallbackAttribute,
-       Psmo_PR_unsetFallbackAttribute
+       Psmo_PR_unsetFallbackAttribute,
+       Psmo_PR_setDefaultDpAddress
        /* Extensions may appear below */

 } Psmo_PR;
@@ -115,6 +117,7 @@
                        /* Context for parsing across buffer boundaries */
                        asn_struct_ctx_t _asn_ctx;
                } unsetFallbackAttribute;
+               SGP32_SetDefaultDpAddressRequest_t       setDefaultDpAddress;
                /*
                 * This type is extensible,
                 * possible extensions are below.
@@ -128,7 +131,7 @@
 /* Implementation */
 extern asn_TYPE_descriptor_t asn_DEF_Psmo;
 extern asn_CHOICE_specifics_t asn_SPC_Psmo_specs_1;
-extern asn_TYPE_member_t asn_MBR_Psmo_1[8];
+extern asn_TYPE_member_t asn_MBR_Psmo_1[9];
 extern asn_per_constraints_t asn_PER_type_Psmo_constr_1;

 #ifdef __cplusplus
diff --git a/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.c 
b/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.c
new file mode 100644
index 0000000..471f70d
--- /dev/null
+++ b/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.c
@@ -0,0 +1,51 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "SGP32Definitions"
+ *     found in "../../../asn1/SGP32Definitions.asn"
+ *     `asn1c -fcompound-names -no-gen-example`
+ */
+
+#include "SGP32-SetDefaultDpAddressRequest.h"
+
+asn_TYPE_member_t asn_MBR_SGP32_SetDefaultDpAddressRequest_1[] = {
+       { ATF_NOFLAGS, 0, offsetof(struct SGP32_SetDefaultDpAddressRequest, 
defaultDpAddress),
+               (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+               -1,     /* IMPLICIT tag at current level */
+               &asn_DEF_UTF8String,
+               0,
+               { 0, 0, 0 },
+               0, 0, /* No default value */
+               "defaultDpAddress"
+               },
+};
+static const ber_tlv_tag_t asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1[] = 
{
+       (ASN_TAG_CLASS_CONTEXT | (101 << 2)),
+       (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t 
asn_MAP_SGP32_SetDefaultDpAddressRequest_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* defaultDpAddress */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SGP32_SetDefaultDpAddressRequest_specs_1 = {
+       sizeof(struct SGP32_SetDefaultDpAddressRequest),
+       offsetof(struct SGP32_SetDefaultDpAddressRequest, _asn_ctx),
+       asn_MAP_SGP32_SetDefaultDpAddressRequest_tag2el_1,
+       1,      /* Count of tags in the map */
+       0, 0, 0,        /* Optional elements (not needed) */
+       1,      /* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SGP32_SetDefaultDpAddressRequest = {
+       "SGP32-SetDefaultDpAddressRequest",
+       "SGP32-SetDefaultDpAddressRequest",
+       &asn_OP_SEQUENCE,
+       asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1,
+       sizeof(asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1)
+               /sizeof(asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1[0]) - 
1, /* 1 */
+       asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1,        /* Same as 
above */
+       sizeof(asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1)
+               /sizeof(asn_DEF_SGP32_SetDefaultDpAddressRequest_tags_1[0]), /* 
2 */
+       { 0, 0, SEQUENCE_constraint },
+       asn_MBR_SGP32_SetDefaultDpAddressRequest_1,
+       1,      /* Elements count */
+       &asn_SPC_SGP32_SetDefaultDpAddressRequest_specs_1       /* Additional 
specs */
+};
+
diff --git a/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.h 
b/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.h
new file mode 100644
index 0000000..137b5e9
--- /dev/null
+++ b/src/ipa/libasn/SGP32-SetDefaultDpAddressRequest.h
@@ -0,0 +1,44 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "SGP32Definitions"
+ *     found in "../../../asn1/SGP32Definitions.asn"
+ *     `asn1c -fcompound-names -no-gen-example`
+ */
+
+#ifndef        _SGP32_SetDefaultDpAddressRequest_H_
+#define        _SGP32_SetDefaultDpAddressRequest_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <UTF8String.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SGP32-SetDefaultDpAddressRequest */
+typedef struct SGP32_SetDefaultDpAddressRequest {
+       UTF8String_t     defaultDpAddress;
+       /*
+        * This type is extensible,
+        * possible extensions are below.
+        */
+
+       /* Context for parsing across buffer boundaries */
+       asn_struct_ctx_t _asn_ctx;
+} SGP32_SetDefaultDpAddressRequest_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SGP32_SetDefaultDpAddressRequest;
+extern asn_SEQUENCE_specifics_t 
asn_SPC_SGP32_SetDefaultDpAddressRequest_specs_1;
+extern asn_TYPE_member_t asn_MBR_SGP32_SetDefaultDpAddressRequest_1[1];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SGP32_SetDefaultDpAddressRequest_H_ */
+#include <asn_internal.h>
diff --git a/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.c 
b/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.c
new file mode 100644
index 0000000..04ee4a0
--- /dev/null
+++ b/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.c
@@ -0,0 +1,51 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "SGP32Definitions"
+ *     found in "../../../asn1/SGP32Definitions.asn"
+ *     `asn1c -fcompound-names -no-gen-example`
+ */
+
+#include "SGP32-SetDefaultDpAddressResponse.h"
+
+static asn_TYPE_member_t asn_MBR_SGP32_SetDefaultDpAddressResponse_1[] = {
+       { ATF_NOFLAGS, 0, offsetof(struct SGP32_SetDefaultDpAddressResponse, 
setDefaultDpAddressResult),
+               (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+               -1,     /* IMPLICIT tag at current level */
+               &asn_DEF_NativeInteger,
+               0,
+               { 0, 0, 0 },
+               0, 0, /* No default value */
+               "setDefaultDpAddressResult"
+               },
+};
+static const ber_tlv_tag_t asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1[] 
= {
+       (ASN_TAG_CLASS_CONTEXT | (101 << 2)),
+       (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t 
asn_MAP_SGP32_SetDefaultDpAddressResponse_tag2el_1[] = {
+    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* 
setDefaultDpAddressResult */
+};
+static asn_SEQUENCE_specifics_t 
asn_SPC_SGP32_SetDefaultDpAddressResponse_specs_1 = {
+       sizeof(struct SGP32_SetDefaultDpAddressResponse),
+       offsetof(struct SGP32_SetDefaultDpAddressResponse, _asn_ctx),
+       asn_MAP_SGP32_SetDefaultDpAddressResponse_tag2el_1,
+       1,      /* Count of tags in the map */
+       0, 0, 0,        /* Optional elements (not needed) */
+       1,      /* First extension addition */
+};
+asn_TYPE_descriptor_t asn_DEF_SGP32_SetDefaultDpAddressResponse = {
+       "SGP32-SetDefaultDpAddressResponse",
+       "SGP32-SetDefaultDpAddressResponse",
+       &asn_OP_SEQUENCE,
+       asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1,
+       sizeof(asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1)
+               /sizeof(asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1[0]) - 
1, /* 1 */
+       asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1,       /* Same as 
above */
+       sizeof(asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1)
+               /sizeof(asn_DEF_SGP32_SetDefaultDpAddressResponse_tags_1[0]), 
/* 2 */
+       { 0, 0, SEQUENCE_constraint },
+       asn_MBR_SGP32_SetDefaultDpAddressResponse_1,
+       1,      /* Elements count */
+       &asn_SPC_SGP32_SetDefaultDpAddressResponse_specs_1      /* Additional 
specs */
+};
+
diff --git a/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.h 
b/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.h
new file mode 100644
index 0000000..83e8d2a
--- /dev/null
+++ b/src/ipa/libasn/SGP32-SetDefaultDpAddressResponse.h
@@ -0,0 +1,48 @@
+/*
+ * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * From ASN.1 module "SGP32Definitions"
+ *     found in "../../../asn1/SGP32Definitions.asn"
+ *     `asn1c -fcompound-names -no-gen-example`
+ */
+
+#ifndef        _SGP32_SetDefaultDpAddressResponse_H_
+#define        _SGP32_SetDefaultDpAddressResponse_H_
+
+
+#include <asn_application.h>
+
+/* Including external dependencies */
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Dependencies */
+typedef enum SGP32_SetDefaultDpAddressResponse__setDefaultDpAddressResult {
+       SGP32_SetDefaultDpAddressResponse__setDefaultDpAddressResult_ok = 0,
+       
SGP32_SetDefaultDpAddressResponse__setDefaultDpAddressResult_undefinedError     
= 127
+} e_SGP32_SetDefaultDpAddressResponse__setDefaultDpAddressResult;
+
+/* SGP32-SetDefaultDpAddressResponse */
+typedef struct SGP32_SetDefaultDpAddressResponse {
+       long     setDefaultDpAddressResult;
+       /*
+        * This type is extensible,
+        * possible extensions are below.
+        */
+
+       /* Context for parsing across buffer boundaries */
+       asn_struct_ctx_t _asn_ctx;
+} SGP32_SetDefaultDpAddressResponse_t;
+
+/* Implementation */
+extern asn_TYPE_descriptor_t asn_DEF_SGP32_SetDefaultDpAddressResponse;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SGP32_SetDefaultDpAddressResponse_H_ */
+#include <asn_internal.h>
diff --git a/src/ipa/libasn/SetDefaultDpAddressResponse.c 
b/src/ipa/libasn/SetDefaultDpAddressResponse.c
index 0115f19..6aa5a5f 100644
--- a/src/ipa/libasn/SetDefaultDpAddressResponse.c
+++ b/src/ipa/libasn/SetDefaultDpAddressResponse.c
@@ -7,7 +7,7 @@

 #include "SetDefaultDpAddressResponse.h"

-static asn_TYPE_member_t asn_MBR_SetDefaultDpAddressResponse_1[] = {
+asn_TYPE_member_t asn_MBR_SetDefaultDpAddressResponse_1[] = {
        { ATF_NOFLAGS, 0, offsetof(struct SetDefaultDpAddressResponse, 
setDefaultDpAddressResult),
                (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
                -1,     /* IMPLICIT tag at current level */
@@ -25,7 +25,7 @@
 static const asn_TYPE_tag2member_t 
asn_MAP_SetDefaultDpAddressResponse_tag2el_1[] = {
     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* 
setDefaultDpAddressResult */
 };
-static asn_SEQUENCE_specifics_t asn_SPC_SetDefaultDpAddressResponse_specs_1 = {
+asn_SEQUENCE_specifics_t asn_SPC_SetDefaultDpAddressResponse_specs_1 = {
        sizeof(struct SetDefaultDpAddressResponse),
        offsetof(struct SetDefaultDpAddressResponse, _asn_ctx),
        asn_MAP_SetDefaultDpAddressResponse_tag2el_1,
diff --git a/src/ipa/libasn/SetDefaultDpAddressResponse.h 
b/src/ipa/libasn/SetDefaultDpAddressResponse.h
index 14a049b..06cd019 100644
--- a/src/ipa/libasn/SetDefaultDpAddressResponse.h
+++ b/src/ipa/libasn/SetDefaultDpAddressResponse.h
@@ -39,6 +39,8 @@

 /* Implementation */
 extern asn_TYPE_descriptor_t asn_DEF_SetDefaultDpAddressResponse;
+extern asn_SEQUENCE_specifics_t asn_SPC_SetDefaultDpAddressResponse_specs_1;
+extern asn_TYPE_member_t asn_MBR_SetDefaultDpAddressResponse_1[1];

 #ifdef __cplusplus
 }
diff --git a/src/ipa/libipa/CMakeLists.txt b/src/ipa/libipa/CMakeLists.txt
index e6bed87..7a6ac28 100644
--- a/src/ipa/libipa/CMakeLists.txt
+++ b/src/ipa/libipa/CMakeLists.txt
@@ -23,6 +23,7 @@
   es10c_delete_prfle.c
   es10c_disable_prfle.c
   es10c_enable_prfle.c
+  es10c_set_def_dp_addr.c
   es10b_immediate_enable.c
   es10c_get_eid.c
   es10c_get_prfle_info.c
diff --git a/src/ipa/libipa/es10b_load_euicc_pkg.c 
b/src/ipa/libipa/es10b_load_euicc_pkg.c
index 01e743a..ff1fc01 100644
--- a/src/ipa/libipa/es10b_load_euicc_pkg.c
+++ b/src/ipa/libipa/es10b_load_euicc_pkg.c
@@ -25,6 +25,7 @@
 #include "es10c_disable_prfle.h"
 #include "es10c_delete_prfle.h"
 #include "es10c_get_prfle_info.h"
+#include "es10c_set_def_dp_addr.h"
 #include "es10b_get_eim_cfg_data.h"
 #include "es10b_add_init_eim.h"
 #include "es10b_get_rat.h"
@@ -292,6 +293,30 @@
        return euicc_result_data;
 }

+struct EuiccResultData *iot_emo_do_setDefaultDpAddress_psmo(struct ipa_context 
*ctx,
+                                                           const 
SGP32_SetDefaultDpAddressRequest_t *setDefaultDpAddress_psmo)
+{
+       struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct 
EuiccResultData);
+       struct ipa_es10c_set_def_dp_addr_req set_def_dp_addr_req = { 0 };
+       struct ipa_es10c_set_def_dp_addr_res *set_def_dp_addr_res = NULL;
+
+       euicc_result_data->present = 
EuiccResultData_PR_setDefaultDpAddressResult;
+
+       set_def_dp_addr_req.req.defaultDpAddress = 
setDefaultDpAddress_psmo->defaultDpAddress;
+
+       set_def_dp_addr_res = ipa_es10c_set_def_dp_addr(ctx, 
&set_def_dp_addr_req);
+       if (set_def_dp_addr_res) {
+               
euicc_result_data->choice.setDefaultDpAddressResult.setDefaultDpAddressResult =
+                       set_def_dp_addr_res->res->setDefaultDpAddressResult;
+       } else {
+               
euicc_result_data->choice.setDefaultDpAddressResult.setDefaultDpAddressResult =
+                       
SetDefaultDpAddressResponse__setDefaultDpAddressResult_undefinedError;
+       }
+
+       ipa_es10c_set_def_dp_addr_res_free(set_def_dp_addr_res);
+       return euicc_result_data;
+}
+
 struct EuiccResultData *iot_emo_do_addEim_eco(struct ipa_context *ctx, const 
struct EimConfigurationData *addEim_eco)
 {
        struct EuiccResultData *euicc_result_data = IPA_ALLOC_ZERO(struct 
EuiccResultData);
@@ -632,6 +657,9 @@
                        case Psmo_PR_unsetFallbackAttribute:
                                psmo_result = 
iot_emo_do_unsetFallbackAttribute_psmo(ctx, 
&psmo->choice.unsetFallbackAttribute);
                                break;
+                       case Psmo_PR_setDefaultDpAddress:
+                               psmo_result = 
iot_emo_do_setDefaultDpAddress_psmo(ctx, &psmo->choice.setDefaultDpAddress);
+                               break;
                        default:
                                IPA_LOGP_ES10X("LoadEuiccPackage", LERROR, 
"ignoring invalid or unsupported PSMO!\n");
                                break;
diff --git a/src/ipa/libipa/es10c_set_def_dp_addr.c 
b/src/ipa/libipa/es10c_set_def_dp_addr.c
new file mode 100644
index 0000000..db755dd
--- /dev/null
+++ b/src/ipa/libipa/es10c_set_def_dp_addr.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2026 sysmocom - s.f.m.c. GmbH. All rights reserved.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-only
+ *
+ * Author: Philipp Maier <[email protected]> / sysmocom - s.f.m.c. GmbH
+ *         Andreas Eversberg <[email protected]> / sysmocom - s.f.m.c. 
GmbH
+ *
+ * See also: GSMA SGP.22, 5.7.4: Function (ES10c): SetDefaultDpAddress
+ */
+
+#include <stdio.h>
+#include <assert.h>
+#include <onomondo/ipa/utils.h>
+#include "context.h"
+#include "utils.h"
+#include "euicc.h"
+#include "es10x.h"
+#include "es10c_set_def_dp_addr.h"
+
+static const struct num_str_map error_code_strings[] = {
+       { SetDefaultDpAddressResponse__setDefaultDpAddressResult_ok, "ok" },
+       { 
SetDefaultDpAddressResponse__setDefaultDpAddressResult_undefinedError, 
"undefinedError" },
+       { 0, NULL }
+};
+
+static int dec_set_def_dp_addr_res(struct ipa_es10c_set_def_dp_addr_res *res, 
const struct ipa_buf *es10c_res)
+{
+       struct SetDefaultDpAddressResponse *asn = NULL;
+
+       asn = ipa_es10x_res_dec(&asn_DEF_SetDefaultDpAddressResponse, 
es10c_res, "SetDefaultDpAddress");
+       if (!asn)
+               return -EINVAL;
+
+       if (asn->setDefaultDpAddressResult != 
SetDefaultDpAddressResponse__setDefaultDpAddressResult_ok) {
+               IPA_LOGP_ES10X("SetDefaultDpAddress", LERROR, "function failed 
with error code %ld=%s!\n",
+                              asn->setDefaultDpAddressResult,
+                              ipa_str_from_num(error_code_strings, 
asn->setDefaultDpAddressResult, "(unknown)"));
+       } else {
+               IPA_LOGP_ES10X("SetDefaultDpAddress", LERROR, "function 
succeeded with status code %ld=%s!\n",
+                              asn->setDefaultDpAddressResult,
+                              ipa_str_from_num(error_code_strings, 
asn->setDefaultDpAddressResult, "(unknown)"));
+       }
+
+       res->res = asn;
+       return 0;
+}
+
+/*! Function (Es10c): SetDefaultDpAddress.
+ *  \param[inout] ctx pointer to ipa_context.
+ *  \param[in] req pointer to struct that holds the function parameters.
+ *  \returns pointer newly allocated struct with function result, NULL on 
error. */
+struct ipa_es10c_set_def_dp_addr_res *ipa_es10c_set_def_dp_addr(struct 
ipa_context *ctx,
+                                                               const struct 
ipa_es10c_set_def_dp_addr_req *req)
+{
+       struct ipa_buf *es10c_req = NULL;
+       struct ipa_buf *es10c_res = NULL;
+       struct ipa_es10c_set_def_dp_addr_res *res = IPA_ALLOC_ZERO(struct 
ipa_es10c_set_def_dp_addr_res);
+       int rc;
+
+       es10c_req = ipa_es10x_req_enc(&asn_DEF_SetDefaultDpAddressRequest, 
&req->req, "SetDefaultDpAddress");
+       if (!es10c_req) {
+               IPA_LOGP_ES10X("SetDefaultDpAddress", LERROR, "unable to encode 
Es10c request\n");
+               goto error;
+       }
+
+       es10c_res = ipa_euicc_transceive_es10x(ctx, es10c_req);
+       if (!es10c_res) {
+               IPA_LOGP_ES10X("SetDefaultDpAddress", LERROR, "no Es10c 
response\n");
+               goto error;
+       }
+
+       rc = dec_set_def_dp_addr_res(res, es10c_res);
+       if (rc < 0)
+               goto error;
+
+       IPA_FREE(es10c_req);
+       IPA_FREE(es10c_res);
+       return res;
+error:
+       IPA_FREE(es10c_req);
+       IPA_FREE(es10c_res);
+       ipa_es10c_set_def_dp_addr_res_free(res);
+       return NULL;
+}
+
+/*! Free results of function (Es10c): SetDefaultDpAddress.
+ *  \param[in] res pointer to function result. */
+void ipa_es10c_set_def_dp_addr_res_free(struct ipa_es10c_set_def_dp_addr_res 
*res)
+{
+       IPA_ES10X_RES_FREE(asn_DEF_SetDefaultDpAddressResponse, res);
+}
diff --git a/src/ipa/libipa/es10c_set_def_dp_addr.h 
b/src/ipa/libipa/es10c_set_def_dp_addr.h
new file mode 100644
index 0000000..c8a3186
--- /dev/null
+++ b/src/ipa/libipa/es10c_set_def_dp_addr.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2026 sysmocom - s.f.m.c. GmbH. All rights reserved.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+#pragma once
+
+#include <SetDefaultDpAddressRequest.h>
+#include <SetDefaultDpAddressResponse.h>
+struct ipa_context;
+
+struct ipa_es10c_set_def_dp_addr_req {
+       struct SetDefaultDpAddressRequest req;
+};
+
+struct ipa_es10c_set_def_dp_addr_res {
+       struct SetDefaultDpAddressResponse *res;
+};
+
+struct ipa_es10c_set_def_dp_addr_res *ipa_es10c_set_def_dp_addr(struct 
ipa_context *ctx,
+                                                               const struct 
ipa_es10c_set_def_dp_addr_req *req);
+void ipa_es10c_set_def_dp_addr_res_free(struct ipa_es10c_set_def_dp_addr_res 
*res);

--
To view, visit https://gerrit.osmocom.org/c/onomondo-ipa/+/43031?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: onomondo-ipa
Gerrit-Branch: master
Gerrit-Change-Id: I514b03240289469142e6a41a7290a4afce199318
Gerrit-Change-Number: 43031
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <[email protected]>

Reply via email to