RSPRO: split ConfigClient into ConfigClientId and ConfigClientBank
The point is that the ClientId is only set once at start-up (and
also only optionally), while the Bank IP/port/ID/slot can be changed
any number of times during a RSPRO connection.
Change-Id: Ic76207c7dd7c18fe93bc5133b29c5f9438a9fb0e
diff --git a/src/remsim_client.c b/src/remsim_client.c
index 7cb05a9..b31a849 100644
--- a/src/remsim_client.c
+++ b/src/remsim_client.c
@@ -129,19 +129,26 @@
rspro_comp_id_retrieve(&srvc->peer_comp_id, &pdu->msg.choice.connectClientRes.identity);
osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_CLIENT_CONN_RES, (void *) pdu);
break;
- case RsproPDUchoice_PR_configClientReq:
+ case RsproPDUchoice_PR_configClientIdReq:
/* store/set the clientID as instructed by the server */
if (!g_client->srv_conn.clslot)
g_client->srv_conn.clslot = talloc_zero(g_client, ClientSlot_t);
- *g_client->srv_conn.clslot = pdu->msg.choice.configClientReq.clientSlot;
+ *g_client->srv_conn.clslot = pdu->msg.choice.configClientIdReq.clientSlot;
+ /* send response to server */
+ resp = rspro_gen_ConfigClientIdRes(ResultCode_ok);
+ server_conn_send_rspro(srvc, resp);
+ break;
+ case RsproPDUchoice_PR_configClientBankReq:
/* store/set the bankd ip/port as instructed by the server */
osmo_talloc_replace_string(g_client, &g_client->bankd_host,
- rspro_IpAddr2str(&pdu->msg.choice.configClientReq.bankd.ip));
- g_client->bankd_port = ntohs(pdu->msg.choice.configClientReq.bankd.port);
+ rspro_IpAddr2str(&pdu->msg.choice.configClientBankReq.bankd.ip));
+ g_client->bankd_port = ntohs(pdu->msg.choice.configClientBankReq.bankd.port);
+ /* FIXME: Store bankslot */
+ //*g_client->srv_conn.bslot = pdu->msg.choice.configClientBankReq.bankSlot;
/* instruct bankd FSM to connect */
osmo_fsm_inst_dispatch(g_client->bankd_fi, BDC_E_ESTABLISH, NULL);
/* send response to server */
- resp = rspro_gen_ConfigClientRes(ResultCode_ok);
+ resp = rspro_gen_ConfigClientBankRes(ResultCode_ok);
server_conn_send_rspro(srvc, resp);
break;
default:
diff --git a/src/rspro/ConfigClientBankReq.c b/src/rspro/ConfigClientBankReq.c
new file mode 100644
index 0000000..f19c9ee
--- /dev/null
+++ b/src/rspro/ConfigClientBankReq.c
@@ -0,0 +1,69 @@
+/*
+ * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
+ * From ASN.1 module "RSPRO"
+ * found in "../../asn1/RSPRO.asn"
+ */
+
+#include "ConfigClientBankReq.h"
+
+static asn_TYPE_member_t asn_MBR_ConfigClientBankReq_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankReq, bankSlot),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ 0,
+ &asn_DEF_BankSlot,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "bankSlot"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankReq, bankd),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ 0,
+ &asn_DEF_IpPort,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "bankd"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ConfigClientBankReq_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ConfigClientBankReq_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* bankSlot */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* bankd */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientBankReq_specs_1 = {
+ sizeof(struct ConfigClientBankReq),
+ offsetof(struct ConfigClientBankReq, _asn_ctx),
+ asn_MAP_ConfigClientBankReq_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 1, /* Start extensions */
+ 3 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ConfigClientBankReq = {
+ "ConfigClientBankReq",
+ "ConfigClientBankReq",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No UPER support, use "-gen-PER" to enable */
+ 0, 0, /* No APER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ConfigClientBankReq_tags_1,
+ sizeof(asn_DEF_ConfigClientBankReq_tags_1)
+ /sizeof(asn_DEF_ConfigClientBankReq_tags_1[0]), /* 1 */
+ asn_DEF_ConfigClientBankReq_tags_1, /* Same as above */
+ sizeof(asn_DEF_ConfigClientBankReq_tags_1)
+ /sizeof(asn_DEF_ConfigClientBankReq_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConfigClientBankReq_1,
+ 2, /* Elements count */
+ &asn_SPC_ConfigClientBankReq_specs_1 /* Additional specs */
+};
+
diff --git a/src/rspro/ConfigClientBankRes.c b/src/rspro/ConfigClientBankRes.c
new file mode 100644
index 0000000..4b3c18a
--- /dev/null
+++ b/src/rspro/ConfigClientBankRes.c
@@ -0,0 +1,59 @@
+/*
+ * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
+ * From ASN.1 module "RSPRO"
+ * found in "../../asn1/RSPRO.asn"
+ */
+
+#include "ConfigClientBankRes.h"
+
+static asn_TYPE_member_t asn_MBR_ConfigClientBankRes_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ConfigClientBankRes, result),
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ 0,
+ &asn_DEF_ResultCode,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "result"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ConfigClientBankRes_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ConfigClientBankRes_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientBankRes_specs_1 = {
+ sizeof(struct ConfigClientBankRes),
+ offsetof(struct ConfigClientBankRes, _asn_ctx),
+ asn_MAP_ConfigClientBankRes_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 2 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ConfigClientBankRes = {
+ "ConfigClientBankRes",
+ "ConfigClientBankRes",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No UPER support, use "-gen-PER" to enable */
+ 0, 0, /* No APER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ConfigClientBankRes_tags_1,
+ sizeof(asn_DEF_ConfigClientBankRes_tags_1)
+ /sizeof(asn_DEF_ConfigClientBankRes_tags_1[0]), /* 1 */
+ asn_DEF_ConfigClientBankRes_tags_1, /* Same as above */
+ sizeof(asn_DEF_ConfigClientBankRes_tags_1)
+ /sizeof(asn_DEF_ConfigClientBankRes_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConfigClientBankRes_1,
+ 1, /* Elements count */
+ &asn_SPC_ConfigClientBankRes_specs_1 /* Additional specs */
+};
+
diff --git a/src/rspro/ConfigClientIdReq.c b/src/rspro/ConfigClientIdReq.c
new file mode 100644
index 0000000..570013a
--- /dev/null
+++ b/src/rspro/ConfigClientIdReq.c
@@ -0,0 +1,59 @@
+/*
+ * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
+ * From ASN.1 module "RSPRO"
+ * found in "../../asn1/RSPRO.asn"
+ */
+
+#include "ConfigClientIdReq.h"
+
+static asn_TYPE_member_t asn_MBR_ConfigClientIdReq_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ConfigClientIdReq, clientSlot),
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ 0,
+ &asn_DEF_ClientSlot,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "clientSlot"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ConfigClientIdReq_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ConfigClientIdReq_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* clientSlot */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientIdReq_specs_1 = {
+ sizeof(struct ConfigClientIdReq),
+ offsetof(struct ConfigClientIdReq, _asn_ctx),
+ asn_MAP_ConfigClientIdReq_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 2 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ConfigClientIdReq = {
+ "ConfigClientIdReq",
+ "ConfigClientIdReq",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No UPER support, use "-gen-PER" to enable */
+ 0, 0, /* No APER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ConfigClientIdReq_tags_1,
+ sizeof(asn_DEF_ConfigClientIdReq_tags_1)
+ /sizeof(asn_DEF_ConfigClientIdReq_tags_1[0]), /* 1 */
+ asn_DEF_ConfigClientIdReq_tags_1, /* Same as above */
+ sizeof(asn_DEF_ConfigClientIdReq_tags_1)
+ /sizeof(asn_DEF_ConfigClientIdReq_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConfigClientIdReq_1,
+ 1, /* Elements count */
+ &asn_SPC_ConfigClientIdReq_specs_1 /* Additional specs */
+};
+
diff --git a/src/rspro/ConfigClientIdRes.c b/src/rspro/ConfigClientIdRes.c
new file mode 100644
index 0000000..a8b0691
--- /dev/null
+++ b/src/rspro/ConfigClientIdRes.c
@@ -0,0 +1,59 @@
+/*
+ * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
+ * From ASN.1 module "RSPRO"
+ * found in "../../asn1/RSPRO.asn"
+ */
+
+#include "ConfigClientIdRes.h"
+
+static asn_TYPE_member_t asn_MBR_ConfigClientIdRes_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct ConfigClientIdRes, result),
+ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
+ 0,
+ &asn_DEF_ResultCode,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "result"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_ConfigClientIdRes_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_ConfigClientIdRes_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientIdRes_specs_1 = {
+ sizeof(struct ConfigClientIdRes),
+ offsetof(struct ConfigClientIdRes, _asn_ctx),
+ asn_MAP_ConfigClientIdRes_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ 0, /* Start extensions */
+ 2 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_ConfigClientIdRes = {
+ "ConfigClientIdRes",
+ "ConfigClientIdRes",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No UPER support, use "-gen-PER" to enable */
+ 0, 0, /* No APER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_ConfigClientIdRes_tags_1,
+ sizeof(asn_DEF_ConfigClientIdRes_tags_1)
+ /sizeof(asn_DEF_ConfigClientIdRes_tags_1[0]), /* 1 */
+ asn_DEF_ConfigClientIdRes_tags_1, /* Same as above */
+ sizeof(asn_DEF_ConfigClientIdRes_tags_1)
+ /sizeof(asn_DEF_ConfigClientIdRes_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_ConfigClientIdRes_1,
+ 1, /* Elements count */
+ &asn_SPC_ConfigClientIdRes_specs_1 /* Additional specs */
+};
+
diff --git a/src/rspro/ConfigClientReq.c b/src/rspro/ConfigClientReq.c
deleted file mode 100644
index 586ac41..0000000
--- a/src/rspro/ConfigClientReq.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
- * From ASN.1 module "RSPRO"
- * found in "../../asn1/RSPRO.asn"
- */
-
-#include <osmocom/rspro/ConfigClientReq.h>
-
-static asn_TYPE_member_t asn_MBR_ConfigClientReq_1[] = {
- { ATF_NOFLAGS, 0, offsetof(struct ConfigClientReq, clientSlot),
- (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
- 0,
- &asn_DEF_ClientSlot,
- 0, /* Defer constraints checking to the member type */
- 0, /* PER is not compiled, use -gen-PER */
- 0,
- "clientSlot"
- },
- { ATF_NOFLAGS, 0, offsetof(struct ConfigClientReq, bankd),
- (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
- 0,
- &asn_DEF_IpPort,
- 0, /* Defer constraints checking to the member type */
- 0, /* PER is not compiled, use -gen-PER */
- 0,
- "bankd"
- },
-};
-static const ber_tlv_tag_t asn_DEF_ConfigClientReq_tags_1[] = {
- (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
-};
-static const asn_TYPE_tag2member_t asn_MAP_ConfigClientReq_tag2el_1[] = {
- { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* clientSlot */
- { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* bankd */
-};
-static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientReq_specs_1 = {
- sizeof(struct ConfigClientReq),
- offsetof(struct ConfigClientReq, _asn_ctx),
- asn_MAP_ConfigClientReq_tag2el_1,
- 2, /* Count of tags in the map */
- 0, 0, 0, /* Optional elements (not needed) */
- 1, /* Start extensions */
- 3 /* Stop extensions */
-};
-asn_TYPE_descriptor_t asn_DEF_ConfigClientReq = {
- "ConfigClientReq",
- "ConfigClientReq",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No UPER support, use "-gen-PER" to enable */
- 0, 0, /* No APER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ConfigClientReq_tags_1,
- sizeof(asn_DEF_ConfigClientReq_tags_1)
- /sizeof(asn_DEF_ConfigClientReq_tags_1[0]), /* 1 */
- asn_DEF_ConfigClientReq_tags_1, /* Same as above */
- sizeof(asn_DEF_ConfigClientReq_tags_1)
- /sizeof(asn_DEF_ConfigClientReq_tags_1[0]), /* 1 */
- 0, /* No PER visible constraints */
- asn_MBR_ConfigClientReq_1,
- 2, /* Elements count */
- &asn_SPC_ConfigClientReq_specs_1 /* Additional specs */
-};
-
diff --git a/src/rspro/ConfigClientRes.c b/src/rspro/ConfigClientRes.c
deleted file mode 100644
index e30fda1..0000000
--- a/src/rspro/ConfigClientRes.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
- * From ASN.1 module "RSPRO"
- * found in "../../asn1/RSPRO.asn"
- */
-
-#include <osmocom/rspro/ConfigClientRes.h>
-
-static asn_TYPE_member_t asn_MBR_ConfigClientRes_1[] = {
- { ATF_NOFLAGS, 0, offsetof(struct ConfigClientRes, result),
- (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
- 0,
- &asn_DEF_ResultCode,
- 0, /* Defer constraints checking to the member type */
- 0, /* PER is not compiled, use -gen-PER */
- 0,
- "result"
- },
-};
-static const ber_tlv_tag_t asn_DEF_ConfigClientRes_tags_1[] = {
- (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
-};
-static const asn_TYPE_tag2member_t asn_MAP_ConfigClientRes_tag2el_1[] = {
- { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* result */
-};
-static asn_SEQUENCE_specifics_t asn_SPC_ConfigClientRes_specs_1 = {
- sizeof(struct ConfigClientRes),
- offsetof(struct ConfigClientRes, _asn_ctx),
- asn_MAP_ConfigClientRes_tag2el_1,
- 1, /* Count of tags in the map */
- 0, 0, 0, /* Optional elements (not needed) */
- 0, /* Start extensions */
- 2 /* Stop extensions */
-};
-asn_TYPE_descriptor_t asn_DEF_ConfigClientRes = {
- "ConfigClientRes",
- "ConfigClientRes",
- SEQUENCE_free,
- SEQUENCE_print,
- SEQUENCE_constraint,
- SEQUENCE_decode_ber,
- SEQUENCE_encode_der,
- SEQUENCE_decode_xer,
- SEQUENCE_encode_xer,
- 0, 0, /* No UPER support, use "-gen-PER" to enable */
- 0, 0, /* No APER support, use "-gen-PER" to enable */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ConfigClientRes_tags_1,
- sizeof(asn_DEF_ConfigClientRes_tags_1)
- /sizeof(asn_DEF_ConfigClientRes_tags_1[0]), /* 1 */
- asn_DEF_ConfigClientRes_tags_1, /* Same as above */
- sizeof(asn_DEF_ConfigClientRes_tags_1)
- /sizeof(asn_DEF_ConfigClientRes_tags_1[0]), /* 1 */
- 0, /* No PER visible constraints */
- asn_MBR_ConfigClientRes_1,
- 1, /* Elements count */
- &asn_SPC_ConfigClientRes_specs_1 /* Additional specs */
-};
-
diff --git a/src/rspro/ErrorCode.c b/src/rspro/ErrorCode.c
index 7b404fc..e603c7a 100644
--- a/src/rspro/ErrorCode.c
+++ b/src/rspro/ErrorCode.c
@@ -4,7 +4,7 @@
* found in "../../asn1/RSPRO.asn"
*/
-#include "ErrorCode.h"
+#include <osmocom/rspro/ErrorCode.h>
int
ErrorCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
diff --git a/src/rspro/ErrorInd.c b/src/rspro/ErrorInd.c
index 63e96d4..47e479a 100644
--- a/src/rspro/ErrorInd.c
+++ b/src/rspro/ErrorInd.c
@@ -4,7 +4,7 @@
* found in "../../asn1/RSPRO.asn"
*/
-#include "ErrorInd.h"
+#include <osmocom/rspro/ErrorInd.h>
static asn_TYPE_member_t asn_MBR_ErrorInd_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct ErrorInd, sender),
diff --git a/src/rspro/ErrorSeverity.c b/src/rspro/ErrorSeverity.c
index cae6447..1a33063 100644
--- a/src/rspro/ErrorSeverity.c
+++ b/src/rspro/ErrorSeverity.c
@@ -4,7 +4,7 @@
* found in "../../asn1/RSPRO.asn"
*/
-#include "ErrorSeverity.h"
+#include <osmocom/rspro/ErrorSeverity.h>
int
ErrorSeverity_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
diff --git a/src/rspro/ErrorString.c b/src/rspro/ErrorString.c
index 82c4700..98d0eda 100644
--- a/src/rspro/ErrorString.c
+++ b/src/rspro/ErrorString.c
@@ -4,7 +4,7 @@
* found in "../../asn1/RSPRO.asn"
*/
-#include "ErrorString.h"
+#include <osmocom/rspro/ErrorString.h>
static int check_permitted_alphabet_1(const void *sptr) {
/* The underlying type is IA5String */
diff --git a/src/rspro/Makefile.am b/src/rspro/Makefile.am
index 4d3f18a..91f0f35 100644
--- a/src/rspro/Makefile.am
+++ b/src/rspro/Makefile.am
@@ -9,8 +9,10 @@
ComponentIdentity.c \
ComponentName.c \
ComponentType.c \
- ConfigClientReq.c \
- ConfigClientRes.c \
+ ConfigClientIdReq.c \
+ ConfigClientIdRes.c \
+ ConfigClientBankReq.c \
+ ConfigClientBankRes.c \
ConnectBankReq.c \
ConnectBankRes.c \
ConnectClientReq.c \
@@ -52,8 +54,10 @@
ComponentIdentity.h \
ComponentName.h \
ComponentType.h \
- ConfigClientReq.h \
- ConfigClientRes.h \
+ ConfigClientIdReq.h \
+ ConfigClientIdRes.h \
+ ConfigClientBankReq.h \
+ ConfigClientBankRes.h \
ConnectBankReq.h \
ConnectBankRes.h \
ConnectClientReq.h \
diff --git a/src/rspro/RsproPDUchoice.c b/src/rspro/RsproPDUchoice.c
index e842876..a5f7161 100644
--- a/src/rspro/RsproPDUchoice.c
+++ b/src/rspro/RsproPDUchoice.c
@@ -79,23 +79,41 @@
0,
"removeMappingRes"
},
- { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientReq),
+ { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientIdReq),
(ASN_TAG_CLASS_CONTEXT | (8 << 2)),
-1, /* IMPLICIT tag at current level */
- &asn_DEF_ConfigClientReq,
+ &asn_DEF_ConfigClientIdReq,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
- "configClientReq"
+ "configClientIdReq"
},
- { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientRes),
+ { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientIdRes),
(ASN_TAG_CLASS_CONTEXT | (9 << 2)),
-1, /* IMPLICIT tag at current level */
- &asn_DEF_ConfigClientRes,
+ &asn_DEF_ConfigClientIdRes,
0, /* Defer constraints checking to the member type */
0, /* PER is not compiled, use -gen-PER */
0,
- "configClientRes"
+ "configClientIdRes"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientBankReq),
+ (ASN_TAG_CLASS_CONTEXT | (17 << 2)),
+ -1, /* IMPLICIT tag at current level */
+ &asn_DEF_ConfigClientBankReq,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "configClientBankReq"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.configClientBankRes),
+ (ASN_TAG_CLASS_CONTEXT | (18 << 2)),
+ -1, /* IMPLICIT tag at current level */
+ &asn_DEF_ConfigClientBankRes,
+ 0, /* Defer constraints checking to the member type */
+ 0, /* PER is not compiled, use -gen-PER */
+ 0,
+ "configClientBankRes"
},
{ ATF_NOFLAGS, 0, offsetof(struct RsproPDUchoice, choice.errorInd),
(ASN_TAG_CLASS_CONTEXT | (16 << 2)),
@@ -170,15 +188,17 @@
{ (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* createMappingRes */
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* removeMappingReq */
{ (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* removeMappingRes */
- { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* configClientReq */
- { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* configClientRes */
- { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 11, 0, 0 }, /* setAtrReq */
- { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 12, 0, 0 }, /* setAtrRes */
- { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 13, 0, 0 }, /* tpduModemToCard */
- { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 14, 0, 0 }, /* tpduCardToModem */
- { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 15, 0, 0 }, /* clientSlotStatusInd */
- { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 16, 0, 0 }, /* bankSlotStatusInd */
- { (ASN_TAG_CLASS_CONTEXT | (16 << 2)), 10, 0, 0 } /* errorInd */
+ { (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 }, /* configClientIdReq */
+ { (ASN_TAG_CLASS_CONTEXT | (9 << 2)), 9, 0, 0 }, /* configClientIdRes */
+ { (ASN_TAG_CLASS_CONTEXT | (10 << 2)), 13, 0, 0 }, /* setAtrReq */
+ { (ASN_TAG_CLASS_CONTEXT | (11 << 2)), 14, 0, 0 }, /* setAtrRes */
+ { (ASN_TAG_CLASS_CONTEXT | (12 << 2)), 15, 0, 0 }, /* tpduModemToCard */
+ { (ASN_TAG_CLASS_CONTEXT | (13 << 2)), 16, 0, 0 }, /* tpduCardToModem */
+ { (ASN_TAG_CLASS_CONTEXT | (14 << 2)), 17, 0, 0 }, /* clientSlotStatusInd */
+ { (ASN_TAG_CLASS_CONTEXT | (15 << 2)), 18, 0, 0 }, /* bankSlotStatusInd */
+ { (ASN_TAG_CLASS_CONTEXT | (16 << 2)), 12, 0, 0 }, /* errorInd */
+ { (ASN_TAG_CLASS_CONTEXT | (17 << 2)), 10, 0, 0 }, /* configClientBankReq */
+ { (ASN_TAG_CLASS_CONTEXT | (18 << 2)), 11, 0, 0 } /* configClientBankRes */
};
static asn_CHOICE_specifics_t asn_SPC_RsproPDUchoice_specs_1 = {
sizeof(struct RsproPDUchoice),
@@ -186,9 +206,9 @@
offsetof(struct RsproPDUchoice, present),
sizeof(((struct RsproPDUchoice *)0)->present),
asn_MAP_RsproPDUchoice_tag2el_1,
- 17, /* Count of tags in the map */
+ 19, /* Count of tags in the map */
0,
- 17 /* Extensions start */
+ 19 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_RsproPDUchoice = {
"RsproPDUchoice",
@@ -209,7 +229,7 @@
0, /* No tags (count) */
0, /* No PER visible constraints */
asn_MBR_RsproPDUchoice_1,
- 17, /* Elements count */
+ 19, /* Elements count */
&asn_SPC_RsproPDUchoice_specs_1 /* Additional specs */
};
diff --git a/src/rspro_util.c b/src/rspro_util.c
index 271ae86..27bf025 100644
--- a/src/rspro_util.c
+++ b/src/rspro_util.c
@@ -276,27 +276,51 @@
return pdu;
}
-RsproPDU_t *rspro_gen_ConfigClientReq(const ClientSlot_t *client, uint32_t ip, uint16_t port)
+RsproPDU_t *rspro_gen_ConfigClientIReq(const ClientSlot_t *client)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
if (!pdu)
return NULL;
pdu->version = 2;
- pdu->msg.present = RsproPDUchoice_PR_configClientReq;
- pdu->msg.choice.configClientReq.clientSlot = *client;
- fill_ip4_port(&pdu->msg.choice.configClientReq.bankd, ip, port);
+ pdu->msg.present = RsproPDUchoice_PR_configClientIdReq;
+ pdu->msg.choice.configClientIdReq.clientSlot = *client;
return pdu;
}
-RsproPDU_t *rspro_gen_ConfigClientRes(e_ResultCode res)
+RsproPDU_t *rspro_gen_ConfigClientIdRes(e_ResultCode res)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
if (!pdu)
return NULL;
pdu->version = 2;
- pdu->msg.present = RsproPDUchoice_PR_configClientRes;
- pdu->msg.choice.configClientRes.result = res;
+ pdu->msg.present = RsproPDUchoice_PR_configClientIdRes;
+ pdu->msg.choice.configClientIdRes.result = res;
+
+ return pdu;
+}
+
+RsproPDU_t *rspro_gen_ConfigClientBankReq(const BankSlot_t *bank, uint32_t ip, uint16_t port)
+{
+ RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
+ if (!pdu)
+ return NULL;
+ pdu->version = 2;
+ pdu->msg.present = RsproPDUchoice_PR_configClientBankReq;
+ pdu->msg.choice.configClientBankReq.bankSlot = *bank;
+ fill_ip4_port(&pdu->msg.choice.configClientBankReq.bankd, ip, port);
+
+ return pdu;
+}
+
+RsproPDU_t *rspro_gen_ConfigClientBankRes(e_ResultCode res)
+{
+ RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
+ if (!pdu)
+ return NULL;
+ pdu->version = 2;
+ pdu->msg.present = RsproPDUchoice_PR_configClientBankRes;
+ pdu->msg.choice.configClientBankRes.result = res;
return pdu;
}
diff --git a/src/rspro_util.h b/src/rspro_util.h
index f8124eb..518b2f0 100644
--- a/src/rspro_util.h
+++ b/src/rspro_util.h
@@ -31,8 +31,10 @@
RsproPDU_t *rspro_gen_CreateMappingRes(e_ResultCode res);
RsproPDU_t *rspro_gen_RemoveMappingReq(const ClientSlot_t *client, const BankSlot_t *bank);
RsproPDU_t *rspro_gen_RemoveMappingRes(e_ResultCode res);
-RsproPDU_t *rspro_gen_ConfigClientReq(const ClientSlot_t *client, uint32_t ip, uint16_t port);
-RsproPDU_t *rspro_gen_ConfigClientRes(e_ResultCode res);
+RsproPDU_t *rspro_gen_ConfigClientIdReq(const ClientSlot_t *client);
+RsproPDU_t *rspro_gen_ConfigClientIdRes(e_ResultCode res);
+RsproPDU_t *rspro_gen_ConfigClientBankReq(const BankSlot_t *bank, uint32_t ip, uint16_t port);
+RsproPDU_t *rspro_gen_ConfigClientBankRes(e_ResultCode res);
RsproPDU_t *rspro_gen_SetAtrReq(uint16_t client_id, uint16_t slot_nr, const uint8_t *atr,
unsigned int atr_len);
RsproPDU_t *rspro_gen_TpduModem2Card(const ClientSlot_t *client, const BankSlot_t *bank,
diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c
index b593f93..432bc16 100644
--- a/src/server/rspro_server.c
+++ b/src/server/rspro_server.c
@@ -447,7 +447,7 @@
case RsproPDUchoice_PR_removeMappingRes:
osmo_fsm_inst_dispatch(conn->fi, CLNTC_E_REMOVE_MAP_RES, (void *)pdu);
break;
- case RsproPDUchoice_PR_configClientRes:
+ case RsproPDUchoice_PR_configClientIdRes:
osmo_fsm_inst_dispatch(conn->fi, CLNTC_E_CONFIG_CL_RES, (void *)pdu);
break;
default:
diff --git a/src/simtrace2-remsim_client.c b/src/simtrace2-remsim_client.c
index e9568fa..f15bdfe 100644
--- a/src/simtrace2-remsim_client.c
+++ b/src/simtrace2-remsim_client.c
@@ -619,19 +619,26 @@
rspro_comp_id_retrieve(&srvc->peer_comp_id, &pdu->msg.choice.connectClientRes.identity);
osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_CLIENT_CONN_RES, (void *) pdu);
break;
- case RsproPDUchoice_PR_configClientReq:
+ case RsproPDUchoice_PR_configClientIdReq:
/* store/set the clientID as instructed by the server */
if (!g_client->srv_conn.clslot)
g_client->srv_conn.clslot = talloc_zero(g_client, ClientSlot_t);
- *g_client->srv_conn.clslot = pdu->msg.choice.configClientReq.clientSlot;
+ *g_client->srv_conn.clslot = pdu->msg.choice.configClientIdReq.clientSlot;
+ /* send response to server */
+ resp = rspro_gen_ConfigClientIdRes(ResultCode_ok);
+ server_conn_send_rspro(srvc, resp);
+ break;
+ case RsproPDUchoice_PR_configClientBankReq:
/* store/set the bankd ip/port as instructed by the server */
osmo_talloc_replace_string(g_client, &g_client->bankd_host,
- rspro_IpAddr2str(&pdu->msg.choice.configClientReq.bankd.ip));
- g_client->bankd_port = ntohs(pdu->msg.choice.configClientReq.bankd.port);
+ rspro_IpAddr2str(&pdu->msg.choice.configClientBankReq.bankd.ip));
+ /* FIXME: Store bankslot */
+ //g_client->bankd_slot = pdu->msg.choice.configClientBankReq.bankSlot;
+ g_client->bankd_port = ntohs(pdu->msg.choice.configClientBankReq.bankd.port);
/* instruct bankd FSM to connect */
osmo_fsm_inst_dispatch(g_client->bankd_fi, BDC_E_ESTABLISH, NULL);
/* send response to server */
- resp = rspro_gen_ConfigClientRes(ResultCode_ok);
+ resp = rspro_gen_ConfigClientBankRes(ResultCode_ok);
server_conn_send_rspro(srvc, resp);
break;
default: