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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
1bd6018f
Commit
1bd6018f
authored
Feb 11, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extract_sys_info(): refactor DU cell sys_info handling in own function
parent
9518e009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
19 deletions
+35
-19
openair2/RRC/NR/rrc_gNB_du.c
openair2/RRC/NR/rrc_gNB_du.c
+35
-19
No files found.
openair2/RRC/NR/rrc_gNB_du.c
View file @
1bd6018f
...
...
@@ -49,6 +49,39 @@ static bool rrc_gNB_plmn_matches(const gNB_RRC_INST *rrc, const f1ap_served_cell
&&
conf
->
mnc
[
0
]
==
info
->
plmn
.
mnc
;
}
static
bool
extract_sys_info
(
const
f1ap_gnb_du_system_info_t
*
sys_info
,
NR_BCCH_BCH_Message_t
**
mib
,
NR_SIB1_t
**
sib1
)
{
DevAssert
(
sys_info
!=
NULL
);
DevAssert
(
mib
!=
NULL
);
DevAssert
(
sib1
!=
NULL
);
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_BCCH_BCH_Message
,
(
void
**
)
mib
,
sys_info
->
mib
,
sys_info
->
mib_length
);
if
(
dec_rval
.
code
!=
RC_OK
||
(
*
mib
)
->
message
.
present
!=
NR_BCCH_BCH_MessageType_PR_mib
||
(
*
mib
)
->
message
.
choice
.
messageClassExtension
==
NULL
)
{
LOG_E
(
RRC
,
"Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits) of DU
\n
"
,
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_BCCH_BCH_Message
,
*
mib
);
return
false
;
}
if
(
sys_info
->
sib1
)
{
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_SIB1
,
(
void
**
)
sib1
,
sys_info
->
sib1
,
sys_info
->
sib1_length
);
if
(
dec_rval
.
code
!=
RC_OK
)
{
ASN_STRUCT_FREE
(
asn_DEF_NR_BCCH_BCH_Message
,
*
mib
);
ASN_STRUCT_FREE
(
asn_DEF_NR_SIB1
,
*
sib1
);
LOG_E
(
RRC
,
"Failed to decode NR_SIB1 (%zu bits), rejecting DU
\n
"
,
dec_rval
.
consumed
);
return
false
;
}
}
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
xer_fprint
(
stdout
,
&
asn_DEF_NR_BCCH_BCH_Message
,
*
mib
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
xer_fprint
(
stdout
,
&
asn_DEF_NR_SIB1
,
*
sib1
);
return
true
;
}
void
rrc_gNB_process_f1_setup_req
(
f1ap_setup_req_t
*
req
,
sctp_assoc_t
assoc_id
)
{
AssertFatal
(
assoc_id
!=
0
,
"illegal assoc_id == 0: should be -1 (monolithic) or >0 (split)
\n
"
);
...
...
@@ -116,29 +149,12 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
NR_SIB1_t
*
sib1
=
NULL
;
if
(
sys_info
!=
NULL
&&
sys_info
->
mib
!=
NULL
&&
!
(
sys_info
->
sib1
==
NULL
&&
get_softmodem_params
()
->
sa
))
{
asn_dec_rval_t
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_BCCH_BCH_Message
,
(
void
**
)
&
mib
,
sys_info
->
mib
,
sys_info
->
mib_length
);
if
(
dec_rval
.
code
!=
RC_OK
||
mib
->
message
.
present
!=
NR_BCCH_BCH_MessageType_PR_mib
||
mib
->
message
.
choice
.
messageClassExtension
==
NULL
)
{
LOG_E
(
RRC
,
"Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits) of DU, rejecting DU
\n
"
,
dec_rval
.
consumed
);
if
(
!
extract_sys_info
(
sys_info
,
&
mib
,
&
sib1
))
{
LOG_W
(
RRC
,
"rejecting DU ID %ld
\n
"
,
req
->
gNB_DU_id
);
f1ap_setup_failure_t
fail
=
{.
cause
=
F1AP_CauseProtocol_semantic_error
};
rrc
->
mac_rrc
.
f1_setup_failure
(
assoc_id
,
&
fail
);
ASN_STRUCT_FREE
(
asn_DEF_NR_BCCH_BCH_Message
,
mib
);
return
;
}
if
(
sys_info
->
sib1
)
{
dec_rval
=
uper_decode_complete
(
NULL
,
&
asn_DEF_NR_SIB1
,
(
void
**
)
&
sib1
,
sys_info
->
sib1
,
sys_info
->
sib1_length
);
if
(
dec_rval
.
code
!=
RC_OK
)
{
LOG_E
(
RRC
,
"Failed to decode NR_SIB1 (%zu bits) of DU, rejecting DU
\n
"
,
dec_rval
.
consumed
);
f1ap_setup_failure_t
fail
=
{.
cause
=
F1AP_CauseProtocol_semantic_error
};
rrc
->
mac_rrc
.
f1_setup_failure
(
assoc_id
,
&
fail
);
ASN_STRUCT_FREE
(
asn_DEF_NR_SIB1
,
sib1
);
return
;
}
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
))
xer_fprint
(
stdout
,
&
asn_DEF_NR_SIB1
,
sib1
);
}
}
LOG_I
(
RRC
,
"Accepting DU %ld (%s), sending F1 Setup Response
\n
"
,
req
->
gNB_DU_id
,
req
->
gNB_DU_name
);
LOG_I
(
RRC
,
"DU uses RRC version %u.%u.%u
\n
"
,
req
->
rrc_ver
[
0
],
req
->
rrc_ver
[
1
],
req
->
rrc_ver
[
2
]);
...
...
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