Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
1
Merge Requests
1
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-RAN
Commits
4633eb88
Commit
4633eb88
authored
Nov 27, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor 5GS registration type encoding (9.11.3.7 of 3GPP TS 24.501)
parent
9dd1929e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
+13
-10
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
+4
-2
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
+2
-1
No files found.
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
View file @
4633eb88
...
@@ -30,11 +30,14 @@
...
@@ -30,11 +30,14 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdint.h>
#include <stdbool.h>
#include "TLVEncoder.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVDecoder.h"
#include "FGSRegistrationType.h"
#include "FGSRegistrationType.h"
#define NO_FOLLOW_ON_REQUEST 0x0
#define FOLLOW_ON_REQUEST 0x08
int
decode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
,
uint8_t
iei
,
uint8_t
value
,
uint32_t
len
)
int
decode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
,
uint8_t
iei
,
uint8_t
value
,
uint32_t
len
)
{
{
int
decoded
=
0
;
int
decoded
=
0
;
...
@@ -49,14 +52,14 @@ int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8
...
@@ -49,14 +52,14 @@ int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8
return
decoded
;
return
decoded
;
}
}
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
)
/**
* @brief Encode 5GS registration type (9.11.3.7 of 3GPP TS 24.501)
* Note: mandatory IE (IEI = 0)
*/
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
,
bool
follow_on_request
)
{
{
uint8_t
bufferReturn
;
// Follow-on request bit
uint8_t
*
buffer
=
&
bufferReturn
;
uint8_t
foR
=
follow_on_request
?
FOLLOW_ON_REQUEST
:
NO_FOLLOW_ON_REQUEST
;
uint8_t
encoded
=
0
;
// Return encoded value
uint8_t
iei
=
0
;
return
(
foR
|
(
*
fgsregistrationtype
&
0x7
));
*
(
buffer
+
encoded
)
=
0x00
|
(
iei
&
0xf0
)
|
0x8
|
(
*
fgsregistrationtype
&
0x7
);
encoded
++
;
return
bufferReturn
;
}
}
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
View file @
4633eb88
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdint.h>
#include <stdbool.h>
#include "OctetString.h"
#include "OctetString.h"
#ifndef FGS_REGISTRATION_TYPE_H_
#ifndef FGS_REGISTRATION_TYPE_H_
...
@@ -41,13 +41,15 @@
...
@@ -41,13 +41,15 @@
typedef
uint8_t
FGSRegistrationType
;
typedef
uint8_t
FGSRegistrationType
;
// clang-format off
// clang-format off
/* 3GPP TS 24.501 Table 9.11.3.7.1: 5GS registration type IE */
#define INITIAL_REGISTRATION 0b001
#define INITIAL_REGISTRATION 0b001
#define MOBILITY_REGISTRATION_UPDATING 0b010
#define MOBILITY_REGISTRATION_UPDATING 0b010
#define PERIODIC_REGISTRATION_UPDATING 0b011
#define PERIODIC_REGISTRATION_UPDATING 0b011
#define EMERGENCY_REGISTRATION 0b100
#define EMERGENCY_REGISTRATION 0b100
#define REG_TYPE_RESERVED 0b111
// clang-format on
// clang-format on
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
);
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
,
bool
follow_on_request
);
int
decode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
,
uint8_t
iei
,
uint8_t
value
,
uint32_t
len
);
int
decode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
,
uint8_t
iei
,
uint8_t
value
,
uint32_t
len
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
View file @
4633eb88
...
@@ -72,9 +72,10 @@ int encode_registration_request(const registration_request_msg *registration_req
...
@@ -72,9 +72,10 @@ int encode_registration_request(const registration_request_msg *registration_req
{
{
int
encoded
=
0
;
int
encoded
=
0
;
int
encode_result
=
0
;
int
encode_result
=
0
;
bool
is_for
=
true
;
// Follow-on request pending
*
(
buffer
+
encoded
)
=
((
encode_nas_key_set_identifier
(
&
registration_request
->
naskeysetidentifier
,
IEI_NULL
)
&
0x0f
)
<<
4
)
*
(
buffer
+
encoded
)
=
((
encode_nas_key_set_identifier
(
&
registration_request
->
naskeysetidentifier
,
IEI_NULL
)
&
0x0f
)
<<
4
)
|
(
encode_5gs_registration_type
(
&
registration_request
->
fgsregistrationtype
)
&
0x0f
);
|
(
encode_5gs_registration_type
(
&
registration_request
->
fgsregistrationtype
,
is_for
)
&
0x0f
);
encoded
++
;
encoded
++
;
if
((
encode_result
=
encode_5gs_mobile_identity
(
&
registration_request
->
fgsmobileidentity
,
0
,
buffer
+
encoded
,
len
-
encoded
))
if
((
encode_result
=
encode_5gs_mobile_identity
(
&
registration_request
->
fgsmobileidentity
,
0
,
buffer
+
encoded
,
len
-
encoded
))
...
...
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