Commit 522fb88c authored by Guido Casati's avatar Guido Casati

E1AP: make ActivityNotificationLevel configurable in Bearer Context Setup

This is a mandatory IE.

Replace hardcoded ActivityNotificationLevel value with configurable field
in e1ap_bearer_setup_req_t structure, enabling proper encoding/decoding
and testability of different notification levels. ActivityNotificationLevel
is now properly encoded from message structure instead of hardcoded value,
enabling different notification levels (DRB, PDU Session, UE) to be
specified per bearer setup request.

Changes:
- Add activity_notification_level_t enum with values: drb, pdu_session, ue
- Add anl field to e1ap_bearer_setup_req_s structure
- Replace hardcoded E1AP_ActivityNotificationLevel_pdu_session with
  dynamic value from msg->anl in encode_E1_bearer_context_setup_request
- Add ActivityNotificationLevel IE dec/eq/cp
- Update test and RRC call sites to initialize anl field
- Add E1AP_ActivityNotificationLevel.h include to e1ap_lib_includes.h
Signed-off-by: default avatarGuido Casati <guido.casati@openairinterface.org>
parent 97143603
......@@ -120,6 +120,12 @@ typedef enum BEARER_CONTEXT_STATUS_e {
BEARER_RESUME,
} BEARER_CONTEXT_STATUS_t;
typedef enum activity_notification_level_e {
activity_notification_level_drb = 0,
activity_notification_level_pdu_session = 1,
activity_notification_level_ue = 2,
} activity_notification_level_t;
typedef enum cell_group_id_e {
MCG = 0,
SCG,
......@@ -486,6 +492,8 @@ typedef struct e1ap_bearer_setup_req_s {
long *ueDlMaxIPBitRate;
// Serving PLMN (M)
PLMN_ID_t servingPLMNid;
// Activity Notification Level (M)
activity_notification_level_t anl;
// Bearer Context Status Change (O)
BEARER_CONTEXT_STATUS_t bearerContextStatus;
// UE Inactivity Timer (O)
......
......@@ -10,6 +10,7 @@
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
#include "common/openairinterface5g_limits.h"
#include "common/utils/LOG/log.h"
#include "common/utils/utils.h"
#include "openair2/F1AP/f1ap_common.h"
#include "e1ap_default_values.h"
#include "gtp_itf.h"
......
......@@ -597,7 +597,7 @@ E1AP_E1AP_PDU_t *encode_E1_bearer_context_setup_request(const e1ap_bearer_setup_
ieC5->id = E1AP_ProtocolIE_ID_id_ActivityNotificationLevel;
ieC5->criticality = E1AP_Criticality_reject;
ieC5->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_ActivityNotificationLevel;
ieC5->value.choice.ActivityNotificationLevel = E1AP_ActivityNotificationLevel_pdu_session; // TODO: Remove hard coding
ieC5->value.choice.ActivityNotificationLevel = (E1AP_ActivityNotificationLevel_t)msg->anl;
// System (M)
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC6);
ieC6->id = E1AP_ProtocolIE_ID_id_System_BearerContextSetupRequest;
......@@ -683,6 +683,11 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
out->servingPLMNid.mnc_digit_length);
break;
case E1AP_ProtocolIE_ID_id_ActivityNotificationLevel:
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_ActivityNotificationLevel);
out->anl = ie->value.choice.ActivityNotificationLevel;
break;
case E1AP_ProtocolIE_ID_id_System_BearerContextSetupRequest:
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_System_BearerContextSetupRequest);
E1AP_System_BearerContextSetupRequest_t *System_BearerContextSetupRequest =
......@@ -759,6 +764,7 @@ e1ap_bearer_setup_req_t cp_bearer_context_setup_request(const e1ap_bearer_setup_
cp.secInfo = msg->secInfo;
cp.ueDlAggMaxBitRate = msg->ueDlAggMaxBitRate;
cp.servingPLMNid = msg->servingPLMNid;
cp.anl = msg->anl;
cp.bearerContextStatus = msg->bearerContextStatus;
cp.numPDUSessions = msg->numPDUSessions;
strncpy(cp.secInfo.encryptionKey, msg->secInfo.encryptionKey, sizeof(cp.secInfo.encryptionKey));
......@@ -785,6 +791,7 @@ bool eq_bearer_context_setup_request(const e1ap_bearer_setup_req_t *a, const e1a
_EQ_CHECK_LONG(a->secInfo.cipheringAlgorithm, b->secInfo.cipheringAlgorithm);
_EQ_CHECK_LONG(a->secInfo.integrityProtectionAlgorithm, b->secInfo.integrityProtectionAlgorithm);
_EQ_CHECK_LONG(a->ueDlAggMaxBitRate, b->ueDlAggMaxBitRate);
_EQ_CHECK_INT(a->anl, b->anl);
_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
// PLMN
_EQ_CHECK_INT(a->servingPLMNid.mcc, b->servingPLMNid.mcc);
......
......@@ -72,5 +72,6 @@
#include "E1AP_QoS-Flow-Failed-List.h"
#include "E1AP_QoS-Flow-Failed-Item.h"
#include "E1AP_DRB-Failed-To-Modify-Item-NG-RAN.h"
#include "E1AP_ActivityNotificationLevel.h"
#endif /* E1AP_LIB_INCLUDES_H_ */
......@@ -98,6 +98,7 @@ static void test_bearer_context_setup_request(void)
.secInfo.cipheringAlgorithm = 0x01,
.secInfo.integrityProtectionAlgorithm = 0x01,
.ueDlAggMaxBitRate = 1000000000,
.anl = activity_notification_level_pdu_session,
.bearerContextStatus = 0,
.servingPLMNid.mcc = 001,
.servingPLMNid.mnc = 01,
......
......@@ -369,6 +369,7 @@ void trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint64_t ueAggMax
.secInfo.cipheringAlgorithm = rrc->security.do_drb_ciphering ? UE->ciphering_algorithm : 0,
.secInfo.integrityProtectionAlgorithm = rrc->security.do_drb_integrity ? UE->integrity_algorithm : 0,
.ueDlAggMaxBitRate = ueAggMaxBitRateDownlink,
.anl = activity_notification_level_pdu_session,
};
// Collect PDU sessions with NEW status first - store pdusession_t directly to avoid stack overflow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment