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
5ea14f46
Commit
5ea14f46
authored
Jan 04, 2023
by
Tien-Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 5GSMobileIdentity
parent
171a535e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
149 additions
and
200 deletions
+149
-200
src/nas/common/3gpp_24.501.hpp
src/nas/common/3gpp_24.501.hpp
+1
-0
src/nas/ies/5GSMobileIdentity.cpp
src/nas/ies/5GSMobileIdentity.cpp
+122
-177
src/nas/ies/5GSMobileIdentity.hpp
src/nas/ies/5GSMobileIdentity.hpp
+19
-22
src/nas/ies/_5GSTrackingAreaIdentity.cpp
src/nas/ies/_5GSTrackingAreaIdentity.cpp
+1
-1
src/utils/NasUtils.cpp
src/utils/NasUtils.cpp
+6
-0
No files found.
src/nas/common/3gpp_24.501.hpp
View file @
5ea14f46
...
...
@@ -205,5 +205,6 @@ static const std::vector<std::string> nas_ciphering_algorithm_list_e2str = {
#define NAS_MESSAGE_MIN_LENGTH 3
constexpr
int
KEncodeDecodeError
=
-
1
;
constexpr
int
KEncodeDecodeOK
=
0
;
#endif
src/nas/ies/5GSMobileIdentity.cpp
View file @
5ea14f46
This diff is collapsed.
Click to expand it.
src/nas/ies/5GSMobileIdentity.hpp
View file @
5ea14f46
...
...
@@ -32,6 +32,8 @@ extern "C" {
#include "bstrlib.h"
}
constexpr
uint8_t
k5gMobileIdentityIe5gGutiLength
=
14
;
namespace
nas
{
// 5G-GUTI
...
...
@@ -84,19 +86,16 @@ typedef struct _5G_S_TMSI_s {
class
_5GSMobileIdentity
{
public:
_5GSMobileIdentity
();
_5GSMobileIdentity
(
uint8_t
_
iei
);
_5GSMobileIdentity
(
uint8_t
iei
);
~
_5GSMobileIdentity
();
// Common
void
clear
();
uint8_t
getTypeOfIdentity
()
const
{
return
typeOfIdentity
;
};
void
setIEI
(
uint8_t
_
iei
);
void
setIEI
(
uint8_t
iei
);
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
// TODO: add len
int
encodeMccMnc2buffer
(
const
std
::
string
&
mcc_str
,
const
std
::
string
&
mnc_str
,
uint8_t
*
buf
);
// 5G GUTI
int
_5g_guti_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_guti_encode2buffer
(
uint8_t
*
buf
,
int
len
);
...
...
@@ -112,39 +111,38 @@ class _5GSMobileIdentity {
void
setSuciWithSupiImsi
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
std
::
string
&
routing
Ind
,
uint8_t
protection_sch_id
,
const
std
::
string
&
routing
_ind
,
const
uint8_t
protection_sch_id
,
const
std
::
string
&
msin
);
// TODO: SetSUCI, SUCI and SUPI format IMSI
void
setSuciWithSupiImsi
(
const
std
::
string
&
mcc
,
const
std
::
string
&
mnc
,
const
std
::
string
&
routing
Ind
,
uint8_t
protecSchId
,
uint8_t
home_pki
,
const
std
::
string
&
msin_digits
);
bool
getSuciWithSupiImsi
(
SUCI_imsi_t
&
)
;
const
std
::
string
&
routing
_ind
,
const
uint8_t
protection_sch_id
,
const
uint8_t
home_pki
,
const
std
::
string
&
msin_digits
);
bool
getSuciWithSupiImsi
(
SUCI_imsi_t
&
suci
)
const
;
// TODO: add len
int
encodeRoutid2buffer
(
std
::
optional
<
std
::
string
>
routing_indicator
,
uint8_t
*
buf
);
// TODO: add len
int
encodeMSIN2buffer
(
std
::
string
msinstr
,
uint8_t
*
buf
);
int
encodeRoutingIndicator2buffer
(
std
::
optional
<
std
::
string
>
routing_indicator
,
uint8_t
*
buf
,
int
len
);
int
encodeMSIN2buffer
(
const
std
::
string
&
msin_str
,
uint8_t
*
buf
,
int
len
);
// TMSI
int
_5g_s_tmsi_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
_5g_s_tmsi_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
bool
get5G_S_TMSI
(
uint16_t
&
amfSetId
,
uint8_t
&
amfPointer
,
std
::
string
&
tmsi
);
int
_5g_s_tmsi_encode2buffer
(
uint8_t
*
buf
,
int
len
);
bool
get5G_S_TMSI
(
uint16_t
&
amf_set_id
,
uint8_t
&
amf_pointer
,
std
::
string
&
tmsi
)
const
;
void
set5G_S_TMSI
(
const
uint16_t
amf
SetId
,
const
uint8_t
amfP
ointer
,
const
std
::
string
tmsi
);
const
uint16_t
amf
_set_id
,
const
uint8_t
amf_p
ointer
,
const
std
::
string
&
tmsi
);
// IMEISV
int
imeisv_encode2buffer
(
uint8_t
*
buf
,
int
len
);
int
imeisv_decodefrombuffer
(
uint8_t
*
buf
,
int
len
);
void
setIMEISV
(
const
IMEISV_t
&
imeisv
);
bool
getIMEISV
(
IMEISV_t
&
imeisv
);
bool
getIMEISV
(
IMEISV_t
&
imeisv
)
const
;
private:
uint8_t
iei
;
uint8_t
iei
_
;
uint16_t
length
;
uint8_t
typeOfIdentity
:
3
;
...
...
@@ -152,7 +150,6 @@ class _5GSMobileIdentity {
std
::
optional
<
_5G_GUTI_t
>
_5g_guti
;
std
::
optional
<
IMEI_IMEISV_t
>
_imei
;
// TODO:
std
::
optional
<
IMEISV_t
>
_IMEISV
;
std
::
optional
<
_5G_S_TMSI_t
>
_5g_s_tmsi
;
};
...
...
src/nas/ies/_5GSTrackingAreaIdentity.cpp
View file @
5ea14f46
...
...
@@ -112,7 +112,7 @@ int _5GSTrackingAreaIdentity::encode2Buffer(uint8_t* buf, int len) {
ENCODE_U24
(
buf
+
encoded_size
,
tac_
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded _5GSTrackingAreaIdentity len(%d)"
,
encoded_size
);
"Encoded _5GSTrackingAreaIdentity len
(%d)"
,
encoded_size
);
return
encoded_size
;
}
...
...
src/utils/NasUtils.cpp
View file @
5ea14f46
...
...
@@ -93,7 +93,13 @@ int NasUtils::decodeMccMncFromBuffer(
if
(
mnc
<
10
)
{
mnc_str
=
"0"
+
mnc_str
;
}
mcc_str
=
std
::
to_string
(
mcc
);
if
(
mcc
<
10
)
{
mcc_str
=
"00"
+
mcc_str
;
}
else
if
(
mcc
<
100
)
{
mcc_str
=
"0"
+
mcc_str
;
}
Logger
::
nas_mm
().
debug
(
"MCC %s, MNC %s"
,
mcc_str
.
c_str
(),
mnc_str
.
c_str
());
return
decoded_size
;
...
...
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