Refactor NGAP cause

* new struct definition including both NGAP cause group and value
* add encoding function, temporarily in ngap_common.c
  (in the long term to be place in a enc/dec NGAP library)
* extend Radio Network cause enum values
* add cause member to Setup Failure
This commit is contained in:
Guido Casati
2025-01-14 14:13:49 +01:00
parent f9bff3d6a0
commit f00a7a0197
12 changed files with 113 additions and 213 deletions
+35
View File
@@ -31,3 +31,38 @@
#include "ngap_common.h"
int asn1_xer_print = 0;
void encode_ngap_cause(NGAP_Cause_t *out, const ngap_cause_t *in)
{
switch (in->type) {
case NGAP_CAUSE_RADIO_NETWORK:
out->present = NGAP_Cause_PR_radioNetwork;
out->choice.radioNetwork = in->value;
break;
case NGAP_CAUSE_TRANSPORT:
out->present = NGAP_Cause_PR_transport;
out->choice.transport = in->value;
break;
case NGAP_CAUSE_NAS:
out->present = NGAP_Cause_PR_nas;
out->choice.nas = in->value;
break;
case NGAP_CAUSE_PROTOCOL:
out->present = NGAP_Cause_PR_protocol;
out->choice.protocol = in->value;
break;
case NGAP_CAUSE_MISC:
out->present = NGAP_Cause_PR_misc;
out->choice.misc = in->value;
break;
case NGAP_CAUSE_NOTHING:
default:
AssertFatal(false, "Unknown failure cause %d\n", in->type);
break;
}
}