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
常顺宇
OpenXG-RAN
Commits
9c462934
Commit
9c462934
authored
Sep 25, 2020
by
heshanyun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compile issue about build ngap asn file
parent
1aac2287
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
7013 additions
and
7011 deletions
+7013
-7011
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-1
openair3/NGAP/MESSAGES/ASN1/ASN1_files/ngap-15.8.0.asn1
openair3/NGAP/MESSAGES/ASN1/ASN1_files/ngap-15.8.0.asn1
+6885
-6892
openair3/NGAP/ngap_common.h
openair3/NGAP/ngap_common.h
+5
-0
openair3/NGAP/ngap_gNB.c
openair3/NGAP/ngap_gNB.c
+13
-11
openair3/NGAP/ngap_gNB_context_management_procedures.c
openair3/NGAP/ngap_gNB_context_management_procedures.c
+10
-8
openair3/NGAP/ngap_gNB_decoder.c
openair3/NGAP/ngap_gNB_decoder.c
+7
-7
openair3/NGAP/ngap_gNB_encoder.c
openair3/NGAP/ngap_gNB_encoder.c
+6
-6
openair3/NGAP/ngap_gNB_handlers.c
openair3/NGAP/ngap_gNB_handlers.c
+23
-23
openair3/NGAP/ngap_gNB_nas_procedures.c
openair3/NGAP/ngap_gNB_nas_procedures.c
+63
-63
No files found.
cmake_targets/CMakeLists.txt
View file @
9c462934
...
...
@@ -451,7 +451,7 @@ set(NGAP_ASN_DIR ${NGAP_DIR}/MESSAGES/ASN1/ASN1_files)
set
(
NGAP_C_DIR
${
asn1_generated_dir
}
/NGAP_
${
NGAP_RELEASE
}
)
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process
(
COMMAND
${
OPENAIR_CMAKE
}
/tools/make_asn1c_includes.sh
"
${
NGAP_C_DIR
}
"
"
${
NGAP_ASN_DIR
}
/
${
NGAP_ASN_FILES
}
"
"NGAP_"
-fno-include-deps
execute_process
(
COMMAND
${
OPENAIR_CMAKE
}
/tools/make_asn1c_includes.sh
"
${
NGAP_C_DIR
}
"
"
${
NGAP_ASN_DIR
}
/
${
NGAP_ASN_FILES
}
"
"NGAP_"
-fno-include-deps
-findirect-choice
RESULT_VARIABLE ret
)
if
(
NOT
${
ret
}
STREQUAL 0
)
message
(
FATAL_ERROR
"
${
ret
}
: error"
)
...
...
openair3/NGAP/MESSAGES/ASN1/ASN1_files/ngap-15.8.0.asn1
View file @
9c462934
This source diff could not be displayed because it is too large. You can
view the blob
instead.
openair3/NGAP/ngap_common.h
View file @
9c462934
...
...
@@ -79,6 +79,11 @@
#include "NGAP_PDUSessionResourceModifyRequestTransfer.h"
#include "NGAP_QosFlowAddOrModifyRequestItem.h"
#include "NGAP_TAIListForPagingItem.h"
#include "NGAP_GNB-ID.h"
#include "NGAP_GlobalGNB-ID.h"
#include "NGAP_GTPTunnel.h"
#include "NGAP_UE-NGAP-ID-pair.h"
#include "NGAP_UserLocationInformationNR.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
...
...
openair3/NGAP/ngap_gNB.c
View file @
9c462934
...
...
@@ -469,28 +469,30 @@ static int ngap_gNB_generate_ng_setup_request(
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_NGSetup
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_NGSetupRequest
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
NGSetupRequest
;
pdu
.
choice
.
initiatingMessage
=
CALLOC
(
1
,
sizeof
(
struct
NGAP_InitiatingMessage
));
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_NGSetup
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_NGSetupRequest
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
NGSetupRequest
;
/* mandatory */
ie
=
(
NGAP_NGSetupRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_NGSetupRequestIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_GlobalRANNodeID
;
ie
->
criticality
=
NGAP_Criticality_reject
;
ie
->
value
.
present
=
NGAP_NGSetupRequestIEs__value_PR_GlobalRANNodeID
;
ie
->
value
.
choice
.
GlobalRANNodeID
.
present
=
NGAP_GlobalRANNodeID_PR_globalGNB_ID
;
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
=
CALLOC
(
1
,
sizeof
(
struct
NGAP_GlobalGNB_ID
));
MCC_MNC_TO_PLMNID
(
instance_p
->
mcc
[
ngap_amf_data_p
->
broadcast_plmn_index
[
0
]],
instance_p
->
mnc
[
ngap_amf_data_p
->
broadcast_plmn_index
[
0
]],
instance_p
->
mnc_digit_length
[
ngap_amf_data_p
->
broadcast_plmn_index
[
0
]],
&
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
pLMNIdentity
);
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
present
=
NGAP_GNB_ID_PR_gNB_ID
;
&
(
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
pLMNIdentity
)
);
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
present
=
NGAP_GNB_ID_PR_gNB_ID
;
MACRO_GNB_ID_TO_BIT_STRING
(
instance_p
->
gNB_id
,
&
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
choice
.
gNB_ID
);
&
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
choice
.
gNB_ID
);
NGAP_INFO
(
"%u -> %02x%02x%02x%02x
\n
"
,
instance_p
->
gNB_id
,
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
choice
.
gNB_ID
.
buf
[
0
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
choice
.
gNB_ID
.
buf
[
1
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
choice
.
gNB_ID
.
buf
[
2
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
.
gNB_ID
.
choice
.
gNB_ID
.
buf
[
3
]);
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
choice
.
gNB_ID
.
buf
[
0
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
choice
.
gNB_ID
.
buf
[
1
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
choice
.
gNB_ID
.
buf
[
2
],
ie
->
value
.
choice
.
GlobalRANNodeID
.
choice
.
globalGNB_ID
->
gNB_ID
.
choice
.
gNB_ID
.
buf
[
3
]);
ASN_SEQUENCE_ADD
(
&
out
->
protocolIEs
.
list
,
ie
);
/* optional */
...
...
openair3/NGAP/ngap_gNB_context_management_procedures.c
View file @
9c462934
...
...
@@ -84,10 +84,11 @@ int ngap_ue_context_release_complete(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_successfulOutcome
;
pdu
.
choice
.
successfulOutcome
.
procedureCode
=
NGAP_ProcedureCode_id_UEContextRelease
;
pdu
.
choice
.
successfulOutcome
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
.
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_UEContextReleaseComplete
;
out
=
&
pdu
.
choice
.
successfulOutcome
.
value
.
choice
.
UEContextReleaseComplete
;
pdu
.
choice
.
successfulOutcome
=
CALLOC
(
1
,
sizeof
(
struct
NGAP_SuccessfulOutcome
));
pdu
.
choice
.
successfulOutcome
->
procedureCode
=
NGAP_ProcedureCode_id_UEContextRelease
;
pdu
.
choice
.
successfulOutcome
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
->
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_UEContextReleaseComplete
;
out
=
&
pdu
.
choice
.
successfulOutcome
->
value
.
choice
.
UEContextReleaseComplete
;
/* mandatory */
ie
=
(
NGAP_UEContextReleaseComplete_IEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_UEContextReleaseComplete_IEs_t
));
...
...
@@ -178,10 +179,11 @@ int ngap_ue_context_release_req(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_UEContextReleaseRequest
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_UEContextReleaseRequest
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
UEContextReleaseRequest
;
pdu
.
choice
.
initiatingMessage
=
CALLOC
(
1
,
sizeof
(
struct
NGAP_InitiatingMessage
));
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_UEContextReleaseRequest
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_UEContextReleaseRequest
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
UEContextReleaseRequest
;
/* mandatory */
ie
=
(
NGAP_UEContextReleaseRequest_IEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_UEContextReleaseRequest_IEs_t
));
...
...
openair3/NGAP/ngap_gNB_decoder.c
View file @
9c462934
...
...
@@ -40,7 +40,7 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
initiatingMessage
.
procedureCode
)
{
switch
(
pdu
->
choice
.
initiatingMessage
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_DownlinkNASTransport
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -88,9 +88,9 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR
(
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
pdu
->
choice
.
initiatingMessage
.
procedureCode
);
(
int
)
pdu
->
choice
.
initiatingMessage
->
procedureCode
);
AssertFatal
(
0
,
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
pdu
->
choice
.
initiatingMessage
.
procedureCode
);
(
int
)
pdu
->
choice
.
initiatingMessage
->
procedureCode
);
return
-
1
;
}
...
...
@@ -101,7 +101,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
successfulOutcome
.
procedureCode
)
{
switch
(
pdu
->
choice
.
successfulOutcome
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_NGSetup
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -120,7 +120,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
successfulOutcome
.
procedureCode
);
(
int
)
pdu
->
choice
.
successfulOutcome
->
procedureCode
);
return
-
1
;
}
...
...
@@ -131,7 +131,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) {
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
)
{
switch
(
pdu
->
choice
.
unsuccessfulOutcome
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_NGSetup
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -143,7 +143,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) {
default:
NGAP_ERROR
(
"Unknown procedure ID (%d) for unsuccessfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
);
(
int
)
pdu
->
choice
.
unsuccessfulOutcome
->
procedureCode
);
return
-
1
;
}
...
...
openair3/NGAP/ngap_gNB_encoder.c
View file @
9c462934
...
...
@@ -82,7 +82,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
initiatingMessage
.
procedureCode
)
{
switch
(
pdu
->
choice
.
initiatingMessage
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_NGSetup
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -125,7 +125,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_DEBUG
(
"Unknown procedure ID (%d) for initiating message
\n
"
,
(
int
)
pdu
->
choice
.
initiatingMessage
.
procedureCode
);
(
int
)
pdu
->
choice
.
initiatingMessage
->
procedureCode
);
return
-
1
;
}
...
...
@@ -146,7 +146,7 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
successfulOutcome
.
procedureCode
)
{
switch
(
pdu
->
choice
.
successfulOutcome
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_InitialContextSetup
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -177,7 +177,7 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_WARN
(
"Unknown procedure ID (%d) for successfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
successfulOutcome
.
procedureCode
);
(
int
)
pdu
->
choice
.
successfulOutcome
->
procedureCode
);
return
-
1
;
}
...
...
@@ -198,7 +198,7 @@ int ngap_gNB_encode_unsuccessfull_outcome(NGAP_NGAP_PDU_t *pdu,
asn_encode_to_new_buffer_result_t
res
=
{
NULL
,
{
0
,
NULL
,
NULL
}
};
DevAssert
(
pdu
!=
NULL
);
switch
(
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
)
{
switch
(
pdu
->
choice
.
unsuccessfulOutcome
->
procedureCode
)
{
case
NGAP_ProcedureCode_id_InitialContextSetup
:
res
=
asn_encode_to_new_buffer
(
NULL
,
ATS_CANONICAL_XER
,
&
asn_DEF_NGAP_NGAP_PDU
,
pdu
);
free
(
res
.
buffer
);
...
...
@@ -206,7 +206,7 @@ int ngap_gNB_encode_unsuccessfull_outcome(NGAP_NGAP_PDU_t *pdu,
default:
NGAP_DEBUG
(
"Unknown procedure ID (%d) for unsuccessfull outcome message
\n
"
,
(
int
)
pdu
->
choice
.
unsuccessfulOutcome
.
procedureCode
);
(
int
)
pdu
->
choice
.
unsuccessfulOutcome
->
procedureCode
);
return
-
1
;
}
...
...
openair3/NGAP/ngap_gNB_handlers.c
View file @
9c462934
...
...
@@ -229,11 +229,11 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
}
/* Checking procedure Code and direction of message */
if
(
pdu
.
choice
.
initiatingMessage
.
procedureCode
>=
sizeof
(
ngap_messages_callback
)
/
(
3
*
sizeof
(
if
(
pdu
.
choice
.
initiatingMessage
->
procedureCode
>=
sizeof
(
ngap_messages_callback
)
/
(
3
*
sizeof
(
ngap_message_decoded_callback
))
||
(
pdu
.
present
>
NGAP_NGAP_PDU_PR_unsuccessfulOutcome
))
{
NGAP_ERROR
(
"[SCTP %d] Either procedureCode %ld or direction %d exceed expected
\n
"
,
assoc_id
,
pdu
.
choice
.
initiatingMessage
.
procedureCode
,
pdu
.
present
);
assoc_id
,
pdu
.
choice
.
initiatingMessage
->
procedureCode
,
pdu
.
present
);
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_NGAP_NGAP_PDU
,
&
pdu
);
return
-
1
;
}
...
...
@@ -241,16 +241,16 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
/* No handler present.
* This can mean not implemented or no procedure for gNB (wrong direction).
*/
if
(
ngap_messages_callback
[
pdu
.
choice
.
initiatingMessage
.
procedureCode
][
pdu
.
present
-
1
]
==
NULL
)
{
if
(
ngap_messages_callback
[
pdu
.
choice
.
initiatingMessage
->
procedureCode
][
pdu
.
present
-
1
]
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] No handler for procedureCode %ld in %s
\n
"
,
assoc_id
,
pdu
.
choice
.
initiatingMessage
.
procedureCode
,
assoc_id
,
pdu
.
choice
.
initiatingMessage
->
procedureCode
,
ngap_direction2String
(
pdu
.
present
-
1
));
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_NGAP_NGAP_PDU
,
&
pdu
);
return
-
1
;
}
/* Calling the right handler */
ret
=
(
*
ngap_messages_callback
[
pdu
.
choice
.
initiatingMessage
.
procedureCode
][
pdu
.
present
-
1
])
ret
=
(
*
ngap_messages_callback
[
pdu
.
choice
.
initiatingMessage
->
procedureCode
][
pdu
.
present
-
1
])
(
assoc_id
,
stream
,
&
pdu
);
ASN_STRUCT_FREE_CONTENTS_ONLY
(
asn_DEF_NGAP_NGAP_PDU
,
&
pdu
);
return
ret
;
...
...
@@ -264,7 +264,7 @@ int ngap_gNB_handle_ng_setup_failure(uint32_t assoc_id,
NGAP_NGSetupFailureIEs_t
*
ie
;
ngap_gNB_amf_data_t
*
amf_desc_p
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
unsuccessfulOutcome
.
value
.
choice
.
NGSetupFailure
;
container
=
&
pdu
->
choice
.
unsuccessfulOutcome
->
value
.
choice
.
NGSetupFailure
;
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
if
(
stream
!=
0
)
{
...
...
@@ -302,7 +302,7 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id,
ngap_gNB_amf_data_t
*
amf_desc_p
;
int
i
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
successfulOutcome
.
value
.
choice
.
NGSetupResponse
;
container
=
&
pdu
->
choice
.
successfulOutcome
->
value
.
choice
.
NGSetupResponse
;
/* NG Setup Response == Non UE-related procedure -> stream 0 */
if
(
stream
!=
0
)
{
...
...
@@ -462,7 +462,7 @@ int ngap_gNB_handle_error_indication(uint32_t assoc_id,
uint64_t
amf_ue_ngap_id
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
ErrorIndication
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
ErrorIndication
;
/* NG Setup Failure == Non UE-related procedure -> stream 0 */
if
(
stream
!=
0
)
{
...
...
@@ -845,7 +845,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t
ran_ue_ngap_id
;
uint64_t
amf_ue_ngap_id
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
InitialContextSetupRequest
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
InitialContextSetupRequest
;
if
((
amf_desc_p
=
ngap_gNB_get_AMF
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received initial context setup request for non "
...
...
@@ -977,7 +977,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
case
NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation
:
{
NGAP_GTPTunnel_t
*
gTPTunnel_p
;
gTPTunnel_p
=
&
pdusessionTransfer_ies
->
value
.
choice
.
UPTransportLayerInformation
.
choice
.
gTPTunnel
;
gTPTunnel_p
=
pdusessionTransfer_ies
->
value
.
choice
.
UPTransportLayerInformation
.
choice
.
gTPTunnel
;
/* Set the transport layer address */
memcpy
(
NGAP_INITIAL_CONTEXT_SETUP_REQ
(
message_p
).
pdusession_param
[
i
].
upf_addr
.
buffer
,
...
...
@@ -1164,7 +1164,7 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
NGAP_UEContextReleaseCommand_t
*
container
;
NGAP_UEContextReleaseCommand_IEs_t
*
ie
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
UEContextReleaseCommand
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
UEContextReleaseCommand
;
if
((
amf_desc_p
=
ngap_gNB_get_AMF
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received UE context release command for non "
...
...
@@ -1178,8 +1178,8 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
switch
(
ie
->
value
.
choice
.
UE_NGAP_IDs
.
present
)
{
case
NGAP_UE_NGAP_IDs_PR_uE_NGAP_ID_pair
:
gnb_ue_ngap_id
=
ie
->
value
.
choice
.
UE_NGAP_IDs
.
choice
.
uE_NGAP_ID_pair
.
rAN_UE_NGAP_ID
;
asn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
UE_NGAP_IDs
.
choice
.
uE_NGAP_ID_pair
.
aMF_UE_NGAP_ID
),
&
amf_ue_ngap_id
);
gnb_ue_ngap_id
=
ie
->
value
.
choice
.
UE_NGAP_IDs
.
choice
.
uE_NGAP_ID_pair
->
rAN_UE_NGAP_ID
;
asn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
UE_NGAP_IDs
.
choice
.
uE_NGAP_ID_pair
->
aMF_UE_NGAP_ID
),
&
amf_ue_ngap_id
);
MSC_LOG_RX_MESSAGE
(
MSC_NGAP_GNB
,
MSC_NGAP_AMF
,
...
...
@@ -1252,7 +1252,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
NGAP_PDUSessionResourceSetupRequest_t
*
container
;
NGAP_PDUSessionResourceSetupRequestIEs_t
*
ie
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
PDUSessionResourceSetupRequest
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
PDUSessionResourceSetupRequest
;
if
((
amf_desc_p
=
ngap_gNB_get_AMF
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received pdu session resource setup request for non "
...
...
@@ -1361,7 +1361,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
case
NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation
:
{
NGAP_GTPTunnel_t
*
gTPTunnel_p
;
gTPTunnel_p
=
&
pdusessionTransfer_ies
->
value
.
choice
.
UPTransportLayerInformation
.
choice
.
gTPTunnel
;
gTPTunnel_p
=
pdusessionTransfer_ies
->
value
.
choice
.
UPTransportLayerInformation
.
choice
.
gTPTunnel
;
/* The transport layer address for the IP packets */
OCTET_STRING_TO_INT32
(
&
gTPTunnel_p
->
gTP_TEID
,
NGAP_PDUSESSION_SETUP_REQ
(
message_p
).
pdusession_setup_params
[
i
].
gtp_teid
);
NGAP_PDUSESSION_SETUP_REQ
(
message_p
).
pdusession_setup_params
[
i
].
upf_addr
.
length
=
...
...
@@ -1449,7 +1449,7 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
NGAP_Paging_t
*
container
;
NGAP_PagingIEs_t
*
ie
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
Paging
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
Paging
;
// received Paging Message from AMF
NGAP_DEBUG
(
"[SCTP %d] Received Paging Message From AMF
\n
"
,
assoc_id
);
...
...
@@ -1481,9 +1481,9 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
NGAP_ProtocolIE_ID_id_UEPagingIdentity
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
OCTET_STRING_TO_INT16
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
.
aMFSetID
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
amf_set_id
);
OCTET_STRING_TO_INT8
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
.
aMFPointer
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
amf_pointer
);
OCTET_STRING_TO_INT32
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
.
fiveG_TMSI
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
m_tmsi
);
OCTET_STRING_TO_INT16
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
->
aMFSetID
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
amf_set_id
);
OCTET_STRING_TO_INT8
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
->
aMFPointer
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
amf_pointer
);
OCTET_STRING_TO_INT32
(
&
ie
->
value
.
choice
.
UEPagingIdentity
.
choice
.
fiveG_S_TMSI
->
fiveG_TMSI
,
NGAP_PAGING_IND
(
message_p
).
ue_paging_identity
.
s_tmsi
.
m_tmsi
);
NGAP_DEBUG
(
"[SCTP %d] Received Paging Identity amf_set_id %d, amf_pointer %d, m_tmsi %d
\n
"
,
assoc_id
,
...
...
@@ -1560,7 +1560,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t
gnb_ue_ngap_id
;
uint64_t
amf_ue_ngap_id
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
PDUSessionResourceModifyRequest
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
PDUSessionResourceModifyRequest
;
if
((
amf_desc_p
=
ngap_gNB_get_AMF
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received PDUSession Resource modify request for non "
...
...
@@ -1763,7 +1763,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
NGAP_RAN_UE_NGAP_ID_t
gnb_ue_ngap_id
;
uint64_t
amf_ue_ngap_id
;
DevAssert
(
pdu
!=
NULL
);
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
PDUSessionResourceReleaseCommand
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
PDUSessionResourceReleaseCommand
;
if
((
amf_desc_p
=
ngap_gNB_get_AMF
(
NULL
,
assoc_id
,
0
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received E-RAB release command for non existing AMF context
\n
"
,
assoc_id
);
...
...
@@ -1870,7 +1870,7 @@ int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id,
NGAP_PDUSESSIONItemIEs_t *e_RABItemIEs;
NGAP_PDUSESSIONItem_t *e_RABItem;
DevAssert(pdu != NULL);
pathSwitchRequestAcknowledge = &pdu->choice.successfulOutcome
.
value.choice.PathSwitchRequestAcknowledge;
pathSwitchRequestAcknowledge = &pdu->choice.successfulOutcome
->
value.choice.PathSwitchRequestAcknowledge;
/* Path Switch request == UE-related procedure -> stream !=0 */
if (stream == 0) {
...
...
@@ -2030,7 +2030,7 @@ int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_
NGAP_PathSwitchRequestFailure_t *pathSwitchRequestFailure;
NGAP_PathSwitchRequestFailureIEs_t *ie;
DevAssert(pdu != NULL);
pathSwitchRequestFailure = &pdu->choice.unsuccessfulOutcome
.
value.choice.PathSwitchRequestFailure;
pathSwitchRequestFailure = &pdu->choice.unsuccessfulOutcome
->
value.choice.PathSwitchRequestFailure;
if (stream != 0) {
NGAP_ERROR("[SCTP %d] Received s1 path switch request failure on stream != 0 (%d)\n",
...
...
openair3/NGAP/ngap_gNB_nas_procedures.c
View file @
9c462934
...
...
@@ -68,10 +68,10 @@ int ngap_gNB_handle_nas_first_req(
DevAssert
(
instance_p
!=
NULL
);
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_InitialUEMessage
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_InitialUEMessage
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
InitialUEMessage
;
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_InitialUEMessage
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_InitialUEMessage
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
InitialUEMessage
;
/* Select the AMF corresponding to the provided GUAMI. */
if
(
ngap_nas_first_req_p
->
ue_identity
.
presenceMask
&
NGAP_UE_IDENTITIES_guami
)
{
...
...
@@ -218,7 +218,7 @@ int ngap_gNB_handle_nas_first_req(
ie
->
value
.
choice
.
UserLocationInformation
.
present
=
NGAP_UserLocationInformation_PR_userLocationInformationNR
;
userinfo_nr_p
=
&
ie
->
value
.
choice
.
UserLocationInformation
.
choice
.
userLocationInformationNR
;
userinfo_nr_p
=
ie
->
value
.
choice
.
UserLocationInformation
.
choice
.
userLocationInformationNR
;
/* Set nRCellIdentity. default userLocationInformationNR */
MACRO_GNB_ID_TO_CELL_IDENTITY
(
instance_p
->
gNB_id
,
...
...
@@ -350,7 +350,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
ngap_gNB_instance
=
amf_desc_p
->
ngap_gNB_instance
;
/* Prepare the NGAP message to encode */
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
DownlinkNASTransport
;
container
=
&
pdu
->
choice
.
initiatingMessage
->
value
.
choice
.
DownlinkNASTransport
;
NGAP_FIND_PROTOCOLIE_BY_ID
(
NGAP_DownlinkNASTransport_IEs_t
,
ie
,
container
,
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
,
true
);
asn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
),
&
amf_ue_ngap_id
);
...
...
@@ -460,10 +460,10 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_UplinkNASTransport
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_UplinkNASTransport
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
UplinkNASTransport
;
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_UplinkNASTransport
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_UplinkNASTransport
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
UplinkNASTransport
;
/* mandatory */
ie
=
(
NGAP_UplinkNASTransport_IEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_UplinkNASTransport_IEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -494,7 +494,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
ie
->
value
.
present
=
NGAP_UplinkNASTransport_IEs__value_PR_UserLocationInformation
;
ie
->
value
.
choice
.
UserLocationInformation
.
present
=
NGAP_UserLocationInformation_PR_userLocationInformationNR
;
userinfo_nr_p
=
&
ie
->
value
.
choice
.
UserLocationInformation
.
choice
.
userLocationInformationNR
;
userinfo_nr_p
=
ie
->
value
.
choice
.
UserLocationInformation
.
choice
.
userLocationInformationNR
;
/* Set nRCellIdentity. default userLocationInformationNR */
MACRO_GNB_ID_TO_CELL_IDENTITY
(
ngap_gNB_instance_p
->
gNB_id
,
...
...
@@ -570,10 +570,10 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_NASNonDeliveryIndication
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_NASNonDeliveryIndication
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
NASNonDeliveryIndication
;
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_NASNonDeliveryIndication
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_NASNonDeliveryIndication
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
NASNonDeliveryIndication
;
/* mandatory */
ie
=
(
NGAP_NASNonDeliveryIndication_IEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_NASNonDeliveryIndication_IEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -676,10 +676,10 @@ int ngap_gNB_initial_ctxt_resp(
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_successfulOutcome
;
pdu
.
choice
.
successfulOutcome
.
procedureCode
=
NGAP_ProcedureCode_id_InitialContextSetup
;
pdu
.
choice
.
successfulOutcome
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
.
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_InitialContextSetupResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
.
value
.
choice
.
InitialContextSetupResponse
;
pdu
.
choice
.
successfulOutcome
->
procedureCode
=
NGAP_ProcedureCode_id_InitialContextSetup
;
pdu
.
choice
.
successfulOutcome
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
->
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_InitialContextSetupResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
->
value
.
choice
.
InitialContextSetupResponse
;
/* mandatory */
ie
=
(
NGAP_InitialContextSetupResponseIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_InitialContextSetupResponseIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -716,23 +716,23 @@ int ngap_gNB_initial_ctxt_resp(
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
present
=
NGAP_UPTransportLayerInformation_PR_gTPTunnel
;
GTP_TEID_TO_ASN1
(
initial_ctxt_resp_p
->
pdusessions
[
i
].
gtp_teid
,
&
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
gTP_TEID
);
GTP_TEID_TO_ASN1
(
initial_ctxt_resp_p
->
pdusessions
[
i
].
gtp_teid
,
&
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
gTP_TEID
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
=
malloc
(
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
=
malloc
(
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
memcpy
(
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
,
memcpy
(
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
,
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
buffer
,
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
size
=
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
bits_unused
=
0
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
size
=
initial_ctxt_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
bits_unused
=
0
;
NGAP_DEBUG
(
"initial_ctxt_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld
\n
"
,
item
->
pDUSessionID
,
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
0
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
1
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
2
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
3
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
size
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
0
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
1
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
2
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
3
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
size
);
/* associatedQosFlowList. number of 1? */
for
(
int
j
=
0
;
j
<
initial_ctxt_resp_p
->
pdusessions
[
i
].
nb_of_qos_flow
;
j
++
)
{
...
...
@@ -894,10 +894,10 @@ int ngap_gNB_ue_capabilities(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_initiatingMessage
;
pdu
.
choice
.
initiatingMessage
.
procedureCode
=
NGAP_ProcedureCode_id_UERadioCapabilityInfoIndication
;
pdu
.
choice
.
initiatingMessage
.
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
.
value
.
present
=
NGAP_InitiatingMessage__value_PR_UERadioCapabilityInfoIndication
;
out
=
&
pdu
.
choice
.
initiatingMessage
.
value
.
choice
.
UERadioCapabilityInfoIndication
;
pdu
.
choice
.
initiatingMessage
->
procedureCode
=
NGAP_ProcedureCode_id_UERadioCapabilityInfoIndication
;
pdu
.
choice
.
initiatingMessage
->
criticality
=
NGAP_Criticality_ignore
;
pdu
.
choice
.
initiatingMessage
->
value
.
present
=
NGAP_InitiatingMessage__value_PR_UERadioCapabilityInfoIndication
;
out
=
&
pdu
.
choice
.
initiatingMessage
->
value
.
choice
.
UERadioCapabilityInfoIndication
;
/* mandatory */
ie
=
(
NGAP_UERadioCapabilityInfoIndicationIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_UERadioCapabilityInfoIndicationIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -987,10 +987,10 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_successfulOutcome
;
pdu
.
choice
.
successfulOutcome
.
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceSetup
;
pdu
.
choice
.
successfulOutcome
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
.
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
.
value
.
choice
.
PDUSessionResourceSetupResponse
;
pdu
.
choice
.
successfulOutcome
->
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceSetup
;
pdu
.
choice
.
successfulOutcome
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
->
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
->
value
.
choice
.
PDUSessionResourceSetupResponse
;
/* mandatory */
ie
=
(
NGAP_PDUSessionResourceSetupResponseIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_PDUSessionResourceSetupResponseIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -1028,23 +1028,23 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
present
=
NGAP_UPTransportLayerInformation_PR_gTPTunnel
;
GTP_TEID_TO_ASN1
(
pdusession_setup_resp_p
->
pdusessions
[
i
].
gtp_teid
,
&
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
gTP_TEID
);
GTP_TEID_TO_ASN1
(
pdusession_setup_resp_p
->
pdusessions
[
i
].
gtp_teid
,
&
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
gTP_TEID
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
=
malloc
(
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
=
malloc
(
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
memcpy
(
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
,
memcpy
(
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
,
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
buffer
,
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
size
=
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
bits_unused
=
0
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
size
=
pdusession_setup_resp_p
->
pdusessions
[
i
].
gNB_addr
.
length
;
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
bits_unused
=
0
;
NGAP_DEBUG
(
"pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld
\n
"
,
item
->
pDUSessionID
,
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
0
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
1
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
2
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
buf
[
3
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
.
transportLayerAddress
.
size
);
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
0
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
1
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
2
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
buf
[
3
],
pdusessionTransfer_p
->
dLQosFlowPerTNLInformation
.
uPTransportLayerInformation
.
choice
.
gTPTunnel
->
transportLayerAddress
.
size
);
/* associatedQosFlowList. number of 1? */
for
(
int
j
=
0
;
j
<
pdusession_setup_resp_p
->
pdusessions
[
i
].
nb_of_qos_flow
;
j
++
)
{
...
...
@@ -1209,10 +1209,10 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_successfulOutcome
;
pdu
.
choice
.
successfulOutcome
.
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceModify
;
pdu
.
choice
.
successfulOutcome
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
.
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceModifyResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
.
value
.
choice
.
PDUSessionResourceModifyResponse
;
pdu
.
choice
.
successfulOutcome
->
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceModify
;
pdu
.
choice
.
successfulOutcome
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
->
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceModifyResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
->
value
.
choice
.
PDUSessionResourceModifyResponse
;
/* mandatory */
ie
=
(
NGAP_PDUSessionResourceModifyResponseIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_PDUSessionResourceModifyResponseIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -1369,10 +1369,10 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
/* Prepare the NGAP message to encode */
memset
(
&
pdu
,
0
,
sizeof
(
pdu
));
pdu
.
present
=
NGAP_NGAP_PDU_PR_successfulOutcome
;
pdu
.
choice
.
successfulOutcome
.
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceRelease
;
pdu
.
choice
.
successfulOutcome
.
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
.
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceReleaseResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
.
value
.
choice
.
PDUSessionResourceReleaseResponse
;
pdu
.
choice
.
successfulOutcome
->
procedureCode
=
NGAP_ProcedureCode_id_PDUSessionResourceRelease
;
pdu
.
choice
.
successfulOutcome
->
criticality
=
NGAP_Criticality_reject
;
pdu
.
choice
.
successfulOutcome
->
value
.
present
=
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceReleaseResponse
;
out
=
&
pdu
.
choice
.
successfulOutcome
->
value
.
choice
.
PDUSessionResourceReleaseResponse
;
/* mandatory */
ie
=
(
NGAP_PDUSessionResourceReleaseResponseIEs_t
*
)
calloc
(
1
,
sizeof
(
NGAP_PDUSessionResourceReleaseResponseIEs_t
));
ie
->
id
=
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
...
...
@@ -1524,10 +1524,10 @@ int ngap_gNB_path_switch_req(instance_t instance,
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage
.
procedureCode = NGAP_ProcedureCode_id_PathSwitchRequest;
pdu.choice.initiatingMessage
.
criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage
.
value.present = NGAP_InitiatingMessage__value_PR_PathSwitchRequest;
out = &pdu.choice.initiatingMessage
.
value.choice.PathSwitchRequest;
pdu.choice.initiatingMessage
->
procedureCode = NGAP_ProcedureCode_id_PathSwitchRequest;
pdu.choice.initiatingMessage
->
criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage
->
value.present = NGAP_InitiatingMessage__value_PR_PathSwitchRequest;
out = &pdu.choice.initiatingMessage
->
value.choice.PathSwitchRequest;
/* mandatory */
ie = (NGAP_PathSwitchRequestIEs_t *)calloc(1, sizeof(NGAP_PathSwitchRequestIEs_t));
...
...
@@ -1714,10 +1714,10 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication(
// Prepare the NGAP message to encode
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage
.
procedureCode = NGAP_ProcedureCode_id_PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage
.
criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage
.
value.present = NGAP_InitiatingMessage__value_PR_PDUSESSIONModificationIndication;
out = &pdu.choice.initiatingMessage
.
value.choice.PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage
->
procedureCode = NGAP_ProcedureCode_id_PDUSESSIONModificationIndication;
pdu.choice.initiatingMessage
->
criticality = NGAP_Criticality_reject;
pdu.choice.initiatingMessage
->
value.present = NGAP_InitiatingMessage__value_PR_PDUSESSIONModificationIndication;
out = &pdu.choice.initiatingMessage
->
value.choice.PDUSESSIONModificationIndication;
/* mandatory */
ie = (NGAP_PDUSESSIONModificationIndicationIEs_t *)calloc(1, sizeof(NGAP_PDUSESSIONModificationIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
...
...
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