rspro_util: Add rspro_msgt_name() to get RSPRO message type name + use it

Change-Id: I4b270addd024f9766923183a75381b71ffe1cfae
changes/97/13497/1
Harald Welte 4 years ago
parent 229e6abce1
commit b49ac9c6bb
  1. 2
      src/remsim_client.c
  2. 1
      src/rspro_client_fsm.c
  3. 7
      src/rspro_util.c
  4. 2
      src/rspro_util.h
  5. 3
      src/server/rspro_server.c

@ -49,6 +49,8 @@ static int bankd_handle_msg(struct bankd_client *bc, struct msgb *msg)
return -1;
}
LOGPFSM(bc->bankd_fi, "Rx RSPRO %s\n", rspro_msgt_name(pdu));
switch (pdu->msg.present) {
case RsproPDUchoice_PR_connectClientRes:
/* Store 'identity' of bankd to in peer_comp_id */

@ -66,6 +66,7 @@ int ipa_client_conn_send_rspro(struct ipa_client_conn *ipa, RsproPDU_t *rspro)
int server_conn_send_rspro(struct rspro_server_conn *srvc, RsproPDU_t *rspro)
{
LOGPFSM(srvc->fi, "Tx RSPRO %s\n", rspro_msgt_name(rspro));
return ipa_client_conn_send_rspro(srvc->conn, rspro);
}

@ -27,6 +27,8 @@
#include <asn_application.h>
#include <der_encoder.h>
#include "asn1c_helpers.h"
#include <osmocom/core/msgb.h>
#include <osmocom/rspro/RsproPDU.h>
@ -42,6 +44,11 @@ do { \
} while (0)
const char *rspro_msgt_name(const RsproPDU_t *pdu)
{
return asn_choice_name(&asn_DEF_RsproPDUchoice, &pdu->msg);
}
struct msgb *rspro_msgb_alloc(void)
{
return msgb_alloc_headroom(1024, 8, "RSPRO");

@ -17,6 +17,8 @@ struct app_comp_id {
char fw_version[MAX_NAME_LEN+1];
};
const char *rspro_msgt_name(const RsproPDU_t *pdu);
struct msgb *rspro_msgb_alloc(void);
struct msgb *rspro_enc_msg(RsproPDU_t *pdu);
RsproPDU_t *rspro_dec_msg(struct msgb *msg);

@ -67,6 +67,7 @@ static void client_conn_send(struct rspro_client_conn *conn, RsproPDU_t *pdu)
ASN_STRUCT_FREE(asn_DEF_RsproPDU, pdu);
return;
}
LOGPFSM(conn->fi, "Tx RSPRO %s\n", pdu);
ipa_prepend_header_ext(msg_tx, IPAC_PROTO_EXT_RSPRO);
ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO);
ipa_server_conn_send(conn->peer, msg_tx);
@ -431,6 +432,8 @@ struct rspro_client_conn *bankd_conn_by_id(struct rspro_server *srv, uint16_t ba
static int handle_rx_rspro(struct rspro_client_conn *conn, const RsproPDU_t *pdu)
{
LOGPFSM(conn->fi, "Rx RSPRO %s\n", rspro_msgt_name(pdu));
switch (pdu->msg.present) {
case RsproPDUchoice_PR_connectClientReq:
osmo_fsm_inst_dispatch(conn->fi, CLNTC_E_CLIENT_CONN, (void *)pdu);

Loading…
Cancel
Save