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
9e815444
Commit
9e815444
authored
May 14, 2022
by
Vaibhav Shrivastava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AS Security, PDCP Count and Enquire Timing Porting Changes
parent
c804d7d0
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
387 additions
and
32 deletions
+387
-32
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-1
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+162
-0
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+12
-0
openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
+2
-0
openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
+4
-4
openair2/RRC/LTE/rrc_eNB.c
openair2/RRC/LTE/rrc_eNB.c
+177
-26
openair2/UTIL/OSA/osa_stream_eia.c
openair2/UTIL/OSA/osa_stream_eia.c
+3
-0
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+26
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
9e815444
...
...
@@ -2747,7 +2747,7 @@ target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB
${
NFAPI_STATIC_LIB
}
NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB
NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
ITTI
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
ATLAS_LIBRARIES
}
-Wl,--end-group z dl
)
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
View file @
9e815444
...
...
@@ -1239,6 +1239,62 @@ void pdcp_update_stats(const protocol_ctxt_t *const ctxt_pP) {
}
int
pdcp_fill_ss_pdcp_cnt
(
pdcp_t
*
pdcp_p
,
uint32_t
rb_id
,
ss_get_pdcp_cnt_t
*
pc
)
{
LOG_D
(
PDCP
,
"Fill PDCPCount for pdcp_p->rb_id : %ld is_srb? : %d
\n
"
,
pdcp_p
->
rb_id
,
pdcp_p
->
is_srb
);
if
(
NULL
==
pc
)
return
-
1
;
pc
->
size
+=
1
;
if
(
pdcp_p
->
is_srb
)
{
pc
->
rb_info
[
rb_id
].
rb_id
=
pdcp_p
->
rb_id
;;
pc
->
rb_info
[
rb_id
].
is_srb
=
true
;
pc
->
rb_info
[
rb_id
].
ul_format
=
E_PdcpCount_Srb
;
pc
->
rb_info
[
rb_id
].
dl_format
=
E_PdcpCount_Srb
;
pc
->
rb_info
[
rb_id
].
ul_count
=
pdcp_get_next_count_rx
(
pdcp_p
,
1
,
pdcp_p
->
rx_hfn
,
pdcp_p
->
next_pdcp_rx_sn
-
1
);
pc
->
rb_info
[
rb_id
].
dl_count
=
pdcp_get_next_count_tx
(
pdcp_p
,
1
,
pdcp_p
->
next_pdcp_tx_sn
-
1
);
LOG_D
(
PDCP
,
"SRB DL Count (dec): %d UL Count (dec): %d
\n
\
RX_HFN: %d TX_HFN: %d
\n
\
RX Seq Num: %d TX Seq Num: %d
\n
"
,
pc
->
rb_info
[
rb_id
].
dl_count
,
pc
->
rb_info
[
rb_id
].
ul_count
,
pdcp_p
->
rx_hfn
,
pdcp_p
->
tx_hfn
,
pdcp_p
->
next_pdcp_rx_sn
-
1
,
pdcp_p
->
next_pdcp_tx_sn
-
1
);
}
else
{
pc
->
rb_info
[
rb_id
].
rb_id
=
pdcp_p
->
rb_id
+
3
;
LOG_D
(
PDCP
,
"Updated rb_id for DRB: %d (+3)
\n
"
,
pc
->
rb_info
[
rb_id
].
rb_id
);
pc
->
rb_info
[
rb_id
].
is_srb
=
false
;
if
(
pdcp_p
->
seq_num_size
==
7
)
{
pc
->
rb_info
[
rb_id
].
ul_format
=
E_PdcpCount_DrbShortSQN
;
pc
->
rb_info
[
rb_id
].
dl_format
=
E_PdcpCount_DrbShortSQN
;
LOG_D
(
PDCP
,
"DRB Short SQN
\n
"
);
}
else
{
pc
->
rb_info
[
rb_id
].
ul_format
=
E_PdcpCount_DrbLongSQN
;
pc
->
rb_info
[
rb_id
].
dl_format
=
E_PdcpCount_DrbLongSQN
;
LOG_D
(
PDCP
,
"DRB Long SQN
\n
"
);
}
pc
->
rb_info
[
rb_id
].
ul_count
=
pdcp_get_next_count_rx
(
pdcp_p
,
0
,
pdcp_p
->
rx_hfn
,
pdcp_p
->
next_pdcp_rx_sn
-
1
);
pc
->
rb_info
[
rb_id
].
dl_count
=
pdcp_get_next_count_tx
(
pdcp_p
,
0
,
pdcp_p
->
next_pdcp_tx_sn
-
1
);
LOG_D
(
PDCP
,
"DRB DL Count (dec): %d UL Count (dec): %d
\n
\
RX_HFN: %d TX_HFN: %d
\n
\
RX Seq Num: %d TX Seq Num: %d
\n
"
,
pc
->
rb_info
[
rb_id
].
dl_count
,
pc
->
rb_info
[
rb_id
].
ul_count
,
pdcp_p
->
rx_hfn
,
pdcp_p
->
tx_hfn
,
pdcp_p
->
next_pdcp_rx_sn
-
1
,
pdcp_p
->
next_pdcp_tx_sn
-
1
);
}
return
0
;
}
//-----------------------------------------------------------------------------
void
pdcp_run
(
...
...
@@ -1321,6 +1377,100 @@ pdcp_run (
}
break
;
case
SS_SET_PDCP_CNT
:
LOG_D
(
PDCP
,
"PDCP Received SS_SET_PDCP_CNT"
);
break
;
case
SS_REQ_PDCP_CNT
:
LOG_D
(
PDCP
,
"PDCP Received SS_GET_PDCP_CNT
\n
"
);
pdcp_t
*
pdcp_p
=
NULL
;
hash_key_t
key
=
HASHTABLE_NOT_A_KEY_VALUE
;
hashtable_rc_t
h_rc
;
MessageDef
*
message_p
;
uint8_t
rbid_
;
rnti_t
ue_rnti
;
if
(
NULL
==
ctxt_pP
)
{
LOG_E
(
PDCP
,
"No context to get PdcpCount
\n
"
);
break
;
}
message_p
=
itti_alloc_new_message
(
TASK_PDCP_ENB
,
ctxt_pP
->
module_id
,
SS_GET_PDCP_CNT
);
SS_GET_PDCP_CNT
(
message_p
).
size
=
0
;
ue_rnti
=
SS_REQ_PDCP_CNT
(
msg_p
).
rnti
;
uint8_t
rb_idx
=
0
;
if
(
SS_REQ_PDCP_CNT
(
msg_p
).
rb_id
==
0xFF
)
{
LOG_D
(
PDCP
,
"PDCP Received request PDCP COUNT for all RB's
\n
"
);
for
(
int
i
=
0
;
i
<
MAX_RBS
;
i
++
)
{
if
(
i
<
3
)
{
rbid_
=
i
;
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
,
rbid_
,
1
);
}
else
{
rbid_
=
i
-
3
;
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
,
rbid_
,
0
);
}
h_rc
=
hashtable_get
(
pdcp_coll_p
,
key
,
(
void
**
)
&
pdcp_p
);
if
(
h_rc
==
HASH_TABLE_OK
)
{
/** Fill response */
LOG_D
(
PDCP
,
"Found entry on hastable for rbid_ : %d ctxt module_id %d rnti %d enb_flag %d
\n
"
,
rbid_
,
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
);
pdcp_fill_ss_pdcp_cnt
(
pdcp_p
,
rb_idx
,
&
(
SS_GET_PDCP_CNT
(
message_p
)));
/** Increase the array index for next RB IDX */
rb_idx
++
;
}
else
{
LOG_D
(
PDCP
,
"No entry on hastable for rbid_: %d ctxt module_id %d rnti %d enb_flag %d
\n
"
,
rbid_
,
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
);
}
}
}
else
{
rb_idx
=
SS_REQ_PDCP_CNT
(
msg_p
).
rb_id
;
LOG_A
(
PDCP
,
"PDCP Received request PDCP COUNT for Single RB:%d
\n
"
,
SS_REQ_PDCP_CNT
(
message_p
).
rb_id
);
if
(
rb_idx
<
3
)
{
rbid_
=
rb_idx
;
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
,
rbid_
,
1
);
}
else
{
rbid_
=
rb_idx
-
3
;
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ue_rnti
,
ctxt_pP
->
enb_flag
,
rbid_
,
0
);
}
h_rc
=
hashtable_get
(
pdcp_coll_p
,
key
,
(
void
**
)
&
pdcp_p
);
if
(
h_rc
==
HASH_TABLE_OK
)
{
if
(
SS_REQ_PDCP_CNT
(
message_p
).
rb_id
<=
MAX_RBS
)
{
/** For single RB always updating at the 0th index only */
pdcp_fill_ss_pdcp_cnt
(
pdcp_p
,
0
,
&
(
SS_GET_PDCP_CNT
(
message_p
)));
}
}
else
{
LOG_D
(
PDCP
,
"No entry for single RB on hastable for rbid_: %d
\n
"
,
rbid_
);
}
}
itti_send_msg_to_task
(
TASK_SYS
,
ctxt_pP
->
module_id
,
message_p
);
break
;
default:
LOG_E
(
PDCP
,
"Received unexpected message %s
\n
"
,
ITTI_MSG_NAME
(
msg_p
));
break
;
...
...
@@ -2191,6 +2341,18 @@ pdcp_config_req_asn1 (
return
0
;
}
//-----------------------------------------------------------------------------
void
pdcp_config_set_security_cipher
(
pdcp_t
*
pdcp_pP
,
uint8_t
security_modeP
)
//-----------------------------------------------------------------------------
{
DevAssert
(
pdcp_pP
!=
NULL
);
pdcp_pP
->
cipheringAlgorithm
=
security_modeP
;
pdcp_pP
->
security_activated
=
1
;
}
//-----------------------------------------------------------------------------
void
pdcp_config_set_security
(
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp.h
View file @
9e815444
...
...
@@ -435,6 +435,18 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt_pP,
const
rb_id_t
rb_idP
,
const
mui_t
muiP
,
confirm_t
confirmP
,
sdu_size_t
sdu_sizeP
,
mem_block_t
*
sdu_pP
,
const
uint32_t
*
const
,
const
uint32_t
*
const
);
uint32_t
pdcp_get_next_count_tx
(
pdcp_t
*
const
pdcp_pP
,
const
srb_flag_t
srb_flagP
,
const
uint16_t
pdcp_sn
);
uint32_t
pdcp_get_next_count_rx
(
pdcp_t
*
const
pdcp_pP
,
const
srb_flag_t
srb_flagP
,
const
uint32_t
hfn
,
const
int
sn
);
/*
* Following two types are utilized between NAS driver and PDCP
*/
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_primitives.h
View file @
9e815444
...
...
@@ -173,6 +173,8 @@ int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
void
pdcp_config_set_security
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
pdcp_t
*
pdcp_pP
,
rb_id_t
rb_idP
,
uint16_t
lc_idP
,
uint8_t
security_modeP
,
uint8_t
*
kRRCenc_pP
,
uint8_t
*
kRRCint_pP
,
uint8_t
*
kUPenc_pP
);
void
pdcp_config_set_security_cipher
(
pdcp_t
*
pdcp_pP
,
uint8_t
security_modeP
);
int
pdcp_apply_security
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
pdcp_t
*
pdcp_entity
,
srb_flag_t
srb_flagP
,
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
View file @
9e815444
...
...
@@ -40,7 +40,7 @@
#include "pdcp_primitives.h"
//-----------------------------------------------------------------------------
static
//
static
uint32_t
pdcp_get_next_count_tx
(
pdcp_t
*
const
pdcp_pP
,
const
srb_flag_t
srb_flagP
,
...
...
@@ -67,7 +67,7 @@ uint32_t pdcp_get_next_count_tx(
}
//-----------------------------------------------------------------------------
static
//
static
uint32_t
pdcp_get_next_count_rx
(
pdcp_t
*
const
pdcp_pP
,
const
srb_flag_t
srb_flagP
,
...
...
@@ -151,7 +151,7 @@ pdcp_apply_security(
}
encrypt_params
.
message
=
&
pdcp_pdu_buffer
[
pdcp_header_len
];
encrypt_params
.
blength
=
sdu_buffer_size
<<
3
;
encrypt_params
.
blength
=
(
sdu_buffer_size
+
4
)
<<
3
;
buffer_encrypted
=
&
pdcp_pdu_buffer
[
pdcp_header_len
];
...
...
@@ -195,7 +195,7 @@ pdcp_validate_security(
decrypt_params
.
bearer
=
rb_id
-
1
;
decrypt_params
.
count
=
pdcp_get_next_count_rx
(
pdcp_pP
,
srb_flagP
,
hfn
,
sn
);
decrypt_params
.
message
=
&
pdcp_pdu_buffer
[
pdcp_header_len
];
decrypt_params
.
blength
=
(
sdu_buffer_size
-
pdcp_header_len
)
<<
3
;
decrypt_params
.
blength
=
(
(
sdu_buffer_size
+
4
)
-
pdcp_header_len
)
<<
3
;
decrypt_params
.
key_length
=
16
;
if
(
srb_flagP
)
{
...
...
openair2/RRC/LTE/rrc_eNB.c
View file @
9e815444
This diff is collapsed.
Click to expand it.
openair2/UTIL/OSA/osa_stream_eia.c
View file @
9e815444
...
...
@@ -216,6 +216,9 @@ int stream_compute_integrity_eia1(stream_cipher_t *stream_cipher, uint8_t out[4]
//printf ("MAC_I:%16X\n",MAC_I);
MAC_I
=
hton_int32
(
MAC_I
);
memcpy
(
out
,
&
MAC_I
,
4
);
LOG_A
(
OSA
,
"MAC-I Calculated for algorithm,
\n
"
"
\t
MAC-I %02x.%02x.%02x.%02x
\n
"
,
out
[
0
],
out
[
1
],
out
[
2
],
out
[
3
]);
return
0
;
}
...
...
targets/RT/USER/lte-enb.c
View file @
9e815444
...
...
@@ -258,7 +258,32 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
eNB
->
UL_INFO
.
subframe
=
proc
->
subframe_rx
;
eNB
->
UL_INFO
.
module_id
=
eNB
->
Mod_id
;
eNB
->
UL_INFO
.
CC_id
=
eNB
->
CC_id
;
eNB
->
if_inst
->
UL_indication
(
&
eNB
->
UL_INFO
,
(
void
*
)
proc
);
eNB
->
if_inst
->
UL_indication
(
&
eNB
->
UL_INFO
,
proc
);
//#ifdef ENB_SS
if
(
RC
.
mode
>=
SS_SOFTMODEM
)
{
MessageDef
*
message_p
=
itti_alloc_new_message
(
TASK_SYS
,
INSTANCE_DEFAULT
,
SS_UPD_TIM_INFO
);
if
(
message_p
)
{
SS_UPD_TIM_INFO
(
message_p
).
sf
=
eNB
->
UL_INFO
.
subframe
;
SS_UPD_TIM_INFO
(
message_p
).
sfn
=
eNB
->
UL_INFO
.
frame
;
int
send_res
=
itti_send_msg_to_task
(
TASK_SYS
,
INSTANCE_DEFAULT
,
message_p
);
if
(
send_res
<
0
)
{
printf
(
"Error in itti_send_msg_to_task"
);
// LOG_E( PHY, "[SS] Error in L1_Thread itti_send_msg_to_task"); /** TODO: Need separate logging for SS */
}
LOG_D
(
PHY
,
"[SS] SS_UPD_TIM_INFO from L1_Thread to SYS task itti_send_msg_to_task sfn %d sf %d"
,
eNB
->
UL_INFO
.
subframe
,
eNB
->
UL_INFO
.
frame
);
/** TODO: Need separate logging for SS */
}
#endif
}
//#endif /** ENB_SS */
AssertFatal
((
ret
=
pthread_mutex_unlock
(
&
eNB
->
UL_INFO_mutex
))
==
0
,
"error unlocking UL_INFO_mutex, return %d
\n
"
,
ret
);
/* this conflict resolution may be totally wrong, to be tested */
/* CONFLICT RESOLUTION: BEGIN */
...
...
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