Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
26692630
Commit
26692630
authored
Nov 07, 2019
by
matzakos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENDC X2AP: Implementation of handler function for SgNB addition request message
parent
587f9f63
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
67 deletions
+124
-67
openair2/COMMON/s1ap_messages_types.h
openair2/COMMON/s1ap_messages_types.h
+16
-0
openair2/COMMON/x2ap_messages_def.h
openair2/COMMON/x2ap_messages_def.h
+3
-0
openair2/COMMON/x2ap_messages_types.h
openair2/COMMON/x2ap_messages_types.h
+16
-6
openair2/X2AP/x2ap_eNB_generate_messages.c
openair2/X2AP/x2ap_eNB_generate_messages.c
+25
-3
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+64
-58
No files found.
openair2/COMMON/s1ap_messages_types.h
View file @
26692630
...
@@ -273,6 +273,22 @@ typedef struct e_rab_setup_s {
...
@@ -273,6 +273,22 @@ typedef struct e_rab_setup_s {
uint32_t
gtp_teid
;
uint32_t
gtp_teid
;
}
e_rab_setup_t
;
}
e_rab_setup_t
;
typedef
struct
e_rab_tobe_added_s
{
/* Unique e_rab_id for the UE. */
uint8_t
e_rab_id
;
/* Unique drb_ID for the UE. */
uint8_t
drb_ID
;
/* The transport layer address for the IP packets */
transport_layer_addr_t
eNB_addr
;
/* S-GW Tunnel endpoint identifier */
uint32_t
gtp_teid
;
}
e_rab_tobe_added_t
;
typedef
struct
e_rab_tobeswitched_s
{
typedef
struct
e_rab_tobeswitched_s
{
/* Unique e_rab_id for the UE. */
/* Unique e_rab_id for the UE. */
uint8_t
e_rab_id
;
uint8_t
e_rab_id
;
...
...
openair2/COMMON/x2ap_messages_def.h
View file @
26692630
...
@@ -50,3 +50,6 @@ MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_
...
@@ -50,3 +50,6 @@ MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_
/*Senb bearer addition messages X2AP <-> RRC */
/*Senb bearer addition messages X2AP <-> RRC */
MESSAGE_DEF
(
X2AP_SENB_ADDITION_REQ
,
MESSAGE_PRIORITY_MED
,
x2ap_senb_addition_req_t
,
x2ap_senb_addition_req
)
MESSAGE_DEF
(
X2AP_SENB_ADDITION_REQ
,
MESSAGE_PRIORITY_MED
,
x2ap_senb_addition_req_t
,
x2ap_senb_addition_req
)
/*SGnb bearer addition messages X2AP <-> RRC */
MESSAGE_DEF
(
X2AP_ENDC_SGNB_ADDITION_REQ
,
MESSAGE_PRIORITY_MED
,
x2ap_ENDC_sgnb_addition_req_t
,
x2ap_ENDC_sgnb_addition_req
)
openair2/COMMON/x2ap_messages_types.h
View file @
26692630
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
#define X2AP_ENDC_SGNB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
...
@@ -286,7 +287,7 @@ typedef struct x2ap_senb_addition_req_ack_s {
...
@@ -286,7 +287,7 @@ typedef struct x2ap_senb_addition_req_ack_s {
int
MeNB_UE_X2_id
;
int
MeNB_UE_X2_id
;
int
S
e
NB_UE_X2_id
;
int
S
g
NB_UE_X2_id
;
uint8_t
nb_sCG_e_rabs_tobeadded
;
uint8_t
nb_sCG_e_rabs_tobeadded
;
...
@@ -304,12 +305,15 @@ typedef struct x2ap_senb_addition_req_ack_s {
...
@@ -304,12 +305,15 @@ typedef struct x2ap_senb_addition_req_ack_s {
}
x2ap_senb_addition_req_ack_t
;
}
x2ap_senb_addition_req_ack_t
;
typedef
struct
x2ap_ENDC_sgnb_addition_req_s
{
typedef
struct
x2ap_ENDC_sgnb_addition_req_s
{
int
ue_x2_id
;
/* used for RRC->X2AP in source eNB */
/* used for RRC->X2AP in source eNB */
int
rnti
;
int
rnti
;
security_capabilities_t
security_capabilities
;
security_capabilities_t
security_capabilities
;
uint8_t
kgnb
[
32
];
// keNB or keNB*
/* SgNB Security Key */
uint8_t
kgnb
[
32
];
/*next_hop_chaining_coun */
/*next_hop_chaining_coun */
long
int
kgnb_ncc
;
long
int
kgnb_ncc
;
...
@@ -317,10 +321,10 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
...
@@ -317,10 +321,10 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
/* UE aggregate maximum bitrate */
/* UE aggregate maximum bitrate */
ambr_t
ue_ambr
;
ambr_t
ue_ambr
;
uint8_t
nb_e_rabs_tobe
setup
;
uint8_t
nb_e_rabs_tobe
added
;
/* list of e_rab
setup-
ed by RRC layers */
/* list of e_rab
to be add
ed by RRC layers */
e_rab_
setup_t
e_rabs_tobesetup
[
S1AP_MAX_E_RAB
];
e_rab_
tobe_added_t
e_rabs_tobeadded
[
S1AP_MAX_E_RAB
];
/* list of e_rab to be setup by RRC layers */
/* list of e_rab to be setup by RRC layers */
e_rab_t
e_rab_param
[
S1AP_MAX_E_RAB
];
e_rab_t
e_rab_param
[
S1AP_MAX_E_RAB
];
...
@@ -331,7 +335,13 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
...
@@ -331,7 +335,13 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
int
rrc_buffer_size
;
int
rrc_buffer_size
;
int
target_assoc_id
;
int
target_assoc_id
;
}
x2ap_ENDC_sgnb_addition_req__t
;
/*long int pDCPatSgNB = X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present;
long int mCGresources = X2AP_EN_DC_ResourceConfiguration__mCGresources_not_present;
long int sCGresources = X2AP_EN_DC_ResourceConfiguration__sCGresources_not_present;*/
}
x2ap_ENDC_sgnb_addition_req_t
;
#endif
/* X2AP_MESSAGES_TYPES_H_ */
#endif
/* X2AP_MESSAGES_TYPES_H_ */
openair2/X2AP/x2ap_eNB_generate_messages.c
View file @
26692630
...
@@ -1524,14 +1524,29 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
...
@@ -1524,14 +1524,29 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
long
qCI
=
1
;
long
qCI
=
1
;
X2AP_Pre_emptionCapability_t
pre_emptionCapability
=
X2AP_Pre_emptionCapability_shall_not_trigger_pre_emption
;
X2AP_Pre_emptionCapability_t
pre_emptionCapability
=
X2AP_Pre_emptionCapability_shall_not_trigger_pre_emption
;
X2AP_Pre_emptionVulnerability_t
pre_emptionVulnerability
=
X2AP_Pre_emptionVulnerability_not_pre_emptable
;
X2AP_Pre_emptionVulnerability_t
pre_emptionVulnerability
=
X2AP_Pre_emptionVulnerability_not_pre_emptable
;
priority_level_t
priority_level
=
PRIORITY_LEVEL_NO_PRIORITY
;
e_rab_setup_t
e_MCG_rabs_tobeadded
;
e_rab_setup_t
e_MCG_rabs_tobeadded
;
e_MCG_rabs_tobeadded
.
gtp_teid
=
0
;
e_MCG_rabs_tobeadded
.
gtp_teid
=
0
;
e_MCG_rabs_tobeadded
.
eNB_addr
.
length
=
24
;
e_MCG_rabs_tobeadded
.
eNB_addr
.
length
=
24
;
uint8_t
buf
[
20
]
=
{
0
};
uint8_t
buf
[
20
]
=
{
0
};
memcpy
(
e_MCG_rabs_tobeadded
.
eNB_addr
.
buffer
,
buf
,
20
*
sizeof
(
uint8_t
));
memcpy
(
e_MCG_rabs_tobeadded
.
eNB_addr
.
buffer
,
buf
,
20
*
sizeof
(
uint8_t
));
FILE
*
fd
;
fd
=
fopen
(
"uecap.raw"
,
"r"
);
if
(
fd
!=
NULL
)
{
OCTET_STRING_t
CG_Config_Info
;
OCTET_STRING_t
CG_Config_Info
;
CG_Config_Info
.
size
=
4096
;
CG_Config_Info
.
size
=
4096
;
CG_Config_Info
.
buf
=
(
uint8_t
*
)
calloc
(
4096
,
sizeof
(
uint8_t
));
CG_Config_Info
.
buf
=
(
uint8_t
*
)
calloc
(
4096
,
sizeof
(
uint8_t
));
int
msg_len
=
fread
(
CG_Config_Info
.
buf
,
1
,
CG_Config_Info
.
size
,
fd
);
/*char buffer[4096];
int msg_len=fread(buffer,1,4096,fd);*/
LOG_I
(
RRC
,
"Read in %d bytes for uecap
\n
"
,
msg_len
);
/*OCTET_STRING_t CG_Config_Info;
CG_Config_Info.size = 4096;
CG_Config_Info.buf = (uint8_t *)calloc(4096, sizeof(uint8_t));*/
DevAssert
(
instance_p
!=
NULL
);
DevAssert
(
instance_p
!=
NULL
);
...
@@ -1608,7 +1623,8 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
...
@@ -1608,7 +1623,8 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
qCI
=
qCI
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
qCI
=
qCI
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionCapability
=
pre_emptionCapability
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionCapability
=
pre_emptionCapability
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionVulnerability
=
pre_emptionVulnerability
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionVulnerability
=
pre_emptionVulnerability
;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
priorityLevel
=
priority_level
;
//Continue from filling the UL_GTPtunnelEndpointInformation inspired from how it is done for the HO case
//Continue from filling the UL_GTPtunnelEndpointInformation inspired from how it is done for the HO case
INT32_TO_OCTET_STRING
(
e_MCG_rabs_tobeadded
.
gtp_teid
,
&
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
gTP_TEID
);
INT32_TO_OCTET_STRING
(
e_MCG_rabs_tobeadded
.
gtp_teid
,
&
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
gTP_TEID
);
...
@@ -1644,6 +1660,12 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
...
@@ -1644,6 +1660,12 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
MSC_LOG_TX_MESSAGE
(
MSC_X2AP_SRC_ENB
,
MSC_X2AP_TARGET_ENB
,
NULL
,
0
,
"0 X2Setup/initiatingMessage assoc_id %u"
,
x2ap_eNB_data_p
->
assoc_id
);
MSC_LOG_TX_MESSAGE
(
MSC_X2AP_SRC_ENB
,
MSC_X2AP_TARGET_ENB
,
NULL
,
0
,
"0 X2Setup/initiatingMessage assoc_id %u"
,
x2ap_eNB_data_p
->
assoc_id
);
x2ap_eNB_itti_send_sctp_data_req
(
instance_p
->
instance
,
x2ap_eNB_data_p
->
assoc_id
,
buffer
,
len
,
0
);
x2ap_eNB_itti_send_sctp_data_req
(
instance_p
->
instance
,
x2ap_eNB_data_p
->
assoc_id
,
buffer
,
len
,
0
);
fclose
(
fd
);
}
else
{
LOG_I
(
RRC
,
"uecap.raw file could not be opened...
\n
"
);
return
-
1
;
}
return
ret
;
return
ret
;
...
...
openair2/X2AP/x2ap_eNB_handler.c
View file @
26692630
...
@@ -1470,8 +1470,8 @@ x2ap_eNB_handle_ENDC_x2_setup_request(instance_t instance,
...
@@ -1470,8 +1470,8 @@ x2ap_eNB_handle_ENDC_x2_setup_request(instance_t instance,
instance_p
=
x2ap_eNB_get_instance
(
instance
);
instance_p
=
x2ap_eNB_get_instance
(
instance
);
DevAssert
(
instance_p
!=
NULL
);
DevAssert
(
instance_p
!=
NULL
);
return
x2ap_eNB_generate_ENDC_x2_setup_response
(
instance_p
,
x2ap_eNB_data
);
//
return x2ap_eNB_generate_ENDC_x2_setup_response(instance_p, x2ap_eNB_data);
//
return x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(instance_p, x2ap_eNB_data,0);
return
x2ap_eNB_generate_ENDC_x2_SgNB_addition_request
(
instance_p
,
x2ap_eNB_data
,
0
);
}
}
...
@@ -1632,7 +1632,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1632,7 +1632,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
X2AP_X2AP_PDU_t
*
pdu
)
X2AP_X2AP_PDU_t
*
pdu
)
{
{
/*
X2AP_SgNBAdditionRequest_t
*
x2SgNBAdditionRequest
;
X2AP_SgNBAdditionRequest_t
*
x2SgNBAdditionRequest
;
X2AP_SgNBAdditionRequest_IEs_t
*
ie
;
X2AP_SgNBAdditionRequest_IEs_t
*
ie
;
...
@@ -1662,8 +1662,9 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1662,8 +1662,9 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
DevAssert
(
instance_p
!=
NULL
);
DevAssert
(
instance_p
!=
NULL
);
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
//msg = itti_alloc_new_message(TASK_X2AP, X2AP_HANDOVER
_REQ);
msg
=
itti_alloc_new_message
(
TASK_X2AP
,
X2AP_ENDC_SGNB_ADDITION
_REQ
);
/* X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID
,
true
);
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID
,
true
);
if
(
ie
==
NULL
)
{
if
(
ie
==
NULL
)
{
...
@@ -1671,6 +1672,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1671,6 +1672,7 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
return
-
1
;
return
-
1
;
}
}
// allocate a new X2AP UE ID
// allocate a new X2AP UE ID
ue_id
=
x2ap_allocate_new_id
(
&
instance_p
->
id_manager
);
ue_id
=
x2ap_allocate_new_id
(
&
instance_p
->
id_manager
);
if
(
ue_id
==
-
1
)
{
if
(
ue_id
==
-
1
)
{
...
@@ -1679,74 +1681,73 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1679,74 +1681,73 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
exit
(
1
);
exit
(
1
);
}
}
// rnti is unknown yet, must not be set to -1, 0 is fine
// rnti is unknown yet, must not be set to -1, 0 is fine
x2ap_set_ids(&instance_p->id_manager, ue_id, 0, ie->value.choice.
SgNB_
UE_X2AP_ID, ue_id);
x2ap_set_ids
(
&
instance_p
->
id_manager
,
ue_id
,
0
,
ie
->
value
.
choice
.
UE_X2AP_ID
,
ue_id
);
x2ap_id_set_state
(
&
instance_p
->
id_manager
,
ue_id
,
X2ID_STATE_TARGET
);
x2ap_id_set_state
(
&
instance_p
->
id_manager
,
ue_id
,
X2ID_STATE_TARGET
);
X2AP_
HANDOVER_REQ(msg).
x2_id = ue_id;
X2AP_
ENDC_SGNB_ADDITION_REQ
(
msg
).
ue_
x2_id
=
ue_id
;
//X2AP_HANDOVER_REQ(msg).target_physCellId = measResults2->measResultNeighCells->choice.
//measResultListEUTRA.list.array[ncell_index]->physCellId;
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverRequest_IEs_t, ie, x2HandoverRequest,
X2AP_ProtocolIE_ID_id_GUMMEI_ID, true);
TBCD_TO_MCC_MNC(&ie->value.choice.ECGI.pLMN_Identity, X2AP_HANDOVER_REQ(msg).ue_gummei.mcc,
/* X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities */
X2AP_HANDOVER_REQ(msg).ue_gummei.mnc, X2AP_HANDOVER_REQ(msg).ue_gummei.mnc_len);
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
OCTET_STRING_TO_INT8(&ie->value.choice.GUMMEI.mME_Code, X2AP_HANDOVER_REQ(msg).ue_gummei.mme_code);
X2AP_ProtocolIE_ID_id_NRUESecurityCapabilities
,
true
);
OCTET_STRING_TO_INT16(&ie->value.choice.GUMMEI.gU_Group_ID.mME_Group_ID, X2AP_HANDOVER_REQ(msg).ue_gummei.mme_group_id);
X2AP_
FIND_PROTOCOLIE_BY_ID(X2AP_HandoverRequest_IEs_t, ie, x2HandoverRequest,
X2AP_
ENDC_SGNB_ADDITION_REQ
(
msg
).
security_capabilities
.
encryption_algorithms
=
X2AP_ProtocolIE_ID_id_UE_ContextInformation, true
);
BIT_STRING_to_uint16
(
&
ie
->
value
.
choice
.
NRUESecurityCapabilities
.
nRencryptionAlgorithms
);
if (ie == NULL ) {
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
security_capabilities
.
integrity_algorithms
=
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
BIT_STRING_to_uint16
(
&
ie
->
value
.
choice
.
NRUESecurityCapabilities
.
nRintegrityProtectionAlgorithms
);
return -1;
}
X2AP_HANDOVER_REQ(msg).mme_ue_s1ap_id = ie->value.choice.UE_ContextInformation.mME_UE_S1AP_ID;
/* X2AP_ProtocolIE_ID_id_SgNBSecurityKey */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
X2AP_ProtocolIE_ID_id_SgNBSecurityKey
,
true
);
// TODO: properly store Target Cell ID
if
((
ie
->
value
.
choice
.
SgNBSecurityKey
.
buf
)
&&
(
ie
->
value
.
choice
.
SgNBSecurityKey
.
size
==
32
))
{
memcpy
(
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
kgnb
,
ie
->
value
.
choice
.
SgNBSecurityKey
.
buf
,
32
);
}
else
{
X2AP_WARN
(
"Size of eNB key star does not match the expected value
\n
"
);
}
X2AP_HANDOVER_REQ(msg).target_assoc_id = assoc_id;
X2AP_HANDOVER_REQ(msg).security_capabilities.encryption_algorithms =
/* X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate */
BIT_STRING_to_uint16(&ie->value.choice.UE_ContextInformation.uESecurityCapabilities.encryptionAlgorithms);
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
X2AP_HANDOVER_REQ(msg).security_capabilities.integrity_algorithms =
X2AP_ProtocolIE_ID_id_SgNBUEAggregateMaximumBitRate
,
true
);
BIT_STRING_to_uint16(&ie->value.choice.UE_ContextInformation.uESecurityCapabilities.integrityProtectionAlgorithms);
//X2AP_HANDOVER_REQ(msg).ue_ambr=ue_context_pP->ue_context.ue_ambr;
//X2AP_ENDC_SGNB_ADDITION_REQ(msg).ue_ambr.br_dl =ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateDownlink;
//X2AP_ENDC_SGNB_ADDITION_REQ(msg).ue_ambr.br_ul = ie->value.choice.UEAggregateMaximumBitRate.uEaggregateMaximumBitRateUplink;
if ((ie->value.choice.UE_ContextInformation.aS_SecurityInformation.key_eNodeB_star.buf) &&
/* X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList */
(ie->value.choice.UE_ContextInformation.aS_SecurityInformation.key_eNodeB_star.size == 32)) {
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
memcpy(X2AP_HANDOVER_REQ(msg).kenb, ie->value.choice.UE_ContextInformation.aS_SecurityInformation.key_eNodeB_star.buf, 32);
X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList
,
true
);
X2AP_HANDOVER_REQ(msg).kenb_ncc = ie->value.choice.UE_ContextInformation.aS_SecurityInformation.nextHopChainingCount;
} else {
X2AP_WARN ("Size of eNB key star does not match the expected value\n");
}
if (ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list.count > 0) {
X2AP_HANDOVER_REQ(msg).nb_e_rabs_tobesetup = ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list.count;
if
(
ie
->
value
.
choice
.
E_RABs_ToBeAdded_SgNBAddReqList
.
list
.
count
>
0
)
{
for (int i=0;i<ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list.count;i++) {
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
nb_e_rabs_tobeadded
=
ie
->
value
.
choice
.
E_RABs_ToBeAdded_SgNBAddReqList
.
list
.
count
;
e_RABS_ToBeSetup_ItemIEs = (X2AP_E_RABs_ToBeSetup_ItemIEs_t *) ie->value.choice.UE_ContextInformation.e_RABs_ToBeSetup_List.list.array[i];
e_RABs_ToBeSetup_Item = &e_RABS_ToBeSetup_ItemIEs->value.choice.E_RABs_ToBeSetup_Item;
X2AP_HANDOVER_REQ(msg).e_rabs_tobesetup[i].e_rab_id = e_RABs_ToBeSetup_Item->e_RAB_ID ;
for
(
int
i
=
0
;
i
<
ie
->
value
.
choice
.
E_RABs_ToBeAdded_SgNBAddReqList
.
list
.
count
;
i
++
)
{
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs
=
(
X2AP_E_RABs_ToBeAdded_SgNBAddReq_ItemIEs_t
*
)
ie
->
value
.
choice
.
E_RABs_ToBeAdded_SgNBAddReqList
.
list
.
array
[
i
];
e_RABS_ToBeAdded_SgNBAddReq_Item
=
&
e_RABS_ToBeAdded_SgNBAddReq_ItemIEs
->
value
.
choice
.
E_RABs_ToBeAdded_SgNBAddReq_Item
;
memcpy(X2AP_HANDOVER_REQ(msg).e_rabs_tobesetup[i].eNB_addr.buffer,
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rabs_tobeadded
[
i
].
e_rab_id
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
e_RAB_ID
;
e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.transportLayerAddress.buf,
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rabs_tobeadded
[
i
].
drb_ID
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
drb_ID
;
e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.transportLayerAddress.size);
if
(
e_RABS_ToBeAdded_SgNBAddReq_Item
->
en_DC_ResourceConfiguration
.
pDCPatSgNB
==
X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present
){
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rab_param
[
i
].
qos
.
qci
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
qCI
;
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rab_param
[
i
].
qos
.
allocation_retention_priority
.
pre_emp_vulnerability
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionVulnerability
;
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rab_param
[
i
].
qos
.
allocation_retention_priority
.
pre_emp_capability
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
pre_emptionCapability
;
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rab_param
[
i
].
qos
.
allocation_retention_priority
.
priority_level
=
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
full_E_RAB_Level_QoS_Parameters
.
allocationAndRetentionPriority
.
priorityLevel
;
X2AP_HANDOVER_REQ(msg).e_rabs_tobesetup[i].eNB_addr.length =
memcpy
(
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rabs_tobeadded
[
i
].
eNB_addr
.
buffer
,
e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.transportLayerAddress.size * 8 - e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.transportLayerAddress.bits_unused;
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
transportLayerAddress
.
buf
,
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
transportLayerAddress
.
size
);
OCTET_STRING_TO_INT32(&e_RABs_ToBeSetup_Item->uL_GTPtunnelEndpoint.gTP_TEID,
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rabs_tobeadded
[
i
].
eNB_addr
.
length
=
X2AP_HANDOVER_REQ(msg).e_rabs_tobesetup[i].gtp_teid);
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
transportLayerAddress
.
size
*
8
-
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
transportLayerAddress
.
bits_unused
;
OCTET_STRING_TO_INT32
(
&
e_RABS_ToBeAdded_SgNBAddReq_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_UL_GTPtunnelEndpoint
.
gTP_TEID
,
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
e_rabs_tobeadded
[
i
].
gtp_teid
);
}
X2AP_HANDOVER_REQ(msg).e_rab_param[i].qos.qci = e_RABs_ToBeSetup_Item->e_RAB_Level_QoS_Parameters.qCI;
X2AP_HANDOVER_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.priority_level = e_RABs_ToBeSetup_Item->e_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.priorityLevel;
X2AP_HANDOVER_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.pre_emp_capability = e_RABs_ToBeSetup_Item->e_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.pre_emptionCapability;
X2AP_HANDOVER_REQ(msg).e_rab_param[i].qos.allocation_retention_priority.pre_emp_vulnerability = e_RABs_ToBeSetup_Item->e_RAB_Level_QoS_Parameters.allocationAndRetentionPriority.pre_emptionVulnerability;
}
}
}
}
...
@@ -1754,15 +1755,20 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1754,15 +1755,20 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
X2AP_ERROR
(
"Can't decode the e_RABs_ToBeSetup_List
\n
"
);
X2AP_ERROR
(
"Can't decode the e_RABs_ToBeSetup_List
\n
"
);
}
}
X2AP_RRC_Context_t *c = &ie->value.choice.UE_ContextInformation.rRC_Context;
/* X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequest_IEs_t
,
ie
,
x2SgNBAdditionRequest
,
X2AP_ProtocolIE_ID_id_MeNBtoSgNBContainer
,
true
);
if (c->size > 8192 ) // TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s
X2AP_MeNBtoSgNBContainer_t
*
container
=
&
ie
->
value
.
choice
.
MeNBtoSgNBContainer
;
if
(
ie
->
value
.
choice
.
MeNBtoSgNBContainer
.
size
>
8192
)
// TODO: this is the size of rrc_buffer in struct x2ap_handover_req_s
{
printf
(
"%s:%d: fatal: buffer too big
\n
"
,
__FILE__
,
__LINE__
);
abort
();
}
{
printf
(
"%s:%d: fatal: buffer too big
\n
"
,
__FILE__
,
__LINE__
);
abort
();
}
memcpy(X2AP_HANDOVER_REQ(msg).rrc_buffer, c->buf, c->size);
memcpy
(
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
rrc_buffer
,
ie
->
value
.
choice
.
MeNBtoSgNBContainer
.
buf
,
ie
->
value
.
choice
.
MeNBtoSgNBContainer
.
size
);
X2AP_HANDOVER_REQ(msg).rrc_buffer_size = c->size;
X2AP_ENDC_SGNB_ADDITION_REQ
(
msg
).
rrc_buffer_size
=
ie
->
value
.
choice
.
MeNBtoSgNBContainer
.
size
;
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);*/
//itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
return
0
;
return
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment