add rspro_gen_{Remove,Create}Mapping{Req,Res}()

Change-Id: If86d34a1e723b7202b5fa2c40ea1d0b152381773
This commit is contained in:
Harald Welte 2018-10-15 00:44:53 +02:00
parent 62e3f5f51c
commit c0a4ae4c3b
2 changed files with 40 additions and 0 deletions

View File

@ -153,6 +153,43 @@ RsproPDU_t *rspro_gen_CreateMappingReq(const ClientSlot_t *client, const BankSlo
return pdu;
}
RsproPDU_t *rspro_gen_CreateMappingRes(e_ResultCode res)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
if (!pdu)
return NULL;
pdu->version = 2;
pdu->msg.present = RsproPDUchoice_PR_createMappingRes;
pdu->msg.choice.createMappingRes.result = res;
return pdu;
}
RsproPDU_t *rspro_gen_RemoveMappingReq(const ClientSlot_t *client, const BankSlot_t *bank)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
if (!pdu)
return NULL;
pdu->version = 2;
pdu->msg.present = RsproPDUchoice_PR_removeMappingReq;
pdu->msg.choice.removeMappingReq.client = *client;
pdu->msg.choice.removeMappingReq.bank = *bank;
return pdu;
}
RsproPDU_t *rspro_gen_RemoveMappingRes(e_ResultCode res)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));
if (!pdu)
return NULL;
pdu->version = 2;
pdu->msg.present = RsproPDUchoice_PR_removeMappingRes;
pdu->msg.choice.removeMappingRes.result = res;
return pdu;
}
RsproPDU_t *rspro_gen_ConfigClientReq(const ClientSlot_t *client, uint32_t ip, uint16_t port)
{
RsproPDU_t *pdu = CALLOC(1, sizeof(*pdu));

View File

@ -25,6 +25,9 @@ RsproPDU_t *rspro_gen_ConnectBankReq(const struct app_comp_id *a_cid,
RsproPDU_t *rspro_gen_ConnectClientReq(const struct app_comp_id *a_cid, const ClientSlot_t *client);
RsproPDU_t *rspro_gen_ConnectClientRes(const struct app_comp_id *a_cid, e_ResultCode res);
RsproPDU_t *rspro_gen_CreateMappingReq(const ClientSlot_t *client, const BankSlot_t *bank);
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_SetAtrReq(uint16_t client_id, uint16_t slot_nr, const uint8_t *atr,
unsigned int atr_len);