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
a0052e37
Commit
a0052e37
authored
Jan 08, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UE Status
parent
670c2dcf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
73 deletions
+72
-73
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+3
-1
src/nas/ies/UEStatus.cpp
src/nas/ies/UEStatus.cpp
+47
-49
src/nas/ies/UEStatus.hpp
src/nas/ies/UEStatus.hpp
+15
-16
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+6
-6
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+1
-1
No files found.
src/nas/common/Ie_Const.hpp
View file @
a0052e37
...
...
@@ -90,7 +90,9 @@ constexpr uint8_t kIeiNetworkSlicingIndication = 0x09; // 9-(4 higher bits)
constexpr
uint8_t
kIeiMicoIndication
=
0x0B
;
// B-(4 higher bits)
constexpr
uint8_t
kIei5gmmCapability
=
0x10
;
constexpr
uint8_t
kIei5gmmCapability
=
0x10
;
constexpr
uint8_t
kIeiUeStatus
=
0x2b
;
constexpr
uint8_t
kIeiUeSecurityCapability
=
0x2e
;
constexpr
uint8_t
kIeiUeNetworkCapability
=
0x17
;
...
...
src/nas/ies/UEStatus.cpp
View file @
a0052e37
...
...
@@ -21,106 +21,104 @@
#include "3gpp_24.501.hpp"
#include "common_defs.h"
#include "Ie_Const.hpp"
#include "logger.hpp"
#include "UEStatus.hpp"
using
namespace
nas
;
//------------------------------------------------------------------------------
UEStatus
::
UEStatus
(
uint8_t
iei
)
{
_iei
=
iei
;
length
=
1
;
S
1
=
false
;
N1
=
false
;
UEStatus
::
UEStatus
(
)
:
Type4NasIe
(
kIeiUeStatus
)
{
s1_
=
false
;
n1_
=
false
;
S
etLengthIndicator
(
1
)
;
SetIeName
(
kUeStatusIeName
)
;
}
//------------------------------------------------------------------------------
UEStatus
::
UEStatus
(
const
uint8_t
iei
,
bool
n1
,
bool
s1
)
{
_iei
=
iei
;
length
=
1
;
S1
=
s1
;
N1
=
n1
;
}
//------------------------------------------------------------------------------
UEStatus
::
UEStatus
()
{
_iei
=
0
;
length
=
1
;
S1
=
false
;
N1
=
false
;
UEStatus
::
UEStatus
(
bool
n1
,
bool
s1
)
:
Type4NasIe
(
kIeiUeStatus
)
{
s1_
=
s1
;
n1_
=
n1
;
SetLengthIndicator
(
1
);
SetIeName
(
kUeStatusIeName
);
}
//------------------------------------------------------------------------------
UEStatus
::~
UEStatus
()
{}
//------------------------------------------------------------------------------
void
UEStatus
::
s
etS1
(
bool
value
)
{
S1
=
value
;
void
UEStatus
::
S
etS1
(
bool
value
)
{
s1_
=
value
;
}
//------------------------------------------------------------------------------
void
UEStatus
::
setN1
(
bool
value
)
{
N1
=
value
;
bool
UEStatus
::
GetS1
()
const
{
return
s1_
;
}
//------------------------------------------------------------------------------
bool
UEStatus
::
getS1
(
)
{
return
S1
;
void
UEStatus
::
SetN1
(
bool
value
)
{
n1_
=
value
;
}
//------------------------------------------------------------------------------
bool
UEStatus
::
getN1
()
{
return
N1
;
bool
UEStatus
::
GetN1
()
const
{
return
n1_
;
}
//------------------------------------------------------------------------------
int
UEStatus
::
encode2Buffer
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding UE Status (IEI 0x%x)"
,
_iei
);
int
UEStatus
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
int
ie_len
=
GetIeLength
();
if
(
(
len
<
kUEStatusIELength
)
or
(
len
<
length
+
2
))
{
if
(
len
<
ie_len
)
{
// Length of the content + IEI/Len
Logger
::
nas_mm
().
error
(
"
Buffer length is less than the minimum length of this IE (%d octet
)"
,
kUEStatusIELength
);
"
Size of the buffer is not enough to store this IE (IE len %d
)"
,
ie_len
);
return
KEncodeDecodeError
;
}
int
encoded_size
=
0
;
if
(
_iei
)
{
ENCODE_U8
(
buf
+
encoded_size
,
_iei
,
encoded_size
);
}
// IEI and Length
int
encoded_header_size
=
Type4NasIe
::
Encode
(
buf
+
encoded_size
,
len
);
if
(
encoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
encoded_size
+=
encoded_header_size
;
ENCODE_U8
(
buf
+
encoded_size
,
length
,
encoded_size
);
uint8_t
octet
=
0x03
&
(
S1
|
(
N1
<<
1
));
uint8_t
octet
=
0x03
&
(
s1_
|
(
n1_
<<
1
));
ENCODE_U8
(
buf
+
encoded_size
,
octet
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded UE Status ( len %d)"
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded %s, len (%d)"
,
GetIeName
().
c_str
(),
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
UEStatus
::
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding
UE Status"
);
int
UEStatus
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
Logger
::
nas_mm
().
debug
(
"Decoding
%s"
,
GetIeName
().
c_str
()
);
if
(
(
len
<
kUEStatusIELength
)
or
(
len
<
length
+
2
)
)
{
if
(
len
<
kUeStatusIeLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kU
EStatusIE
Length
);
kU
eStatusIe
Length
);
return
KEncodeDecodeError
;
}
int
decoded_size
=
0
;
if
(
is_option
)
{
DECODE_U8
(
buf
+
decoded_size
,
_iei
,
decoded_size
);
}
DECODE_U8
(
buf
+
decoded_size
,
length
,
decoded_size
);
// IEI and Length
int
decoded_header_size
=
Type4NasIe
::
Decode
(
buf
+
decoded_size
,
len
,
is_iei
);
// decoded_size += Type4NasIe::Decode(buf + decoded_size, len, is_iei);
if
(
decoded_header_size
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
decoded_size
+=
decoded_header_size
;
uint8_t
octet
=
0
;
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
N1
=
octet
&
0x02
;
S1
=
octet
&
0x01
;
n1_
=
octet
&
0x02
;
s1_
=
octet
&
0x01
;
Logger
::
nas_mm
().
debug
(
"Decoded UE Status, N1 0x%x, S1 0x%x, len %d"
,
N1
,
S1
,
decoded_size
);
"Decoded %s, len (%d)"
,
GetIeName
().
c_str
(),
decoded_size
);
Logger
::
nas_mm
().
debug
(
"N1 0x%x, S1 0x%x"
,
n1_
,
s1_
);
return
decoded_size
;
}
src/nas/ies/UEStatus.hpp
View file @
a0052e37
...
...
@@ -19,36 +19,35 @@
* contact@openairinterface.org
*/
#ifndef _UE_S
tatus
_H_
#define _UE_S
tatus
_H_
#ifndef _UE_S
TATUS
_H_
#define _UE_S
TATUS
_H_
#include "Type4NasIe.hpp"
#include <stdint.h>
constexpr
uint8_t
kUEStatusIELength
=
3
;
constexpr
uint8_t
kUeStatusIeLength
=
3
;
constexpr
auto
kUeStatusIeName
=
"UE Status"
;
namespace
nas
{
class
UEStatus
{
class
UEStatus
:
public
Type4NasIe
{
public:
UEStatus
();
UEStatus
(
uint8_t
iei
);
UEStatus
(
const
uint8_t
iei
,
bool
n1
,
bool
s1
);
UEStatus
(
bool
n1
,
bool
s1
);
~
UEStatus
();
int
encode2Buffer
(
uint8_t
*
buf
,
int
len
);
int
decodeFromBuffer
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
);
void
s
etN1
(
bool
value
);
bool
getN1
()
;
void
S
etN1
(
bool
value
);
bool
GetN1
()
const
;
void
s
etS1
(
bool
value
);
bool
getS1
()
;
void
S
etS1
(
bool
value
);
bool
GetS1
()
const
;
private:
uint8_t
_iei
;
uint8_t
length
;
bool
N1
;
bool
S1
;
bool
n1_
;
bool
s1_
;
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
a0052e37
...
...
@@ -336,14 +336,14 @@ bool RegistrationRequest::getMicoIndication(uint8_t& sprti, uint8_t& raai) {
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setUEStatus
(
bool
n1
,
bool
s1
)
{
ie_ue_status
=
std
::
make_optional
<
UEStatus
>
(
0x2B
,
n1
,
s1
);
ie_ue_status
=
std
::
make_optional
<
UEStatus
>
(
n1
,
s1
);
}
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
getUeStatus
(
uint8_t
&
n1ModeReg
,
uint8_t
&
s1ModeReg
)
{
if
(
ie_ue_status
.
has_value
())
{
n1ModeReg
=
ie_ue_status
.
value
().
g
etN1
();
s1ModeReg
=
ie_ue_status
.
value
().
g
etS1
();
n1ModeReg
=
ie_ue_status
.
value
().
G
etN1
();
s1ModeReg
=
ie_ue_status
.
value
().
G
etS1
();
return
true
;
}
else
{
return
false
;
...
...
@@ -682,7 +682,7 @@ int RegistrationRequest::encode2Buffer(uint8_t* buf, int len) {
if
(
!
ie_ue_status
.
has_value
())
{
Logger
::
nas_mm
().
warn
(
"IE ie_ue_status is not available"
);
}
else
{
if
(
int
size
=
ie_ue_status
.
value
().
encode2Buffer
(
if
(
int
size
=
ie_ue_status
.
value
().
Encode
(
buf
+
encoded_size
,
len
-
encoded_size
))
{
encoded_size
+=
size
;
}
else
{
...
...
@@ -975,10 +975,10 @@ int RegistrationRequest::decodeFromBuffer(uint8_t* buf, int len) {
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Next IEI 0x%x"
,
octet
);
}
break
;
case
0x2B
:
{
case
kIeiUeStatus
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x2B)"
);
UEStatus
ie_ue_status_tmp
=
{};
decoded_size
+=
ie_ue_status_tmp
.
decodeFromBuffer
(
decoded_size
+=
ie_ue_status_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
);
ie_ue_status
=
std
::
optional
<
UEStatus
>
(
ie_ue_status_tmp
);
octet
=
*
(
buf
+
decoded_size
);
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
a0052e37
...
...
@@ -159,8 +159,8 @@ class RegistrationRequest : public NasMmPlainHeader {
std
::
optional
<
UENetworkCapability
>
ie_s1_ue_network_capability
;
// Optional
std
::
optional
<
UplinkDataStatus
>
ie_uplink_data_status
;
// Optional
std
::
optional
<
PDUSessionStatus
>
ie_PDU_session_status
;
// Optional
std
::
optional
<
MicoIndication
>
ie_MICO_indication
;
// Optional
std
::
optional
<
MicoIndication
>
ie_MICO_indication
;
// Optional
std
::
optional
<
UEStatus
>
ie_ue_status
;
// Optional
std
::
optional
<
_5GSMobileIdentity
>
ie_additional_guti
;
// Optional
std
::
optional
<
AllowedPDUSessionStatus
>
...
...
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