mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
Error Indication is added
This commit is contained in:
parent
f37b3cbfd3
commit
831b3e8985
9 changed files with 146 additions and 16 deletions
|
|
@ -56,6 +56,9 @@ static inline int s1ap_encode_handover_preparation_failure(
|
|||
static inline int s1ap_encode_mme_status_transfer(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
|
||||
static inline int s1ap_encode_error_indication(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
|
||||
static void s1ap_encode_xer_print_message(
|
||||
asn_enc_rval_t (*func)(asn_app_consume_bytes_f *cb,
|
||||
void *app_key, s1ap_message_t *message_p),
|
||||
|
|
@ -182,6 +185,12 @@ static inline int s1ap_encode_initiating_message(
|
|||
ret = s1ap_encode_mme_status_transfer(message_p, pkbuf);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_ErrorIndication:
|
||||
s1ap_encode_xer_print_message(s1ap_xer_print_s1ap_errorindication,
|
||||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_error_indication(message_p, pkbuf);
|
||||
break;
|
||||
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for initiating message_p\n",
|
||||
(int)message_p->procedureCode);
|
||||
|
|
@ -1079,6 +1088,43 @@ static inline int s1ap_encode_mme_status_transfer(
|
|||
return enc_ret.encoded;
|
||||
}
|
||||
|
||||
static inline int s1ap_encode_error_indication(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
|
||||
S1AP_PDU_t pdu;
|
||||
S1ap_ErrorIndication_t error;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_ErrorIndication;
|
||||
|
||||
memset(&error, 0, sizeof(S1ap_ErrorIndication_t));
|
||||
if (s1ap_encode_s1ap_errorindicationies(
|
||||
&error, &message_p->s1ap_ErrorIndicationIEs) < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&pdu, 0, sizeof (S1AP_PDU_t));
|
||||
pdu.present = S1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = message_p->procedureCode;
|
||||
pdu.choice.initiatingMessage.criticality = S1ap_Criticality_ignore;
|
||||
ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, &error);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_PDU,
|
||||
&pdu, pkbuf->payload, MAX_SDU_LEN);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, &error);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_PDU, &pdu);
|
||||
|
||||
if (enc_ret.encoded < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
}
|
||||
|
||||
return enc_ret.encoded;
|
||||
}
|
||||
|
||||
static void s1ap_encode_xer_print_message(
|
||||
asn_enc_rval_t (*func)(asn_app_consume_bytes_f *cb,
|
||||
void *app_key, s1ap_message_t *message_p),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue