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
1b0cacb0
Commit
1b0cacb0
authored
Sep 22, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactor for 5GSMobileIdentity
parent
5d3d05e5
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
147 additions
and
135 deletions
+147
-135
src/nas/common/3gpp_24.501.hpp
src/nas/common/3gpp_24.501.hpp
+12
-1
src/nas/common/NasIeHeader.hpp
src/nas/common/NasIeHeader.hpp
+1
-1
src/nas/ies/5GSMobileIdentity.cpp
src/nas/ies/5GSMobileIdentity.cpp
+33
-39
src/nas/ies/5GSMobileIdentity.hpp
src/nas/ies/5GSMobileIdentity.hpp
+33
-26
src/nas/ies/NasKeySetIdentifier.cpp
src/nas/ies/NasKeySetIdentifier.cpp
+9
-6
src/nas/ies/NasKeySetIdentifier.hpp
src/nas/ies/NasKeySetIdentifier.hpp
+8
-7
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+5
-5
src/nas/msgs/DeregistrationRequest.hpp
src/nas/msgs/DeregistrationRequest.hpp
+1
-1
src/nas/msgs/IdentityResponse.cpp
src/nas/msgs/IdentityResponse.cpp
+2
-2
src/nas/msgs/IdentityResponse.hpp
src/nas/msgs/IdentityResponse.hpp
+2
-2
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+3
-3
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+3
-3
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+21
-25
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+3
-3
src/nas/msgs/SecurityModeComplete.cpp
src/nas/msgs/SecurityModeComplete.cpp
+4
-4
src/nas/msgs/SecurityModeComplete.hpp
src/nas/msgs/SecurityModeComplete.hpp
+2
-2
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+4
-4
src/nas/msgs/ServiceRequest.hpp
src/nas/msgs/ServiceRequest.hpp
+1
-1
No files found.
src/nas/common/3gpp_24.501.hpp
View file @
1b0cacb0
...
@@ -85,6 +85,7 @@ enum class RegistrationTypeEnum {
...
@@ -85,6 +85,7 @@ enum class RegistrationTypeEnum {
EMERGENCY_REGISTRATION
=
0b100
,
EMERGENCY_REGISTRATION
=
0b100
,
RESERVED
=
0b111
RESERVED
=
0b111
};
};
#define INITIAL_REGISTRATION 0b001
#define INITIAL_REGISTRATION 0b001
#define MOBILITY_REGISTRATION_UPDATING 0b010
#define MOBILITY_REGISTRATION_UPDATING 0b010
#define PERIODIC_REGISTRATION_UPDATING 0b011
#define PERIODIC_REGISTRATION_UPDATING 0b011
...
@@ -98,12 +99,22 @@ enum class RegistrationTypeEnum {
...
@@ -98,12 +99,22 @@ enum class RegistrationTypeEnum {
/********* 5GSMobilityIdentity **********/
/********* 5GSMobilityIdentity **********/
enum
class
_5GSMobilityIdentityEnum
{
NO_IDENTITY
=
0b000
,
SUCI
=
0b001
,
_5G_GUTI
=
0b010
,
IMEI
=
0b011
,
_5G_S_TMSI
=
0b100
,
IMEISV
=
0b101
,
MAC_ADDRESS
=
0b110
};
#define NO_IDENTITY 0b000
#define NO_IDENTITY 0b000
#define SUCI 0b001
#define SUCI 0b001
#define _5G_GUTI 0b010
#define _5G_GUTI 0b010
#define IMEI 0b011
#define IMEI 0b011
#define _5G_S_TMSI 0b100
#define _5G_S_TMSI 0b100
#define IMEISV
I
0b101
#define IMEISV 0b101
#define MAC_ADDRESS 0b110
#define MAC_ADDRESS 0b110
#define EVEN_IENTITY 0
#define EVEN_IENTITY 0
...
...
src/nas/common/NasIeHeader.hpp
View file @
1b0cacb0
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
#include "../ies/5GSMobileIdentity.hpp"
#include "NasMmPlainHeader.hpp"
#include "NasMmPlainHeader.hpp"
#include "5GMMCapability.hpp"
#include "5GMMCapability.hpp"
#include "5GSMobilityIdentity.hpp"
#include "5GSRegistrationType.hpp"
#include "5GSRegistrationType.hpp"
#include "ABBA.hpp"
#include "ABBA.hpp"
#include "Additional_5G_Security_Information.hpp"
#include "Additional_5G_Security_Information.hpp"
...
...
src/nas/ies/5GSMobil
ity
Identity.cpp
→
src/nas/ies/5GSMobil
e
Identity.cpp
View file @
1b0cacb0
This diff is collapsed.
Click to expand it.
src/nas/ies/5GSMobil
ity
Identity.hpp
→
src/nas/ies/5GSMobil
e
Identity.hpp
View file @
1b0cacb0
...
@@ -19,19 +19,11 @@
...
@@ -19,19 +19,11 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file 5GSMobilityIdentity.hpp
#ifndef _5GS_MOBILE_IDENTITY_H_
\brief
#define _5GS_MOBILE_IDENTITY_H_
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _5GSMobilityIdentity_H_
#define _5GSMobilityIdentity_H_
#include <stdint.h>
#include <stdint.h>
#include <iostream>
#include "struct.hpp"
#include "struct.hpp"
extern
"C"
{
extern
"C"
{
#include "TLVDecoder.h"
#include "TLVDecoder.h"
...
@@ -42,6 +34,7 @@ using namespace std;
...
@@ -42,6 +34,7 @@ using namespace std;
namespace
nas
{
namespace
nas
{
// 5G-GUTI
typedef
struct
_5G_GUTI_s
{
typedef
struct
_5G_GUTI_s
{
string
mcc
;
string
mcc
;
string
mnc
;
string
mnc
;
...
@@ -49,9 +42,9 @@ typedef struct _5G_GUTI_s {
...
@@ -49,9 +42,9 @@ typedef struct _5G_GUTI_s {
uint8_t
amf_set_id
;
uint8_t
amf_set_id
;
uint16_t
amf_pointer
;
uint16_t
amf_pointer
;
uint32_t
_5g_tmsi
;
uint32_t
_5g_tmsi
;
}
_5G_GUTI_t
;
}
_5G_GUTI_t
;
// IMEI or IMEISV
typedef
struct
IMEI_or_IMEISV_s
{
typedef
struct
IMEI_or_IMEISV_s
{
uint8_t
typeOfIdentity
:
3
;
uint8_t
typeOfIdentity
:
3
;
bool
odd_even_indic
;
// for imei, even means bits 5 to 8 of last octet is
bool
odd_even_indic
;
// for imei, even means bits 5 to 8 of last octet is
...
@@ -60,6 +53,7 @@ typedef struct IMEI_or_IMEISV_s {
...
@@ -60,6 +53,7 @@ typedef struct IMEI_or_IMEISV_s {
string
identity
;
// "46011000001"
string
identity
;
// "46011000001"
}
IMEI_IMEISV_t
;
}
IMEI_IMEISV_t
;
// SUCI and SUPI format IMSI
typedef
struct
SUCI_imsi_s
{
typedef
struct
SUCI_imsi_s
{
uint8_t
supi_format
:
3
;
uint8_t
supi_format
:
3
;
string
mcc
;
string
mcc
;
...
@@ -70,25 +64,34 @@ typedef struct SUCI_imsi_s {
...
@@ -70,25 +64,34 @@ typedef struct SUCI_imsi_s {
string
msin
;
// two types of coding; BCD & hexadecimal
string
msin
;
// two types of coding; BCD & hexadecimal
}
SUCI_imsi_t
;
// SUPI format "IMSI"
}
SUCI_imsi_t
;
// SUPI format "IMSI"
//
don't define suci and supi
format "Network specific identifier"
//
TODO: SUCI and SUPI
format "Network specific identifier"
// 5G-S-TMSI
typedef
struct
_5G_S_TMSI_s
{
typedef
struct
_5G_S_TMSI_s
{
uint16_t
amf_set_id
;
uint16_t
amf_set_id
;
uint8_t
amf_pointer
;
uint8_t
amf_pointer
;
string
_5g_tmsi
;
string
_5g_tmsi
;
}
_5G_S_TMSI_t
;
}
_5G_S_TMSI_t
;
class
_5GSMobilityIdentity
{
// TODO: 5GS mobile identity information element for type of identity "MAC
// address"
class
_5GSMobileIdentity
{
public:
public:
_5GSMobil
ity
Identity
(
_5GSMobil
e
Identity
(
uint8_t
_iei
,
const
uint16_t
amfSetId
,
const
uint8_t
amfPointer
,
uint8_t
_iei
,
const
uint16_t
amfSetId
,
const
uint8_t
amfPointer
,
const
string
tmsi
);
const
string
tmsi
);
// 5G-S-TMSI
_5GSMobil
ity
Identity
(
_5GSMobil
e
Identity
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
const
string
msin
);
uint8_t
protection_sch_id
,
_5GSMobilityIdentity
();
const
string
msin
);
// SUCI and SUPI format IMSI
~
_5GSMobilityIdentity
();
_5GSMobileIdentity
();
~
_5GSMobileIdentity
();
uint8_t
getTypeOfIdentity
()
const
{
return
typeOfIdentity
;
};
void
setIEI
(
uint8_t
_iei
);
void
setIEI
(
uint8_t
_iei
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
suci_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
suci_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_guti_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_guti_encode2buffer
(
uint8_t
*
buf
,
int
len
);
...
@@ -98,12 +101,18 @@ class _5GSMobilityIdentity {
...
@@ -98,12 +101,18 @@ class _5GSMobilityIdentity {
int
_5g_s_tmsi_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_s_tmsi_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_s_tmsi_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_s_tmsi_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
imeisv_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
imeisv_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
suci_decodefrombuffer
(
uint8_t
*
buf
,
int
len
,
int
length
);
int
suci_decodefrombuffer
(
uint8_t
*
buf
,
int
len
,
int
length
);
int
_5g_guti_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_guti_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
void
set5GGUTI
(
void
set5GGUTI
(
const
string
mcc
,
const
string
mnc
,
uint8_t
amf_region_id
,
const
string
mcc
,
const
string
mnc
,
uint8_t
amf_region_id
,
uint16_t
amf_set_id
,
uint8_t
amf_pointer
,
const
uint32_t
_5g_tmsi
);
uint16_t
amf_set_id
,
uint8_t
amf_pointer
,
const
uint32_t
_5g_tmsi
);
void
get5GGUTI
(
_5G_GUTI_t
&
);
void
setSuciWithSupiImsi
(
void
setSuciWithSupiImsi
(
const
string
&
mcc
,
const
string
&
mnc
,
const
string
&
routingInd
,
const
string
&
mcc
,
const
string
&
mnc
,
const
string
&
routingInd
,
uint8_t
protecSchId
,
uint8_t
home_pki
,
const
string
&
msin_digits
);
uint8_t
protecSchId
,
uint8_t
home_pki
,
const
string
&
msin_digits
);
...
@@ -111,24 +120,22 @@ class _5GSMobilityIdentity {
...
@@ -111,24 +120,22 @@ class _5GSMobilityIdentity {
const
string
&
mcc
,
const
string
&
mnc
,
const
string
&
routingInd
,
const
string
&
mcc
,
const
string
&
mnc
,
const
string
&
routingInd
,
uint8_t
protecSchId
,
const
string
&
msin_digits
);
uint8_t
protecSchId
,
const
string
&
msin_digits
);
void
getSuciWithSupiImsi
(
SUCI_imsi_t
&
);
void
getSuciWithSupiImsi
(
SUCI_imsi_t
&
);
void
get5GGUTI
(
_5G_GUTI_t
&
);
uint8_t
gettypeOfIdentity
()
{
return
typeOfIdentity
;
};
bool
get5G_S_TMSI
(
uint16_t
&
amfSetId
,
uint8_t
&
amfPointer
,
string
&
tmsi
);
bool
get5G_S_TMSI
(
uint16_t
&
amfSetId
,
uint8_t
&
amfPointer
,
string
&
tmsi
);
void
setIMEISV
(
IMEISV_t
imeisv
);
void
setIMEISV
(
IMEISV_t
imeisv
);
void
getIMEISV
(
IMEISV_t
&
imeisv
);
void
getIMEISV
(
IMEISV_t
&
imeisv
);
int
imeisv_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
imeisv_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
private:
private:
uint8_t
iei
;
uint8_t
iei
;
uint16_t
length
;
uint8_t
typeOfIdentity
:
3
;
_5G_GUTI_t
*
_5g_guti
;
_5G_GUTI_t
*
_5g_guti
;
IMEI_IMEISV_t
*
imei_imeisv
;
IMEI_IMEISV_t
*
imei_imeisv
;
SUCI_imsi_t
*
supi_format_imsi
;
SUCI_imsi_t
*
supi_format_imsi
;
_5G_S_TMSI_t
*
_5g_s_tmsi
;
_5G_S_TMSI_t
*
_5g_s_tmsi
;
bool
is_no_identity
;
bool
is_no_identity
;
uint16_t
length
;
uint8_t
typeOfIdentity
:
3
;
IMEISV_t
_IMEISV
;
IMEISV_t
_IMEISV
;
};
};
...
...
src/nas/ies/NasKeySetIdentifier.cpp
View file @
1b0cacb0
...
@@ -47,7 +47,10 @@ NasKeySetIdentifier::NasKeySetIdentifier(
...
@@ -47,7 +47,10 @@ NasKeySetIdentifier::NasKeySetIdentifier(
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
NasKeySetIdentifier
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
NasKeySetIdentifier
::~
NasKeySetIdentifier
(){};
//------------------------------------------------------------------------------
int
NasKeySetIdentifier
::
encode2Buffer
(
uint8_t
*
buf
,
const
int
&
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding NasKeySetIdentifier IE (IEI 0x%x)"
,
iei_
);
Logger
::
nas_mm
().
debug
(
"Encoding NasKeySetIdentifier IE (IEI 0x%x)"
,
iei_
);
if
(
len
<
kType1IeSize
)
{
if
(
len
<
kType1IeSize
)
{
Logger
::
nas_mm
().
error
(
Logger
::
nas_mm
().
error
(
...
@@ -73,7 +76,7 @@ int NasKeySetIdentifier::encode2Buffer(uint8_t* buf, int len) {
...
@@ -73,7 +76,7 @@ int NasKeySetIdentifier::encode2Buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int
NasKeySetIdentifier
::
decodeFromBuffer
(
int
NasKeySetIdentifier
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
,
bool
is_high
)
{
uint8_t
*
buf
,
const
int
&
len
,
bool
is_option
,
bool
is_high
)
{
Logger
::
nas_mm
().
debug
(
"Decoding NasKeySetIdentifier IE"
);
Logger
::
nas_mm
().
debug
(
"Decoding NasKeySetIdentifier IE"
);
if
(
len
<
kType1IeSize
)
{
if
(
len
<
kType1IeSize
)
{
...
@@ -109,21 +112,21 @@ int NasKeySetIdentifier::decodeFromBuffer(
...
@@ -109,21 +112,21 @@ int NasKeySetIdentifier::decodeFromBuffer(
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NasKeySetIdentifier
::
setTypeOfSecurityContext
(
uint8_t
type
)
{
void
NasKeySetIdentifier
::
setTypeOfSecurityContext
(
const
uint8_t
&
type
)
{
tsc_
=
0x01
&
type
;
tsc_
=
0x01
&
type
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NasKeySetIdentifier
::
setNasKeyIdentifier
(
uint8_t
id
)
{
void
NasKeySetIdentifier
::
setNasKeyIdentifier
(
const
uint8_t
&
id
)
{
key_id_
=
0x07
&
id
;
key_id_
=
0x07
&
id
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_t
NasKeySetIdentifier
::
getTypeOfSecurityContext
()
{
uint8_t
NasKeySetIdentifier
::
getTypeOfSecurityContext
()
const
{
return
tsc_
;
return
tsc_
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_t
NasKeySetIdentifier
::
get
asKeyIdentifier
()
{
uint8_t
NasKeySetIdentifier
::
get
NasKeyIdentifier
()
const
{
return
key_id_
;
return
key_id_
;
}
}
src/nas/ies/NasKeySetIdentifier.hpp
View file @
1b0cacb0
...
@@ -34,13 +34,14 @@ class NasKeySetIdentifier {
...
@@ -34,13 +34,14 @@ class NasKeySetIdentifier {
NasKeySetIdentifier
(
const
uint8_t
&
tsc
,
const
uint8_t
&
key_id
);
NasKeySetIdentifier
(
const
uint8_t
&
tsc
,
const
uint8_t
&
key_id
);
~
NasKeySetIdentifier
();
~
NasKeySetIdentifier
();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
encode2Buffer
(
uint8_t
*
buf
,
const
int
&
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
,
bool
is_high
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
const
int
&
len
,
bool
is_option
,
bool
is_high
);
void
setTypeOfSecurityContext
(
uint8_t
type
);
void
setNasKeyIdentifier
(
uint8_t
id
);
void
setTypeOfSecurityContext
(
const
uint8_t
&
type
);
uint8_t
getTypeOfSecurityContext
();
void
setNasKeyIdentifier
(
const
uint8_t
&
id
);
uint8_t
getasKeyIdentifier
();
uint8_t
getTypeOfSecurityContext
()
const
;
uint8_t
getNasKeyIdentifier
()
const
;
private:
private:
uint8_t
iei_
;
uint8_t
iei_
;
...
...
src/nas/msgs/DeregistrationRequest.cpp
View file @
1b0cacb0
...
@@ -86,8 +86,8 @@ void DeregistrationRequest::getDeregistrationType(
...
@@ -86,8 +86,8 @@ void DeregistrationRequest::getDeregistrationType(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
DeregistrationRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
bool
DeregistrationRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
if
(
ie_ngKSI
)
{
if
(
ie_ngKSI
)
{
ng_ksi
=
ng_ksi
=
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
ie_ngKSI
->
get
asKeyIdentifier
();
ie_ngKSI
->
getN
asKeyIdentifier
();
return
true
;
return
true
;
}
else
{
}
else
{
// ng_ksi = 0;
// ng_ksi = 0;
...
@@ -106,14 +106,14 @@ void DeregistrationRequest::setSUCI_SUPI_format_IMSI(
...
@@ -106,14 +106,14 @@ void DeregistrationRequest::setSUCI_SUPI_format_IMSI(
return
;
return
;
}
else
{
}
else
{
ie_5gs_mobility_id
=
ie_5gs_mobility_id
=
new
_5GSMobil
ity
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
new
_5GSMobil
e
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
}
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DeregistrationRequest
::
getMobilityIdentityType
(
uint8_t
&
type
)
{
void
DeregistrationRequest
::
getMobilityIdentityType
(
uint8_t
&
type
)
{
if
(
ie_5gs_mobility_id
)
{
if
(
ie_5gs_mobility_id
)
{
type
=
ie_5gs_mobility_id
->
get
t
ypeOfIdentity
();
type
=
ie_5gs_mobility_id
->
get
T
ypeOfIdentity
();
}
else
{
}
else
{
type
=
0
;
type
=
0
;
}
}
...
@@ -219,7 +219,7 @@ int DeregistrationRequest::decodeFromBuffer(
...
@@ -219,7 +219,7 @@ int DeregistrationRequest::decodeFromBuffer(
decoded_size
+=
ie_ngKSI
->
decodeFromBuffer
(
decoded_size
+=
ie_ngKSI
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
decoded_size
++
;
decoded_size
++
;
ie_5gs_mobility_id
=
new
_5GSMobil
ity
Identity
();
ie_5gs_mobility_id
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_5gs_mobility_id
->
decodeFromBuffer
(
decoded_size
+=
ie_5gs_mobility_id
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
Logger
::
nas_mm
().
debug
(
Logger
::
nas_mm
().
debug
(
...
...
src/nas/msgs/DeregistrationRequest.hpp
View file @
1b0cacb0
...
@@ -67,7 +67,7 @@ class DeregistrationRequest {
...
@@ -67,7 +67,7 @@ class DeregistrationRequest {
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
_5GSDeregistrationType
*
ie_deregistrationtype
;
_5GSDeregistrationType
*
ie_deregistrationtype
;
NasKeySetIdentifier
*
ie_ngKSI
;
NasKeySetIdentifier
*
ie_ngKSI
;
_5GSMobil
ity
Identity
*
ie_5gs_mobility_id
;
_5GSMobil
e
Identity
*
ie_5gs_mobility_id
;
};
};
}
// namespace nas
}
// namespace nas
...
...
src/nas/msgs/IdentityResponse.cpp
View file @
1b0cacb0
...
@@ -61,7 +61,7 @@ void IdentityResponse::setSUCI_SUPI_format_IMSI(
...
@@ -61,7 +61,7 @@ void IdentityResponse::setSUCI_SUPI_format_IMSI(
return
;
return
;
}
else
{
}
else
{
ie_mobility_id
=
ie_mobility_id
=
new
_5GSMobil
ity
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
new
_5GSMobil
e
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
}
}
}
}
...
@@ -111,7 +111,7 @@ int IdentityResponse::decodeFromBuffer(
...
@@ -111,7 +111,7 @@ int IdentityResponse::decodeFromBuffer(
Logger
::
nas_mm
().
debug
(
"decoding IdentityResponse message"
);
Logger
::
nas_mm
().
debug
(
"decoding IdentityResponse message"
);
int
decoded_size
=
3
;
int
decoded_size
=
3
;
plain_header
=
header
;
plain_header
=
header
;
ie_mobility_id
=
new
_5GSMobil
ity
Identity
();
ie_mobility_id
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_mobility_id
->
decodeFromBuffer
(
decoded_size
+=
ie_mobility_id
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
Logger
::
nas_mm
().
debug
(
"decoded_size(%d)"
,
decoded_size
);
Logger
::
nas_mm
().
debug
(
"decoded_size(%d)"
,
decoded_size
);
...
...
src/nas/msgs/IdentityResponse.hpp
View file @
1b0cacb0
...
@@ -49,10 +49,10 @@ class IdentityResponse {
...
@@ -49,10 +49,10 @@ class IdentityResponse {
void
set5G_GUTI
();
void
set5G_GUTI
();
void
setIMEI_IMEISV
();
void
setIMEI_IMEISV
();
void
set5G_S_TMSI
();
void
set5G_S_TMSI
();
/*** belongs to _5GSMobil
ity
Identity**/
/*** belongs to _5GSMobil
e
Identity**/
public:
public:
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
_5GSMobil
ity
Identity
*
ie_mobility_id
;
_5GSMobil
e
Identity
*
ie_mobility_id
;
};
};
}
// namespace nas
}
// namespace nas
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
1b0cacb0
...
@@ -95,7 +95,7 @@ void RegistrationAccept::setSUCI_SUPI_format_IMSI(
...
@@ -95,7 +95,7 @@ void RegistrationAccept::setSUCI_SUPI_format_IMSI(
return
;
return
;
}
else
{
}
else
{
ie_5g_guti
=
ie_5g_guti
=
new
_5GSMobil
ity
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
new
_5GSMobil
e
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
ie_5g_guti
->
setIEI
(
0x77
);
ie_5g_guti
->
setIEI
(
0x77
);
}
}
}
}
...
@@ -109,7 +109,7 @@ void RegistrationAccept::setSUCI_SUPI_format_IMSI(
...
@@ -109,7 +109,7 @@ void RegistrationAccept::setSUCI_SUPI_format_IMSI(
void
RegistrationAccept
::
set5G_GUTI
(
void
RegistrationAccept
::
set5G_GUTI
(
const
string
mcc
,
const
string
mnc
,
const
string
amfRegionId
,
const
string
mcc
,
const
string
mnc
,
const
string
amfRegionId
,
const
string
amfSetId
,
const
string
amfPointer
,
const
uint32_t
tmsi
)
{
const
string
amfSetId
,
const
string
amfPointer
,
const
uint32_t
tmsi
)
{
ie_5g_guti
=
new
_5GSMobil
ity
Identity
();
ie_5g_guti
=
new
_5GSMobil
e
Identity
();
int
regionId
=
fromString
<
int
>
(
amfRegionId
);
int
regionId
=
fromString
<
int
>
(
amfRegionId
);
int
setId
=
fromString
<
int
>
(
amfSetId
);
int
setId
=
fromString
<
int
>
(
amfSetId
);
int
pointer
=
fromString
<
int
>
(
amfPointer
);
int
pointer
=
fromString
<
int
>
(
amfPointer
);
...
@@ -661,7 +661,7 @@ int RegistrationAccept::decodeFromBuffer(
...
@@ -661,7 +661,7 @@ int RegistrationAccept::decodeFromBuffer(
switch
(
octet
)
{
switch
(
octet
)
{
case
0x77
:
{
case
0x77
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
ie_5g_guti
=
new
_5GSMobil
ity
Identity
();
ie_5g_guti
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_5g_guti
->
decodeFromBuffer
(
decoded_size
+=
ie_5g_guti
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationAccept.hpp
View file @
1b0cacb0
...
@@ -43,7 +43,7 @@ class RegistrationAccept {
...
@@ -43,7 +43,7 @@ class RegistrationAccept {
void
setSOR_Transparent_Container
(
uint8_t
header
,
uint8_t
*
value
);
void
setSOR_Transparent_Container
(
uint8_t
header
,
uint8_t
*
value
);
void
set_5GS_Registration_Result
(
void
set_5GS_Registration_Result
(
bool
emergency
,
bool
nssaa
,
bool
sms
,
uint8_t
value
);
bool
emergency
,
bool
nssaa
,
bool
sms
,
uint8_t
value
);
/*** belongs to _5GSMobil
ity
Identity**/
/*** belongs to _5GSMobil
e
Identity**/
void
setSUCI_SUPI_format_IMSI
(
void
setSUCI_SUPI_format_IMSI
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
const
string
msin
);
uint8_t
protection_sch_id
,
const
string
msin
);
...
@@ -55,7 +55,7 @@ class RegistrationAccept {
...
@@ -55,7 +55,7 @@ class RegistrationAccept {
const
string
amfSetId
,
const
string
amfPointer
,
const
uint32_t
tmsi
);
const
string
amfSetId
,
const
string
amfPointer
,
const
uint32_t
tmsi
);
void
setIMEI_IMEISV
();
void
setIMEI_IMEISV
();
void
set5G_S_TMSI
();
void
set5G_S_TMSI
();
/*** belongs to _5GSMobil
ity
Identity**/
/*** belongs to _5GSMobil
e
Identity**/
void
setEquivalent_PLMNs
(
void
setEquivalent_PLMNs
(
uint8_t
MNC_MCC1
,
uint8_t
MNC_MCC2
,
uint8_t
MNC_MCC3
);
uint8_t
MNC_MCC1
,
uint8_t
MNC_MCC2
,
uint8_t
MNC_MCC3
);
void
setALLOWED_NSSAI
(
std
::
vector
<
struct
SNSSAI_s
>
nssai
);
void
setALLOWED_NSSAI
(
std
::
vector
<
struct
SNSSAI_s
>
nssai
);
...
@@ -87,7 +87,7 @@ class RegistrationAccept {
...
@@ -87,7 +87,7 @@ class RegistrationAccept {
public:
public:
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
_5GS_Registration_Result
*
ie_5gs_registration_result
;
_5GS_Registration_Result
*
ie_5gs_registration_result
;
_5GSMobil
ity
Identity
*
ie_5g_guti
;
_5GSMobil
e
Identity
*
ie_5g_guti
;
PLMN_List
*
ie_equivalent_plmns
;
PLMN_List
*
ie_equivalent_plmns
;
NSSAI
*
ie_allowed_nssai
;
NSSAI
*
ie_allowed_nssai
;
Rejected_NSSAI
*
ie_rejected_nssai
;
Rejected_NSSAI
*
ie_rejected_nssai
;
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
1b0cacb0
...
@@ -39,7 +39,7 @@ RegistrationRequest::RegistrationRequest()
...
@@ -39,7 +39,7 @@ RegistrationRequest::RegistrationRequest()
:
NasMmPlainHeader
(
EPD_5GS_MM_MSG
,
REGISTRATION_REQUEST
)
{
:
NasMmPlainHeader
(
EPD_5GS_MM_MSG
,
REGISTRATION_REQUEST
)
{
// plain_header = nullptr;
// plain_header = nullptr;
// ie_5gsregistrationtype = nullptr;
// ie_5gsregistrationtype = nullptr;
ie_ngKSI
=
nullptr
;
//
ie_ngKSI = nullptr;
ie_5gs_mobility_id
=
nullptr
;
ie_5gs_mobility_id
=
nullptr
;
ie_non_current_native_nas_ksi
=
nullptr
;
ie_non_current_native_nas_ksi
=
nullptr
;
ie_5g_mm_capability
=
nullptr
;
ie_5g_mm_capability
=
nullptr
;
...
@@ -90,19 +90,15 @@ bool RegistrationRequest::get5GSRegistrationType(
...
@@ -90,19 +90,15 @@ bool RegistrationRequest::get5GSRegistrationType(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setngKSI
(
uint8_t
tsc
,
uint8_t
key_set_id
)
{
void
RegistrationRequest
::
setngKSI
(
uint8_t
tsc
,
uint8_t
key_set_id
)
{
ie_ngKSI
=
new
NasKeySetIdentifier
(
tsc
,
key_set_id
);
ie_ngKSI
.
setNasKeyIdentifier
(
key_set_id
);
ie_ngKSI
.
setTypeOfSecurityContext
(
tsc
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
bool
RegistrationRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
if
(
ie_ngKSI
)
{
ng_ksi
=
ng_ksi
=
(
ie_ngKSI
.
getTypeOfSecurityContext
())
|
ie_ngKSI
.
getNasKeyIdentifier
();
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
ie_ngKSI
->
getasKeyIdentifier
();
return
true
;
return
true
;
}
else
{
// ng_ksi = 0;
return
false
;
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -116,14 +112,14 @@ void RegistrationRequest::setSUCI_SUPI_format_IMSI(
...
@@ -116,14 +112,14 @@ void RegistrationRequest::setSUCI_SUPI_format_IMSI(
return
;
return
;
}
else
{
}
else
{
ie_5gs_mobility_id
=
ie_5gs_mobility_id
=
new
_5GSMobil
ity
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
new
_5GSMobil
e
Identity
(
mcc
,
mnc
,
routingInd
,
protection_sch_id
,
msin
);
}
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_t
RegistrationRequest
::
getMobilityIdentityType
()
{
uint8_t
RegistrationRequest
::
getMobilityIdentityType
()
{
if
(
ie_5gs_mobility_id
)
{
if
(
ie_5gs_mobility_id
)
{
return
ie_5gs_mobility_id
->
get
t
ypeOfIdentity
();
return
ie_5gs_mobility_id
->
get
T
ypeOfIdentity
();
}
else
{
}
else
{
return
0
;
return
0
;
}
}
...
@@ -165,7 +161,7 @@ void RegistrationRequest::setAdditional_GUTI_SUCI_SUPI_format_IMSI(
...
@@ -165,7 +161,7 @@ void RegistrationRequest::setAdditional_GUTI_SUCI_SUPI_format_IMSI(
choose right interface"); return;
choose right interface"); return;
}
}
else {*/
else {*/
ie_additional_guti
=
new
_5GSMobil
ity
Identity
();
ie_additional_guti
=
new
_5GSMobil
e
Identity
();
ie_additional_guti
->
setIEI
(
0x77
);
ie_additional_guti
->
setIEI
(
0x77
);
uint32_t
tmsi
=
fromString
<
uint32_t
>
(
_5g_tmsi
);
uint32_t
tmsi
=
fromString
<
uint32_t
>
(
_5g_tmsi
);
ie_additional_guti
->
set5GGUTI
(
ie_additional_guti
->
set5GGUTI
(
...
@@ -208,7 +204,7 @@ uint8_t RegistrationRequest::getNonCurrentNativeNasKSI() {
...
@@ -208,7 +204,7 @@ uint8_t RegistrationRequest::getNonCurrentNativeNasKSI() {
if
(
ie_non_current_native_nas_ksi
)
{
if
(
ie_non_current_native_nas_ksi
)
{
uint8_t
a
=
0
;
uint8_t
a
=
0
;
a
|=
(
ie_non_current_native_nas_ksi
->
getTypeOfSecurityContext
())
|
a
|=
(
ie_non_current_native_nas_ksi
->
getTypeOfSecurityContext
())
|
(
ie_non_current_native_nas_ksi
->
getasKeyIdentifier
());
(
ie_non_current_native_nas_ksi
->
get
N
asKeyIdentifier
());
return
a
;
return
a
;
}
else
{
}
else
{
return
0
;
return
0
;
...
@@ -557,10 +553,11 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
...
@@ -557,10 +553,11 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
return 0;
return 0;
}
}
*/
*/
if
(
!
ie_ngKSI
)
{
/*
if (!ie_ngKSI) {
Logger::nas_mm().error("Mandatory IE missing ie_ngKSI");
Logger::nas_mm().error("Mandatory IE missing ie_ngKSI");
return 0;
return 0;
}
}*/
if
(
!
ie_5gs_mobility_id
)
{
if
(
!
ie_5gs_mobility_id
)
{
Logger
::
nas_mm
().
error
(
"Mandatory IE missing ie_5gs_mobility_id"
);
Logger
::
nas_mm
().
error
(
"Mandatory IE missing ie_5gs_mobility_id"
);
return
0
;
return
0
;
...
@@ -569,21 +566,21 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
...
@@ -569,21 +566,21 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
encoded_size
+=
3
;
encoded_size
+=
3
;
if
(
!
(
ie_5gsregistrationtype
.
encode2Buffer
(
if
(
!
(
ie_5gsregistrationtype
.
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
)))
{
buf
+
encoded_size
,
len
-
encoded_size
)))
{
if
(
!
(
ie_ngKSI
->
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
)))
{
if
(
!
(
ie_ngKSI
.
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
)))
{
encoded_size
+=
1
;
encoded_size
+=
1
;
}
else
{
}
else
{
Logger
::
nas_mm
().
error
(
"
encoding ie
ie_ngKSI error"
);
Logger
::
nas_mm
().
error
(
"
Encoding IE
ie_ngKSI error"
);
return
0
;
return
0
;
}
}
}
else
{
}
else
{
Logger
::
nas_mm
().
error
(
"
encoding ie
5gsregistrationtype error"
);
Logger
::
nas_mm
().
error
(
"
Encoding IE
5gsregistrationtype error"
);
return
0
;
return
0
;
}
}
if
(
int
size
=
ie_5gs_mobility_id
->
encode2Buffer
(
if
(
int
size
=
ie_5gs_mobility_id
->
encode2Buffer
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
encoded_size
+=
size
;
}
else
{
}
else
{
Logger
::
nas_mm
().
error
(
"
encoding ie
ie_5gs_mobility_id error"
);
Logger
::
nas_mm
().
error
(
"
Encoding IE
ie_5gs_mobility_id error"
);
return
0
;
return
0
;
}
}
if
(
!
ie_non_current_native_nas_ksi
)
{
if
(
!
ie_non_current_native_nas_ksi
)
{
...
@@ -593,7 +590,7 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
...
@@ -593,7 +590,7 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
buf
+
encoded_size
,
len
-
encoded_size
)
==
1
)
{
buf
+
encoded_size
,
len
-
encoded_size
)
==
1
)
{
encoded_size
++
;
encoded_size
++
;
}
else
{
}
else
{
Logger
::
nas_mm
().
error
(
"
encoding ie
_non_current_native_nas_ksi error"
);
Logger
::
nas_mm
().
error
(
"
Encoding IE
_non_current_native_nas_ksi error"
);
}
}
}
}
if
(
!
ie_5g_mm_capability
)
{
if
(
!
ie_5g_mm_capability
)
{
...
@@ -843,11 +840,10 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
...
@@ -843,11 +840,10 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
// ie_5gsregistrationtype = new _5GSRegistrationType();
// ie_5gsregistrationtype = new _5GSRegistrationType();
decoded_size
+=
ie_5gsregistrationtype
.
decodeFromBuffer
(
decoded_size
+=
ie_5gsregistrationtype
.
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
ie_ngKSI
=
new
NasKeySetIdentifier
();
decoded_size
+=
ie_ngKSI
.
decodeFromBuffer
(
decoded_size
+=
ie_ngKSI
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
decoded_size
++
;
decoded_size
++
;
ie_5gs_mobility_id
=
new
_5GSMobil
ity
Identity
();
ie_5gs_mobility_id
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_5gs_mobility_id
->
decodeFromBuffer
(
decoded_size
+=
ie_5gs_mobility_id
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
...
@@ -958,7 +954,7 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
...
@@ -958,7 +954,7 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
}
break
;
}
break
;
case
0x77
:
{
case
0x77
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
ie_additional_guti
=
new
_5GSMobil
ity
Identity
();
ie_additional_guti
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_additional_guti
->
decodeFromBuffer
(
decoded_size
+=
ie_additional_guti
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
octet
=
*
(
buf
+
decoded_size
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
1b0cacb0
...
@@ -148,8 +148,8 @@ class RegistrationRequest : public NasMmPlainHeader {
...
@@ -148,8 +148,8 @@ class RegistrationRequest : public NasMmPlainHeader {
public:
public:
// NasMmPlainHeader* plain_header;
// NasMmPlainHeader* plain_header;
_5GSRegistrationType
ie_5gsregistrationtype
;
// Mandatory
_5GSRegistrationType
ie_5gsregistrationtype
;
// Mandatory
NasKeySetIdentifier
*
ie_ngKSI
;
// Mandatory
NasKeySetIdentifier
ie_ngKSI
;
// Mandatory
_5GSMobil
ityIdentity
*
ie_5gs_mobility_id
;
// Mandatory
_5GSMobil
eIdentity
*
ie_5gs_mobility_id
;
// Mandatory
NasKeySetIdentifier
*
ie_non_current_native_nas_ksi
;
// Optional
NasKeySetIdentifier
*
ie_non_current_native_nas_ksi
;
// Optional
_5GMMCapability
*
ie_5g_mm_capability
;
// Optional
_5GMMCapability
*
ie_5g_mm_capability
;
// Optional
...
@@ -162,7 +162,7 @@ class RegistrationRequest : public NasMmPlainHeader {
...
@@ -162,7 +162,7 @@ class RegistrationRequest : public NasMmPlainHeader {
PDU_Session_Status
*
ie_PDU_session_status
;
// Optional
PDU_Session_Status
*
ie_PDU_session_status
;
// Optional
MICO_Indication
*
ie_MICO_indicationl
;
// Optional
MICO_Indication
*
ie_MICO_indicationl
;
// Optional
UE_Status
*
ie_ue_status
;
// Optional
UE_Status
*
ie_ue_status
;
// Optional
_5GSMobil
ityIdentity
*
ie_additional_guti
;
// Optional
_5GSMobil
eIdentity
*
ie_additional_guti
;
// Optional
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
// Optional
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
// Optional
UES_Usage_Setting
*
ie_ues_usage_setting
;
// Optional
UES_Usage_Setting
*
ie_ues_usage_setting
;
// Optional
_5GS_DRX_arameters
*
ie_5gs_drx_parameters
;
// Optional
_5GS_DRX_arameters
*
ie_5gs_drx_parameters
;
// Optional
...
...
src/nas/msgs/SecurityModeComplete.cpp
View file @
1b0cacb0
...
@@ -54,7 +54,7 @@ void SecurityModeComplete::setHeader(uint8_t security_header_type) {
...
@@ -54,7 +54,7 @@ void SecurityModeComplete::setHeader(uint8_t security_header_type) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
setIMEISV
(
IMEISV_t
imeisv
)
{
void
SecurityModeComplete
::
setIMEISV
(
IMEISV_t
imeisv
)
{
ie_imeisv
=
new
_5GSMobil
ity
Identity
();
ie_imeisv
=
new
_5GSMobil
e
Identity
();
ie_imeisv
->
setIEI
(
0x77
);
ie_imeisv
->
setIEI
(
0x77
);
ie_imeisv
->
setIMEISV
(
imeisv
);
ie_imeisv
->
setIMEISV
(
imeisv
);
}
}
...
@@ -66,7 +66,7 @@ void SecurityModeComplete::setNAS_Message_Container(bstring value) {
...
@@ -66,7 +66,7 @@ void SecurityModeComplete::setNAS_Message_Container(bstring value) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
setNON_IMEISV
(
IMEISV_t
imeisv
)
{
void
SecurityModeComplete
::
setNON_IMEISV
(
IMEISV_t
imeisv
)
{
ie_non_imeisvpei
=
new
_5GSMobil
ity
Identity
();
ie_non_imeisvpei
=
new
_5GSMobil
e
Identity
();
ie_non_imeisvpei
->
setIEI
(
0x78
);
ie_non_imeisvpei
->
setIEI
(
0x78
);
ie_non_imeisvpei
->
setIMEISV
(
imeisv
);
ie_non_imeisvpei
->
setIMEISV
(
imeisv
);
}
}
...
@@ -164,7 +164,7 @@ int SecurityModeComplete::decodeFromBuffer(
...
@@ -164,7 +164,7 @@ int SecurityModeComplete::decodeFromBuffer(
switch
(
octet
)
{
switch
(
octet
)
{
case
0x77
:
{
case
0x77
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
ie_imeisv
=
new
_5GSMobil
ity
Identity
();
ie_imeisv
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_imeisv
->
decodeFromBuffer
(
decoded_size
+=
ie_imeisv
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
}
break
;
}
break
;
...
@@ -176,7 +176,7 @@ int SecurityModeComplete::decodeFromBuffer(
...
@@ -176,7 +176,7 @@ int SecurityModeComplete::decodeFromBuffer(
}
break
;
}
break
;
case
0x78
:
{
case
0x78
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x78)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x78)"
);
ie_non_imeisvpei
=
new
_5GSMobil
ity
Identity
();
ie_non_imeisvpei
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_non_imeisvpei
->
decodeFromBuffer
(
decoded_size
+=
ie_non_imeisvpei
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
}
break
;
}
break
;
...
...
src/nas/msgs/SecurityModeComplete.hpp
View file @
1b0cacb0
...
@@ -51,9 +51,9 @@ class SecurityModeComplete {
...
@@ -51,9 +51,9 @@ class SecurityModeComplete {
public:
public:
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
_5GSMobil
ity
Identity
*
ie_imeisv
;
_5GSMobil
e
Identity
*
ie_imeisv
;
NAS_Message_Container
*
ie_nas_message_container
;
NAS_Message_Container
*
ie_nas_message_container
;
_5GSMobil
ity
Identity
*
ie_non_imeisvpei
;
_5GSMobil
e
Identity
*
ie_non_imeisvpei
;
};
};
}
// namespace nas
}
// namespace nas
...
...
src/nas/msgs/ServiceRequest.cpp
View file @
1b0cacb0
...
@@ -68,7 +68,7 @@ void ServiceRequest::setServiceType(uint8_t stp) {
...
@@ -68,7 +68,7 @@ void ServiceRequest::setServiceType(uint8_t stp) {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceRequest
::
set5G_S_TMSI
(
void
ServiceRequest
::
set5G_S_TMSI
(
uint16_t
amfSetId
,
uint8_t
amfPointer
,
string
tmsi
)
{
uint16_t
amfSetId
,
uint8_t
amfPointer
,
string
tmsi
)
{
ie_5g_s_tmsi
=
new
_5GSMobil
ity
Identity
(
0x00
,
amfSetId
,
amfPointer
,
tmsi
);
ie_5g_s_tmsi
=
new
_5GSMobil
e
Identity
(
0x00
,
amfSetId
,
amfPointer
,
tmsi
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -198,7 +198,7 @@ int ServiceRequest::decodeFromBuffer(
...
@@ -198,7 +198,7 @@ int ServiceRequest::decodeFromBuffer(
decoded_size
+=
ie_service_type
->
decodeFromBuffer
(
decoded_size
+=
ie_service_type
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
true
);
decoded_size
++
;
decoded_size
++
;
ie_5g_s_tmsi
=
new
_5GSMobil
ity
Identity
();
ie_5g_s_tmsi
=
new
_5GSMobil
e
Identity
();
decoded_size
+=
ie_5g_s_tmsi
->
decodeFromBuffer
(
decoded_size
+=
ie_5g_s_tmsi
->
decodeFromBuffer
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
...
@@ -248,8 +248,8 @@ int ServiceRequest::decodeFromBuffer(
...
@@ -248,8 +248,8 @@ int ServiceRequest::decodeFromBuffer(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
ServiceRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
bool
ServiceRequest
::
getngKSI
(
uint8_t
&
ng_ksi
)
{
if
(
ie_ngKSI
)
{
if
(
ie_ngKSI
)
{
ng_ksi
=
ng_ksi
=
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
(
ie_ngKSI
->
getTypeOfSecurityContext
())
|
ie_ngKSI
->
get
asKeyIdentifier
();
ie_ngKSI
->
getN
asKeyIdentifier
();
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
src/nas/msgs/ServiceRequest.hpp
View file @
1b0cacb0
...
@@ -68,7 +68,7 @@ class ServiceRequest {
...
@@ -68,7 +68,7 @@ class ServiceRequest {
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
NasKeySetIdentifier
*
ie_ngKSI
;
NasKeySetIdentifier
*
ie_ngKSI
;
ServiceType
*
ie_service_type
;
ServiceType
*
ie_service_type
;
_5GSMobil
ity
Identity
*
ie_5g_s_tmsi
;
_5GSMobil
e
Identity
*
ie_5g_s_tmsi
;
UplinkDataStatus
*
ie_uplink_data_status
;
UplinkDataStatus
*
ie_uplink_data_status
;
PDU_Session_Status
*
ie_PDU_session_status
;
PDU_Session_Status
*
ie_PDU_session_status
;
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
Allowed_PDU_Session_Status
*
ie_allowed_PDU_session_status
;
...
...
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