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
57b28d07
Commit
57b28d07
authored
Sep 18, 2020
by
zhenghuangkun
Committed by
Noboru Kobayashi
Oct 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PDUSessionResourceReleaseCommand
parent
22ac1b94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
50 deletions
+54
-50
openair3/NGAP/ngap_common.h
openair3/NGAP/ngap_common.h
+1
-0
openair3/NGAP/ngap_gNB_handlers.c
openair3/NGAP/ngap_gNB_handlers.c
+33
-33
openair3/NGAP/ngap_gNB_management_procedures.c
openair3/NGAP/ngap_gNB_management_procedures.c
+20
-17
No files found.
openair3/NGAP/ngap_common.h
View file @
57b28d07
...
...
@@ -74,6 +74,7 @@
#include "NGAP_PDUSessionResourceFailedToModifyItemModRes.h"
#include "NGAP_PDUSessionResourceModifyUnsuccessfulTransfer.h"
#include "NGAP_PDUSessionResourceReleasedItemRelRes.h"
#include "NGAP_PDUSessionResourceToReleaseItemRelCmd.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
...
...
openair3/NGAP/ngap_gNB_handlers.c
View file @
57b28d07
...
...
@@ -1707,17 +1707,17 @@ static
int
ngap_gNB_handle_pdusession_release_command
(
uint32_t
assoc_id
,
uint32_t
stream
,
NGAP_NGAP_PDU_t
*
pdu
)
{
#if 0
int
i
;
ngap_gNB_amf_data_t
*
amf_desc_p
=
NULL
;
ngap_gNB_ue_context_t
*
ue_desc_p
=
NULL
;
MessageDef
*
message_p
=
NULL
;
NGAP_PDUS
ESSION
ReleaseCommand_t *container;
NGAP_PDUS
ESSION
ReleaseCommandIEs_t *ie;
NGAP_
GNB_UE_NGAP_ID_t e
nb_ue_ngap_id;
NGAP_AMF_UE_NGAP_ID_t
amf_ue_ngap_id;
NGAP_PDUS
essionResource
ReleaseCommand_t
*
container
;
NGAP_PDUS
essionResource
ReleaseCommandIEs_t
*
ie
;
NGAP_
RAN_UE_NGAP_ID_t
g
nb_ue_ngap_id
;
uint64_t
amf_ue_ngap_id
;
DevAssert
(
pdu
!=
NULL
);
container = &pdu->choice.initiatingMessage.value.choice.PDUS
ESSION
ReleaseCommand;
container
=
&
pdu
->
choice
.
initiatingMessage
.
value
.
choice
.
PDUS
essionResource
ReleaseCommand
;
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
);
...
...
@@ -1726,29 +1726,29 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
/* id-AMF-UE-NGAP-ID */
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUS
ESSION
ReleaseCommandIEs_t, ie, container,
NGAP_FIND_PROTOCOLIE_BY_ID
(
NGAP_PDUS
essionResource
ReleaseCommandIEs_t
,
ie
,
container
,
NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
a
mf_ue_ngap_id = ie->value.choice.AMF_UE_NGAP_ID
;
a
sn_INTEGER2ulong
(
&
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
),
&
amf_ue_ngap_id
)
;
}
else
{
return
-
1
;
}
/* id-
gNB
-UE-NGAP-ID */
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUS
ESSION
ReleaseCommandIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_
gNB
_UE_NGAP_ID, true);
/* id-
RAN
-UE-NGAP-ID */
NGAP_FIND_PROTOCOLIE_BY_ID
(
NGAP_PDUS
essionResource
ReleaseCommandIEs_t
,
ie
,
container
,
NGAP_ProtocolIE_ID_id_
RAN
_UE_NGAP_ID
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
enb_ue_ngap_id = ie->value.choice.GNB
_UE_NGAP_ID;
gnb_ue_ngap_id
=
ie
->
value
.
choice
.
RAN
_UE_NGAP_ID
;
}
else
{
return
-
1
;
}
if
((
ue_desc_p
=
ngap_gNB_get_ue_context
(
amf_desc_p
->
ngap_gNB_instance
,
e
nb_ue_ngap_id)) == NULL) {
NGAP_ERROR("[SCTP %d] Received
E-RAB release command for non existing UE context 0x%06
lx\n", assoc_id,
ie->value.choice.
GNB
_UE_NGAP_ID);
g
nb_ue_ngap_id
))
==
NULL
)
{
NGAP_ERROR
(
"[SCTP %d] Received
PDUSession Resource release command for non existing UE context 0x%08
lx
\n
"
,
assoc_id
,
ie
->
value
.
choice
.
RAN
_UE_NGAP_ID
);
return
-
1
;
}
...
...
@@ -1762,23 +1762,22 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
ue_desc_p
->
rx_stream
=
stream
;
if
(
ue_desc_p
->
amf_ue_ngap_id
!=
amf_ue_ngap_id
)
{
NGAP_WARN("UE context amf_ue_ngap_id is different form that of the message (%
d != %ld
)",
ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
NGAP_WARN
(
"UE context amf_ue_ngap_id is different form that of the message (%
lu != %lu
)"
,
(
uint64_t
)
ue_desc_p
->
amf_ue_ngap_id
,
amf_ue_ngap_id
);
}
NGAP_DEBUG("[SCTP %d] Received E-RAB release command for gNB_UE_NGAP_ID %l
d amf_ue_ngap_id %ld
\n",
assoc_id,
e
nb_ue_ngap_id, amf_ue_ngap_id);
NGAP_DEBUG
(
"[SCTP %d] Received E-RAB release command for gNB_UE_NGAP_ID %l
u amf_ue_ngap_id %lu
\n
"
,
assoc_id
,
g
nb_ue_ngap_id
,
amf_ue_ngap_id
);
message_p
=
itti_alloc_new_message
(
TASK_NGAP
,
NGAP_PDUSESSION_RELEASE_COMMAND
);
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).gNB_ue_ngap_id =
e
nb_ue_ngap_id;
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
gNB_ue_ngap_id
=
g
nb_ue_ngap_id
;
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
amf_ue_ngap_id
=
amf_ue_ngap_id
;
/* id-NAS-PDU */
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUS
ESSION
ReleaseCommandIEs_t, ie, container,
NGAP_FIND_PROTOCOLIE_BY_ID
(
NGAP_PDUS
essionResource
ReleaseCommandIEs_t
,
ie
,
container
,
NGAP_ProtocolIE_ID_id_NAS_PDU
,
false
);
if
(
ie
&&
ie
->
value
.
choice
.
NAS_PDU
.
size
>
0
)
{
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
nas_pdu
.
length
=
ie
->
value
.
choice
.
NAS_PDU
.
size
;
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).nas_pdu.buffer =
malloc(sizeof(uint8_t) * ie->value.choice.NAS_PDU.size);
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
nas_pdu
.
buffer
=
malloc
(
sizeof
(
uint8_t
)
*
ie
->
value
.
choice
.
NAS_PDU
.
size
);
memcpy
(
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
nas_pdu
.
buffer
,
ie
->
value
.
choice
.
NAS_PDU
.
buf
,
ie
->
value
.
choice
.
NAS_PDU
.
size
);
...
...
@@ -1787,25 +1786,26 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
nas_pdu
.
buffer
=
NULL
;
}
/* id-
E-RABToBeReleasedList
*/
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUS
ESSION
ReleaseCommandIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_PDUS
ESSIONToBeReleasedList
, true);
/* id-
PDUSessionResourceToReleaseListRelCmd
*/
NGAP_FIND_PROTOCOLIE_BY_ID
(
NGAP_PDUS
essionResource
ReleaseCommandIEs_t
,
ie
,
container
,
NGAP_ProtocolIE_ID_id_PDUS
essionResourceToReleaseListRelCmd
,
true
);
if
(
ie
!=
NULL
)
{
/* checked by macro but cppcheck doesn't see it */
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).nb_pdusessions_torelease = ie->value.choice.PDUS
ESSIONList
.list.count;
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
nb_pdusessions_torelease
=
ie
->
value
.
choice
.
PDUS
essionResourceToReleaseListRelCmd
.
list
.
count
;
for (i = 0; i < ie->value.choice.PDUSESSIONList.list.count; i++) {
NGAP_PDUSESSIONItem_t *item_p;
item_p = &(((NGAP_PDUSESSIONItemIEs_t *)ie->value.choice.PDUSESSIONList.list.array[i])->value.choice.PDUSESSIONItem);
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].pdusession_id = item_p->e_RAB_ID;
NGAP_DEBUG("[SCTP] Received E-RAB release command for e-rab id %ld\n", item_p->e_RAB_ID);
for
(
i
=
0
;
i
<
ie
->
value
.
choice
.
PDUSessionResourceToReleaseListRelCmd
.
list
.
count
;
i
++
)
{
NGAP_PDUSessionResourceToReleaseItemRelCmd_t
*
item_p
;
item_p
=
(
NGAP_PDUSessionResourceToReleaseItemRelCmd_t
*
)
ie
->
value
.
choice
.
PDUSessionResourceToReleaseListRelCmd
.
list
.
array
[
i
];
NGAP_PDUSESSION_RELEASE_COMMAND
(
message_p
).
pdusession_release_params
[
i
].
pdusession_id
=
item_p
->
pDUSessionID
;
NGAP_DEBUG
(
"[SCTP] Received E-RAB release command for pDUSessionID id %ld
\n
"
,
item_p
->
pDUSessionID
);
}
}
else
{
return
-
1
;
}
itti_send_msg_to_task
(
TASK_RRC_GNB
,
ue_desc_p
->
gNB_instance
->
instance
,
message_p
);
#endif
return
0
;
}
...
...
openair3/NGAP/ngap_gNB_management_procedures.c
View file @
57b28d07
...
...
@@ -152,39 +152,42 @@ ngap_gNB_instance_t *ngap_gNB_get_instance(instance_t instance)
void
ngap_gNB_remove_amf_desc
(
ngap_gNB_instance_t
*
instance
)
{
#if 0
struct
ngap_gNB_amf_data_s
*
amf
=
NULL
;
struct
ngap_gNB_amf_data_s
*
amfNext
=
NULL
;
struct
plmn_identity_s
*
plmnInfo
;
struct served_
group_id_s* group
Info;
struct
served_
region_id_s
*
region
Info
;
struct
served_guami_s
*
guamInfo
;
struct amf_
code_s* amfCode
;
struct
amf_
set_id_s
*
amfSet
;
struct
amf_pointer_s
*
amfPoint
;
for
(
amf
=
RB_MIN
(
ngap_amf_map
,
&
instance
->
ngap_amf_head
);
amf
;
amf
=
amfNext
)
{
amfNext
=
RB_NEXT
(
ngap_amf_map
,
&
instance
->
ngap_amf_head
,
amf
);
RB_REMOVE
(
ngap_amf_map
,
&
instance
->
ngap_amf_head
,
amf
);
while
(
!
STAILQ_EMPTY
(
&
amf
->
served_guami
))
{
guamInfo
=
STAILQ_FIRST
(
&
amf
->
served_guami
);
STAILQ_REMOVE_HEAD
(
&
amf
->
served_guami
,
next
);
while
(
!
STAILQ_EMPTY
(
&
guamInfo
->
served_plmns
))
{
plmnInfo = STAILQ_FIRST(&guamInfo->served_plmns);
STAILQ_REMOVE_HEAD(&guamInfo->served_plmns, next);
free(plmnInfo);
plmnInfo
=
STAILQ_FIRST
(
&
guamInfo
->
served_plmns
);
STAILQ_REMOVE_HEAD
(
&
guamInfo
->
served_plmns
,
next
);
free
(
plmnInfo
);
}
while
(
!
STAILQ_EMPTY
(
&
guamInfo
->
served_region_ids
))
{
regionInfo
=
STAILQ_FIRST
(
&
guamInfo
->
served_region_ids
);
STAILQ_REMOVE_HEAD
(
&
guamInfo
->
served_region_ids
,
next
);
free
(
regionInfo
);
}
while (!STAILQ_EMPTY(&guamInfo->
served_group
_ids)) {
groupInfo = STAILQ_FIRST(&guamInfo->served_group
_ids);
STAILQ_REMOVE_HEAD(&guamInfo->served_group
_ids, next);
free(groupInfo
);
while
(
!
STAILQ_EMPTY
(
&
guamInfo
->
amf_set
_ids
))
{
amfSet
=
STAILQ_FIRST
(
&
guamInfo
->
amf_set
_ids
);
STAILQ_REMOVE_HEAD
(
&
guamInfo
->
amf_set
_ids
,
next
);
free
(
amfSet
);
}
while (!STAILQ_EMPTY(&guamInfo->amf_
code
s)) {
amfCode = STAILQ_FIRST(&guamInfo->amf_code
s);
STAILQ_REMOVE_HEAD(&guamInfo->amf_code
s, next);
free(amfCode
);
while
(
!
STAILQ_EMPTY
(
&
guamInfo
->
amf_
pointer
s
))
{
amfPoint
=
STAILQ_FIRST
(
&
guamInfo
->
amf_pointer
s
);
STAILQ_REMOVE_HEAD
(
&
guamInfo
->
amf_pointer
s
,
next
);
free
(
amfPoint
);
}
free
(
guamInfo
);
}
free
(
amf
);
}
#endif
}
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