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
7e495db5
Commit
7e495db5
authored
May 28, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add encoding/decoding lib for F1 Setup Failure (interface management)
parent
28e2d67e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
0 deletions
+121
-0
openair2/F1AP/lib/f1ap_interface_management.c
openair2/F1AP/lib/f1ap_interface_management.c
+114
-0
openair2/F1AP/lib/f1ap_interface_management.h
openair2/F1AP/lib/f1ap_interface_management.h
+6
-0
openair2/F1AP/lib/f1ap_lib_includes.h
openair2/F1AP/lib/f1ap_lib_includes.h
+1
-0
No files found.
openair2/F1AP/lib/f1ap_interface_management.c
View file @
7e495db5
...
...
@@ -856,3 +856,117 @@ void free_f1ap_setup_response(const f1ap_setup_resp_t *msg)
if
(
msg
->
cells_to_activate
[
i
].
SI_msg
[
j
].
SI_container_length
>
0
)
free
(
msg
->
cells_to_activate
[
i
].
SI_msg
[
j
].
SI_container
);
}
/* ====================================
* F1AP Setup Failure
* ==================================== */
/**
* @brief F1AP Setup Failure encoding
*/
F1AP_F1AP_PDU_t
*
encode_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
msg
)
{
F1AP_F1AP_PDU_t
*
pdu
=
calloc_or_fail
(
1
,
sizeof
(
*
pdu
));
/* Create */
/* 0. Message Type */
asn1cCalloc
(
pdu
->
choice
.
unsuccessfulOutcome
,
UnsuccessfulOutcome
);
pdu
->
present
=
F1AP_F1AP_PDU_PR_unsuccessfulOutcome
;
UnsuccessfulOutcome
->
procedureCode
=
F1AP_ProcedureCode_id_F1Setup
;
UnsuccessfulOutcome
->
criticality
=
F1AP_Criticality_reject
;
UnsuccessfulOutcome
->
value
.
present
=
F1AP_UnsuccessfulOutcome__value_PR_F1SetupFailure
;
F1AP_F1SetupFailure_t
*
out
=
&
pdu
->
choice
.
unsuccessfulOutcome
->
value
.
choice
.
F1SetupFailure
;
/* mandatory */
/* c1. Transaction ID (integer value)*/
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_F1SetupFailureIEs_t
,
ie1
);
ie1
->
id
=
F1AP_ProtocolIE_ID_id_TransactionID
;
ie1
->
criticality
=
F1AP_Criticality_reject
;
ie1
->
value
.
present
=
F1AP_F1SetupFailureIEs__value_PR_TransactionID
;
ie1
->
value
.
choice
.
TransactionID
=
msg
->
transaction_id
;
/* mandatory */
/* c2. Cause */
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_F1SetupFailureIEs_t
,
ie2
);
ie2
->
id
=
F1AP_ProtocolIE_ID_id_Cause
;
ie2
->
criticality
=
F1AP_Criticality_ignore
;
ie2
->
value
.
present
=
F1AP_F1SetupFailureIEs__value_PR_Cause
;
ie2
->
value
.
choice
.
Cause
.
present
=
F1AP_Cause_PR_radioNetwork
;
ie2
->
value
.
choice
.
Cause
.
choice
.
radioNetwork
=
msg
->
cause
;
/* optional */
/* c3. TimeToWait */
if
(
msg
->
time_to_wait
>
0
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_F1SetupFailureIEs_t
,
ie3
);
ie3
->
id
=
F1AP_ProtocolIE_ID_id_TimeToWait
;
ie3
->
criticality
=
F1AP_Criticality_ignore
;
ie3
->
value
.
present
=
F1AP_F1SetupFailureIEs__value_PR_TimeToWait
;
ie3
->
value
.
choice
.
TimeToWait
=
F1AP_TimeToWait_v10s
;
}
/* optional */
/* c4. CriticalityDiagnostics*/
if
(
msg
->
criticality_diagnostics
)
{
asn1cSequenceAdd
(
out
->
protocolIEs
.
list
,
F1AP_F1SetupFailureIEs_t
,
ie4
);
ie4
->
id
=
F1AP_ProtocolIE_ID_id_CriticalityDiagnostics
;
ie4
->
criticality
=
F1AP_Criticality_ignore
;
ie4
->
value
.
present
=
F1AP_F1SetupFailureIEs__value_PR_CriticalityDiagnostics
;
asn1cCallocOne
(
ie4
->
value
.
choice
.
CriticalityDiagnostics
.
procedureCode
,
F1AP_ProcedureCode_id_UEContextSetup
);
asn1cCallocOne
(
ie4
->
value
.
choice
.
CriticalityDiagnostics
.
triggeringMessage
,
F1AP_TriggeringMessage_initiating_message
);
asn1cCallocOne
(
ie4
->
value
.
choice
.
CriticalityDiagnostics
.
procedureCriticality
,
F1AP_Criticality_reject
);
asn1cCallocOne
(
ie4
->
value
.
choice
.
CriticalityDiagnostics
.
transactionID
,
0
);
}
return
pdu
;
}
/**
* @brief F1AP Setup Failure decoding
*/
bool
decode_f1ap_setup_failure
(
const
F1AP_F1AP_PDU_t
*
pdu
,
f1ap_setup_failure_t
*
out
)
{
F1AP_F1SetupFailureIEs_t
*
ie
;
F1AP_F1SetupFailure_t
*
in
=
&
pdu
->
choice
.
unsuccessfulOutcome
->
value
.
choice
.
F1SetupFailure
;
/* Check presence of mandatory IEs */
F1AP_LIB_FIND_IE
(
F1AP_F1SetupFailureIEs_t
,
ie
,
in
,
F1AP_ProtocolIE_ID_id_TransactionID
,
true
);
F1AP_LIB_FIND_IE
(
F1AP_F1SetupFailureIEs_t
,
ie
,
in
,
F1AP_ProtocolIE_ID_id_Cause
,
true
);
/* Loop over all IEs */
for
(
int
i
=
0
;
i
<
in
->
protocolIEs
.
list
.
count
;
i
++
)
{
ie
=
in
->
protocolIEs
.
list
.
array
[
i
];
switch
(
ie
->
id
)
{
case
F1AP_ProtocolIE_ID_id_TransactionID
:
/* Transaction ID (M) */
out
->
transaction_id
=
ie
->
value
.
choice
.
TransactionID
;
break
;
case
F1AP_ProtocolIE_ID_id_Cause
:
/* Cause (M) */
out
->
cause
=
ie
->
value
.
choice
.
Cause
.
choice
.
radioNetwork
;
break
;
case
F1AP_ProtocolIE_ID_id_TimeToWait
:
out
->
time_to_wait
=
ie
->
value
.
choice
.
TimeToWait
;
break
;
case
F1AP_ProtocolIE_ID_id_CriticalityDiagnostics
:
AssertError
(
1
==
0
,
return
false
,
"F1AP_ProtocolIE_ID_id_CriticalityDiagnostics is not supported"
);
break
;
default:
AssertError
(
1
==
0
,
return
false
,
"F1AP_ProtocolIE_ID_id %ld unknown
\n
"
,
ie
->
id
);
break
;
}
}
return
true
;
}
/**
* @brief F1AP Setup Failure equality check
*/
bool
eq_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
a
,
const
f1ap_setup_failure_t
*
b
)
{
if
(
a
->
transaction_id
!=
b
->
transaction_id
)
return
false
;
return
true
;
}
/**
* @brief F1AP Setup Failure deep copy
*/
f1ap_setup_failure_t
cp_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
msg
)
{
f1ap_setup_failure_t
cp
=
{
0
};
/* transaction_id */
cp
.
transaction_id
=
msg
->
transaction_id
;
return
cp
;
}
openair2/F1AP/lib/f1ap_interface_management.h
View file @
7e495db5
...
...
@@ -40,4 +40,10 @@ void free_f1ap_setup_response(const f1ap_setup_resp_t *msg);
f1ap_setup_resp_t
cp_f1ap_setup_response
(
const
f1ap_setup_resp_t
*
msg
);
bool
eq_f1ap_setup_response
(
const
f1ap_setup_resp_t
*
a
,
const
f1ap_setup_resp_t
*
b
);
/* F1 Setup Failure */
struct
F1AP_F1AP_PDU
*
encode_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
msg
);
bool
decode_f1ap_setup_failure
(
const
struct
F1AP_F1AP_PDU
*
pdu
,
f1ap_setup_failure_t
*
out
);
bool
eq_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
a
,
const
f1ap_setup_failure_t
*
b
);
f1ap_setup_failure_t
cp_f1ap_setup_failure
(
const
f1ap_setup_failure_t
*
msg
);
#endif
/* F1AP_INTERFACE_MANAGEMENT_H_ */
openair2/F1AP/lib/f1ap_lib_includes.h
View file @
7e495db5
...
...
@@ -39,5 +39,6 @@
#include "F1AP_FreqBandNrItem.h"
#include "F1AP_SuccessfulOutcome.h"
#include "F1AP_SibtypetobeupdatedListItem.h"
#include "F1AP_UnsuccessfulOutcome.h"
#endif
/* F1AP_LIB_INCLUDES_H_ */
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