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
spbro
OpenXG-RAN
Commits
a5a746ee
Commit
a5a746ee
authored
Oct 16, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Pass UE context directly into rrc_gNB_generate_UECapabilityEnquiry()
parent
cec54f1c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
70 deletions
+26
-70
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+2
-7
openair2/RRC/NR/MESSAGES/asn1_msg.h
openair2/RRC/NR/MESSAGES/asn1_msg.h
+1
-3
openair2/RRC/NR/MESSAGES/tests/test_asn1_msg.cpp
openair2/RRC/NR/MESSAGES/tests/test_asn1_msg.cpp
+1
-2
openair2/RRC/NR/nr_rrc_proto.h
openair2/RRC/NR/nr_rrc_proto.h
+0
-6
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+22
-52
No files found.
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
a5a746ee
...
...
@@ -559,12 +559,7 @@ int do_NR_SecurityModeCommand(uint8_t *const buffer,
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
/*TODO*/
//------------------------------------------------------------------------------
int
do_NR_SA_UECapabilityEnquiry
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
uint8_t
*
const
buffer
,
const
uint8_t
Transaction_id
)
//------------------------------------------------------------------------------
int
do_NR_SA_UECapabilityEnquiry
(
uint8_t
*
const
buffer
,
const
uint8_t
Transaction_id
)
{
NR_UE_CapabilityRequestFilterNR_t
*
sa_band_filter
;
NR_FreqBandList_t
*
sa_band_list
;
...
...
@@ -624,7 +619,7 @@ int do_NR_SA_UECapabilityEnquiry(const protocol_ctxt_t *const ctxt_pP,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_NR_DL_DCCH_Message
,
&
dl_dcch_msg
);
LOG_D
(
NR_RRC
,
"
[gNB %d] NR UECapabilityRequest for UE %lx Encoded %zd bits (%zd bytes)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rntiMaybeUEid
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
LOG_D
(
NR_RRC
,
"
NR UECapabilityRequestEncoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.h
View file @
a5a746ee
...
...
@@ -86,9 +86,7 @@ int do_NR_SecurityModeCommand(uint8_t *const buffer,
const
uint8_t
cipheringAlgorithm
,
NR_IntegrityProtAlgorithm_t
integrityProtAlgorithm
);
int
do_NR_SA_UECapabilityEnquiry
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
uint8_t
*
const
buffer
,
const
uint8_t
Transaction_id
);
int
do_NR_SA_UECapabilityEnquiry
(
uint8_t
*
const
buffer
,
const
uint8_t
Transaction_id
);
int
do_NR_RRCRelease
(
uint8_t
*
buffer
,
size_t
buffer_size
,
uint8_t
Transaction_id
);
...
...
openair2/RRC/NR/MESSAGES/tests/test_asn1_msg.cpp
View file @
a5a746ee
...
...
@@ -37,9 +37,8 @@ TEST(nr_asn1, rrc_reject)
TEST
(
nr_asn1
,
sa_capability_enquiry
)
{
protocol_ctxt_t
ctxt
=
{
0
};
unsigned
char
buf
[
1000
];
EXPECT_GT
(
do_NR_SA_UECapabilityEnquiry
(
&
ctxt
,
buf
,
0
),
0
);
EXPECT_GT
(
do_NR_SA_UECapabilityEnquiry
(
buf
,
0
),
0
);
}
TEST
(
nr_asn1
,
rrc_reconfiguration_complete_for_nsa
)
...
...
openair2/RRC/NR/nr_rrc_proto.h
View file @
a5a746ee
...
...
@@ -78,12 +78,6 @@ void rrc_forward_ue_nas_message(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE);
unsigned
int
rrc_gNB_get_next_transaction_identifier
(
module_id_t
gnb_mod_idP
);
void
rrc_gNB_generate_UECapabilityEnquiry
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
);
void
rrc_gNB_generate_RRCRelease
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
a5a746ee
...
...
@@ -1623,7 +1623,22 @@ static void handle_rrcReconfigurationComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *U
}
}
}
//-----------------------------------------------------------------------------
static
void
rrc_gNB_generate_UECapabilityEnquiry
(
gNB_RRC_INST
*
rrc
,
gNB_RRC_UE_t
*
ue
)
{
uint8_t
buffer
[
100
];
T
(
T_ENB_RRC_UE_CAPABILITY_ENQUIRY
,
T_INT
(
rrc
->
module_id
),
T_INT
(
0
),
T_INT
(
0
),
T_INT
(
ue
->
rrc_ue_id
));
uint8_t
xid
=
rrc_gNB_get_next_transaction_identifier
(
rrc
->
module_id
);
ue
->
xids
[
xid
]
=
RRC_UECAPABILITY_ENQUIRY
;
int
size
=
do_NR_SA_UECapabilityEnquiry
(
buffer
,
xid
);
LOG_I
(
NR_RRC
,
"UE %d: Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d, xid %d)
\n
"
,
ue
->
rrc_ue_id
,
size
,
xid
);
AssertFatal
(
!
NODE_IS_DU
(
rrc
->
node_type
),
"illegal node type DU!
\n
"
);
nr_rrc_transfer_protected_rrc_message
(
rrc
,
ue
,
DCCH
,
buffer
,
size
);
}
int
rrc_gNB_decode_dcch
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
rb_id_t
Srb_id
,
const
uint8_t
*
const
Rx_sdu
,
...
...
@@ -1682,38 +1697,15 @@ int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
break
;
case
NR_UL_DCCH_MessageType__c1_PR_securityModeComplete
:
// to avoid segmentation fault
if
(
!
ue_context_p
)
{
LOG_I
(
NR_RRC
,
"Processing securityModeComplete UE %lx, ue_context_p is NULL
\n
"
,
ctxt_pP
->
rntiMaybeUEid
);
break
;
}
LOG_I
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" received securityModeComplete on UL-DCCH %d from UE
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
);
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(securityModeComplete) ---> RRC_eNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
,
sdu_sizeP
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
ul_dcch_msg
);
}
/* configure ciphering */
nr_rrc_pdcp_config_security
(
&
ue_context_p
->
ue_context
,
true
);
ue_context_p
->
ue_context
.
as_security_active
=
true
;
nr_rrc_pdcp_config_security
(
UE
,
true
);
UE
->
as_security_active
=
true
;
/* trigger UE capability enquiry if we don't have them yet */
if
(
ue_context_p
->
ue_context
.
ue_cap_buffer
.
len
==
0
)
{
rrc_gNB_generate_UECapabilityEnquiry
(
ctxt_pP
,
ue_context_p
);
if
(
UE
->
ue_cap_buffer
.
len
==
0
)
{
rrc_gNB_generate_UECapabilityEnquiry
(
rrc
,
UE
);
/* else blocks are executed after receiving UE capability info */
}
else
if
(
ue_context_p
->
ue_context
.
n_initial_pdu
>
0
)
{
gNB_RRC_UE_t
*
UE
=
&
ue_context_p
->
ue_context
;
}
else
if
(
UE
->
n_initial_pdu
>
0
)
{
/* there were PDU sessions with the NG UE Context setup, but we had
* to set up security, so trigger PDU sessions now. The UE NAS
* message will be forwarded in the corresponding reconfiguration,
...
...
@@ -1723,7 +1715,7 @@ int rrc_gNB_decode_dcch(const protocol_ctxt_t *const ctxt_pP,
/* we already have capabilities, and no PDU sessions to setup, ack
* this UE */
rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP
(
rrc
,
UE
);
rrc_forward_ue_nas_message
(
RC
.
nrrrc
[
0
],
&
ue_context_p
->
ue_context
);
rrc_forward_ue_nas_message
(
rrc
,
UE
);
}
break
;
...
...
@@ -2575,28 +2567,6 @@ void rrc_gNB_generate_SecurityModeCommand(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p)
nr_rrc_transfer_protected_rrc_message
(
rrc
,
ue_p
,
DCCH
,
buffer
,
size
);
}
void
rrc_gNB_generate_UECapabilityEnquiry
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
)
//-----------------------------------------------------------------------------
{
uint8_t
buffer
[
100
];
T
(
T_ENB_RRC_UE_CAPABILITY_ENQUIRY
,
T_INT
(
ctxt_pP
->
module_id
),
T_INT
(
ctxt_pP
->
frame
),
T_INT
(
ctxt_pP
->
subframe
),
T_INT
(
ctxt_pP
->
rntiMaybeUEid
));
gNB_RRC_UE_t
*
ue
=
&
ue_context_pP
->
ue_context
;
uint8_t
xid
=
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
);
ue
->
xids
[
xid
]
=
RRC_UECAPABILITY_ENQUIRY
;
int
size
=
do_NR_SA_UECapabilityEnquiry
(
ctxt_pP
,
buffer
,
xid
);
LOG_I
(
NR_RRC
,
"UE %d: Logical Channel DL-DCCH, Generate NR UECapabilityEnquiry (bytes %d, xid %d)
\n
"
,
ue
->
rrc_ue_id
,
size
,
xid
);
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
ctxt_pP
->
module_id
];
AssertFatal
(
!
NODE_IS_DU
(
rrc
->
node_type
),
"illegal node type DU!
\n
"
);
nr_rrc_transfer_protected_rrc_message
(
rrc
,
ue
,
DCCH
,
buffer
,
size
);
}
typedef
struct
deliver_ue_ctxt_release_data_t
{
gNB_RRC_INST
*
rrc
;
f1ap_ue_context_release_cmd_t
*
release_cmd
;
...
...
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