Move client/bank slot conversion functions to rspro_util.c

Change-Id: I18f1d1cb1fb712b01a0991419743db52338688af
changes/97/13497/1
Harald Welte 4 years ago
parent d571a3e2e1
commit cf8b89ad84
  1. 12
      src/bankd_main.c
  2. 24
      src/rspro_util.c
  3. 7
      src/rspro_util.h
  4. 18
      src/server/rspro_server.c

@ -131,18 +131,6 @@ static struct bankd_worker *bankd_create_worker(struct bankd *bankd, unsigned in
static bool terminate = false;
static void rspro2bank_slot(struct bank_slot *out, const BankSlot_t *in)
{
out->bank_id = in->bankId;
out->slot_nr = in->slotNr;
}
static void rspro2client_slot(struct client_slot *out, const ClientSlot_t *in)
{
out->client_id = in->clientId;
out->slot_nr = in->slotNr;
}
/* handle incoming messages from server */
static int bankd_srvc_handle_rx(struct rspro_server_conn *srvc, const RsproPDU_t *pdu)
{

@ -375,3 +375,27 @@ RsproPDU_t *rspro_gen_TpduCard2Modem(const BankSlot_t *bank, const ClientSlot_t
return pdu;
}
void rspro2bank_slot(struct bank_slot *out, const BankSlot_t *in)
{
out->bank_id = in->bankId;
out->slot_nr = in->slotNr;
}
void bank_slot2rspro(BankSlot_t *out, const struct bank_slot *in)
{
out->bankId = in->bank_id;
out->slotNr = in->slot_nr;
}
void rspro2client_slot(struct client_slot *out, const ClientSlot_t *in)
{
out->client_id = in->clientId;
out->slot_nr = in->slotNr;
}
void client_slot2rspro(ClientSlot_t *out, const struct client_slot *in)
{
out->clientId = in->client_id;
out->slotNr = in->slot_nr;
}

@ -44,3 +44,10 @@ RsproPDU_t *rspro_gen_TpduCard2Modem(const BankSlot_t *bank, const ClientSlot_t
void rspro_comp_id_retrieve(struct app_comp_id *out, const ComponentIdentity_t *in);
const char *rspro_IpAddr2str(const IpAddress_t *in);
#include "slotmap.h"
void rspro2bank_slot(struct bank_slot *out, const BankSlot_t *in);
void bank_slot2rspro(BankSlot_t *out, const struct bank_slot *in);
void rspro2client_slot(struct client_slot *out, const ClientSlot_t *in);
void client_slot2rspro(ClientSlot_t *out, const struct client_slot *in);

@ -19,24 +19,6 @@
#define S(x) (1 << (x))
static void client_slot2rspro(ClientSlot_t *out, const struct client_slot *in)
{
out->clientId = in->client_id;
out->slotNr = in->slot_nr;
}
static void rspro2client_slot(struct client_slot *out, const ClientSlot_t *in)
{
out->client_id = in->clientId;
out->slot_nr = in->slotNr;
}
static void bank_slot2rspro(BankSlot_t *out, const struct bank_slot *in)
{
out->bankId = in->bank_id;
out->slotNr = in->slot_nr;
}
static RsproPDU_t *slotmap2CreateMappingReq(const struct slot_mapping *slotmap)
{
ClientSlot_t clslot;

Loading…
Cancel
Save