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
62fb80e6
Commit
62fb80e6
authored
Dec 06, 2019
by
matzakos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENDC X2AP: Implementation of SgNB Addition Response handler
parent
ad82602e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
19 deletions
+151
-19
openair2/COMMON/x2ap_messages_types.h
openair2/COMMON/x2ap_messages_types.h
+5
-14
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+7
-0
openair2/RRC/NR/rrc_gNB_internode.c
openair2/RRC/NR/rrc_gNB_internode.c
+0
-2
openair2/RRC/NR/rrc_gNB_nsa.c
openair2/RRC/NR/rrc_gNB_nsa.c
+0
-2
openair2/X2AP/x2ap_eNB_decoder.c
openair2/X2AP/x2ap_eNB_decoder.c
+4
-0
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+135
-1
No files found.
openair2/COMMON/x2ap_messages_types.h
View file @
62fb80e6
...
@@ -345,26 +345,17 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
...
@@ -345,26 +345,17 @@ typedef struct x2ap_ENDC_sgnb_addition_req_s {
}
x2ap_ENDC_sgnb_addition_req_t
;
}
x2ap_ENDC_sgnb_addition_req_t
;
typedef
struct
x2ap_ENDC_sgnb_addition_req_ACK_s
{
typedef
struct
x2ap_ENDC_sgnb_addition_req_ACK_s
{
int
ue_x2_id
;
int
MeNB_ue_x2_id
;
int
SgNB_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
;
uint8_t
nb_e_rabs_admitted_tobeadded
;
/* SgNB Security Key */
uint8_t
kgnb
[
32
];
/*next_hop_chaining_coun */
long
int
kgnb_ncc
;
/* UE aggregate maximum bitrate */
ambr_t
ue_ambr
;
uint8_t
nb_e_rabs_tobeadded
;
/* list of e_rab to be added by RRC layers */
/* list of e_rab to be added by RRC layers */
e_rab_tobe_added_t
e_rabs_tobeadded
[
S1AP_MAX_E_RAB
];
e_rab_tobe_added_t
e_rabs_
admitted_
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
];
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
62fb80e6
...
@@ -8525,6 +8525,13 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
...
@@ -8525,6 +8525,13 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
break
;
break
;
}
}
case
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
:
{
LOG_I
(
RRC
,
"RRC processing of SgNB addition response information to be added...
\n
"
);
break
;
}
/* Messages from eNB app */
/* Messages from eNB app */
case
RRC_CONFIGURATION_REQ
:
case
RRC_CONFIGURATION_REQ
:
LOG_I
(
RRC
,
"[eNB %d] Received %s : %p
\n
"
,
instance
,
msg_name_p
,
&
RRC_CONFIGURATION_REQ
(
msg_p
));
LOG_I
(
RRC
,
"[eNB %d] Received %s : %p
\n
"
,
instance
,
msg_name_p
,
&
RRC_CONFIGURATION_REQ
(
msg_p
));
...
...
openair2/RRC/NR/rrc_gNB_internode.c
View file @
62fb80e6
...
@@ -121,8 +121,6 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
...
@@ -121,8 +121,6 @@ int generate_CG_Config(gNB_RRC_INST *rrc,
fclose
(
fd
);
fclose
(
fd
);
total_size
=
total_size
+
((
enc_rval
.
encoded
+
7
)
>>
3
);
total_size
=
total_size
+
((
enc_rval
.
encoded
+
7
)
>>
3
);
LOG_I
(
RRC
,
"Total size in generate_CG_Config(): %d
\n
"
,
total_size
);
return
(
total_size
);
return
(
total_size
);
}
}
...
...
openair2/RRC/NR/rrc_gNB_nsa.c
View file @
62fb80e6
...
@@ -143,8 +143,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
...
@@ -143,8 +143,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
1024
);
1024
);
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
rrc_buffer_size
=
(
enc_rval
.
encoded
+
7
)
>>
3
;
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
rrc_buffer_size
=
(
enc_rval
.
encoded
+
7
)
>>
3
;
LOG_I
(
RRC
,
"Total size in rrc_add_nsa_user(): %d
\n
"
,
(
enc_rval
.
encoded
+
7
)
>>
3
);
itti_send_msg_to_task
(
TASK_X2AP
,
ENB_MODULE_ID_TO_INSTANCE
(
0
),
msg
);
//Check right id instead of hardcoding
itti_send_msg_to_task
(
TASK_X2AP
,
ENB_MODULE_ID_TO_INSTANCE
(
0
),
msg
);
//Check right id instead of hardcoding
...
...
openair2/X2AP/x2ap_eNB_decoder.c
View file @
62fb80e6
...
@@ -96,6 +96,10 @@ static int x2ap_eNB_decode_successful_outcome(X2AP_X2AP_PDU_t *pdu)
...
@@ -96,6 +96,10 @@ static int x2ap_eNB_decode_successful_outcome(X2AP_X2AP_PDU_t *pdu)
X2AP_INFO
(
"x2ap_eNB_decode_successfuloutcome_message!
\n
"
);
X2AP_INFO
(
"x2ap_eNB_decode_successfuloutcome_message!
\n
"
);
break
;
break
;
case
X2AP_ProcedureCode_id_sgNBAdditionPreparation
:
X2AP_INFO
(
"x2ap_eNB_decode_successfuloutcome_message!
\n
"
);
break
;
default:
default:
X2AP_ERROR
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
X2AP_ERROR
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
successfulOutcome
.
procedureCode
);
(
int
)
pdu
->
choice
.
successfulOutcome
.
procedureCode
);
...
...
openair2/X2AP/x2ap_eNB_handler.c
View file @
62fb80e6
...
@@ -120,6 +120,12 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -120,6 +120,12 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
uint32_t
stream
,
uint32_t
stream
,
X2AP_X2AP_PDU_t
*
pdu
);
X2AP_X2AP_PDU_t
*
pdu
);
static
int
x2ap_gNB_handle_ENDC_sGNB_addition_response
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
X2AP_X2AP_PDU_t
*
pdu
);
/* Handlers matrix. Only eNB related procedure present here. Placement of callback functions according to X2AP_ProcedureCode.h */
/* Handlers matrix. Only eNB related procedure present here. Placement of callback functions according to X2AP_ProcedureCode.h */
x2ap_message_decoded_callback
x2ap_messages_callback
[][
3
]
=
{
x2ap_message_decoded_callback
x2ap_messages_callback
[][
3
]
=
{
...
@@ -150,7 +156,7 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
...
@@ -150,7 +156,7 @@ x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
{
0
,
0
,
0
},
/* seNBinitiatedSeNBRelease */
{
0
,
0
,
0
},
/* seNBinitiatedSeNBRelease */
{
0
,
0
,
0
},
/* seNBCounterCheck */
{
0
,
0
,
0
},
/* seNBCounterCheck */
{
0
,
0
,
0
},
/* retrieveUEContext */
{
0
,
0
,
0
},
/* retrieveUEContext */
{
x2ap_gNB_handle_ENDC_sGNB_addition_request
,
0
,
0
},
/*X2AP_ProcedureCode_id_sgNBAdditionPreparation*/
{
x2ap_gNB_handle_ENDC_sGNB_addition_request
,
x2ap_gNB_handle_ENDC_sGNB_addition_response
,
0
},
/*X2AP_ProcedureCode_id_sgNBAdditionPreparation*/
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
},
...
@@ -1773,3 +1779,131 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
...
@@ -1773,3 +1779,131 @@ int x2ap_gNB_handle_ENDC_sGNB_addition_request (instance_t instance,
return
0
;
return
0
;
}
}
static
int
x2ap_gNB_handle_ENDC_sGNB_addition_response
(
instance_t
instance
,
uint32_t
assoc_id
,
uint32_t
stream
,
X2AP_X2AP_PDU_t
*
pdu
)
{
X2AP_SgNBAdditionRequestAcknowledge_t
*
x2SgNBAdditionRequest_ack
;
X2AP_SgNBAdditionRequestAcknowledge_IEs_t
*
ie
;
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t
*
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs
;
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item_t
*
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
;
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_data_t
*
x2ap_eNB_data
;
MessageDef
*
msg
;
int
ue_id
;
DevAssert
(
pdu
!=
NULL
);
x2SgNBAdditionRequest_ack
=
&
pdu
->
choice
.
successfulOutcome
.
value
.
choice
.
SgNBAdditionRequestAcknowledge
;
/*if (stream == 0) {
X2AP_ERROR ("Received new x2 SgNB Addition request on stream == 0\n");
// TODO: send a x2 failure response
return 0;
}*/
X2AP_DEBUG
(
"Received a new X2 SgNB Addition request
\n
"
);
x2ap_eNB_data
=
x2ap_get_eNB
(
NULL
,
assoc_id
,
0
);
DevAssert
(
x2ap_eNB_data
!=
NULL
);
X2AP_INFO
(
"X2AP Association id: %d
\n
"
,
assoc_id
);
instance_p
=
x2ap_eNB_get_instance
(
instance
);
DevAssert
(
instance_p
!=
NULL
);
//Allocate an ITTI X2AP_SGNB_ADDITION_REQ message instead
msg
=
itti_alloc_new_message
(
TASK_X2AP
,
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
);
/* X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequestAcknowledge_IEs_t
,
ie
,
x2SgNBAdditionRequest_ack
,
X2AP_ProtocolIE_ID_id_MeNB_UE_X2AP_ID
,
true
);
if
(
ie
==
NULL
)
{
X2AP_ERROR
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
MeNB_ue_x2_id
=
ie
->
value
.
choice
.
UE_X2AP_ID
;
/* X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequestAcknowledge_IEs_t
,
ie
,
x2SgNBAdditionRequest_ack
,
X2AP_ProtocolIE_ID_id_SgNB_UE_X2AP_ID
,
true
);
if
(
ie
==
NULL
)
{
X2AP_ERROR
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
SgNB_ue_x2_id
=
ie
->
value
.
choice
.
SgNB_UE_X2AP_ID
;
/* X2AP_ProtocolIE_ID_id_E_RABs_ToBeAdded_SgNBAddReqList */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequestAcknowledge_IEs_t
,
ie
,
x2SgNBAdditionRequest_ack
,
X2AP_ProtocolIE_ID_id_E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList
,
true
);
if
(
ie
==
NULL
)
{
X2AP_ERROR
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
if
(
ie
->
value
.
choice
.
E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList
.
list
.
count
>
0
)
{
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
nb_e_rabs_admitted_tobeadded
=
ie
->
value
.
choice
.
E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList
.
list
.
count
;
for
(
int
i
=
0
;
i
<
ie
->
value
.
choice
.
E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList
.
list
.
count
;
i
++
)
{
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs
=
(
X2AP_E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs_t
*
)
ie
->
value
.
choice
.
E_RABs_Admitted_ToBeAdded_SgNBAddReqAckList
.
list
.
array
[
i
];
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
=
&
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_ItemIEs
->
value
.
choice
.
E_RABs_Admitted_ToBeAdded_SgNBAddReqAck_Item
;
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
e_rabs_admitted_tobeadded
[
i
].
e_rab_id
=
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
e_RAB_ID
;
if
(
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
en_DC_ResourceConfiguration
.
pDCPatSgNB
==
X2AP_EN_DC_ResourceConfiguration__pDCPatSgNB_present
){
memcpy
(
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
e_rabs_admitted_tobeadded
[
i
].
eNB_addr
.
buffer
,
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_DL_GTPtunnelEndpoint
.
transportLayerAddress
.
buf
,
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_DL_GTPtunnelEndpoint
.
transportLayerAddress
.
size
);
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
e_rabs_admitted_tobeadded
[
i
].
eNB_addr
.
length
=
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_DL_GTPtunnelEndpoint
.
transportLayerAddress
.
size
*
8
-
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_DL_GTPtunnelEndpoint
.
transportLayerAddress
.
bits_unused
;
OCTET_STRING_TO_INT32
(
&
e_RABS_Admitted_ToBeAdded_SgNBAddReqAck_Item
->
resource_configuration
.
choice
.
sgNBPDCPpresent
.
s1_DL_GTPtunnelEndpoint
.
gTP_TEID
,
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
e_rabs_admitted_tobeadded
[
i
].
gtp_teid
);
}
}
}
else
{
X2AP_ERROR
(
"Can't decode the e_RABs_ToBeSetup_List
\n
"
);
}
/* X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer */
X2AP_FIND_PROTOCOLIE_BY_ID
(
X2AP_SgNBAdditionRequestAcknowledge_IEs_t
,
ie
,
x2SgNBAdditionRequest_ack
,
X2AP_ProtocolIE_ID_id_SgNBtoMeNBContainer
,
true
);
if
(
ie
==
NULL
)
{
X2AP_ERROR
(
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
//X2AP_MeNBtoSgNBContainer_t *container = &ie->value.choice.MeNBtoSgNBContainer;
if
(
ie
->
value
.
choice
.
SgNBtoMeNBContainer
.
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
();
}
memcpy
(
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
rrc_buffer
,
ie
->
value
.
choice
.
SgNBtoMeNBContainer
.
buf
,
ie
->
value
.
choice
.
SgNBtoMeNBContainer
.
size
);
X2AP_ENDC_SGNB_ADDITION_REQ_ACK
(
msg
).
rrc_buffer_size
=
ie
->
value
.
choice
.
SgNBtoMeNBContainer
.
size
;
itti_send_msg_to_task
(
TASK_RRC_ENB
,
instance_p
->
instance
,
msg
);
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