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
1e127878
Commit
1e127878
authored
Jan 18, 2023
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_sst_sd_cots_ue' into 'develop'
Fix sst sd cots ue See merge request oai/cn5g/oai-cn5g-amf!174
parents
44cffecf
e42c609b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
11 deletions
+45
-11
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+22
-5
src/common/common_defs.h
src/common/common_defs.h
+14
-4
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+1
-0
src/nas/ies/Rejected_SNSSAI.cpp
src/nas/ies/Rejected_SNSSAI.cpp
+8
-2
No files found.
src/amf-app/amf_n1.cpp
View file @
1e127878
...
...
@@ -3255,8 +3255,8 @@ void amf_n1::ul_nas_transport_handle(
// TODO: Only use the first one for now if there's multiple requested
// NSSAI since we don't know which slice associated with this PDU session
if
(
nc
->
requestedN
ssai
.
size
()
>
0
)
{
snssai
=
nc
->
requestedN
ssai
[
0
];
if
(
nc
->
allowed_n
ssai
.
size
()
>
0
)
{
snssai
=
nc
->
allowed_n
ssai
[
0
];
Logger
::
amf_n1
().
debug
(
"Use first Requested S-NSSAI %s"
,
snssai
.
ToString
().
c_str
());
}
else
{
...
...
@@ -4128,6 +4128,23 @@ void amf_n1::initialize_registration_accept(
requested_nssai
.
push_back
(
ss
.
second
);
}
// Allowed NSSAI
for
(
auto
s
:
common_nssais
)
{
SNSSAI_t
snssai
=
{};
snssai
.
sst
=
s
.
sst
;
snssai
.
sd
=
s
.
sd
;
if
(
s
.
sd
==
SD_NO_VALUE
)
{
snssai
.
length
=
SST_LENGTH
;
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
Logger
::
amf_n1
().
debug
(
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)"
,
s
.
sst
,
s
.
sd
);
allowed_nssais
.
push_back
(
snssai
);
// Store in the NAS context
nc
->
allowed_nssai
.
push_back
(
snssai
);
// TODO: refactor NAS_Context
}
// Rejected NSSAIs
for
(
auto
rn
:
requested_nssai
)
{
bool
found
=
false
;
...
...
@@ -4142,9 +4159,9 @@ void amf_n1::initialize_registration_accept(
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
Logger
::
amf_n1
().
debug
(
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)"
,
s
.
sst
,
s
.
sd
);
allowed_nssais
.
push_back
(
snssai
);
//
Logger::amf_n1().debug(
//
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)", s.sst, s.sd);
//
allowed_nssais.push_back(snssai);
found
=
true
;
break
;
}
else
{
...
...
src/common/common_defs.h
View file @
1e127878
...
...
@@ -63,8 +63,14 @@ typedef enum {
sIZE += sizeof(uint16_t)
#define DECODE_U24(bUFFER, vALUE, sIZE) \
vALUE = ntohl(*(uint32_t*) (bUFFER)) >> 8; \
sIZE += sizeof(uint8_t) + sizeof(uint16_t)
do { \
uint32_t value_tmp = 0; \
uint8_t size_tmp = sizeof(uint8_t) + sizeof(uint16_t); \
memcpy((unsigned char*) &value_tmp, bUFFER, size_tmp); \
vALUE = ntohl(value_tmp); \
vALUE = vALUE >> 8; \
sIZE += size_tmp; \
} while (0)
#define DECODE_U32(bUFFER, vALUE, sIZE) \
vALUE = ntohl(*(uint32_t*) (bUFFER)); \
...
...
@@ -89,8 +95,12 @@ typedef enum {
size += sizeof(uint16_t)
#define ENCODE_U24(buffer, value, size) \
*(uint32_t*) (buffer) = htonl(value); \
size += sizeof(uint8_t) + sizeof(uint16_t)
do { \
uint32_t value_tmp = htonl(value << 8); \
uint8_t size_tmp = sizeof(uint8_t) + sizeof(uint16_t); \
memcpy(buffer, (unsigned char*) &value_tmp, size_tmp); \
size += size_tmp; \
} while (0)
#define ENCODE_U32(buffer, value, size) \
*(uint32_t*) (buffer) = htonl(value); \
...
...
src/contexts/nas_context.hpp
View file @
1e127878
...
...
@@ -98,6 +98,7 @@ class nas_context {
// Set to true if marked as default
std
::
vector
<
std
::
pair
<
bool
,
nas
::
SNSSAI_t
>>
subscribed_snssai
;
std
::
vector
<
nas
::
SNSSAI_t
>
configured_nssai
;
// TODO: rejected_nssai;
// std::vector<nas::SNSSAI_t> default_configured_nssai;
// std::vector<nas::SNSSAI_t> s_nssai; //for Network Slice selection
...
...
src/nas/ies/Rejected_SNSSAI.cpp
View file @
1e127878
...
...
@@ -126,6 +126,12 @@ int Rejected_SNSSAI::encode2buffer(uint8_t* buf, int len) {
Logger
::
nas_mm
().
debug
(
"SST %d"
,
sst_
);
if
(
sd_
.
has_value
())
{
ENCODE_U24
(
buf
+
encoded_size
,
sd_
.
value
(),
encoded_size
);
/*ENCODE_U8(
buf + encoded_size, (sd_.value() & 0x00ff0000) >> 16, encoded_size);
ENCODE_U8(
buf + encoded_size, (sd_.value() & 0x0000ff00) >> 8, encoded_size);
ENCODE_U8(buf + encoded_size, (sd_.value() & 0x000000ff), encoded_size);
*/
Logger
::
nas_mm
().
debug
(
"SD 0x%x"
,
sd_
.
value
());
}
Logger
::
nas_mm
().
debug
(
"Encoded Rejected_SNSSAI (len %d)"
,
encoded_size
);
...
...
@@ -147,10 +153,10 @@ int Rejected_SNSSAI::decodefrombuffer(uint8_t* buf, int len) {
cause_
,
sst_
);
}
else
if
(
length_
==
4
)
{
uint32_t
sd
=
0
;
DECODE_U
8
(
buf
+
decoded_size
,
sd
,
decoded_size
);
DECODE_U
24
(
buf
+
decoded_size
,
sd
,
decoded_size
);
sd_
=
std
::
optional
<
uint32_t
>
(
sd
);
Logger
::
nas_mm
().
debug
(
"Decoded Rejected_SNSSAI length 0x%x,cause 0x%x, SST 0x%x, SD 0x%x"
,
"Decoded Rejected_SNSSAI length 0x%x,
cause 0x%x, SST 0x%x, SD 0x%x"
,
length_
,
cause_
,
sst_
,
sd
);
}
else
{
return
-
1
;
// invalid value
...
...
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