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
lizhongxiao
OpenXG-RAN
Commits
f9bb4150
Commit
f9bb4150
authored
Oct 03, 2021
by
Laurent Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle only
parent
b7a91d56
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
329 additions
and
325 deletions
+329
-325
openair2/F1AP/f1ap_common.c
openair2/F1AP/f1ap_common.c
+4
-3
openair2/F1AP/f1ap_cu_interface_management.c
openair2/F1AP/f1ap_cu_interface_management.c
+19
-20
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
+0
-1
openair2/F1AP/f1ap_cu_task.c
openair2/F1AP/f1ap_cu_task.c
+9
-8
openair2/F1AP/f1ap_cu_ue_context_management.c
openair2/F1AP/f1ap_cu_ue_context_management.c
+55
-51
openair2/F1AP/f1ap_du_interface_management.c
openair2/F1AP/f1ap_du_interface_management.c
+4
-2
openair2/F1AP/f1ap_du_rrc_message_transfer.c
openair2/F1AP/f1ap_du_rrc_message_transfer.c
+4
-7
openair2/F1AP/f1ap_du_task.c
openair2/F1AP/f1ap_du_task.c
+14
-15
openair2/F1AP/f1ap_du_ue_context_management.c
openair2/F1AP/f1ap_du_ue_context_management.c
+218
-218
openair2/F1AP/f1ap_encoder.c
openair2/F1AP/f1ap_encoder.c
+2
-0
No files found.
openair2/F1AP/f1ap_common.c
View file @
f9bb4150
...
...
@@ -100,6 +100,7 @@ int f1ap_add_ue(F1_t isCu,
return
i
;
}
}
// We didn't find the rnti
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_ENB
;
i
++
)
{
if
(
f1_inst
->
f1ap_ue
[
i
].
rnti
==
0
)
{
...
...
@@ -188,8 +189,8 @@ int f1ap_du_add_cu_ue_id(instance_t instanceP,
instance_t
du_ue_f1ap_id
,
instance_t
cu_ue_f1ap_id
)
{
f1ap_cudu_inst_t
*
f1_inst
=
getCxt
(
DUtype
,
instanceP
);
instance_t
f1ap_uid
=-
1
;
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_ENB
;
i
++
)
{
if
(
f1_inst
->
f1ap_ue
[
i
].
du_ue_f1ap_id
==
du_ue_f1ap_id
)
{
f1ap_uid
=
i
;
...
...
openair2/F1AP/f1ap_cu_interface_management.c
View file @
f9bb4150
...
...
@@ -97,8 +97,6 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* assoc_id */
f1ap_setup_req_t
*
req
=&
getCxt
(
true
,
instance
)
->
setupReq
;
req
->
assoc_id
=
assoc_id
;
/* gNB_DU_id */
// this function exits if the ie is mandatory
...
...
@@ -153,6 +151,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
f1ap_req
(
true
,
instance
)
->
cell_type
=
CELL_MACRO_GNB
;
else
f1ap_req
(
true
,
instance
)
->
cell_type
=
CELL_MACRO_ENB
;
LOG_I
(
F1AP
,
"Received Cell in %d context
\n
"
,
f1ap_req
(
true
,
instance
)
->
cell_type
==
CELL_MACRO_GNB
);
// System Information
/* mib */
...
...
@@ -209,10 +208,10 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
// uint16_t nr_sul_band[32];
// } tdd;
// } nr_mode_info[F1AP_MAX_NB_CELLS];
// We copy and store in F1 task data, RRC will free "req" as it frees all itti received messages
message_p
=
itti_alloc_new_message
(
TASK_CU_F1
,
0
,
F1AP_SETUP_REQ
);
memcpy
(
&
F1AP_SETUP_REQ
(
message_p
),
req
,
sizeof
(
f1ap_setup_req_t
)
);
if
(
num_cells_available
>
0
)
{
if
(
f1ap_req
(
true
,
instance
)
->
cell_type
==
CELL_MACRO_GNB
)
{
itti_send_msg_to_task
(
TASK_RRC_GNB
,
GNB_MODULE_ID_TO_INSTANCE
(
instance
),
message_p
);
...
...
openair2/F1AP/f1ap_cu_rrc_message_transfer.c
View file @
f9bb4150
...
...
@@ -100,7 +100,6 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
LOG_I
(
F1AP
,
"%s() RRCContainer (CCCH) size %ld: "
,
__func__
,
ie
->
value
.
choice
.
RRCContainer
.
size
);
/* DUtoCURRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_InitialULRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DUtoCURRCContainer
,
false
);
...
...
openair2/F1AP/f1ap_cu_task.c
View file @
f9bb4150
...
...
@@ -42,7 +42,7 @@
instance_t
CUuniqInstance
=
0
;
static
instance_t
cu_task_create_gtpu_instance_to_du
(
eth_params_t
*
IPaddrs
)
{
openAddr_t
tmp
=
{
0
};
openAddr_t
tmp
=
{
0
};
strncpy
(
tmp
.
originHost
,
IPaddrs
->
my_addr
,
sizeof
(
tmp
.
originHost
)
-
1
);
strncpy
(
tmp
.
destinationHost
,
IPaddrs
->
remote_addr
,
sizeof
(
tmp
.
destinationHost
)
-
1
);
sprintf
(
tmp
.
originService
,
"%d"
,
IPaddrs
->
my_portd
);
...
...
@@ -90,7 +90,7 @@ static void cu_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *s
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
static
void
cu_task_send_sctp_init_req
(
instance_t
instance
,
char
*
my_addr
)
{
static
void
cu_task_send_sctp_init_req
(
instance_t
instance
,
char
*
my_addr
)
{
// 1. get the itti msg, and retrive the enb_id from the message
// 2. use RC.rrc[enb_id] to fill the sctp_init_t with the ip, port
// 3. creat an itti message to init
...
...
@@ -103,7 +103,6 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) {
message_p
->
ittiMsg
.
sctp_init
.
ipv6
=
0
;
message_p
->
ittiMsg
.
sctp_init
.
nb_ipv4_addr
=
1
;
message_p
->
ittiMsg
.
sctp_init
.
ipv4_address
[
0
]
=
inet_addr
(
my_addr
);
/*
* SR WARNING: ipv6 multi-homing fails sometimes for localhost.
* * * * Disable it for now.
...
...
@@ -113,7 +112,7 @@ static void cu_task_send_sctp_init_req(instance_t instance, char * my_addr) {
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
void
*
F1AP_CU_task
(
void
*
arg
)
{
void
*
F1AP_CU_task
(
void
*
arg
)
{
MessageDef
*
received_msg
=
NULL
;
int
result
;
LOG_I
(
F1AP
,
"Starting F1AP at CU
\n
"
);
...
...
@@ -121,11 +120,13 @@ void * F1AP_CU_task(void *arg) {
pool_buffer_init
();
itti_mark_task_ready
(
TASK_CU_F1
);
eth_params_t
*
IPaddrs
;
// Hardcoded instance id!
if
(
RC
.
nrrrc
&&
RC
.
nrrrc
[
0
]
->
node_type
==
ngran_gNB_CU
)
IPaddrs
=&
RC
.
nrrrc
[
0
]
->
eth_params_s
;
else
IPaddrs
=&
RC
.
rrc
[
0
]
->
eth_params_s
;
cu_task_send_sctp_init_req
(
0
,
IPaddrs
->
my_addr
);
while
(
1
)
{
...
...
openair2/F1AP/f1ap_cu_ue_context_management.c
View file @
f9bb4150
...
...
@@ -130,6 +130,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ie6
->
id
=
F1AP_ProtocolIE_ID_id_CUtoDURRCInformation
;
ie6
->
criticality
=
F1AP_Criticality_reject
;
ie6
->
value
.
present
=
F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation
;
/* optional */
/* 6.1 cG_ConfigInfo */
if
(
0
)
{
...
...
@@ -205,6 +206,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
OCTET_STRING_fromBuf
(
&
ie9
->
value
.
choice
.
ResourceCoordinationTransferContainer
,
"asdsa1d32sa1d31asd31as"
,
strlen
(
"asdsa1d32sa1d31asd31as"
));
}
/* mandatory */
/* c10. SCell_ToBeSetup_List */
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupRequestIEs_t
,
ie10
);
...
...
@@ -391,7 +393,6 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* 12.1.2.2 sNSSAI */
{
/* sST */
OCTET_STRING_fromBuf
(
&
DRB_Information
->
sNSSAI
.
sST
,
"1"
,
1
);
/* OPTIONAL */
...
...
@@ -507,7 +508,6 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
int
sz
=
sizeof
(
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_dl_tnl
[
0
].
tl_address
);
memcpy
(
addr
.
buffer
,
&
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_dl_tnl
[
0
].
tl_address
,
sz
);
addr
.
length
=
sz
*
8
;
f1ap_ue_context_setup_req
->
drbs_to_be_setup
[
i
].
up_ul_tnl
[
j
].
teid
=
newGtpuCreateTunnel
(
getCxt
(
CUtype
,
instance
)
->
gtpInst
,
f1ap_ue_context_setup_req
->
rnti
,
...
...
@@ -641,45 +641,41 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
f1ap_ue_context_setup_t
*
f1ap_ue_context_setup_resp
=
&
F1AP_UE_CONTEXT_SETUP_RESP
(
msg_p
);
container
=
&
pdu
->
choice
.
successfulOutcome
->
value
.
choice
.
UEContextSetupResponse
;
int
i
;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID
,
true
);
f1ap_ue_context_setup_resp
->
gNB_CU_ue_id
=
ie
->
value
.
choice
.
GNB_CU_UE_F1AP_ID
;
LOG_D
(
F1AP
,
"f1ap_ue_context_setup_resp->gNB_CU_ue_id is: %d
\n
"
,
f1ap_ue_context_setup_resp
->
gNB_CU_ue_id
);
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID
,
true
);
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
=
ie
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
;
LOG_D
(
F1AP
,
"f1ap_ue_context_setup_resp->gNB_DU_ue_id is: %d
\n
"
,
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
);
f1ap_ue_context_setup_resp
->
rnti
=
f1ap_get_rnti_by_du_id
(
CUtype
,
instance
,
f1ap_ue_context_setup_resp
->
gNB_DU_ue_id
);
// DUtoCURRCInformation
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DUtoCURRCInformation
,
true
);
if
(
ie
==
NULL
){
if
(
ie
==
NULL
)
{
LOG_E
(
F1AP
,
"%s %d: ie is a NULL pointer
\n
"
,
__FILE__
,
__LINE__
);
return
-
1
;
}
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information
=
(
uint8_t
*
)
calloc
(
1
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
);
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information
=
(
uint8_t
*
)
calloc
(
1
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
);
memcpy
(
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
buf
,
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
);
f1ap_ue_context_setup_resp
->
du_to_cu_rrc_information_length
=
ie
->
value
.
choice
.
DUtoCURRCInformation
.
cellGroupConfig
.
size
;
// DRBs_Setup_List
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DRBs_Setup_List
,
false
);
if
(
ie
!=
NULL
){
if
(
ie
!=
NULL
)
{
f1ap_ue_context_setup_resp
->
drbs_to_be_setup_length
=
ie
->
value
.
choice
.
DRBs_Setup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
drbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
drbs_to_be_setup_length
,
sizeof
(
f1ap_drb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
drbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
drbs_to_be_setup_length
;
++
i
)
{
f1ap_drb_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_resp
->
drbs_to_be_setup
[
i
];
F1AP_DRBs_Setup_Item_t
*
drbs_setup_item_p
;
...
...
@@ -700,30 +696,35 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
drb_p
->
up_dl_tnl
[
0
].
teid
);
}
}
// SRBs_FailedToBeSetup_List
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List
,
false
);
if
(
ie
!=
NULL
){
if
(
ie
!=
NULL
)
{
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
=
ie
->
value
.
choice
.
SRBs_FailedToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
,
sizeof
(
f1ap_rb_failed_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->srbs_failed_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup_length
;
++
i
)
{
f1ap_rb_failed_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_resp
->
srbs_failed_to_be_setup
[
i
];
srb_p
->
rb_id
=
((
F1AP_SRBs_FailedToBeSetup_Item_t
*
)
ie
->
value
.
choice
.
SRBs_FailedToBeSetup_List
.
list
.
array
[
i
])
->
sRBID
;
}
}
// DRBs_FailedToBeSetup_List
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List
,
false
);
if
(
ie
!=
NULL
){
if
(
ie
!=
NULL
)
{
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
=
ie
->
value
.
choice
.
DRBs_FailedToBeSetup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
,
sizeof
(
f1ap_rb_failed_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_failed_to_be_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup_length
;
++
i
)
{
f1ap_rb_failed_to_be_setup_t
*
drb_p
=
&
f1ap_ue_context_setup_resp
->
drbs_failed_to_be_setup
[
i
];
drb_p
->
rb_id
=
((
F1AP_DRBs_FailedToBeSetup_Item_t
*
)
ie
->
value
.
choice
.
DRBs_FailedToBeSetup_List
.
list
.
array
[
i
])
->
dRBID
;
...
...
@@ -733,19 +734,22 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance,
// SCell_FailedtoSetup_List
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List
,
false
);
if
(
ie
!=
NULL
){
if
(
ie
!=
NULL
)
{
LOG_E
(
F1AP
,
"Not supporting handling of SCell_FailedtoSetup_List
\n
"
);
}
// SRBs_Setup_List
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_UEContextSetupResponseIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBs_Setup_List
,
false
);
if
(
ie
!=
NULL
){
if
(
ie
!=
NULL
)
{
f1ap_ue_context_setup_resp
->
srbs_to_be_setup_length
=
ie
->
value
.
choice
.
SRBs_Setup_List
.
list
.
count
;
f1ap_ue_context_setup_resp
->
srbs_to_be_setup
=
calloc
(
f1ap_ue_context_setup_resp
->
srbs_to_be_setup_length
,
sizeof
(
f1ap_srb_to_be_setup_t
));
AssertFatal
(
f1ap_ue_context_setup_resp
->
srbs_to_be_setup
,
"could not allocate memory for f1ap_ue_context_setup_resp->drbs_setup
\n
"
);
for
(
i
=
0
;
i
<
f1ap_ue_context_setup_resp
->
srbs_to_be_setup_length
;
++
i
)
{
f1ap_srb_to_be_setup_t
*
srb_p
=
&
f1ap_ue_context_setup_resp
->
srbs_to_be_setup
[
i
];
F1AP_SRBs_Setup_Item_t
*
srbs_setup_item_p
;
...
...
openair2/F1AP/f1ap_du_interface_management.c
View file @
f9bb4150
...
...
@@ -44,8 +44,10 @@ int to_NRNRB(int nrb) {
for
(
int
i
=
0
;
i
<
sizeofArray
(
nrb_lut
);
i
++
)
if
(
nrb_lut
[
i
]
==
nrb
)
return
i
;
if
(
!
RC
.
nrrrc
)
return
0
;
AssertFatal
(
1
==
0
,
"nrb %d is not in the list of possible NRNRB
\n
"
,
nrb
);
}
...
...
openair2/F1AP/f1ap_du_rrc_message_transfer.c
View file @
f9bb4150
...
...
@@ -137,7 +137,6 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
/* RRC Container */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_RRCContainer
,
true
);
rrc_dl_sdu_len
=
ie
->
value
.
choice
.
RRCContainer
.
size
;
/* optional */
...
...
@@ -932,7 +931,6 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
/* SRBID */
F1AP_FIND_PROTOCOLIE_BY_ID
(
F1AP_DLRRCMessageTransferIEs_t
,
ie
,
container
,
F1AP_ProtocolIE_ID_id_SRBID
,
true
);
uint64_t
srb_id
=
ie
->
value
.
choice
.
SRBID
;
LOG_D
(
F1AP
,
"srb_id %lu
\n
"
,
srb_id
);
...
...
@@ -985,13 +983,12 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
// decode RRC Container and act on the message type
AssertFatal
(
srb_id
<
3
,
"illegal srb_id
\n
"
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_DU_F1
,
0
,
NR_DU_RRC_DL_INDICATION
);
NRDuDlReq_t
*
req
=&
NRDuDlReq
(
msg
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_DU_F1
,
0
,
NR_DU_RRC_DL_INDICATION
);
NRDuDlReq_t
*
req
=&
NRDuDlReq
(
msg
);
req
->
rnti
=
f1ap_get_rnti_by_du_id
(
DUtype
,
instance
,
du_ue_f1ap_id
);
req
->
srb_id
=
srb_id
;
req
->
buf
=
get_free_mem_block
(
ie
->
value
.
choice
.
RRCContainer
.
size
,
__func__
);
memcpy
(
req
->
buf
->
data
,
ie
->
value
.
choice
.
RRCContainer
.
buf
,
ie
->
value
.
choice
.
RRCContainer
.
size
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
instance
,
msg
);
return
0
;
}
openair2/F1AP/f1ap_du_task.c
View file @
f9bb4150
...
...
@@ -85,7 +85,6 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data
->
sctp_out_streams
=
sctp_new_association_resp
->
out_streams
;
f1ap_du_data
->
default_sctp_stream_id
=
0
;
/* setup parameters for F1U and start the server */
DU_send_F1_SETUP_REQUEST
(
instance
);
}
...
...
@@ -98,8 +97,8 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
static
instance_t
du_create_gtpu_instance_to_cu
(
char
*
CUaddr
,
uint16_t
CUport
,
char
*
DUaddr
,
uint16_t
DUport
)
{
openAddr_t
tmp
=
{
0
};
static
instance_t
du_create_gtpu_instance_to_cu
(
char
*
CUaddr
,
uint16_t
CUport
,
char
*
DUaddr
,
uint16_t
DUport
)
{
openAddr_t
tmp
=
{
0
};
strncpy
(
tmp
.
originHost
,
DUaddr
,
sizeof
(
tmp
.
originHost
)
-
1
);
strncpy
(
tmp
.
destinationHost
,
CUaddr
,
sizeof
(
tmp
.
destinationHost
)
-
1
);
sprintf
(
tmp
.
originService
,
"%d"
,
DUport
);
...
...
@@ -126,7 +125,7 @@ void *F1AP_DU_task(void *arg) {
// 2. store the message in f1ap context, that is also stored in RC
// 2. send a sctp_association req
LOG_I
(
F1AP
,
"DU Task Received F1AP_SETUP_REQ
\n
"
);
f1ap_setup_req_t
*
msgSetup
=&
F1AP_SETUP_REQ
(
msg
);
f1ap_setup_req_t
*
msgSetup
=&
F1AP_SETUP_REQ
(
msg
);
createF1inst
(
false
,
myInstance
,
msgSetup
);
getCxt
(
DUtype
,
myInstance
)
->
gtpInst
=
du_create_gtpu_instance_to_cu
(
msgSetup
->
CU_f1_ip_address
.
ipv4_address
,
msgSetup
->
CUport
,
...
...
openair2/F1AP/f1ap_du_ue_context_management.c
View file @
f9bb4150
...
...
@@ -159,6 +159,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
OCTET_STRING_TO_INT32
(
&
ul_up_tnl0
->
gTP_TEID
,
drb_p
->
up_ul_tnl
[
0
].
teid
);
// 3GPP assumes GTP-U is on port 2152, but OAI is configurable
drb_p
->
up_ul_tnl
[
0
].
port
=
getCxt
(
false
,
instance
)
->
setupReq
.
CUport
;
switch
(
drbs_tobesetup_item_p
->
rLCMode
)
{
case
F1AP_RLCMode_rlc_am
:
drb_p
->
rlc_mode
=
RLC_MODE_AM
;
...
...
@@ -168,6 +169,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
drb_p
->
rlc_mode
=
RLC_MODE_TM
;
break
;
}
if
(
!
(
RC
.
nrrrc
&&
RC
.
nrrrc
[
instance
]
->
node_type
==
ngran_gNB_DU
))
{
transport_layer_addr_t
addr
;
memcpy
(
addr
.
buffer
,
&
drb_p
->
up_ul_tnl
[
0
].
tl_address
,
sizeof
(
drb_p
->
up_ul_tnl
[
0
].
tl_address
));
...
...
@@ -239,6 +241,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
else
// in 4G, race conditon is to fix
DU_send_UE_CONTEXT_SETUP_RESPONSE
(
instance
,
f1ap_ue_context_setup_req
);
return
0
;
}
...
...
@@ -269,7 +272,6 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
ie2
->
criticality
=
F1AP_Criticality_reject
;
ie2
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID
;
ie2
->
value
.
choice
.
GNB_DU_UE_F1AP_ID
=
f1ap_get_du_ue_f1ap_id
(
DUtype
,
instance
,
req
->
rnti
);
/* mandatory */
/* c3. DUtoCURRCInformation */
//if (0) {
...
...
@@ -337,6 +339,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
ie7
->
id
=
F1AP_ProtocolIE_ID_id_DRBs_Setup_List
;
ie7
->
criticality
=
F1AP_Criticality_ignore
;
ie7
->
value
.
present
=
F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List
;
for
(
int
i
=
0
;
i
<
req
->
drbs_to_be_setup_length
;
i
++
)
{
//
asn1cSequenceAdd
(
ie7
->
value
.
choice
.
DRBs_Setup_List
.
list
,
...
...
@@ -375,7 +378,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* mandatory */
/* c8. SRBs_FailedToBeSetup_List */
if
(
0
){
if
(
0
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie8
);
ie8
->
id
=
F1AP_ProtocolIE_ID_id_SRBs_FailedToBeSetup_List
;
ie8
->
criticality
=
F1AP_Criticality_ignore
;
...
...
@@ -424,7 +427,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
/* */
/* c9. DRBs_FailedToBeSetup_List */
if
(
0
){
if
(
0
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie9
);
ie9
->
id
=
F1AP_ProtocolIE_ID_id_DRBs_FailedToBeSetup_List
;
ie9
->
criticality
=
F1AP_Criticality_ignore
;
...
...
@@ -473,7 +476,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
// /* */
/* c10. SCell_FailedtoSetup_List */
if
(
0
){
if
(
0
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_UEContextSetupResponseIEs_t
,
ie10
);
ie10
->
id
=
F1AP_ProtocolIE_ID_id_SCell_FailedtoSetup_List
;
ie10
->
criticality
=
F1AP_Criticality_ignore
;
...
...
@@ -679,7 +682,6 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
AssertFatal
(
ctxt
.
rnti
==
rnti
,
"RNTI obtained through DU ID (%x) is different from CU ID (%x)
\n
"
,
rnti
,
ctxt
.
rnti
);
int
UE_out_of_sync
=
0
;
if
(
RC
.
nrrrc
&&
RC
.
nrrrc
[
instance
]
->
node_type
==
ngran_gNB_DU
)
{
...
...
@@ -753,9 +755,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
DU_send_UE_CONTEXT_RELEASE_COMPLETE
(
instance
,
&
cplt
);
return
0
;
}
else
{
struct
rrc_eNB_ue_context_s
*
ue_context_p
;
ue_context_p
=
rrc_eNB_get_ue_context
(
RC
.
rrc
[
ctxt
.
instance
],
ctxt
.
rnti
);
if
(
ue_context_p
&&
!
UE_out_of_sync
)
{
...
...
openair2/F1AP/f1ap_encoder.c
View file @
f9bb4150
...
...
@@ -50,10 +50,12 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length) {
char
errbuf
[
128
];
/* Buffer for error message */
size_t
errlen
=
sizeof
(
errbuf
);
/* Size of the buffer */
int
ret
=
asn_check_constraints
(
&
asn_DEF_F1AP_F1AP_PDU
,
pdu
,
errbuf
,
&
errlen
);
/* assert(errlen < sizeof(errbuf)); // Guaranteed: you may rely on that */
if
(
ret
)
{
fprintf
(
stderr
,
"Constraint validation failed: %s
\n
"
,
errbuf
);
}
encoded
=
aper_encode_to_new_buffer
(
&
asn_DEF_F1AP_F1AP_PDU
,
0
,
pdu
,
(
void
**
)
buffer
);
if
(
encoded
<
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