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
canghaiwuhen
OpenXG-RAN
Commits
ac3db89e
Commit
ac3db89e
authored
Sep 11, 2018
by
Bing-Kai Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the dummy value in DU, and store the payload data in DU
parent
7732b49a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
149 additions
and
336 deletions
+149
-336
openair2/COMMON/f1ap_messages_types.h
openair2/COMMON/f1ap_messages_types.h
+14
-8
openair2/ENB_APP/enb_config.c
openair2/ENB_APP/enb_config.c
+4
-3
openair2/F1AP/f1ap_cu.c
openair2/F1AP/f1ap_cu.c
+16
-1
openair2/F1AP/f1ap_cu_defs.h
openair2/F1AP/f1ap_cu_defs.h
+0
-36
openair2/F1AP/f1ap_du.c
openair2/F1AP/f1ap_du.c
+114
-214
openair2/F1AP/f1ap_du.h
openair2/F1AP/f1ap_du.h
+0
-37
openair2/F1AP/f1ap_du_defs.h
openair2/F1AP/f1ap_du_defs.h
+0
-36
openair2/F1AP/f1ap_encoder.c
openair2/F1AP/f1ap_encoder.c
+1
-1
No files found.
openair2/COMMON/f1ap_messages_types.h
View file @
ac3db89e
...
...
@@ -66,6 +66,12 @@ typedef struct f1ap_setup_req_s {
// Midhaul networking parameters
/* Connexion id used between SCTP/F1AP */
uint16_t
cnx_id
;
/* SCTP association id */
int32_t
assoc_id
;
/* The eNB IP address to bind */
f1ap_net_ip_address_t
CU_f1_ip_address
;
f1ap_net_ip_address_t
DU_f1_ip_address
;
...
...
@@ -91,20 +97,20 @@ typedef struct f1ap_setup_req_s {
/* Mobile Country Codes
* Mobile Network Codes
*/
uint16_t
mcc
[
F1AP_MAX_NB_CELLS
];
uint16_t
mnc
[
F1AP_MAX_NB_CELLS
];
uint8_t
mnc_digit_length
[
F1AP_MAX_NB_CELLS
];
uint16_t
mcc
[
F1AP_MAX_NB_CELLS
];
//[6];
uint16_t
mnc
[
F1AP_MAX_NB_CELLS
];
//[6];
uint8_t
mnc_digit_length
[
F1AP_MAX_NB_CELLS
];
//[6];
// NR Physical Cell Ids
uint16_t
nr_pci
[
F1AP_MAX_NB_CELLS
];
// NR Cell Ids
uint8_t
nr_cellid
[
F1AP_MAX_NB_CELLS
];
// Number of slide support items (max 16, could be increased to as much as 1024)
uint16_t
num_ssi
[
F1AP_MAX_NB_CELLS
];
uint8_t
sst
[
F1AP_MAX_NB_CELLS
]
[
1
6
];
uint8_t
sd
[
F1AP_MAX_NB_CELLS
]
[
1
6
];
//
tdd_flag = 0 means FDD, 1
means TDD
int
t
dd_flag
;
uint16_t
num_ssi
[
F1AP_MAX_NB_CELLS
];
//[6];
uint8_t
sst
[
F1AP_MAX_NB_CELLS
]
;
//[16][
6];
uint8_t
sd
[
F1AP_MAX_NB_CELLS
]
;
//[16][
6];
//
fdd_flag = 1 means FDD, 0
means TDD
int
f
dd_flag
;
union
{
struct
{
...
...
openair2/ENB_APP/enb_config.c
View file @
ac3db89e
...
...
@@ -2432,10 +2432,12 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
F1AP_SETUP_REQ
(
msg_p
).
nr_pci
[
k
]
=
rrc
->
carrier
[
0
].
physCellId
;
F1AP_SETUP_REQ
(
msg_p
).
nr_cellid
[
k
]
=
0
;
F1AP_SETUP_REQ
(
msg_p
).
num_ssi
[
k
]
=
0
;
if
(
rrc
->
carrier
[
0
].
sib1
->
tdd_Config
)
{
LOG_I
(
ENB_APP
,
"ngran_DU: Configuring Cell %d for TDD
\n
"
,
k
);
F1AP_SETUP_REQ
(
msg_p
).
tdd_flag
=
1
;
F1AP_SETUP_REQ
(
msg_p
).
fdd_flag
=
0
;
F1AP_SETUP_REQ
(
msg_p
).
nr_mode_info
[
k
].
tdd
.
nr_arfcn
=
freq_to_arfcn10
(
rrc
->
carrier
[
0
].
sib1
->
freqBandIndicator
,
rrc
->
carrier
[
0
].
dl_CarrierFreq
);
// For LTE use scs field to carry prefix type and number of antennas
...
...
@@ -2449,8 +2451,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
}
else
{
LOG_I
(
ENB_APP
,
"ngran_DU: Configuring Cell %d for FDD
\n
"
,
k
);
F1AP_SETUP_REQ
(
msg_p
).
tdd_flag
=
0
;
F1AP_SETUP_REQ
(
msg_p
).
fdd_flag
=
1
;
F1AP_SETUP_REQ
(
msg_p
).
nr_mode_info
[
k
].
fdd
.
dl_nr_arfcn
=
freq_to_arfcn10
(
rrc
->
carrier
[
0
].
sib1
->
freqBandIndicator
,
rrc
->
carrier
[
0
].
dl_CarrierFreq
);
F1AP_SETUP_REQ
(
msg_p
).
nr_mode_info
[
k
].
fdd
.
ul_nr_arfcn
=
F1AP_SETUP_REQ
(
msg_p
).
nr_mode_info
[
k
].
fdd
.
dl_nr_arfcn
;
...
...
openair2/F1AP/f1ap_cu.c
View file @
ac3db89e
...
...
@@ -49,6 +49,8 @@
#include "common/ran_context.h"
extern
RAN_CONTEXT_t
RC
;
static
f1ap_setup_resp_t
*
f1ap_cu_data
;
/* This structure describes association of a DU to a CU */
typedef
struct
f1ap_info
{
...
...
@@ -166,6 +168,14 @@ void *F1AP_CU_task(void *arg) {
CU_handle_sctp_data_ind
(
&
received_msg
->
ittiMsg
.
sctp_data_ind
);
break
;
// case F1AP_SETUP_RESPONSE: // This is from RRC
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
// break;
// case F1AP_SETUP_FAILURE: // This is from RRC
// CU_send_F1_SETUP_FAILURE(instance, *f1ap_setup_ind, &(F1AP_SETUP_FAILURE) f1ap_setup_failure)
// break;
case
TERMINATE_MESSAGE
:
LOG_W
(
CU_F1AP
,
" *** Exiting CU_F1AP thread
\n
"
);
itti_exit_task
();
...
...
@@ -211,6 +221,11 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) {
/* handle */
// fill f1ap_setup_req_t
// send ITTI F1AP_SETUP_REQ to RRC
// return
// send successful callback
//CU_send_F1_SETUP_RESPONSE();
// or failure callback
...
...
@@ -218,7 +233,7 @@ void CU_handle_F1_SETUP_REQUEST(F1AP_F1SetupRequest_t *message_p) {
}
void
CU_send_F1_SETUP_RESPONSE
(
instance_t
instance
,
sctp_new_association_ind_t
*
f1ap_setup_ind
)
{
void
CU_send_F1_SETUP_RESPONSE
(
instance_t
instance
,
sctp_new_association_ind_t
*
f1ap_setup_ind
,
f1ap_setup_resp_t
*
f1ap_setup_resp
)
{
//void CU_send_F1_SETUP_RESPONSE(F1AP_F1SetupResponse_t *F1SetupResponse) {
//AssertFatal(1==0,"Not implemented yet\n");
...
...
openair2/F1AP/f1ap_cu_defs.h
View file @
ac3db89e
...
...
@@ -19,45 +19,9 @@
* contact@openairinterface.org
*/
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef CU_F1AP_DEFS_H_
#define CU_F1AP_DEFS_H_
struct
cu_f1ap_instance_s
;
typedef
struct
du_f1ap_instance_s
{
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t
instance
;
// F1_Setup_Req payload
uint32_t
gNB_CU_id
;
char
*
gNB_CU_name
;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t
eNB_id
;
/* Tracking area code */
uint16_t
tac
;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t
mcc
;
uint16_t
mnc
;
uint8_t
mnc_digit_length
;
}
cu_f1ap_instance_t
;
#endif
/* CU_F1AP_DEFS_H_ */
openair2/F1AP/f1ap_du.c
View file @
ac3db89e
...
...
@@ -43,40 +43,9 @@
#include "T.h"
/* This structure describes association of a DU to a CU */
typedef
struct
f1ap_info
{
static
f1ap_setup_req_t
*
f1ap_du_data
;
module_id_t
enb_mod_idP
;
module_id_t
cu_mod_idP
;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t
GNB_DU_ID
;
/* This is the optional name provided by the MME */
char
*
GNB_DU_Name
;
f1ap_net_ip_address_t
mme_net_ip_address
;
// useful for joining assoc_id and ip address of packets
/* Number of input/ouput streams */
uint16_t
in_streams
;
uint16_t
out_streams
;
/* Connexion id used between SCTP/S1AP */
uint16_t
cnx_id
;
/* SCTP association id */
int32_t
assoc_id
;
uint16_t
mcc
;
uint16_t
mnc
;
uint8_t
mnc_digit_length
;
}
f1ap_info_t
;
void
DU_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
);
void
DU_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
);
uint8_t
F1AP_get_UE_identifier
(
module_id_t
enb_mod_idP
,
int
CC_idP
,
int
UE_id
)
{
...
...
@@ -104,7 +73,6 @@ void DU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
void
*
F1AP_DU_task
(
void
*
arg
)
{
//sctp_cu_init();
MessageDef
*
received_msg
=
NULL
;
int
result
;
...
...
@@ -141,7 +109,7 @@ void *F1AP_DU_task(void *arg) {
LOG_I
(
DU_F1AP
,
"SCTP_NEW_ASSOCIATION_RESP
\n
"
);
LOG_I
(
DU_F1AP
,
"--------------1--------------
\n
"
);
DU_handle_sctp_association_resp
(
ITTI_MESSAGE_GET_INSTANCE
(
received_msg
),
&
received_msg
->
ittiMsg
.
sctp_new_association_resp
);
&
received_msg
->
ittiMsg
.
sctp_new_association_resp
);
break
;
case
SCTP_DATA_IND
:
...
...
@@ -172,81 +140,62 @@ void *F1AP_DU_task(void *arg) {
// ==============================================================================
static
void
du_f1ap_register
(
du_f1ap_instance_t
*
instance_p
,
f1ap_net_ip_address_t
*
remote_address
,
// CU
f1ap_net_ip_address_t
*
local_address
,
// DU
uint16_t
in_streams
,
uint16_t
out_streams
)
{
void
DU_send_sctp_association_req
(
instance_t
instance
,
f1ap_setup_req_t
*
f1ap_setup_req
)
{
DevAssert
(
f1ap_setup_req
!=
NULL
);
MessageDef
*
message_p
=
NULL
;
sctp_new_association_req_t
*
sctp_new_association_req_p
=
NULL
;
message_p
=
itti_alloc_new_message
(
TASK_DU_F1
,
SCTP_NEW_ASSOCIATION_REQ
);
sctp_new_association_req_p
=
&
message_p
->
ittiMsg
.
sctp_new_association_req
;
sctp_new_association_req_p
->
ulp_cnx_id
=
instance
_p
->
instance
;
sctp_new_association_req_p
->
ulp_cnx_id
=
instance
;
sctp_new_association_req_p
->
port
=
F1AP_PORT_NUMBER
;
sctp_new_association_req_p
->
ppid
=
F1AP_SCTP_PPID
;
sctp_new_association_req_p
->
in_streams
=
in_streams
;
sctp_new_association_req_p
->
out_streams
=
out_streams
;
sctp_new_association_req_p
->
in_streams
=
f1ap_setup_req
->
sctp_
in_streams
;
sctp_new_association_req_p
->
out_streams
=
f1ap_setup_req
->
sctp_
out_streams
;
// remote
memcpy
(
&
sctp_new_association_req_p
->
remote_address
,
remote
_address
,
sizeof
(
*
remote
_address
));
&
f1ap_setup_req
->
CU_f1_ip
_address
,
sizeof
(
f1ap_setup_req
->
CU_f1_ip
_address
));
// local
memcpy
(
&
sctp_new_association_req_p
->
local_address
,
local_address
,
sizeof
(
*
local_address
));
&
f1ap_setup_req
->
DU_f1_ip_address
,
sizeof
(
f1ap_setup_req
->
DU_f1_ip_address
));
// store data
f1ap_du_data
=
(
f1ap_setup_req_t
*
)
calloc
(
1
,
sizeof
(
f1ap_setup_req_t
));
*
f1ap_du_data
=
*
f1ap_setup_req
;
itti_send_msg_to_task
(
TASK_SCTP
,
instance_p
->
instance
,
message_p
);
//du_f1ap_register_to_sctp
itti_send_msg_to_task
(
TASK_SCTP
,
instance
,
message_p
);
}
void
DU_send_sctp_association_req
(
instance_t
instance
,
f1ap_setup_req_t
*
f1ap_setup_req
)
{
du_f1ap_instance_t
*
new_instance
;
//uint8_t index;
DevAssert
(
f1ap_setup_req
!=
NULL
);
void
DU_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
)
{
/* Look if the provided instance already exists */
//new_instance = s1ap_eNB_get_instance(instance);
// @Todo
// if (new_instance != NULL) {
// /* Checks if it is a retry on the same eNB */
// DevCheck(new_instance->gNB_DU_id == f1ap_setup_req->gNB_DU_id, new_instance->gNB_DU_id, f1ap_setup_req->gNB_DU_id, 0);
// DevCheck(new_instance->cell_type == f1ap_setup_req->cell_type, new_instance->cell_type, f1ap_setup_req->cell_type, 0);
// DevCheck(new_instance->tac == f1ap_setup_req->tac, new_instance->tac, f1ap_setup_req->tac, 0);
// DevCheck(new_instance->mcc == f1ap_setup_req->mcc, new_instance->mcc, f1ap_setup_req->mcc, 0);
// DevCheck(new_instance->mnc == f1ap_setup_req->mnc, new_instance->mnc, f1ap_setup_req->mnc, 0);
// DevCheck(new_instance->mnc_digit_length == f1ap_setup_req->mnc_digit_length, new_instance->mnc_digit_length, f1ap_setup_req->mnc_digit_length, 0);
// DevCheck(new_instance->default_drx == f1ap_setup_req->default_drx, new_instance->default_drx, f1ap_setup_req->default_drx, 0);
// } else {
new_instance
=
calloc
(
1
,
sizeof
(
du_f1ap_instance_t
));
DevAssert
(
new_instance
!=
NULL
);
/* Copy usefull parameters */
new_instance
->
instance
=
instance
;
new_instance
->
gNB_DU_id
=
f1ap_setup_req
->
gNB_DU_id
;
new_instance
->
gNB_DU_name
=
f1ap_setup_req
->
gNB_DU_name
;
new_instance
->
tac
=
f1ap_setup_req
->
tac
[
0
];
new_instance
->
mcc
=
f1ap_setup_req
->
mcc
[
0
];
new_instance
->
mnc
=
f1ap_setup_req
->
mnc
[
0
];
new_instance
->
mnc_digit_length
=
f1ap_setup_req
->
mnc_digit_length
;
//}
du_f1ap_register
(
new_instance
,
&
f1ap_setup_req
->
CU_f1_ip_address
,
// remote
&
f1ap_setup_req
->
DU_f1_ip_address
,
// local
f1ap_setup_req
->
sctp_in_streams
,
f1ap_setup_req
->
sctp_out_streams
);
DevAssert
(
sctp_new_association_resp
!=
NULL
);
}
if
(
sctp_new_association_resp
->
sctp_state
!=
SCTP_STATE_ESTABLISHED
)
{
LOG_W
(
F1AP
,
"Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u
\n
"
,
sctp_new_association_resp
->
sctp_state
,
instance
,
sctp_new_association_resp
->
ulp_cnx_id
);
void
DU_handle_sctp_association_resp
(
instance_t
instance
,
sctp_new_association_resp_t
*
sctp_new_association_resp
)
{
DU_send_F1_SETUP_REQUEST
(
instance
,
sctp_new_association_resp
);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return
;
// exit -1 for debugging
}
// save the assoc id
f1ap_du_data
->
assoc_id
=
sctp_new_association_resp
->
assoc_id
;
f1ap_du_data
->
sctp_in_streams
=
sctp_new_association_resp
->
in_streams
;
f1ap_du_data
->
sctp_out_streams
=
sctp_new_association_resp
->
out_streams
;
DU_send_F1_SETUP_REQUEST
(
instance
);
}
...
...
@@ -254,8 +203,7 @@ void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_r
// SETUP REQUEST
//void DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *f1ap_setup_req) {
void
DU_send_F1_SETUP_REQUEST
(
instance_t
instance
,
sctp_new_association_resp_t
*
f1ap_setup_req
)
{
void
DU_send_F1_SETUP_REQUEST
(
instance_t
instance
)
{
module_id_t
enb_mod_idP
;
module_id_t
du_mod_idP
;
...
...
@@ -266,14 +214,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
uint8_t
*
buffer
;
uint32_t
len
;
int
i
=
0
;
// for test
f1ap_info_t
f1ap_info
;
f1ap_info
.
GNB_DU_ID
=
789
;
f1ap_info
.
GNB_DU_Name
=
"ABC"
;
f1ap_info
.
mcc
=
208
;
f1ap_info
.
mnc
=
93
;
f1ap_info
.
mnc_digit_length
=
3
;
int
j
=
0
;
/* Create */
/* 0. pdu Type */
...
...
@@ -300,18 +241,18 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ie
->
id
=
F1AP_ProtocolIE_ID_id_gNB_DU_ID
;
ie
->
criticality
=
F1AP_Criticality_reject
;
ie
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID
;
asn_int642INTEGER
(
&
ie
->
value
.
choice
.
GNB_DU_ID
,
f1ap_
info
.
GNB_DU_ID
);
asn_int642INTEGER
(
&
ie
->
value
.
choice
.
GNB_DU_ID
,
f1ap_
du_data
->
gNB_DU_id
);
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
/* optional */
/* c3. GNB_DU_Name */
if
(
f1ap_
info
.
GNB_DU_N
ame
!=
NULL
)
{
if
(
f1ap_
du_data
->
gNB_DU_n
ame
!=
NULL
)
{
ie
=
(
F1AP_F1SetupRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
F1AP_F1SetupRequestIEs_t
));
ie
->
id
=
F1AP_ProtocolIE_ID_id_gNB_DU_Name
;
ie
->
criticality
=
F1AP_Criticality_ignore
;
ie
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Name
;
OCTET_STRING_fromBuf
(
&
ie
->
value
.
choice
.
GNB_DU_Name
,
f1ap_
info
.
GNB_DU_N
ame
,
strlen
(
f1ap_
info
.
GNB_DU_N
ame
));
OCTET_STRING_fromBuf
(
&
ie
->
value
.
choice
.
GNB_DU_Name
,
f1ap_
du_data
->
gNB_DU_n
ame
,
strlen
(
f1ap_
du_data
->
gNB_DU_n
ame
));
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
}
...
...
@@ -322,8 +263,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ie
->
criticality
=
F1AP_Criticality_reject
;
ie
->
value
.
present
=
F1AP_F1SetupRequestIEs__value_PR_GNB_DU_Served_Cells_List
;
int
num_cells_available
=
f1ap_du_data
->
num_cells_available
;
printf
(
"num_cells_available = %d
\n
"
,
num_cells_available
);
for
(
i
=
0
;
i
<
1
;
i
<
num_cells_available
;
i
++
)
{
/* mandatory */
/* 4.1 serverd cells item */
...
...
@@ -344,30 +287,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
memset
((
void
*
)
&
served_cell_information
,
0
,
sizeof
(
F1AP_Served_Cell_Information_t
));
/* - nRCGI */
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
nRCGI
.
pLMN_Identity
);
//INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
nRCGI
.
nRCellIdentity
.
buf
=
malloc
((
36
+
7
)
/
8
);
nRCGI
.
nRCellIdentity
.
size
=
(
36
+
7
)
/
8
;
nRCGI
.
nRCellIdentity
.
bits_unused
=
4
;
nRCGI
.
nRCellIdentity
.
buf
[
0
]
=
123
;
//nRCGI.nRCellIdentity = 15;
MCC_MNC_TO_PLMNID
(
f1ap_du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
],
&
nRCGI
.
pLMN_Identity
);
//MCC_MNC_TO_PLMNID(208, 95, 2, &nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING
(
f1ap_du_data
->
nr_cellid
[
i
],
&
nRCGI
.
nRCellIdentity
);
served_cell_information
.
nRCGI
=
nRCGI
;
/* - nRPCI */
served_cell_information
.
nRPCI
=
321
;
// int 0..1007
served_cell_information
.
nRPCI
=
f1ap_du_data
->
nr_pci
[
i
]
;
// int 0..1007
/* - fiveGS_TAC */
OCTET_STRING_fromBuf
(
&
served_cell_information
.
fiveGS_TAC
,
"10"
,
3
);
f1ap_du_data
->
tac
[
i
],
sizeof
(
f1ap_du_data
->
tac
[
i
]));
// OCTET_STRING_fromBuf(&served_cell_information.fiveGS_TAC,
// "10",
// 3);
/* - Configured_EPS_TAC */
if
(
1
){
if
(
0
){
served_cell_information
.
configured_EPS_TAC
=
(
F1AP_Configured_EPS_TAC_t
*
)
calloc
(
1
,
sizeof
(
F1AP_Configured_EPS_TAC_t
));
OCTET_STRING_fromBuf
(
served_cell_information
.
configured_EPS_TAC
,
"2"
,
...
...
@@ -375,30 +313,33 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
}
/* - broadcast PLMNs */
int
maxnoofBPLMNS
=
1
;
for
(
i
=
0
;
i
<
maxnoofBPLMNS
;
i
++
)
{
// RK: add the num_available_broadcast_PLMNs to the message
int
num_available_broadcast_PLMNs
=
1
;
//f1ap_du_data->num_available_broadcast_PLMNs;
printf
(
"num_available_broadcast_PLMNs = %d
\n
"
,
num_available_broadcast_PLMNs
);
for
(
j
=
0
;
j
<
num_available_broadcast_PLMNs
;
// num_available_broadcast_PLMNs
j
++
)
{
/* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t
*
broadcastPLMNs_Item
=
(
F1AP_BroadcastPLMNs_Item_t
*
)
calloc
(
1
,
sizeof
(
F1AP_BroadcastPLMNs_Item_t
));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID
(
f1ap_info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
broadcastPLMNs_Item
->
pLMN_Identity
);
//MCC_MNC_TO_PLMNID(208, 95, 2, &broadcastPLMNs_Item->pLMN_Identity);
MCC_MNC_TO_PLMNID
(
f1ap_du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
],
&
broadcastPLMNs_Item
->
pLMN_Identity
);
ASN_SEQUENCE_ADD
(
&
served_cell_information
.
servedPLMNs
.
list
,
broadcastPLMNs_Item
);
}
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t
nR_Mode_Info
;
if
(
"FDD"
)
{
//f1ap_du_data->fdd_flag = 1;
if
(
f1ap_du_data
->
fdd_flag
)
{
// FDD
nR_Mode_Info
.
present
=
F1AP_NR_Mode_Info_PR_fDD
;
/* > FDD >> FDD Info */
F1AP_FDD_Info_t
*
fDD_Info
=
(
F1AP_FDD_Info_t
*
)
calloc
(
1
,
sizeof
(
F1AP_FDD_Info_t
));
/* >>> UL NRFreqInfo */
fDD_Info
->
uL_NRFreqInfo
.
nRARFCN
=
999L
;
fDD_Info
->
uL_NRFreqInfo
.
nRARFCN
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
ul_nr_arfcn
;
F1AP_FreqBandNrItem_t
ul_freqBandNrItem
;
memset
((
void
*
)
&
ul_freqBandNrItem
,
0
,
sizeof
(
F1AP_FreqBandNrItem_t
));
ul_freqBandNrItem
.
freqBandIndicatorNr
=
888
L
;
ul_freqBandNrItem
.
freqBandIndicatorNr
=
777
L
;
F1AP_SupportedSULFreqBandItem_t
ul_supportedSULFreqBandItem
;
memset
((
void
*
)
&
ul_supportedSULFreqBandItem
,
0
,
sizeof
(
F1AP_SupportedSULFreqBandItem_t
));
...
...
@@ -408,25 +349,25 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ASN_SEQUENCE_ADD
(
&
fDD_Info
->
uL_NRFreqInfo
.
freqBandListNr
.
list
,
&
ul_freqBandNrItem
);
/* >>> DL NRFreqInfo */
fDD_Info
->
dL_NRFreqInfo
.
nRARFCN
=
666L
;
fDD_Info
->
dL_NRFreqInfo
.
nRARFCN
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
dl_nr_arfcn
;
F1AP_FreqBandNrItem_t
dl_freqBandNrItem
;
memset
((
void
*
)
&
dl_freqBandNrItem
,
0
,
sizeof
(
F1AP_FreqBandNrItem_t
));
dl_freqBandNrItem
.
freqBandIndicatorNr
=
555
L
;
dl_freqBandNrItem
.
freqBandIndicatorNr
=
777
L
;
F1AP_SupportedSULFreqBandItem_t
dl_supportedSULFreqBandItem
;
memset
((
void
*
)
&
dl_supportedSULFreqBandItem
,
0
,
sizeof
(
F1AP_SupportedSULFreqBandItem_t
));
dl_supportedSULFreqBandItem
.
freqBandIndicatorNr
=
444
L
;
dl_supportedSULFreqBandItem
.
freqBandIndicatorNr
=
777
L
;
ASN_SEQUENCE_ADD
(
&
dl_freqBandNrItem
.
supportedSULBandList
.
list
,
&
dl_supportedSULFreqBandItem
);
ASN_SEQUENCE_ADD
(
&
fDD_Info
->
dL_NRFreqInfo
.
freqBandListNr
.
list
,
&
dl_freqBandNrItem
);
/* >>> UL Transmission Bandwidth */
fDD_Info
->
uL_Transmission_Bandwidth
.
nRSCS
=
F1AP_NRSCS_scs15
;
fDD_Info
->
uL_Transmission_Bandwidth
.
nRNRB
=
F1AP_NRNRB_nrb11
;
fDD_Info
->
uL_Transmission_Bandwidth
.
nRSCS
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
ul_scs
;
fDD_Info
->
uL_Transmission_Bandwidth
.
nRNRB
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
ul_nrb
;
/* >>> DL Transmission Bandwidth */
fDD_Info
->
dL_Transmission_Bandwidth
.
nRSCS
=
F1AP_NRSCS_scs15
;
fDD_Info
->
dL_Transmission_Bandwidth
.
nRNRB
=
F1AP_NRNRB_nrb11
;
fDD_Info
->
dL_Transmission_Bandwidth
.
nRSCS
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
dl_scs
;
fDD_Info
->
dL_Transmission_Bandwidth
.
nRNRB
=
f1ap_du_data
->
nr_mode_info
[
i
].
fdd
.
dl_nrb
;
nR_Mode_Info
.
choice
.
fDD
=
fDD_Info
;
}
else
{
// TDD
...
...
@@ -435,9 +376,10 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
/* > TDD >> TDD Info */
F1AP_TDD_Info_t
*
tDD_Info
=
(
F1AP_TDD_Info_t
*
)
calloc
(
1
,
sizeof
(
F1AP_TDD_Info_t
));
/* >>> ARFCN */
tDD_Info
->
nRFreqInfo
.
nRARFCN
=
999L
;
// Integer
tDD_Info
->
nRFreqInfo
.
nRARFCN
=
f1ap_du_data
->
nr_mode_info
[
i
].
tdd
.
nr_arfcn
;
// Integer
F1AP_FreqBandNrItem_t
nr_freqBandNrItem
;
memset
((
void
*
)
&
nr_freqBandNrItem
,
0
,
sizeof
(
F1AP_FreqBandNrItem_t
));
// RK: missing params
nr_freqBandNrItem
.
freqBandIndicatorNr
=
555L
;
F1AP_SupportedSULFreqBandItem_t
nr_supportedSULFreqBandItem
;
...
...
@@ -447,8 +389,8 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
ASN_SEQUENCE_ADD
(
&
tDD_Info
->
nRFreqInfo
.
freqBandListNr
.
list
,
&
nr_freqBandNrItem
);
tDD_Info
->
transmission_Bandwidth
.
nRSCS
=
F1AP_NRSCS_scs15
;
tDD_Info
->
transmission_Bandwidth
.
nRNRB
=
F1AP_NRNRB_nrb11
;
tDD_Info
->
transmission_Bandwidth
.
nRSCS
=
f1ap_du_data
->
nr_mode_info
[
i
].
tdd
.
scs
;
tDD_Info
->
transmission_Bandwidth
.
nRNRB
=
f1ap_du_data
->
nr_mode_info
[
i
].
tdd
.
nrb
;
nR_Mode_Info
.
choice
.
tDD
=
tDD_Info
;
}
...
...
@@ -467,12 +409,20 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
F1AP_GNB_DU_System_Information_t
*
gNB_DU_System_Information
=
(
F1AP_GNB_DU_System_Information_t
*
)
calloc
(
1
,
sizeof
(
F1AP_GNB_DU_System_Information_t
));
OCTET_STRING_fromBuf
(
&
gNB_DU_System_Information
->
mIB_message
,
// sept. 2018
"1"
,
//f1ap_setup_req
->mib,
sizeof
(
"1"
)
);
f1ap_du_data
->
mib
[
i
],
//f1ap_du_data
->mib,
f1ap_du_data
->
mib_length
[
i
]
);
OCTET_STRING_fromBuf
(
&
gNB_DU_System_Information
->
sIB1_message
,
// sept. 2018
"1"
,
sizeof
(
"1"
));
f1ap_du_data
->
sib1
[
i
],
f1ap_du_data
->
sib1_length
[
i
]);
// OCTET_STRING_fromBuf(&gNB_DU_System_Information->mIB_message, // sept. 2018
// "1",//f1ap_setup_req->mib,
// sizeof("1"));
// OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
// "1",
// sizeof("1"));
gnb_du_served_cells_item
.
gNB_DU_System_Information
=
gNB_DU_System_Information
;
//
/* ADD */
...
...
@@ -489,7 +439,7 @@ void DU_send_F1_SETUP_REQUEST(instance_t instance, sctp_new_association_resp_t *
printf
(
"Failed to encode F1 setup request
\n
"
);
}
du_f1ap_itti_send_sctp_data_req
(
instance
,
f1ap_
setup_req
->
assoc_id
,
buffer
,
len
,
0
);
du_f1ap_itti_send_sctp_data_req
(
instance
,
f1ap_
du_data
->
assoc_id
,
buffer
,
len
,
0
);
}
...
...
@@ -510,27 +460,16 @@ void DU_handle_F1_SETUP_RESPONSE() {
// SETUP FAILURE
void
DU_handle_F1_SETUP_FAILURE
(
struct
F1AP_F1AP_PDU_t
*
pdu_p
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
//F1AP_F1SetupFailureIEs_t *f1_setup_failure_p;
//f1_setup_failure_p = &pdu_p.choice.unsuccessfulOutcome.value.choice.F1SetupFailureIEs.protocolIEs;
}
void
DU_send_ERROR_INDICATION
(
struct
F1AP_F1AP_PDU_t
*
pdu_p
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
//F1AP_F1ErrorIndicationIEs_t *f1_error_indication_p;
//f1_error_indication_p = &pdu_p.choice.successfulOutcome.value.choice.F1ErrorIndicationIEs.protocolIEs;
}
void
DU_handle_ERROR_INDICATION
(
F1AP_ErrorIndication_t
*
ErrorIndication
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
void
DU_handle_RESET
(
F1AP_Reset_t
*
Reset
)
{
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
...
...
@@ -547,8 +486,6 @@ void DU_handle_RESET_ACKKNOWLEDGE(F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal
(
1
==
0
,
"Not implemented yet
\n
"
);
}
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(F1AP_ULRRCMessageTransfer_t *ULRRCMessageTransfer) {
//void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER() {
void
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER
(
module_id_t
module_idP
,
int
CC_idP
,
...
...
@@ -565,14 +502,6 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
uint8_t
*
buffer
;
uint32_t
len
;
// for test
f1ap_info_t
f1ap_info
;
f1ap_info
.
GNB_DU_ID
=
789
;
f1ap_info
.
GNB_DU_Name
=
"ABC"
;
f1ap_info
.
mcc
=
208
;
f1ap_info
.
mnc
=
93
;
f1ap_info
.
mnc_digit_length
=
3
;
/* Create */
/* 0. Message Type */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
...
...
@@ -601,7 +530,7 @@ void DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(
ie
->
value
.
present
=
F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI
;
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
0
],
f1ap_du_data
->
mnc
[
0
],
f1ap_du_data
->
mnc_digit_length
[
0
]
,
&
nRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
nRCGI
.
nRCellIdentity
);
ie
->
value
.
choice
.
NRCGI
=
nRCGI
;
...
...
@@ -732,7 +661,7 @@ void DU_handle_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessage
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) {
void
DU_send_gNB_DU_CONFIGURATION_UPDATE
(
module_id_t
enb_mod_idP
,
module_id_t
du_mod_idP
)
{
void
DU_send_gNB_DU_CONFIGURATION_UPDATE
(
module_id_t
enb_mod_idP
,
module_id_t
du_mod_idP
,
f1ap_setup_req_t
*
f1ap_du_data
)
{
F1AP_F1AP_PDU_t
pdu
;
F1AP_GNBDUConfigurationUpdate_t
*
out
;
F1AP_GNBDUConfigurationUpdateIEs_t
*
ie
;
...
...
@@ -740,14 +669,8 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
uint8_t
*
buffer
;
uint32_t
len
;
int
i
=
0
;
int
j
=
0
;
// for test
f1ap_info_t
f1ap_info
;
f1ap_info
.
GNB_DU_ID
=
789
;
f1ap_info
.
GNB_DU_Name
=
"ABC"
;
f1ap_info
.
mcc
=
208
;
f1ap_info
.
mnc
=
93
;
f1ap_info
.
mnc_digit_length
=
3
;
/* Create */
/* 0. Message Type */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
...
...
@@ -775,9 +698,9 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
ie
->
criticality
=
F1AP_Criticality_reject
;
ie
->
value
.
present
=
F1AP_GNBDUConfigurationUpdateIEs__value_PR_Served_Cells_To_Add_List
;
for
(
i
=
0
;
i
<
1
;
i
++
)
{
for
(
j
=
0
;
j
<
1
;
j
++
)
{
//
F1AP_Served_Cells_To_Add_ItemIEs_t
*
served_cells_to_add_item_ies
;
served_cells_to_add_item_ies
=
(
F1AP_Served_Cells_To_Add_ItemIEs_t
*
)
calloc
(
1
,
sizeof
(
F1AP_Served_Cells_To_Add_ItemIEs_t
));
...
...
@@ -794,22 +717,12 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
memset
((
void
*
)
&
served_cell_information
,
0
,
sizeof
(
F1AP_Served_Cell_Information_t
));
/* - nRCGI */
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
nRCGI
.
pLMN_Identity
);
//INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
nRCGI
.
nRCellIdentity
.
buf
=
malloc
((
36
+
7
)
/
8
);
nRCGI
.
nRCellIdentity
.
size
=
(
36
+
7
)
/
8
;
nRCGI
.
nRCellIdentity
.
bits_unused
=
4
;
nRCGI
.
nRCellIdentity
.
buf
[
0
]
=
123
;
//nRCGI.nRCellIdentity = 15;
MCC_MNC_TO_PLMNID
(
f1ap_du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
],
&
nRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
nRCGI
.
nRCellIdentity
);
served_cell_information
.
nRCGI
=
nRCGI
;
/* - nRPCI */
served_cell_information
.
nRPCI
=
321
;
// int 0..1007
served_cell_information
.
nRPCI
=
321
L
;
// int 0..1007
/* - fiveGS_TAC */
OCTET_STRING_fromBuf
(
&
served_cell_information
.
fiveGS_TAC
,
...
...
@@ -832,7 +745,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t
*
broadcastPLMNs_Item
=
(
F1AP_BroadcastPLMNs_Item_t
*
)
calloc
(
1
,
sizeof
(
F1AP_BroadcastPLMNs_Item_t
));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
broadcastPLMNs_Item
->
pLMN_Identity
);
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
broadcastPLMNs_Item
->
pLMN_Identity
);
ASN_SEQUENCE_ADD
(
&
served_cell_information
.
servedPLMNs
.
list
,
broadcastPLMNs_Item
);
}
...
...
@@ -957,7 +870,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */
F1AP_NRCGI_t
oldNRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
oldNRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
oldNRCGI
.
nRCellIdentity
);
served_cells_to_modify_item
.
oldNRCGI
=
oldNRCGI
;
...
...
@@ -969,14 +882,13 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* - nRCGI */
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
nRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
nRCGI
.
nRCellIdentity
);
served_cell_information
.
nRCGI
=
nRCGI
;
/* - nRPCI */
served_cell_information
.
nRPCI
=
321
;
// int 0..1007
served_cell_information
.
nRPCI
=
321
L
;
// int 0..1007
/* - fiveGS_TAC */
OCTET_STRING_fromBuf
(
&
served_cell_information
.
fiveGS_TAC
,
...
...
@@ -999,7 +911,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* > PLMN BroadcastPLMNs Item */
F1AP_BroadcastPLMNs_Item_t
*
broadcastPLMNs_Item
=
(
F1AP_BroadcastPLMNs_Item_t
*
)
calloc
(
1
,
sizeof
(
F1AP_BroadcastPLMNs_Item_t
));
//memset((void *)&broadcastPLMNs_Item, 0, sizeof(F1AP_BroadcastPLMNs_Item_t));
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
broadcastPLMNs_Item
->
pLMN_Identity
);
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
broadcastPLMNs_Item
->
pLMN_Identity
);
ASN_SEQUENCE_ADD
(
&
served_cell_information
.
servedPLMNs
.
list
,
broadcastPLMNs_Item
);
}
...
...
@@ -1124,7 +1036,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */
F1AP_NRCGI_t
oldNRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
oldNRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
oldNRCGI
.
nRCellIdentity
);
served_cells_to_delete_item
.
oldNRCGI
=
oldNRCGI
;
...
...
@@ -1160,7 +1072,7 @@ void DU_send_gNB_DU_CONFIGURATION_UPDATE(module_id_t enb_mod_idP, module_id_t du
/* 3.1 oldNRCGI */
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
nRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
nRCGI
.
nRCellIdentity
);
active_cells_item
.
nRCGI
=
nRCGI
;
...
...
@@ -1224,12 +1136,6 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
uint32_t
len
;
int
i
=
0
;
f1ap_info_t
f1ap_info
;
f1ap_info
.
GNB_DU_Name
=
"ABC"
;
f1ap_info
.
mcc
=
208
;
f1ap_info
.
mnc
=
93
;
f1ap_info
.
mnc_digit_length
=
8
;
/* Create */
/* 0. Message Type */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
...
...
@@ -1435,7 +1341,7 @@ void DU_send_UE_CONTEXT_SETUP_RESPONSE(void) {
/* - nRCGI */
F1AP_NRCGI_t
nRCGI
;
// issue here
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
&
nRCGI
.
pLMN_Identity
);
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
nRCGI
.
pLMN_Identity
);
//
// INT32_TO_BIT_STRING(123, &nRCGI.nRCellIdentity);
// nRCGI.nRCellIdentity.buf = malloc((36+7)/8);
...
...
@@ -1529,12 +1435,6 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
uint32_t
len
;
int
i
=
0
;
f1ap_info_t
f1ap_info
;
f1ap_info
.
GNB_DU_Name
=
"ABC"
;
f1ap_info
.
mcc
=
208
;
f1ap_info
.
mnc
=
93
;
f1ap_info
.
mnc_digit_length
=
8
;
/* Create */
/* 0. Message Type */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
...
...
@@ -1797,7 +1697,7 @@ void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(void) {
/* - sCell_ID */
F1AP_NRCGI_t
nRCGI
;
MCC_MNC_TO_PLMNID
(
f1ap_
info
.
mcc
,
f1ap_info
.
mnc
,
f1ap_info
.
mnc_digit_length
,
MCC_MNC_TO_PLMNID
(
f1ap_
du_data
->
mcc
[
i
],
f1ap_du_data
->
mnc
[
i
],
f1ap_du_data
->
mnc_digit_length
[
i
]
,
&
nRCGI
.
pLMN_Identity
);
NR_CELL_ID_TO_BIT_STRING
(
123456
,
&
nRCGI
.
nRCellIdentity
);
...
...
openair2/F1AP/f1ap_du.h
View file @
ac3db89e
...
...
@@ -19,45 +19,8 @@
* contact@openairinterface.org
*/
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_
struct
du_f1ap_instance_s
;
typedef
struct
du_f1ap_instance_s
{
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t
instance
;
// F1_Setup_Req payload
uint32_t
gNB_DU_id
;
char
*
gNB_DU_name
;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t
eNB_id
;
/* Tracking area code */
uint16_t
tac
;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t
mcc
;
uint16_t
mnc
;
uint8_t
mnc_digit_length
;
}
du_f1ap_instance_t
;
#endif
/* DU_F1AP_DEFS_H_ */
openair2/F1AP/f1ap_du_defs.h
View file @
ac3db89e
...
...
@@ -19,45 +19,9 @@
* contact@openairinterface.org
*/
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#ifndef DU_F1AP_DEFS_H_
#define DU_F1AP_DEFS_H_
struct
du_f1ap_instance_s
;
typedef
struct
du_f1ap_instance_s
{
/* Next f1ap du association.
* Only used for virtual mode.
*/
/* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
instance_t
instance
;
// F1_Setup_Req payload
uint32_t
gNB_DU_id
;
char
*
gNB_DU_name
;
/* Unique eNB_id to identify the eNB within EPC.
* In our case the eNB is a macro eNB so the id will be 20 bits long.
* For Home eNB id, this field should be 28 bits long.
*/
uint32_t
eNB_id
;
/* Tracking area code */
uint16_t
tac
;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t
mcc
;
uint16_t
mnc
;
uint8_t
mnc_digit_length
;
}
du_f1ap_instance_t
;
#endif
/* DU_F1AP_DEFS_H_ */
openair2/F1AP/f1ap_encoder.c
View file @
ac3db89e
...
...
@@ -86,7 +86,7 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
DevAssert
(
buffer
!=
NULL
);
DevAssert
(
length
!=
NULL
);
//
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
xer_fprint
(
stdout
,
&
asn_DEF_F1AP_F1AP_PDU
,
pdu
);
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