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
520b0ee6
Commit
520b0ee6
authored
Jan 10, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Network Slicing Indication
parent
c950dc54
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
72 deletions
+72
-72
src/nas/ies/MICOIndication.cpp
src/nas/ies/MICOIndication.cpp
+1
-1
src/nas/ies/NetworkSlicingIndication.cpp
src/nas/ies/NetworkSlicingIndication.cpp
+53
-58
src/nas/ies/NetworkSlicingIndication.hpp
src/nas/ies/NetworkSlicingIndication.hpp
+16
-11
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+2
-2
No files found.
src/nas/ies/MICOIndication.cpp
View file @
520b0ee6
...
...
@@ -92,7 +92,7 @@ int MicoIndication::Encode(uint8_t* buf, int len) {
ENCODE_U8
(
buf
+
encoded_size
,
octet
,
encoded_size
);
Logger
::
nas_mm
().
debug
(
"Encoded
MicoIndication IE (len: %d octet)"
,
encoded_size
);
"Encoded
%s, len (%d)"
,
GetIeName
().
c_str
()
,
encoded_size
);
return
encoded_size
;
}
...
...
src/nas/ies/NetworkSlicingIndication.cpp
View file @
520b0ee6
...
...
@@ -28,98 +28,93 @@
using
namespace
nas
;
//------------------------------------------------------------------------------
NetworkSlicingIndication
::
NetworkSlicingIndication
(
uint8_t
iei
)
{
_iei
=
iei
;
DCNI
=
false
;
NSSCI
=
false
;
NetworkSlicingIndication
::
NetworkSlicingIndication
()
:
Type1NasIeFormatTv
(),
dcni_
(),
nssci_
()
{
SetIeName
(
kNetworkSlicingIndicationIeName
);
}
//------------------------------------------------------------------------------
NetworkSlicingIndication
::
NetworkSlicingIndication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssc
i
)
{
_iei
=
iei
;
DCNI
=
dcni
;
NSSCI
=
nssci
;
NetworkSlicingIndication
::
NetworkSlicingIndication
(
uint8_t
iei
)
:
Type1NasIeFormatTv
(
ie
i
)
{
dcni_
=
false
;
nssci_
=
false
;
SetIeName
(
kNetworkSlicingIndicationIeName
)
;
}
//------------------------------------------------------------------------------
NetworkSlicingIndication
::
NetworkSlicingIndication
()
:
_iei
(),
DCNI
(),
NSSCI
()
{}
NetworkSlicingIndication
::
NetworkSlicingIndication
(
bool
dcni
,
bool
nssci
)
:
Type1NasIeFormatTv
()
{
dcni_
=
dcni
;
nssci_
=
nssci
;
SetIeName
(
kNetworkSlicingIndicationIeName
);
}
//------------------------------------------------------------------------------
NetworkSlicingIndication
::
NetworkSlicingIndication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssci
)
:
Type1NasIeFormatTv
(
iei
)
{
dcni_
=
dcni
;
nssci_
=
nssci
;
SetIeName
(
kNetworkSlicingIndicationIeName
);
}
//------------------------------------------------------------------------------
NetworkSlicingIndication
::~
NetworkSlicingIndication
()
{}
//------------------------------------------------------------------------------
void
NetworkSlicingIndication
::
setDCNI
(
bool
value
)
{
DCNI
=
value
;
void
NetworkSlicingIndication
::
SetValue
(
)
{
value_
=
0x0f
|
(
dcni_
<<
1
)
|
nssci_
;
}
//------------------------------------------------------------------------------
void
NetworkSlicingIndication
::
setNSSCI
(
bool
value
)
{
NSSCI
=
value
;
void
NetworkSlicingIndication
::
GetValue
()
{
dcni_
=
value_
&
0x02
;
nssci_
=
value_
&
0x01
;
}
//------------------------------------------------------------------------------
bool
NetworkSlicingIndication
::
getDCNI
(
)
{
return
DCNI
;
void
NetworkSlicingIndication
::
SetDcni
(
bool
value
)
{
dcni_
=
value
;
}
//------------------------------------------------------------------------------
bool
NetworkSlicingIndication
::
getNSSCI
(
)
{
return
NSSCI
;
void
NetworkSlicingIndication
::
SetNssci
(
bool
value
)
{
nssci_
=
value
;
}
//------------------------------------------------------------------------------
int
NetworkSlicingIndication
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding Network Slicing Indication"
);
if
(
len
<
kNetworkSlicingIndicationLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kNetworkSlicingIndicationLength
);
return
KEncodeDecodeError
;
}
bool
NetworkSlicingIndication
::
GetDcni
()
const
{
return
dcni_
;
}
int
encoded_size
=
0
;
uint8_t
octet
=
0
;
if
(
_iei
)
{
octet
=
(
_iei
<<
4
)
|
(
DCNI
<<
1
)
|
NSSCI
;
}
else
{
octet
=
0x0f
&
((
DCNI
<<
1
)
|
NSSCI
);
}
//------------------------------------------------------------------------------
bool
NetworkSlicingIndication
::
GetNssci
()
const
{
return
nssci_
;
}
ENCODE_U8
(
buf
+
encoded_size
,
octet
,
encoded_size
);
//------------------------------------------------------------------------------
int
NetworkSlicingIndication
::
Encode
(
uint8_t
*
buf
,
int
len
)
{
Logger
::
nas_mm
().
debug
(
"Encoding %s"
,
GetIeName
().
c_str
());
Logger
::
nas_mm
().
debug
(
"Encoded NetworkSlicingIndication DCNI (0x%x) NSSCI (0x%x)"
,
DCNI
,
NSSCI
);
int
encoded_size
=
0
;
SetValue
();
// Update Value in Type1NasIeFormatTv
encoded_size
=
Type1NasIeFormatTv
::
Encode
(
buf
,
len
);
Logger
::
nas_mm
().
debug
(
"Encoded
NetworkSlicingIndication IE (len, %d octet)"
,
encoded_size
);
"Encoded
%s, len (%d)"
,
GetIeName
().
c_str
()
,
encoded_size
);
return
encoded_size
;
}
//------------------------------------------------------------------------------
int
NetworkSlicingIndication
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
)
{
Logger
::
nas_mm
().
debug
(
"Decoding Network Slicing Indication"
);
if
(
len
<
kNetworkSlicingIndicationLength
)
{
Logger
::
nas_mm
().
error
(
"Buffer length is less than the minimum length of this IE (%d octet)"
,
kNetworkSlicingIndicationLength
);
return
KEncodeDecodeError
;
}
int
NetworkSlicingIndication
::
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
)
{
Logger
::
nas_mm
().
debug
(
"Decoding %s"
,
GetIeName
().
c_str
());
int
decoded_size
=
0
;
uint8_t
octet
=
0
;
DECODE_U8
(
buf
+
decoded_size
,
octet
,
decoded_size
);
if
(
is_option
)
{
_iei
=
(
octet
&
0xf0
)
>>
4
;
}
DCNI
=
octet
&
0x02
;
NSSCI
=
octet
&
0x01
;
decoded_size
=
Type1NasIeFormatTv
::
Decode
(
buf
,
len
,
is_iei
);
// Get DCNI/NSSCI from value
GetValue
();
Logger
::
nas_mm
().
debug
(
"DCNI 0x%x, NSSCI 0x%x"
,
dcni_
,
nssci_
);
Logger
::
nas_mm
().
debug
(
"Decoded
NetworkSlicingIndication DCNI (0x%x) NSSCI (0x%x)"
,
DCNI
,
NSSCI
);
"Decoded
%s, len (%d)"
,
GetIeName
().
c_str
(),
decoded_size
);
return
decoded_size
;
}
src/nas/ies/NetworkSlicingIndication.hpp
View file @
520b0ee6
...
...
@@ -19,35 +19,40 @@
* contact@openairinterface.org
*/
#ifndef _Network_Slicing_Indication_H_
#define _Network_Slicing_Indication_H_
#ifndef _NETWORK_SLICING_INDICATION_H_
#define _NETWORK_SLICING_INDICATION_H_
#include "Type1NasIeFormatTv.hpp"
#include <stdint.h>
constexpr
uint8_t
kNetworkSlicingIndicationLength
=
1
;
constexpr
auto
kNetworkSlicingIndicationIeName
=
"Network Slicing Indication"
;
namespace
nas
{
class
NetworkSlicingIndication
{
class
NetworkSlicingIndication
:
Type1NasIeFormatTv
{
public:
NetworkSlicingIndication
();
NetworkSlicingIndication
(
uint8_t
iei
);
NetworkSlicingIndication
(
const
uint8_t
iei
,
bool
dcni
,
bool
nssci
);
NetworkSlicingIndication
(
bool
dcni
,
bool
nssci
);
~
NetworkSlicingIndication
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
option
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_
iei
);
void
setDCNI
(
bool
value
);
bool
getDCNI
();
void
SetValue
();
void
GetValue
();
void
SetDcni
(
bool
value
);
bool
GetDcni
()
const
;
void
setNSSCI
(
bool
value
);
bool
getNSSCI
()
;
void
SetNssci
(
bool
value
);
bool
GetNssci
()
const
;
private:
uint8_t
_iei
;
bool
DCNI
;
bool
NSSCI
;
bool
dcni_
;
bool
nssci_
;
};
}
// namespace nas
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
520b0ee6
...
...
@@ -466,8 +466,8 @@ void RegistrationRequest::setNetwork_Slicing_Indication(bool dcni, bool nssci) {
bool
RegistrationRequest
::
getNetworkSlicingIndication
(
uint8_t
&
dcni
,
uint8_t
&
nssci
)
{
if
(
ie_network_slicing_indication
.
has_value
())
{
dcni
=
ie_network_slicing_indication
.
value
().
getDCNI
();
nssci
=
ie_network_slicing_indication
.
value
().
getNSSCI
();
dcni
=
ie_network_slicing_indication
.
value
().
GetDcni
();
nssci
=
ie_network_slicing_indication
.
value
().
GetNssci
();
return
true
;
}
else
{
return
false
;
...
...
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