Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
d7d372bf
Commit
d7d372bf
authored
Feb 14, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI improvements
parent
e8a6df12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
+54
-3
src/nas/ie6.cpp
src/nas/ie6.cpp
+46
-0
src/nas/ie6.hpp
src/nas/ie6.hpp
+4
-1
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+2
-0
src/utils/common_types.hpp
src/utils/common_types.hpp
+2
-2
No files found.
src/nas/ie6.cpp
View file @
d7d372bf
...
...
@@ -443,4 +443,50 @@ void IEEapMessage::Encode(const IEEapMessage &ie, OctetString &stream)
eap
::
EncodeEapPdu
(
stream
,
*
ie
.
eap
);
}
Json
ToJson
(
const
IE5gsMobileIdentity
&
v
)
{
switch
(
v
.
type
)
{
case
EIdentityType
:
:
NO_IDENTITY
:
return
"no-identitiy"
;
case
EIdentityType
:
:
SUCI
:
{
switch
(
v
.
supiFormat
)
{
case
ESupiFormat
:
:
IMSI
:
return
Json
::
Obj
({
{
"plmn"
,
ToJson
(
v
.
imsi
.
plmn
)},
{
"routing-indicator"
,
v
.
imsi
.
routingIndicator
},
{
"protection-schema"
,
v
.
imsi
.
protectionSchemaId
},
{
"hnp-key-id"
,
ToJson
(
v
.
imsi
.
homeNetworkPublicKeyIdentifier
)},
{
"scheme-output"
,
v
.
imsi
.
schemeOutput
},
});
case
ESupiFormat
:
:
NETWORK_SPECIFIC_IDENTIFIER
:
return
"nai-"
+
v
.
value
;
default:
return
"?"
;
}
}
case
EIdentityType
:
:
GUTI
:
return
Json
::
Obj
({
{
"plmn"
,
ToJson
(
v
.
gutiOrTmsi
.
plmn
)},
{
"amf-region-id"
,
ToJson
(
v
.
gutiOrTmsi
.
amfRegionId
)},
{
"amf-set-id"
,
v
.
gutiOrTmsi
.
amfSetId
},
{
"amf-pointer"
,
v
.
gutiOrTmsi
.
amfPointer
},
{
"tmsi"
,
ToJson
(
v
.
gutiOrTmsi
.
tmsi
)},
});
case
EIdentityType
:
:
IMEI
:
return
"imei-"
+
v
.
value
;
case
EIdentityType
:
:
TMSI
:
return
Json
::
Obj
({
{
"amf-set-id"
,
v
.
gutiOrTmsi
.
amfSetId
},
{
"amf-pointer"
,
v
.
gutiOrTmsi
.
amfPointer
},
{
"tmsi"
,
ToJson
(
v
.
gutiOrTmsi
.
tmsi
)},
});
case
EIdentityType
:
:
IMEISV
:
return
"imeisv-"
+
v
.
value
;
default:
return
"?"
;
}
}
}
// namespace nas
\ No newline at end of file
src/nas/ie6.hpp
View file @
d7d372bf
...
...
@@ -14,6 +14,7 @@
#include "values.hpp"
#include <utils/common_types.hpp>
#include <utils/json.hpp>
namespace
nas
{
...
...
@@ -187,7 +188,7 @@ struct IE5gsMobileIdentity : InformationElement6
ESupiFormat
supiFormat
;
// meaningful if identityType is SUCI
// using at most one of the following 3 members:
GutiMobileIdentity
gutiOrTmsi
{};
// used for TMSI and GUTI (
first two member
not exist in TMSI)
GutiMobileIdentity
gutiOrTmsi
{};
// used for TMSI and GUTI (
some members
not exist in TMSI)
std
::
string
value
{};
// used for IMEI, IMEI-SV, NSI,
ImsiMobileIdentity
imsi
{};
// used for IMSI
...
...
@@ -203,4 +204,6 @@ struct IEEapMessage : InformationElement6
static
void
Encode
(
const
IEEapMessage
&
ie
,
OctetString
&
stream
);
};
Json
ToJson
(
const
IE5gsMobileIdentity
&
v
);
}
// namespace nas
src/ue/app/cmd_handler.cpp
View file @
d7d372bf
...
...
@@ -88,6 +88,8 @@ void UeCmdHandler::HandleCmdImpl(TaskBase &base, NwUeCliCommand &msg)
{
"rm-state"
,
ToJson
(
base
.
nasTask
->
mm
->
m_rmState
)},
{
"mm-state"
,
ToJson
(
base
.
nasTask
->
mm
->
m_mmSubState
)},
{
"sim-inserted"
,
base
.
nasTask
->
mm
->
m_validSim
},
{
"stored-suci"
,
ToJson
(
base
.
nasTask
->
mm
->
m_storedSuci
)},
{
"stored-guti"
,
ToJson
(
base
.
nasTask
->
mm
->
m_storedGuti
)},
});
msg
.
sendResult
(
json
.
dumpYaml
());
break
;
...
...
src/utils/common_types.hpp
View file @
d7d372bf
...
...
@@ -69,8 +69,8 @@ struct TmsiMobileIdentity
struct
GutiMobileIdentity
{
Plmn
plmn
;
octet
amfRegionId
;
Plmn
plmn
;
// Not used in TMSI
octet
amfRegionId
;
// Not used in TMSI
int
amfSetId
:
10
;
int
amfPointer
:
6
;
octet4
tmsi
;
...
...
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