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
d1bb9b5f
Commit
d1bb9b5f
authored
Aug 29, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactoring for IniitialUEMesasge
parent
4fa4f831
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
177 additions
and
170 deletions
+177
-170
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+1
-1
src/ngap/ngapIEs/AMFPointer.cpp
src/ngap/ngapIEs/AMFPointer.cpp
+21
-19
src/ngap/ngapIEs/AMFPointer.hpp
src/ngap/ngapIEs/AMFPointer.hpp
+7
-7
src/ngap/ngapIEs/AMFRegionID.cpp
src/ngap/ngapIEs/AMFRegionID.cpp
+2
-2
src/ngap/ngapIEs/AMFRegionID.hpp
src/ngap/ngapIEs/AMFRegionID.hpp
+2
-2
src/ngap/ngapIEs/AMFSetID.cpp
src/ngap/ngapIEs/AMFSetID.cpp
+26
-21
src/ngap/ngapIEs/AMFSetID.hpp
src/ngap/ngapIEs/AMFSetID.hpp
+7
-6
src/ngap/ngapIEs/CriticalityDiagnostics.cpp
src/ngap/ngapIEs/CriticalityDiagnostics.cpp
+2
-2
src/ngap/ngapIEs/CriticalityDiagnostics.hpp
src/ngap/ngapIEs/CriticalityDiagnostics.hpp
+1
-1
src/ngap/ngapIEs/FiveGSTmsi.cpp
src/ngap/ngapIEs/FiveGSTmsi.cpp
+23
-22
src/ngap/ngapIEs/FiveGSTmsi.hpp
src/ngap/ngapIEs/FiveGSTmsi.hpp
+8
-8
src/ngap/ngapIEs/GUAMI.cpp
src/ngap/ngapIEs/GUAMI.cpp
+16
-14
src/ngap/ngapIEs/GUAMI.hpp
src/ngap/ngapIEs/GUAMI.hpp
+2
-2
src/ngap/ngapIEs/IEsCriticalityDiagnostics.cpp
src/ngap/ngapIEs/IEsCriticalityDiagnostics.cpp
+1
-1
src/ngap/ngapIEs/IEsCriticalityDiagnostics.hpp
src/ngap/ngapIEs/IEsCriticalityDiagnostics.hpp
+1
-1
src/ngap/ngapIEs/MessageType.hpp
src/ngap/ngapIEs/MessageType.hpp
+1
-1
src/ngap/ngapIEs/NR-CGI.cpp
src/ngap/ngapIEs/NR-CGI.cpp
+2
-2
src/ngap/ngapIEs/NRCellIdentity.cpp
src/ngap/ngapIEs/NRCellIdentity.cpp
+2
-3
src/ngap/ngapIEs/NRCellIdentity.hpp
src/ngap/ngapIEs/NRCellIdentity.hpp
+2
-2
src/ngap/ngapIEs/RRCEstablishmentCause.cpp
src/ngap/ngapIEs/RRCEstablishmentCause.cpp
+10
-15
src/ngap/ngapIEs/RRCEstablishmentCause.hpp
src/ngap/ngapIEs/RRCEstablishmentCause.hpp
+5
-6
src/ngap/ngapIEs/SecurityKey.cpp
src/ngap/ngapIEs/SecurityKey.cpp
+2
-2
src/ngap/ngapIEs/SecurityKey.hpp
src/ngap/ngapIEs/SecurityKey.hpp
+2
-2
src/ngap/ngapIEs/UEPagingIdentity.cpp
src/ngap/ngapIEs/UEPagingIdentity.cpp
+5
-5
src/ngap/ngapIEs/UEPagingIdentity.hpp
src/ngap/ngapIEs/UEPagingIdentity.hpp
+1
-1
src/ngap/ngapMsgs/HandoverRequest.cpp
src/ngap/ngapMsgs/HandoverRequest.cpp
+1
-1
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
+2
-2
src/ngap/ngapMsgs/InitialUEMessage.cpp
src/ngap/ngapMsgs/InitialUEMessage.cpp
+8
-8
src/ngap/ngapMsgs/Paging.cpp
src/ngap/ngapMsgs/Paging.cpp
+1
-1
src/ngap/ngapMsgs/RerouteNASRequest.cpp
src/ngap/ngapMsgs/RerouteNASRequest.cpp
+12
-9
src/ngap/ngapMsgs/RerouteNASRequest.hpp
src/ngap/ngapMsgs/RerouteNASRequest.hpp
+1
-1
No files found.
src/amf-app/amf_n2.cpp
View file @
d1bb9b5f
...
...
@@ -2119,7 +2119,7 @@ void amf_n2::handle_itti_message(itti_rereoute_nas& itti_msg) {
RerouteNASRequest
rerouteNASRequest
=
{};
rerouteNASRequest
.
setRanUeNgapId
(
itti_msg
.
ran_ue_ngap_id
);
rerouteNASRequest
.
setAmfUeNgapId
(
itti_msg
.
amf_ue_ngap_id
);
rerouteNASRequest
.
setAMFSetID
(
itti_msg
.
amf_set_id
)
;
if
(
!
rerouteNASRequest
.
setAMFSetID
(
itti_msg
.
amf_set_id
))
return
;
if
(
unc
->
initialUEMsg
.
size
>
0
)
rerouteNASRequest
.
setNgapMessage
(
unc
->
initialUEMsg
);
// Include InitialUEMessage
...
...
src/ngap/ngapIEs/AMFPointer.cpp
View file @
d1bb9b5f
...
...
@@ -21,52 +21,54 @@
#include "AMFPointer.hpp"
#include <iostream>
#include "String2Value.hpp"
using
namespace
std
;
namespace
ngap
{
//------------------------------------------------------------------------------
AMFPointer
::
AMFPointer
()
{
pointer
=
0
;
pointer
_
=
0
;
}
//------------------------------------------------------------------------------
AMFPointer
::~
AMFPointer
()
{}
//------------------------------------------------------------------------------
void
AMFPointer
::
setAMFPointer
(
const
std
::
string
charPointer
)
{
pointer
=
fromString
<
int
>
(
charPointer
);
bool
AMFPointer
::
set
(
const
std
::
string
&
pointer
)
{
uint8_t
tmp
=
fromString
<
int
>
(
pointer
);
if
(
tmp
>
kAmfPointerMaxValue
)
return
false
;
pointer_
=
tmp
;
return
true
;
}
//------------------------------------------------------------------------------
void
AMFPointer
::
setAMFPointer
(
const
uint8_t
&
p
)
{
pointer
=
p
;
bool
AMFPointer
::
set
(
const
uint8_t
&
pointer
)
{
if
(
pointer
>
kAmfPointerMaxValue
)
return
false
;
pointer_
=
pointer
;
return
true
;
}
//------------------------------------------------------------------------------
void
AMFPointer
::
get
AMFPointer
(
std
::
string
&
charP
ointer
)
{
charPointer
=
to_string
(
pointer
);
void
AMFPointer
::
get
(
std
::
string
&
p
ointer
)
{
pointer
=
std
::
to_string
(
pointer_
);
}
//------------------------------------------------------------------------------
bool
AMFPointer
::
encode
2bitstring
(
Ngap_AMFPointer_t
&
amf
pointer
)
{
amfpointer
.
size
=
1
;
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
sizeof
(
uint8_t
));
bool
AMFPointer
::
encode
(
Ngap_AMFPointer_t
&
amf_
pointer
)
{
amf
_
pointer
.
size
=
1
;
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
sizeof
(
uint8_t
));
if
(
!
buffer
)
return
false
;
*
buffer
=
((
pointer
&
0x3f
)
<<
2
);
amfpointer
.
buf
=
buffer
;
amfpointer
.
bits_unused
=
2
;
*
buffer
=
((
pointer_
&
0x3f
)
<<
2
);
amf
_
pointer
.
buf
=
buffer
;
amf
_
pointer
.
bits_unused
=
2
;
return
true
;
}
//------------------------------------------------------------------------------
bool
AMFPointer
::
decode
frombitstring
(
Ngap_AMFPointer_t
&
amf
pointer
)
{
if
(
!
amfpointer
.
buf
)
return
false
;
pointer
=
(
amf
pointer
.
buf
[
0
]
&
0xfc
)
>>
2
;
// 1111 1100
bool
AMFPointer
::
decode
(
Ngap_AMFPointer_t
&
amf_
pointer
)
{
if
(
!
amf
_
pointer
.
buf
)
return
false
;
pointer
_
=
(
amf_
pointer
.
buf
[
0
]
&
0xfc
)
>>
2
;
// 1111 1100
return
true
;
}
...
...
src/ngap/ngapIEs/AMFPointer.hpp
View file @
d1bb9b5f
...
...
@@ -23,7 +23,7 @@
#define _AMFPOINTER_H_
#include <string>
constexpr
uint8_t
kAmfPointerMaxValue
=
63
;
// 6 bits
extern
"C"
{
#include "Ngap_AMFPointer.h"
}
...
...
@@ -35,15 +35,15 @@ class AMFPointer {
AMFPointer
();
virtual
~
AMFPointer
();
void
setAMFPointer
(
const
std
::
string
);
void
get
AMFPointer
(
std
::
string
&
);
void
setAMFPointer
(
const
uint8_t
&
);
bool
set
(
const
std
::
string
&
);
void
get
(
std
::
string
&
);
bool
set
(
const
uint8_t
&
);
bool
encode
2bitstring
(
Ngap_AMFPointer_t
&
);
bool
decode
frombitstring
(
Ngap_AMFPointer_t
&
);
bool
encode
(
Ngap_AMFPointer_t
&
);
bool
decode
(
Ngap_AMFPointer_t
&
);
private:
uint8_t
pointer
;
uint8_t
pointer
_
;
};
}
// namespace ngap
...
...
src/ngap/ngapIEs/AMFRegionID.cpp
View file @
d1bb9b5f
...
...
@@ -52,7 +52,7 @@ void AMFRegionID::getAMFRegionID(std::string& charid) {
}
//------------------------------------------------------------------------------
bool
AMFRegionID
::
encode
2bitstring
(
Ngap_AMFRegionID_t
&
amfregionid
)
{
bool
AMFRegionID
::
encode
(
Ngap_AMFRegionID_t
&
amfregionid
)
{
amfregionid
.
size
=
1
;
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
sizeof
(
uint8_t
));
if
(
!
buffer
)
return
false
;
...
...
@@ -64,7 +64,7 @@ bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t& amfregionid) {
}
//------------------------------------------------------------------------------
bool
AMFRegionID
::
decode
frombitstring
(
Ngap_AMFRegionID_t
&
amfregionid
)
{
bool
AMFRegionID
::
decode
(
Ngap_AMFRegionID_t
&
amfregionid
)
{
if
(
!
amfregionid
.
buf
)
return
false
;
regionid
=
*
amfregionid
.
buf
;
...
...
src/ngap/ngapIEs/AMFRegionID.hpp
View file @
d1bb9b5f
...
...
@@ -40,8 +40,8 @@ class AMFRegionID {
void
setAMFRegionID
(
const
uint8_t
&
);
bool
encode
2bitstring
(
Ngap_AMFRegionID_t
&
);
bool
decode
frombitstring
(
Ngap_AMFRegionID_t
&
);
bool
encode
(
Ngap_AMFRegionID_t
&
);
bool
decode
(
Ngap_AMFRegionID_t
&
);
private:
uint8_t
regionid
;
...
...
src/ngap/ngapIEs/AMFSetID.cpp
View file @
d1bb9b5f
...
...
@@ -29,51 +29,56 @@ namespace ngap {
//------------------------------------------------------------------------------
AMFSetID
::
AMFSetID
()
{
setId
=
0
;
id_
=
0
;
}
//------------------------------------------------------------------------------
AMFSetID
::~
AMFSetID
()
{}
//------------------------------------------------------------------------------
void
AMFSetID
::
setAMFSetID
(
const
std
::
string
&
charid
)
{
setId
=
fromString
<
uint16_t
>
(
charid
);
bool
AMFSetID
::
set
(
const
std
::
string
&
id
)
{
uint16_t
tmp
=
fromString
<
uint16_t
>
(
id
);
if
(
tmp
>
kAmfSetIdMaxValue
)
return
false
;
id_
=
tmp
;
return
true
;
}
//------------------------------------------------------------------------------
void
AMFSetID
::
setAMFSetID
(
const
uint16_t
&
set_id
)
{
setId
=
set_id
;
bool
AMFSetID
::
set
(
const
uint16_t
&
id
)
{
if
(
id
>
kAmfSetIdMaxValue
)
return
false
;
id_
=
id
;
return
true
;
}
//------------------------------------------------------------------------------
void
AMFSetID
::
get
AMFSetID
(
std
::
string
&
char
id
)
{
charid
=
std
::
to_string
(
setId
);
void
AMFSetID
::
get
(
std
::
string
&
id
)
{
id
=
std
::
to_string
(
id_
);
}
//------------------------------------------------------------------------------
bool
AMFSetID
::
encode
2bitstring
(
Ngap_AMFSetID_t
&
amfSetId
)
{
amf
SetId
.
size
=
2
;
bool
AMFSetID
::
encode
(
Ngap_AMFSetID_t
&
amf_set_id
)
const
{
amf
_set_id
.
size
=
2
;
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
sizeof
(
uint16_t
));
if
(
!
buffer
)
return
false
;
//*(uint16_t *)buffer =
setId
& 0x3ff;
buffer
[
0
]
=
((
setId
&
0x03fc
)
>>
2
);
buffer
[
1
]
=
((
setId
&
0x0003
)
<<
6
);
amf
SetI
d
.
buf
=
buffer
;
amf
SetI
d
.
bits_unused
=
6
;
//*(uint16_t *)buffer =
id_
& 0x3ff;
buffer
[
0
]
=
((
id_
&
0x03fc
)
>>
2
);
buffer
[
1
]
=
((
id_
&
0x0003
)
<<
6
);
amf
_set_i
d
.
buf
=
buffer
;
amf
_set_i
d
.
bits_unused
=
6
;
return
true
;
}
//------------------------------------------------------------------------------
bool
AMFSetID
::
decode
frombitstring
(
Ngap_AMFSetID_t
&
amfSetI
d
)
{
if
(
!
amf
SetI
d
.
buf
)
return
false
;
for
(
int
i
=
0
;
i
<
amf
SetI
d
.
size
;
i
++
)
{
printf
(
"%x "
,
amf
SetI
d
.
buf
[
i
]);
bool
AMFSetID
::
decode
(
const
Ngap_AMFSetID_t
&
amf_set_i
d
)
{
if
(
!
amf
_set_i
d
.
buf
)
return
false
;
for
(
int
i
=
0
;
i
<
amf
_set_i
d
.
size
;
i
++
)
{
printf
(
"%x "
,
amf
_set_i
d
.
buf
[
i
]);
}
printf
(
"
\n
"
);
uint16_t
temp
=
0
;
temp
|=
amf
SetI
d
.
buf
[
0
]
<<
8
;
temp
|=
amf
SetI
d
.
buf
[
1
];
setId
=
(
temp
&
0xffc0
)
>>
6
;
// 1111 1111 11 00 0000
temp
|=
amf
_set_i
d
.
buf
[
0
]
<<
8
;
temp
|=
amf
_set_i
d
.
buf
[
1
];
id_
=
(
temp
&
0xffc0
)
>>
6
;
// 1111 1111 11 00 0000
return
true
;
}
...
...
src/ngap/ngapIEs/AMFSetID.hpp
View file @
d1bb9b5f
...
...
@@ -22,6 +22,7 @@
#define _AMF_SET_ID_H_
#include <string>
constexpr
uint16_t
kAmfSetIdMaxValue
=
1023
;
extern
"C"
{
#include "Ngap_AMFSetID.h"
...
...
@@ -34,15 +35,15 @@ class AMFSetID {
AMFSetID
();
virtual
~
AMFSetID
();
void
setAMFSetID
(
const
std
::
string
&
);
void
setAMFSetID
(
const
uint16_t
&
set_id
);
void
get
AMFSetID
(
std
::
string
&
);
bool
set
(
const
std
::
string
&
);
bool
set
(
const
uint16_t
&
);
void
get
(
std
::
string
&
);
bool
encode
2bitstring
(
Ngap_AMFSetID_t
&
)
;
bool
decode
frombitstring
(
Ngap_AMFSetID_t
&
);
bool
encode
(
Ngap_AMFSetID_t
&
)
const
;
bool
decode
(
const
Ngap_AMFSetID_t
&
);
private:
uint16_t
setId
;
uint16_t
id_
;
};
}
// namespace ngap
...
...
src/ngap/ngapIEs/CriticalityDiagnostics.cpp
View file @
d1bb9b5f
...
...
@@ -121,7 +121,7 @@ int CriticalityDiagnostics::encode2pdu(Ngap_NGSetupFailure_t* ngSetupFailure) {
}
//------------------------------------------------------------------------------
bool
CriticalityDiagnostics
::
decode
fromp
du
(
Ngap_CriticalityDiagnostics_t
*
pdu
)
{
bool
CriticalityDiagnostics
::
decode
FromP
du
(
Ngap_CriticalityDiagnostics_t
*
pdu
)
{
// timeValue = *pdu;
if
(
pdu
->
procedureCode
)
{
procedureCodeIsSet
=
true
;
...
...
@@ -141,7 +141,7 @@ bool CriticalityDiagnostics::decodefrompdu(Ngap_CriticalityDiagnostics_t* pdu) {
iEsCriticalityDiagnostics
=
new
IEsCriticalityDiagnostics
[
numberOfIEsCriticalityDiagnostics
]();
for
(
int
i
=
0
;
i
<
numberOfIEsCriticalityDiagnostics
;
i
++
)
{
iEsCriticalityDiagnostics
[
i
].
decode
fromp
du
(
iEsCriticalityDiagnostics
[
i
].
decode
FromP
du
(
pdu
->
iEsCriticalityDiagnostics
->
list
.
array
[
i
]);
}
}
...
...
src/ngap/ngapIEs/CriticalityDiagnostics.hpp
View file @
d1bb9b5f
...
...
@@ -39,7 +39,7 @@ class CriticalityDiagnostics {
virtual
~
CriticalityDiagnostics
();
int
encode2pdu
(
Ngap_NGSetupFailure_t
*
);
bool
decode
fromp
du
(
Ngap_CriticalityDiagnostics_t
*
);
bool
decode
FromP
du
(
Ngap_CriticalityDiagnostics_t
*
);
void
setProcedureCodeValue
(
Ngap_ProcedureCode_t
);
void
setTriggeringMessageValue
(
Ngap_TriggeringMessage_t
);
void
setCriticalityValue
(
Ngap_Criticality_t
);
...
...
src/ngap/ngapIEs/FiveGSTmsi.cpp
View file @
d1bb9b5f
...
...
@@ -31,47 +31,48 @@ FiveGSTmsi::FiveGSTmsi() {}
FiveGSTmsi
::~
FiveGSTmsi
()
{}
//------------------------------------------------------------------------------
bool
FiveGSTmsi
::
decode
fromp
du
(
Ngap_FiveG_S_TMSI_t
pdu
)
{
amf
Setid
.
decodefrombitstring
(
pdu
.
aMFSetID
);
amf
Pointer
.
decodefrombitstring
(
pdu
.
aMFPointer
);
bool
FiveGSTmsi
::
decode
FromP
du
(
Ngap_FiveG_S_TMSI_t
pdu
)
{
amf
_set_id_
.
decode
(
pdu
.
aMFSetID
);
amf
_pointer_
.
decode
(
pdu
.
aMFPointer
);
uint32_t
tmsi
=
ntohl
(
*
(
uint32_t
*
)
pdu
.
fiveG_TMSI
.
buf
);
int
size
=
pdu
.
fiveG_TMSI
.
size
;
std
::
string
setId
,
pointer
;
amf
Setid
.
getAMFSetID
(
setId
);
amf
Pointer
.
getAMFPointer
(
pointer
);
_5g_s_tmsi
=
setId
+
pointer
+
conv
::
tmsi_to_string
(
tmsi
);
tmsi_value
=
conv
::
tmsi_to_string
(
tmsi
);
amf
_set_id_
.
get
(
setId
);
amf
_pointer_
.
get
(
pointer
);
_5g_s_tmsi
_
=
setId
+
pointer
+
conv
::
tmsi_to_string
(
tmsi
);
tmsi_value
_
=
conv
::
tmsi_to_string
(
tmsi
);
return
true
;
}
//------------------------------------------------------------------------------
void
FiveGSTmsi
::
get
Value
(
std
::
string
&
tmsi
)
{
tmsi
=
_5g_s_tmsi
;
void
FiveGSTmsi
::
get
Tmsi
(
std
::
string
&
tmsi
)
{
tmsi
=
_5g_s_tmsi
_
;
}
//------------------------------------------------------------------------------
void
FiveGSTmsi
::
get
Value
(
std
::
string
&
setid
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
)
{
amf
Setid
.
getAMFSetID
(
set
id
);
amf
Pointer
.
getAMFPointer
(
pointer
);
tmsi
=
tmsi_value
;
void
FiveGSTmsi
::
get
(
std
::
string
&
set
_
id
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
)
{
amf
_set_id_
.
get
(
set_
id
);
amf
_pointer_
.
get
(
pointer
);
tmsi
=
tmsi_value
_
;
}
//------------------------------------------------------------------------------
void
FiveGSTmsi
::
setValue
(
const
std
::
string
&
set
I
d
,
const
std
::
string
&
pointer
,
bool
FiveGSTmsi
::
set
(
const
std
::
string
&
set
_i
d
,
const
std
::
string
&
pointer
,
const
std
::
string
&
tmsi
)
{
amfSetid
.
setAMFSetID
(
setId
);
amfPointer
.
setAMFPointer
(
pointer
);
_5g_s_tmsi
=
tmsi
;
if
(
!
amf_set_id_
.
set
(
set_id
))
return
false
;
if
(
!
amf_pointer_
.
set
(
pointer
))
return
false
;
_5g_s_tmsi_
=
tmsi
;
return
true
;
}
//------------------------------------------------------------------------------
bool
FiveGSTmsi
::
encode2pdu
(
Ngap_FiveG_S_TMSI_t
*
pdu
)
{
amf
Setid
.
encode2bitstring
(
pdu
->
aMFSetID
);
amf
Pointer
.
encode2bitstring
(
pdu
->
aMFPointer
);
amf
_set_id_
.
encode
(
pdu
->
aMFSetID
);
amf
_pointer_
.
encode
(
pdu
->
aMFPointer
);
uint32_t
tmsi
=
(
uint32_t
)
std
::
stol
(
_5g_s_tmsi
);
uint32_t
tmsi
=
(
uint32_t
)
std
::
stol
(
_5g_s_tmsi
_
);
uint8_t
*
buf
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint32_t
));
*
(
uint32_t
*
)
buf
=
htonl
(
tmsi
);
pdu
->
fiveG_TMSI
.
buf
=
buf
;
...
...
src/ngap/ngapIEs/FiveGSTmsi.hpp
View file @
d1bb9b5f
...
...
@@ -38,20 +38,20 @@ class FiveGSTmsi {
~
FiveGSTmsi
();
public:
bool
decode
fromp
du
(
Ngap_FiveG_S_TMSI_t
pdu
);
void
get
Value
(
std
::
string
&
value
);
void
get
Value
(
std
::
string
&
setId
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
);
void
setValue
(
bool
decode
FromP
du
(
Ngap_FiveG_S_TMSI_t
pdu
);
void
get
Tmsi
(
std
::
string
&
value
);
void
get
(
std
::
string
&
setId
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
);
bool
set
(
const
std
::
string
&
setId
,
const
std
::
string
&
pointer
,
const
std
::
string
&
tmsi
);
bool
encode2pdu
(
Ngap_FiveG_S_TMSI_t
*
pdu
);
private:
std
::
string
_5g_s_tmsi
;
std
::
string
tmsi_value
;
std
::
string
_5g_s_tmsi
_
;
std
::
string
tmsi_value
_
;
AMFSetID
amf
Setid
;
AMFPointer
amf
Pointer
;
AMFSetID
amf
_set_id_
;
AMFPointer
amf
_pointer_
;
};
}
// namespace ngap
...
...
src/ngap/ngapIEs/GUAMI.cpp
View file @
d1bb9b5f
...
...
@@ -43,31 +43,33 @@ void GUAMI::setGUAMI(
}
//------------------------------------------------------------------------------
void
GUAMI
::
setGUAMI
(
bool
GUAMI
::
setGUAMI
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
uint8_t
&
regionId
,
const
uint16_t
&
setId
,
const
uint8_t
&
pointer
)
{
plmnId
.
set
(
mcc
,
mnc
);
aMFRegionID
.
setAMFRegionID
(
regionId
);
aMFSetID
.
setAMFSetID
(
setId
);
aMFPointer
.
setAMFPointer
(
pointer
);
if
(
!
aMFSetID
.
set
(
setId
))
return
false
;
if
(
!
aMFPointer
.
set
(
pointer
))
return
false
;
return
true
;
}
//------------------------------------------------------------------------------
void
GUAMI
::
setGUAMI
(
bool
GUAMI
::
setGUAMI
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
std
::
string
&
regionId
,
const
std
::
string
&
setId
,
const
std
::
string
&
pointer
)
{
plmnId
.
set
(
mcc
,
mnc
);
aMFRegionID
.
setAMFRegionID
(
regionId
);
aMFSetID
.
setAMFSetID
(
setId
);
aMFPointer
.
setAMFPointer
(
pointer
);
if
(
!
aMFSetID
.
set
(
setId
))
return
false
;
if
(
!
aMFPointer
.
set
(
pointer
))
return
false
;
return
true
;
}
//------------------------------------------------------------------------------
bool
GUAMI
::
encode2GUAMI
(
Ngap_GUAMI_t
*
guami
)
{
if
(
!
plmnId
.
encode
(
guami
->
pLMNIdentity
))
return
false
;
if
(
!
aMFRegionID
.
encode
2bitstring
(
guami
->
aMFRegionID
))
return
false
;
if
(
!
aMFSetID
.
encode
2bitstring
(
guami
->
aMFSetID
))
return
false
;
if
(
!
aMFPointer
.
encode
2bitstring
(
guami
->
aMFPointer
))
return
false
;
if
(
!
aMFRegionID
.
encode
(
guami
->
aMFRegionID
))
return
false
;
if
(
!
aMFSetID
.
encode
(
guami
->
aMFSetID
))
return
false
;
if
(
!
aMFPointer
.
encode
(
guami
->
aMFPointer
))
return
false
;
return
true
;
}
...
...
@@ -75,9 +77,9 @@ bool GUAMI::encode2GUAMI(Ngap_GUAMI_t* guami) {
//------------------------------------------------------------------------------
bool
GUAMI
::
decodefromGUAMI
(
Ngap_GUAMI_t
*
pdu
)
{
if
(
!
plmnId
.
decode
(
pdu
->
pLMNIdentity
))
return
false
;
if
(
!
aMFRegionID
.
decode
frombitstring
(
pdu
->
aMFRegionID
))
return
false
;
if
(
!
aMFSetID
.
decode
frombitstring
(
pdu
->
aMFSetID
))
return
false
;
if
(
!
aMFPointer
.
decode
frombitstring
(
pdu
->
aMFPointer
))
return
false
;
if
(
!
aMFRegionID
.
decode
(
pdu
->
aMFRegionID
))
return
false
;
if
(
!
aMFSetID
.
decode
(
pdu
->
aMFSetID
))
return
false
;
if
(
!
aMFPointer
.
decode
(
pdu
->
aMFPointer
))
return
false
;
return
true
;
}
...
...
@@ -98,8 +100,8 @@ void GUAMI::getGUAMI(
plmnId
.
getMcc
(
mcc
);
plmnId
.
getMnc
(
mnc
);
aMFRegionID
.
getAMFRegionID
(
regionId
);
aMFSetID
.
get
AMFSetID
(
setId
);
aMFPointer
.
get
AMFPointer
(
pointer
);
aMFSetID
.
get
(
setId
);
aMFPointer
.
get
(
pointer
);
}
}
// namespace ngap
src/ngap/ngapIEs/GUAMI.hpp
View file @
d1bb9b5f
...
...
@@ -41,11 +41,11 @@ class GUAMI {
void
setGUAMI
(
const
PlmnId
&
m_plmnId
,
const
AMFRegionID
&
m_aMFRegionID
,
const
AMFSetID
&
m_aMFSetID
,
const
AMFPointer
&
m_aMFPointer
);
void
setGUAMI
(
bool
setGUAMI
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
uint8_t
&
regionId
,
const
uint16_t
&
setId
,
const
uint8_t
&
pointer
);
void
setGUAMI
(
bool
setGUAMI
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
std
::
string
&
regionId
,
const
std
::
string
&
setId
,
const
std
::
string
&
pointer
);
...
...
src/ngap/ngapIEs/IEsCriticalityDiagnostics.cpp
View file @
d1bb9b5f
...
...
@@ -58,7 +58,7 @@ void IEsCriticalityDiagnostics::encode2pdu(
}
//------------------------------------------------------------------------------
void
IEsCriticalityDiagnostics
::
decode
fromp
du
(
void
IEsCriticalityDiagnostics
::
decode
FromP
du
(
Ngap_CriticalityDiagnostics_IE_Item_t
*
pdu
)
{
criticality
=
pdu
->
iECriticality
;
protocolIE_ID
=
pdu
->
iE_ID
;
...
...
src/ngap/ngapIEs/IEsCriticalityDiagnostics.hpp
View file @
d1bb9b5f
...
...
@@ -34,7 +34,7 @@ class IEsCriticalityDiagnostics {
virtual
~
IEsCriticalityDiagnostics
();
void
encode2pdu
(
Ngap_CriticalityDiagnostics_IE_Item_t
*
);
void
decode
fromp
du
(
Ngap_CriticalityDiagnostics_IE_Item_t
*
);
void
decode
FromP
du
(
Ngap_CriticalityDiagnostics_IE_Item_t
*
);
void
setIeCriticality
(
Ngap_Criticality_t
);
void
setIeId
(
Ngap_ProtocolIE_ID_t
);
void
setTypeOfError
(
Ngap_TypeOfError_t
);
...
...
src/ngap/ngapIEs/MessageType.hpp
View file @
d1bb9b5f
...
...
@@ -48,7 +48,7 @@ class MessageType {
void
setValuePresent
(
Ngap_SuccessfulOutcome__value_PR
m_valuePresent
);
void
setValuePresent
(
Ngap_UnsuccessfulOutcome__value_PR
m_valuePresent
);
// void decode
fromp
du(Ngap_NGAP_PDU_t*);
// void decode
FromP
du(Ngap_NGAP_PDU_t*);
Ngap_ProcedureCode_t
getProcedureCode
();
Ngap_NGAP_PDU_PR
getTypeOfMessage
();
Ngap_Criticality
getCriticality
();
...
...
src/ngap/ngapIEs/NR-CGI.cpp
View file @
d1bb9b5f
...
...
@@ -63,7 +63,7 @@ void NR_CGI::getNR_CGI(struct NrCgi_s& cig) {
//------------------------------------------------------------------------------
bool
NR_CGI
::
encode2NR_CGI
(
Ngap_NR_CGI_t
*
nr_cgi
)
{
if
(
!
plmnId
.
encode
(
nr_cgi
->
pLMNIdentity
))
return
false
;
if
(
!
nRCellIdentity
.
encode
2bitstring
(
nr_cgi
->
nRCellIdentity
))
return
false
;
if
(
!
nRCellIdentity
.
encode
(
nr_cgi
->
nRCellIdentity
))
return
false
;
return
true
;
}
...
...
@@ -71,7 +71,7 @@ bool NR_CGI::encode2NR_CGI(Ngap_NR_CGI_t* nr_cgi) {
//------------------------------------------------------------------------------
bool
NR_CGI
::
decodefromNR_CGI
(
Ngap_NR_CGI_t
*
nr_cgi
)
{
if
(
!
plmnId
.
decode
(
nr_cgi
->
pLMNIdentity
))
return
false
;
if
(
!
nRCellIdentity
.
decode
frombitstring
(
nr_cgi
->
nRCellIdentity
))
return
false
;
if
(
!
nRCellIdentity
.
decode
(
nr_cgi
->
nRCellIdentity
))
return
false
;
return
true
;
}
...
...
src/ngap/ngapIEs/NRCellIdentity.cpp
View file @
d1bb9b5f
...
...
@@ -40,7 +40,7 @@ void NRCellIdentity::setNRCellIdentity(unsigned long m_nrcellidentity) {
}
//------------------------------------------------------------------------------
bool
NRCellIdentity
::
encode
2bitstring
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
)
{
bool
NRCellIdentity
::
encode
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
)
{
nRCellIdentity
.
bits_unused
=
4
;
nRCellIdentity
.
size
=
5
;
nRCellIdentity
.
buf
=
(
uint8_t
*
)
calloc
(
1
,
sizeof
(
uint32_t
)
+
sizeof
(
uint8_t
));
...
...
@@ -55,8 +55,7 @@ bool NRCellIdentity::encode2bitstring(Ngap_NRCellIdentity_t& nRCellIdentity) {
}
//------------------------------------------------------------------------------
bool
NRCellIdentity
::
decodefrombitstring
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
)
{
bool
NRCellIdentity
::
decode
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
)
{
if
(
!
nRCellIdentity
.
buf
)
return
false
;
nrcellidentity
=
nRCellIdentity
.
buf
[
0
];
...
...
src/ngap/ngapIEs/NRCellIdentity.hpp
View file @
d1bb9b5f
...
...
@@ -33,8 +33,8 @@ class NRCellIdentity {
NRCellIdentity
();
virtual
~
NRCellIdentity
();
bool
encode
2bitstring
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
);
bool
decode
frombitstring
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
);
bool
encode
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
);
bool
decode
(
Ngap_NRCellIdentity_t
&
nRCellIdentity
);
unsigned
long
getNRCellIdentity
();
void
setNRCellIdentity
(
unsigned
long
m_nrcellidentity
);
...
...
src/ngap/ngapIEs/RRCEstablishmentCause.cpp
View file @
d1bb9b5f
...
...
@@ -21,41 +21,36 @@
#include "RRCEstablishmentCause.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
//------------------------------------------------------------------------------
RRCEstablishmentCause
::
RRCEstablishmentCause
()
{
rrcestablishmentcause
=
-
1
;
cause_
=
-
1
;
}
//------------------------------------------------------------------------------
RRCEstablishmentCause
::~
RRCEstablishmentCause
()
{}
//------------------------------------------------------------------------------
void
RRCEstablishmentCause
::
setRRCEstablishmentCause
(
e_Ngap_RRCEstablishmentCause
m_rrcestablishmentcause
)
{
rrcestablishmentcause
=
m_rrcestablishmentcause
;
void
RRCEstablishmentCause
::
set
(
const
e_Ngap_RRCEstablishmentCause
&
cause
)
{
cause_
=
cause
;
}
//------------------------------------------------------------------------------
int
RRCEstablishmentCause
::
get
RRCEstablishmentCause
()
{
return
rrcestablishmentcause
;
int
RRCEstablishmentCause
::
get
()
const
{
return
cause_
;
}
//------------------------------------------------------------------------------
bool
RRCEstablishmentCause
::
encode2RRCEstablishmentCause
(
Ngap_RRCEstablishmentCause_t
&
rRCEstablishmentCause
)
{
rRCEstablishmentCause
=
rrcestablishmentcause
;
bool
RRCEstablishmentCause
::
encode
(
Ngap_RRCEstablishmentCause_t
&
cause
)
const
{
cause
=
cause_
;
return
true
;
}
//------------------------------------------------------------------------------
bool
RRCEstablishmentCause
::
decode
fromRRCEstablishmentCause
(
Ngap_RRCEstablishmentCause_t
&
rRCEstablishmentCause
)
{
rrcestablishmentcause
=
rRCEstablishmentCause
;
bool
RRCEstablishmentCause
::
decode
(
const
Ngap_RRCEstablishmentCause_t
&
cause
)
{
cause_
=
cause
;
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/RRCEstablishmentCause.hpp
View file @
d1bb9b5f
...
...
@@ -33,15 +33,14 @@ class RRCEstablishmentCause {
RRCEstablishmentCause
();
virtual
~
RRCEstablishmentCause
();
void
setRRCEstablishmentCause
(
e_Ngap_RRCEstablishmentCause
m_rrcestablishmentcause
);
int
getRRCEstablishmentCause
();
void
set
(
const
e_Ngap_RRCEstablishmentCause
&
cause
);
int
get
()
const
;
bool
encode
2RRCEstablishmentCause
(
Ngap_RRCEstablishmentCause_t
&
)
;
bool
decode
fromRRCEstablishmentCause
(
Ngap_RRCEstablishmentCause_t
&
);
bool
encode
(
Ngap_RRCEstablishmentCause_t
&
)
const
;
bool
decode
(
const
Ngap_RRCEstablishmentCause_t
&
);
private:
int
rrcestablishmentcause
;
int
cause_
;
};
}
// namespace ngap
...
...
src/ngap/ngapIEs/SecurityKey.cpp
View file @
d1bb9b5f
...
...
@@ -33,7 +33,7 @@ SecurityKey::SecurityKey() {
SecurityKey
::~
SecurityKey
()
{}
//------------------------------------------------------------------------------
bool
SecurityKey
::
encode
2bitstring
(
Ngap_SecurityKey_t
&
m_securitykey
)
{
bool
SecurityKey
::
encode
(
Ngap_SecurityKey_t
&
m_securitykey
)
{
m_securitykey
.
bits_unused
=
0
;
m_securitykey
.
size
=
32
;
uint8_t
*
buffer
=
(
uint8_t
*
)
calloc
(
1
,
32
);
...
...
@@ -45,7 +45,7 @@ bool SecurityKey::encode2bitstring(Ngap_SecurityKey_t& m_securitykey) {
}
//------------------------------------------------------------------------------
bool
SecurityKey
::
decode
frombitstring
(
Ngap_SecurityKey_t
&
m_securitykey
)
{
bool
SecurityKey
::
decode
(
Ngap_SecurityKey_t
&
m_securitykey
)
{
securitykeybuffer
=
m_securitykey
.
buf
;
return
true
;
}
...
...
src/ngap/ngapIEs/SecurityKey.hpp
View file @
d1bb9b5f
...
...
@@ -33,8 +33,8 @@ class SecurityKey {
SecurityKey
();
virtual
~
SecurityKey
();
bool
encode
2bitstring
(
Ngap_SecurityKey_t
&
);
bool
decode
frombitstring
(
Ngap_SecurityKey_t
&
);
bool
encode
(
Ngap_SecurityKey_t
&
);
bool
decode
(
Ngap_SecurityKey_t
&
);
bool
getSecurityKey
(
uint8_t
*&
buffer
);
void
setSecurityKey
(
uint8_t
*
buffer
);
...
...
src/ngap/ngapIEs/UEPagingIdentity.cpp
View file @
d1bb9b5f
...
...
@@ -33,18 +33,18 @@ UEPagingIdentity::~UEPagingIdentity() {}
void
UEPagingIdentity
::
setUEPagingIdentity
(
const
std
::
string
&
setid
,
const
std
::
string
&
pointer
,
const
std
::
string
&
tmsi
)
{
fiveGSTmsi
.
set
Value
(
setid
,
pointer
,
tmsi
);
fiveGSTmsi
.
set
(
setid
,
pointer
,
tmsi
);
}
//------------------------------------------------------------------------------
void
UEPagingIdentity
::
getUEPagingIdentity
(
std
::
string
&
_5g_s_tmsi
)
{
fiveGSTmsi
.
get
Value
(
_5g_s_tmsi
);
fiveGSTmsi
.
get
Tmsi
(
_5g_s_tmsi
);
}
//------------------------------------------------------------------------------
void
UEPagingIdentity
::
getUEPagingIdentity
(
std
::
string
&
setid
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
)
{
fiveGSTmsi
.
get
Value
(
setid
,
pointer
,
tmsi
);
fiveGSTmsi
.
get
(
setid
,
pointer
,
tmsi
);
}
//------------------------------------------------------------------------------
...
...
@@ -59,9 +59,9 @@ bool UEPagingIdentity::encode2pdu(Ngap_UEPagingIdentity_t* pdu) {
}
//------------------------------------------------------------------------------
bool
UEPagingIdentity
::
decode
fromp
du
(
Ngap_UEPagingIdentity_t
pdu
)
{
bool
UEPagingIdentity
::
decode
FromP
du
(
Ngap_UEPagingIdentity_t
pdu
)
{
if
(
pdu
.
present
!=
Ngap_UEPagingIdentity_PR_fiveG_S_TMSI
)
return
false
;
if
(
!
fiveGSTmsi
.
decode
fromp
du
(
*
pdu
.
choice
.
fiveG_S_TMSI
))
return
false
;
if
(
!
fiveGSTmsi
.
decode
FromP
du
(
*
pdu
.
choice
.
fiveG_S_TMSI
))
return
false
;
return
true
;
}
...
...
src/ngap/ngapIEs/UEPagingIdentity.hpp
View file @
d1bb9b5f
...
...
@@ -43,7 +43,7 @@ class UEPagingIdentity {
std
::
string
&
setid
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
);
bool
encode2pdu
(
Ngap_UEPagingIdentity_t
*
pdu
);
bool
decode
fromp
du
(
Ngap_UEPagingIdentity_t
pdu
);
bool
decode
FromP
du
(
Ngap_UEPagingIdentity_t
pdu
);
private:
FiveGSTmsi
fiveGSTmsi
;
...
...
src/ngap/ngapMsgs/HandoverRequest.cpp
View file @
d1bb9b5f
...
...
@@ -263,7 +263,7 @@ void HandoverRequest::setAllowedNSSAI(std::vector<S_NSSAI>& list) {
void
HandoverRequest
::
setSecurityContext
(
const
long
&
count
,
uint8_t
*
buffer
)
{
SecurityKey
securitykey
;
securitykey
.
setSecurityKey
(
buffer
);
securitykey
.
encode
2bitstring
(
securityContext
.
nextHopNH
);
securitykey
.
encode
(
securityContext
.
nextHopNH
);
securityContext
.
nextHopChainingCount
=
count
;
Ngap_HandoverRequestIEs_t
*
ie
=
...
...
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
View file @
d1bb9b5f
...
...
@@ -359,7 +359,7 @@ void InitialContextSetupRequestMsg::setSecurityKey(uint8_t* key) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_InitialContextSetupRequestIEs__value_PR_SecurityKey
;
int
ret
=
securityKey
.
encode
2bitstring
(
ie
->
value
.
choice
.
SecurityKey
);
int
ret
=
securityKey
.
encode
(
ie
->
value
.
choice
.
SecurityKey
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode SecurityKey IE error!"
);
free_wrapper
((
void
**
)
&
ie
);
...
...
@@ -620,7 +620,7 @@ bool InitialContextSetupRequestMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
initialContextSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialContextSetupRequestIEs__value_PR_SecurityKey
)
{
if
(
!
securityKey
.
decode
frombitstring
(
if
(
!
securityKey
.
decode
(
initialContextSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
SecurityKey
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP SecurityKey IE error"
);
...
...
src/ngap/ngapMsgs/InitialUEMessage.cpp
View file @
d1bb9b5f
...
...
@@ -126,7 +126,7 @@ void InitialUEMessageMsg::setUserLocationInfoNR(
//------------------------------------------------------------------------------
void
InitialUEMessageMsg
::
setRRCEstablishmentCause
(
const
e_Ngap_RRCEstablishmentCause
&
cause
)
{
rRCEstablishmentCause
.
set
RRCEstablishmentCause
(
cause
);
rRCEstablishmentCause
.
set
(
cause
);
Ngap_InitialUEMessage_IEs_t
*
ie
=
(
Ngap_InitialUEMessage_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_InitialUEMessage_IEs_t
));
...
...
@@ -134,8 +134,8 @@ void InitialUEMessageMsg::setRRCEstablishmentCause(
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_InitialUEMessage_IEs__value_PR_RRCEstablishmentCause
;
int
ret
=
rRCEstablishmentCause
.
encode2RRCEstablishmentCause
(
ie
->
value
.
choice
.
RRCEstablishmentCause
);
int
ret
=
rRCEstablishmentCause
.
encode
(
ie
->
value
.
choice
.
RRCEstablishmentCause
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode RRCEstablishmentCause IE error"
);
free_wrapper
((
void
**
)
&
ie
);
...
...
@@ -251,7 +251,7 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_ignore
&&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialUEMessage_IEs__value_PR_RRCEstablishmentCause
)
{
if
(
!
rRCEstablishmentCause
.
decode
fromRRCEstablishmentCause
(
if
(
!
rRCEstablishmentCause
.
decode
(
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RRCEstablishmentCause
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP RRCEstablishmentCause IE error"
);
...
...
@@ -286,7 +286,7 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialUEMessage_IEs__value_PR_FiveG_S_TMSI
)
{
fivegSTmsi
=
new
FiveGSTmsi
();
if
(
!
fivegSTmsi
->
decode
fromp
du
(
if
(
!
fivegSTmsi
->
decode
FromP
du
(
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
FiveG_S_TMSI
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP FiveG_S_TMSI IE error"
);
...
...
@@ -338,7 +338,7 @@ bool InitialUEMessageMsg::getUserLocationInfoNR(
//------------------------------------------------------------------------------
int
InitialUEMessageMsg
::
getRRCEstablishmentCause
()
{
return
rRCEstablishmentCause
.
get
RRCEstablishmentCause
();
return
rRCEstablishmentCause
.
get
();
}
//------------------------------------------------------------------------------
...
...
@@ -353,7 +353,7 @@ int InitialUEMessageMsg::getUeContextRequest() {
//------------------------------------------------------------------------------
bool
InitialUEMessageMsg
::
get5GS_TMSI
(
std
::
string
&
_5GsTmsi
)
{
if
(
fivegSTmsi
)
{
fivegSTmsi
->
get
Value
(
_5GsTmsi
);
fivegSTmsi
->
get
Tmsi
(
_5GsTmsi
);
return
true
;
}
else
return
false
;
...
...
@@ -363,7 +363,7 @@ bool InitialUEMessageMsg::get5GS_TMSI(std::string& _5GsTmsi) {
bool
InitialUEMessageMsg
::
get5GS_TMSI
(
std
::
string
&
setid
,
std
::
string
&
pointer
,
std
::
string
&
tmsi
)
{
if
(
fivegSTmsi
)
{
fivegSTmsi
->
get
Value
(
setid
,
pointer
,
tmsi
);
fivegSTmsi
->
get
(
setid
,
pointer
,
tmsi
);
return
true
;
}
else
return
false
;
...
...
src/ngap/ngapMsgs/Paging.cpp
View file @
d1bb9b5f
...
...
@@ -72,7 +72,7 @@ bool PagingMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_ignore
&&
pagingIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_PagingIEs__value_PR_UEPagingIdentity
)
{
if
(
!
uePagingIdentity
.
decode
fromp
du
(
if
(
!
uePagingIdentity
.
decode
FromP
du
(
pagingIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UEPagingIdentity
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP UEPagingIdentity IE error"
);
...
...
src/ngap/ngapMsgs/RerouteNASRequest.cpp
View file @
d1bb9b5f
...
...
@@ -175,8 +175,8 @@ bool RerouteNASRequest::getNgapMessage(OCTET_STRING_t& message) const {
}
//------------------------------------------------------------------------------
void
RerouteNASRequest
::
setAMFSetID
(
const
uint16_t
&
amf_set_id
)
{
amfSetID
.
setAMFSetID
(
amf_set_id
)
;
bool
RerouteNASRequest
::
setAMFSetID
(
const
uint16_t
&
amf_set_id
)
{
if
(
!
amfSetID
.
set
(
amf_set_id
))
return
false
;
Ngap_RerouteNASRequest_IEs_t
*
ie
=
(
Ngap_RerouteNASRequest_IEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_RerouteNASRequest_IEs_t
));
...
...
@@ -184,20 +184,24 @@ void RerouteNASRequest::setAMFSetID(const uint16_t& amf_set_id) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_RerouteNASRequest_IEs__value_PR_AMFSetID
;
int
ret
=
amfSetID
.
encode
2bitstring
(
ie
->
value
.
choice
.
AMFSetID
);
int
ret
=
amfSetID
.
encode
(
ie
->
value
.
choice
.
AMFSetID
);
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode AMFSetID IE error!"
);
free_wrapper
((
void
**
)
&
ie
);
return
;
return
false
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
rerouteNASRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode AMFSetID IE error!"
);
if
(
ret
!=
0
)
{
Logger
::
ngap
().
error
(
"Encode AMFSetID IE error!"
);
return
false
;
}
return
true
;
}
//------------------------------------------------------------------------------
void
RerouteNASRequest
::
getAMFSetID
(
std
::
string
&
amf_set_id
)
{
amfSetID
.
get
AMFSetID
(
amf_set_id
);
amfSetID
.
get
(
amf_set_id
);
}
//------------------------------------------------------------------------------
...
...
@@ -274,9 +278,8 @@ bool RerouteNASRequest::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
rerouteNASRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_RerouteNASRequest_IEs__value_PR_AMFSetID
)
{
if
(
!
amfSetID
.
decodefrombitstring
(
rerouteNASRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMFSetID
))
{
if
(
!
amfSetID
.
decode
(
rerouteNASRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMFSetID
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP AMFSetID error"
);
return
false
;
}
...
...
src/ngap/ngapMsgs/RerouteNASRequest.hpp
View file @
d1bb9b5f
...
...
@@ -50,7 +50,7 @@ class RerouteNASRequest : public NgapMessage {
void
setNgapMessage
(
const
OCTET_STRING_t
&
message
);
bool
getNgapMessage
(
OCTET_STRING_t
&
message
)
const
;
void
setAMFSetID
(
const
uint16_t
&
amf_set_id
);
bool
setAMFSetID
(
const
uint16_t
&
amf_set_id
);
void
getAMFSetID
(
std
::
string
&
amf_set_id
);
void
setAllowedNssai
(
const
std
::
vector
<
S_Nssai
>&
list
);
...
...
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