Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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-AMF
Commits
705d7a6d
Commit
705d7a6d
authored
Mar 04, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for decoding ResetType
parent
552f041c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
329 additions
and
10 deletions
+329
-10
src/ngap/ngapIEs/ResetType.cpp
src/ngap/ngapIEs/ResetType.cpp
+85
-0
src/ngap/ngapIEs/ResetType.hpp
src/ngap/ngapIEs/ResetType.hpp
+65
-0
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.cpp
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.cpp
+105
-0
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.hpp
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.hpp
+59
-0
src/ngap/ngapMsgs/NGReset.cpp
src/ngap/ngapMsgs/NGReset.cpp
+11
-8
src/ngap/ngapMsgs/NGReset.hpp
src/ngap/ngapMsgs/NGReset.hpp
+4
-2
No files found.
src/ngap/ngapIEs/ResetType.cpp
0 → 100644
View file @
705d7a6d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date 2021
\email: contact@openairinterface.org
*/
#include "ResetType.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
//------------------------------------------------------------------------------
ResetType
::
ResetType
()
{
present
=
Ngap_ResetType_PR_NOTHING
;
nG_Interface
=
0
;
partOfNG_Interface
=
nullptr
;
ueAssociationLogicalNGConnectionItem
=
nullptr
;
}
//------------------------------------------------------------------------------
ResetType
::~
ResetType
()
{}
//------------------------------------------------------------------------------
void
ResetType
::
setResetType
(
long
)
{}
//------------------------------------------------------------------------------
bool
ResetType
::
encode
(
Ngap_ResetType_t
*
type
)
{}
//------------------------------------------------------------------------------
bool
ResetType
::
decode
(
Ngap_ResetType_t
*
type
)
{
if
(
type
->
present
==
Ngap_ResetType_PR_nG_Interface
)
{
nG_Interface
=
(
long
)
type
->
choice
.
nG_Interface
;
return
true
;
}
else
if
(
type
->
present
==
Ngap_ResetType_PR_partOfNG_Interface
)
{
int
num_item
=
type
->
choice
.
partOfNG_Interface
->
list
.
count
;
partOfNG_Interface
=
new
Ngap_UE_associatedLogicalNG_connectionList
();
UEAssociationLogicalNGConnectionItem
*
item
=
new
UEAssociationLogicalNGConnectionItem
[
num_item
]();
for
(
int
i
=
0
;
i
<
num_item
;
i
++
)
{
if
(
!
item
[
i
].
decode
(
type
->
choice
.
partOfNG_Interface
->
list
.
array
[
i
]))
return
false
;
}
}
else
{
return
false
;
}
}
//------------------------------------------------------------------------------
void
ResetType
::
getResetType
(
long
&
resetType
)
{}
//------------------------------------------------------------------------------
void
ResetType
::
getResetType
(
struct
Ngap_UE_associatedLogicalNG_connectionList
*&
list
)
{}
//------------------------------------------------------------------------------
void
ResetType
::
setUE_associatedLogicalNG_connectionList
(
const
std
::
vector
<
UEAssociationLogicalNGConnectionItem
>
list
)
{}
}
// namespace ngap
src/ngap/ngapIEs/ResetType.hpp
0 → 100644
View file @
705d7a6d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date 2021
\email: contact@openairinterface.org
*/
#ifndef _RESET_TYPE_H_
#define _RESET_TYPE_H_
#include "UEAssociationLogicalNGConnectionItem.hpp"
extern
"C"
{
#include "Ngap_ResetType.h"
}
#include <vector>
namespace
ngap
{
class
ResetType
{
public:
ResetType
();
virtual
~
ResetType
();
void
setResetType
(
long
);
bool
encode
(
Ngap_ResetType_t
*
type
);
bool
decode
(
Ngap_ResetType_t
*
type
);
void
getResetType
(
long
&
);
void
getResetType
(
struct
Ngap_UE_associatedLogicalNG_connectionList
*&
);
void
setUE_associatedLogicalNG_connectionList
(
const
std
::
vector
<
UEAssociationLogicalNGConnectionItem
>
list
);
private:
Ngap_ResetType_PR
present
;
long
nG_Interface
;
struct
Ngap_UE_associatedLogicalNG_connectionList
*
partOfNG_Interface
;
UEAssociationLogicalNGConnectionItem
*
ueAssociationLogicalNGConnectionItem
;
// struct Ngap_ProtocolIE_SingleContainer *choice_Extensions;
};
}
// namespace ngap
#endif
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.cpp
0 → 100644
View file @
705d7a6d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date 2021
\email: contact@openairinterface.org
*/
#include "UEAssociationLogicalNGConnectionItem.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
UEAssociationLogicalNGConnectionItem
::
UEAssociationLogicalNGConnectionItem
()
{
amfUeNgapId
=
nullptr
;
ranUeNgapId
=
nullptr
;
}
//------------------------------------------------------------------------------
void
UEAssociationLogicalNGConnectionItem
::
setAmfUeNgapId
(
unsigned
long
id
)
{
if
(
!
amfUeNgapId
)
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
Ngap_DownlinkNASTransport_IEs_t
*
ie
=
(
Ngap_DownlinkNASTransport_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DownlinkNASTransport_IEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_DownlinkNASTransport_IEs__value_PR_AMF_UE_NGAP_ID
;
int
ret
=
amfUeNgapId
->
encode2AMF_UE_NGAP_ID
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
);
if
(
!
ret
)
{
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
}
//------------------------------------------------------------------------------
void
UEAssociationLogicalNGConnectionItem
::
setRanUeNgapId
(
uint32_t
ran_ue_ngap_id
)
{
if
(
!
ranUeNgapId
)
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
ranUeNgapId
->
setRanUeNgapId
(
ran_ue_ngap_id
);
Ngap_DownlinkNASTransport_IEs_t
*
ie
=
(
Ngap_DownlinkNASTransport_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DownlinkNASTransport_IEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_DownlinkNASTransport_IEs__value_PR_RAN_UE_NGAP_ID
;
int
ret
=
ranUeNgapId
->
encode2RAN_UE_NGAP_ID
(
ie
->
value
.
choice
.
RAN_UE_NGAP_ID
);
if
(
!
ret
)
{
cout
<<
"Encode RAN_UE_NGAP_ID IE error"
<<
endl
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
}
//------------------------------------------------------------------------------
bool
UEAssociationLogicalNGConnectionItem
::
encode
(
Ngap_UE_associatedLogicalNG_connectionItem_t
&
item
)
{}
//------------------------------------------------------------------------------
bool
UEAssociationLogicalNGConnectionItem
::
decode
(
Ngap_UE_associatedLogicalNG_connectionItem_t
*
item
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
*
item
->
aMF_UE_NGAP_ID
))
{
cout
<<
"Decoded NGAP AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
*
item
->
rAN_UE_NGAP_ID
))
{
cout
<<
"Decoded NGAP RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/UEAssociationLogicalNGConnectionItem.hpp
0 → 100644
View file @
705d7a6d
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date 2021
\email: contact@openairinterface.org
*/
#ifndef _UE_ASSOCIATION_LOGICAL_NG_CONNECTION_ITEM_H_
#define _UE_ASSOCIATION_LOGICAL_NG_CONNECTION_ITEM_H_
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
extern
"C"
{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_UE-associatedLogicalNG-connectionItem.h"
}
namespace
ngap
{
class
UEAssociationLogicalNGConnectionItem
{
public:
UEAssociationLogicalNGConnectionItem
();
virtual
~
UEAssociationLogicalNGConnectionItem
(){};
void
setAmfUeNgapId
(
unsigned
long
id
);
void
setRanUeNgapId
(
uint32_t
id
);
bool
encode
(
Ngap_UE_associatedLogicalNG_connectionItem_t
&
item
);
bool
decode
(
Ngap_UE_associatedLogicalNG_connectionItem_t
*
item
);
private:
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
};
}
// namespace ngap
#endif
src/ngap/ngapMsgs/NGReset.cpp
View file @
705d7a6d
...
...
@@ -51,7 +51,7 @@ NGResetMsg::NGResetMsg() {
ngResetIEs
=
nullptr
;
// cause = {};
cause
=
nullptr
;
resetType
=
{}
;
resetType
=
nullptr
;
}
//------------------------------------------------------------------------------
NGResetMsg
::~
NGResetMsg
()
{}
...
...
@@ -87,7 +87,7 @@ void NGResetMsg::setCause(Ngap_Cause_t cause) {
//------------------------------------------------------------------------------
void
NGResetMsg
::
setResetType
(
Ngap_ResetType_t
resetType
)
{
th
is
->
resetType
=
resetType
;
//
is->resetType = resetType;
}
void
NGResetMsg
::
getCause
(
Ngap_Cause_t
&
cause
)
{
...
...
@@ -95,7 +95,7 @@ void NGResetMsg::getCause(Ngap_Cause_t& cause) {
}
void
NGResetMsg
::
getResetType
(
Ngap_ResetType_t
&
resetType
)
{
resetType
=
this
->
resetType
;
//
resetType = this->resetType;
}
//------------------------------------------------------------------------------
...
...
@@ -131,11 +131,9 @@ bool NGResetMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
if
(
!
cause
->
decodefromCause
(
&
ngResetIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
Cause
))
{
cout
<<
"
decoded ngap
Cause IE error"
<<
endl
;
cout
<<
"
Decoded NGAP
Cause IE error"
<<
endl
;
return
false
;
}
// cause =
// ngResetIEs->protocolIEs.list.array[i]->value.choice.Cause;
}
else
{
cout
<<
"Decoded NGAP Cause IE error"
<<
endl
;
return
false
;
...
...
@@ -146,8 +144,13 @@ bool NGResetMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu) {
Ngap_Criticality_ignore
&&
ngResetIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_NGResetIEs__value_PR_ResetType
)
{
resetType
=
ngResetIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
ResetType
;
resetType
=
new
ResetType
();
if
(
!
resetType
->
decode
(
&
ngResetIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
ResetType
))
{
cout
<<
"Decoded NGAP ResetType IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"Decoded NGAP ResetType IE error"
<<
endl
;
return
false
;
...
...
src/ngap/ngapMsgs/NGReset.hpp
View file @
705d7a6d
...
...
@@ -33,6 +33,7 @@
#include "MessageType.hpp"
#include "Cause.hpp"
#include "ResetType.hpp"
extern
"C"
{
#include "Ngap_NGAP-PDU.h"
...
...
@@ -60,9 +61,10 @@ class NGResetMsg {
Ngap_NGAP_PDU_t
*
ngResetPdu
;
Ngap_NGReset_t
*
ngResetIEs
;
// Ngap_Cause_t cause;
Ngap_ResetType_t
resetType
;
// Ngap_ResetType_t resetType;
Cause
*
cause
;
// ResetType
resetType;
ResetType
*
resetType
;
};
}
// namespace ngap
...
...
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