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
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
littleBu
OpenXG-RAN
Commits
9719f5e5
Commit
9719f5e5
authored
Nov 13, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add const attribute to NAS enc/dec functions
parent
08e3f2f0
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
87 additions
and
60 deletions
+87
-60
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c
+4
-1
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h
+4
-1
openair3/NAS/COMMON/IES/NasKeySetIdentifier.c
openair3/NAS/COMMON/IES/NasKeySetIdentifier.c
+1
-1
openair3/NAS/COMMON/IES/NasKeySetIdentifier.h
openair3/NAS/COMMON/IES/NasKeySetIdentifier.h
+1
-1
openair3/NAS/COMMON/UTIL/OctetString.c
openair3/NAS/COMMON/UTIL/OctetString.c
+2
-3
openair3/NAS/COMMON/UTIL/OctetString.h
openair3/NAS/COMMON/UTIL/OctetString.h
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c
+9
-9
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c
+4
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h
+4
-1
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.c
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.c
+8
-2
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.h
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.h
+9
-3
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.c
+3
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.h
+3
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.c
...R_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.c
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.h
...R_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.c
+4
-4
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.h
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.c
+3
-3
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.h
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.h
+2
-2
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.c
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.c
+1
-1
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.h
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.h
+1
-1
No files found.
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c
View file @
9719f5e5
...
...
@@ -53,7 +53,10 @@ int decode_authentication_response_parameter(AuthenticationResponseParameter *au
#endif
return
decoded
;
}
int
encode_authentication_response_parameter
(
AuthenticationResponseParameter
*
authenticationresponseparameter
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_authentication_response_parameter
(
const
AuthenticationResponseParameter
*
authenticationresponseparameter
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint8_t
*
lenPtr
;
uint32_t
encoded
=
0
;
...
...
openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h
View file @
9719f5e5
...
...
@@ -35,7 +35,10 @@ typedef struct AuthenticationResponseParameter_tag {
OctetString
res
;
}
AuthenticationResponseParameter
;
int
encode_authentication_response_parameter
(
AuthenticationResponseParameter
*
authenticationresponseparameter
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_authentication_response_parameter
(
const
AuthenticationResponseParameter
*
authenticationresponseparameter
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_authentication_response_parameter
(
AuthenticationResponseParameter
*
authenticationresponseparameter
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
...
...
openair3/NAS/COMMON/IES/NasKeySetIdentifier.c
View file @
9719f5e5
...
...
@@ -50,7 +50,7 @@ int decode_nas_key_set_identifier(NasKeySetIdentifier *naskeysetidentifier, uint
/**
* @brief Encode the NAS key set identifier in one byte
*/
uint8_t
encode_nas_key_set_identifier
(
NasKeySetIdentifier
*
naskeysetidentifier
,
uint8_t
iei
)
uint8_t
encode_nas_key_set_identifier
(
const
NasKeySetIdentifier
*
naskeysetidentifier
,
uint8_t
iei
)
{
#if defined (NAS_DEBUG)
dump_nas_key_set_identifier_xml
(
naskeysetidentifier
,
iei
);
...
...
openair3/NAS/COMMON/IES/NasKeySetIdentifier.h
View file @
9719f5e5
...
...
@@ -39,7 +39,7 @@ typedef struct NasKeySetIdentifier_tag {
uint8_t
naskeysetidentifier
:
3
;
}
NasKeySetIdentifier
;
uint8_t
encode_nas_key_set_identifier
(
NasKeySetIdentifier
*
naskeysetidentifier
,
uint8_t
iei
);
uint8_t
encode_nas_key_set_identifier
(
const
NasKeySetIdentifier
*
naskeysetidentifier
,
uint8_t
iei
);
void
dump_nas_key_set_identifier_xml
(
NasKeySetIdentifier
*
naskeysetidentifier
,
uint8_t
iei
);
...
...
openair3/NAS/COMMON/UTIL/OctetString.c
View file @
9719f5e5
...
...
@@ -55,8 +55,7 @@ void free_octet_string(OctetString *octetstring)
}
}
int
encode_octet_string
(
OctetString
*
octetstring
,
uint8_t
*
buffer
,
uint32_t
buflen
)
int
encode_octet_string
(
const
OctetString
*
octetstring
,
uint8_t
*
buffer
,
uint32_t
buflen
)
{
if
(
octetstring
!=
NULL
)
{
if
((
octetstring
->
value
!=
NULL
)
&&
(
octetstring
->
length
>
0
))
{
...
...
@@ -71,7 +70,7 @@ int encode_octet_string(OctetString *octetstring, uint8_t *buffer, uint32_t bufl
}
}
int
decode_octet_string
(
OctetString
*
octetstring
,
uint16_t
pdulen
,
uint8_t
*
buffer
,
uint32_t
buflen
)
int
decode_octet_string
(
OctetString
*
octetstring
,
uint16_t
pdulen
,
const
uint8_t
*
buffer
,
uint32_t
buflen
)
{
if
(
buflen
<
pdulen
)
return
-
1
;
...
...
openair3/NAS/COMMON/UTIL/OctetString.h
View file @
9719f5e5
...
...
@@ -58,9 +58,9 @@ OctetString* dup_octet_string(OctetString*octetstring);
void
free_octet_string
(
OctetString
*
octetstring
);
int
encode_octet_string
(
OctetString
*
octetstring
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_octet_string
(
const
OctetString
*
octetstring
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_octet_string
(
OctetString
*
octetstring
,
uint16_t
pdulen
,
uint8_t
*
buffer
,
uint32_t
buflen
);
int
decode_octet_string
(
OctetString
*
octetstring
,
uint16_t
pdulen
,
const
uint8_t
*
buffer
,
uint32_t
buflen
);
char
*
dump_octet_string_xml
(
const
OctetString
*
const
octetstring
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.c
View file @
9719f5e5
...
...
@@ -60,7 +60,7 @@ int decode_fgc_nas_message_container(FGCNasMessageContainer *nasmessagecontainer
return
decoded
;
}
int
encode_fgc_nas_message_container
(
FGCNasMessageContainer
*
nasmessagecontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_fgc_nas_message_container
(
const
FGCNasMessageContainer
*
nasmessagecontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
encoded
=
0
;
int
encode_result
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGCNasMessageContainer.h
View file @
9719f5e5
...
...
@@ -44,7 +44,7 @@ typedef struct FGCNasMessageContainer_tag {
OctetString
nasmessagecontainercontents
;
}
FGCNasMessageContainer
;
int
encode_fgc_nas_message_container
(
FGCNasMessageContainer
*
nasmessagecontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_fgc_nas_message_container
(
const
FGCNasMessageContainer
*
nasmessagecontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_fgc_nas_message_container
(
FGCNasMessageContainer
*
nasmessagecontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.c
View file @
9719f5e5
...
...
@@ -35,7 +35,7 @@
#include "TLVDecoder.h"
#include "FGMMCapability.h"
int
encode_5gmm_capability
(
FGMMCapability
*
fgmmcapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_5gmm_capability
(
const
FGMMCapability
*
fgmmcapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
if
(
iei
)
{
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGMMCapability.h
View file @
9719f5e5
...
...
@@ -42,6 +42,6 @@ typedef struct {
uint8_t
value
;
}
FGMMCapability
;
int
encode_5gmm_capability
(
FGMMCapability
*
fgmmcapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_5gmm_capability
(
const
FGMMCapability
*
fgmmcapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* FGMM_CAPABILITY_H_ */
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.c
View file @
9719f5e5
...
...
@@ -41,11 +41,11 @@
static
int
decode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
const
uint8_t
*
buffer
);
static
int
encode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
);
static
int
encode_suci_5gs_mobile_identity
(
Suci5GSMobileIdentity_t
*
suci
,
uint8_t
*
buffer
);
static
int
encode_imeisv_5gs_mobile_identity
(
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
);
static
int
encode_guti_5gs_mobile_identity
(
const
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
);
static
int
encode_suci_5gs_mobile_identity
(
const
Suci5GSMobileIdentity_t
*
suci
,
uint8_t
*
buffer
);
static
int
encode_imeisv_5gs_mobile_identity
(
const
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
);
int
encode_stmsi_5gs_mobile_identity
(
uint8_t
*
buffer
,
Stmsi5GSMobileIdentity_t
*
stmsi
,
uint32_t
len
)
int
encode_stmsi_5gs_mobile_identity
(
uint8_t
*
buffer
,
const
Stmsi5GSMobileIdentity_t
*
stmsi
,
uint32_t
len
)
{
// Return if buffer is shorter than min length
if
(
len
<
LEN_5G_FGS_TMSI_IE
)
...
...
@@ -126,7 +126,7 @@ int decode_5gs_mobile_identity(FGSMobileIdentity *fgsmobileidentity, uint8_t iei
return
(
decoded
+
decoded_rc
);
}
int
encode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_5gs_mobile_identity
(
const
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
// Return if buffer is shorter than min length
if
(
len
<
MIN_LEN_FGS_MOBILE_ID_IE
)
...
...
@@ -222,7 +222,7 @@ static int decode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, const
return
decoded
;
}
static
int
encode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
)
static
int
encode_guti_5gs_mobile_identity
(
const
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
)
{
uint32_t
encoded
=
0
;
uint16_t
temp
;
...
...
@@ -245,7 +245,7 @@ static int encode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, uint8_
return
encoded
;
}
static
int
encode_suci_5gs_mobile_identity
(
Suci5GSMobileIdentity_t
*
suci
,
uint8_t
*
buffer
)
static
int
encode_suci_5gs_mobile_identity
(
const
Suci5GSMobileIdentity_t
*
suci
,
uint8_t
*
buffer
)
{
uint32_t
encoded
=
0
;
*
(
buffer
+
encoded
)
=
(
suci
->
supiformat
<<
4
)
|
(
suci
->
typeofidentity
);
...
...
@@ -269,7 +269,7 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_
*
(
buffer
+
encoded
)
=
suci
->
homenetworkpki
;
encoded
++
;
char
*
ptr
=
suci
->
schemeoutput
;
c
onst
c
har
*
ptr
=
suci
->
schemeoutput
;
while
(
ptr
<
suci
->
schemeoutput
+
strlen
(
suci
->
schemeoutput
))
{
buffer
[
encoded
]
=
((
*
(
ptr
+
1
)
-
'0'
)
<<
4
)
|
(
*
(
ptr
)
-
'0'
);
encoded
++
;
...
...
@@ -281,7 +281,7 @@ static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_
return
encoded
;
}
static
int
encode_imeisv_5gs_mobile_identity
(
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
)
static
int
encode_imeisv_5gs_mobile_identity
(
const
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
)
{
uint32_t
encoded
=
0
;
*
(
buffer
+
encoded
)
=
0x00
|
(
imeisv
->
digittac01
<<
4
)
|
(
imeisv
->
oddeven
<<
3
)
|
(
imeisv
->
typeofidentity
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSMobileIdentity.h
View file @
9719f5e5
...
...
@@ -148,11 +148,11 @@ typedef union FGSMobileIdentity_tag {
}
FGSMobileIdentity
;
// clang-format on
int
encode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_5gs_mobile_identity
(
const
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
const
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_stmsi_5gs_mobile_identity
(
uint8_t
*
buffer
,
Stmsi5GSMobileIdentity_t
*
stmsi
,
uint32_t
len
);
int
encode_stmsi_5gs_mobile_identity
(
uint8_t
*
buffer
,
const
Stmsi5GSMobileIdentity_t
*
stmsi
,
uint32_t
len
);
int
decode_stmsi_5gs_mobile_identity
(
Stmsi5GSMobileIdentity_t
*
stmsi
,
const
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* FGS MOBILE IDENTITY_H_ */
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.c
View file @
9719f5e5
...
...
@@ -46,7 +46,7 @@ int decode_fgs_registration_result(FGSRegistrationResult *fgsregistrationresult,
return
decoded
;
}
uint16_t
encode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
)
uint16_t
encode_fgs_registration_result
(
const
FGSRegistrationResult
*
fgsregistrationresult
)
{
uint16_t
bufferReturn
;
uint16_t
*
buffer
=
&
bufferReturn
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationResult.h
View file @
9719f5e5
...
...
@@ -48,7 +48,7 @@ typedef struct {
uint8_t
registrationresult
:
3
;
}
FGSRegistrationResult
;
uint16_t
encode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
);
uint16_t
encode_fgs_registration_result
(
const
FGSRegistrationResult
*
fgsregistrationresult
);
int
decode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
,
uint8_t
iei
,
uint16_t
value
,
uint32_t
len
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c
View file @
9719f5e5
...
...
@@ -49,7 +49,7 @@ int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8
return
decoded
;
}
int
encode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
)
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
)
{
uint8_t
bufferReturn
;
uint8_t
*
buffer
=
&
bufferReturn
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h
View file @
9719f5e5
...
...
@@ -47,7 +47,7 @@ typedef uint8_t FGSRegistrationType;
#define EMERGENCY_REGISTRATION 0b100
// clang-format on
int
encode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
);
int
encode_5gs_registration_type
(
const
FGSRegistrationType
*
fgsregistrationtype
);
int
decode_5gs_registration_type
(
FGSRegistrationType
*
fgsregistrationtype
,
uint8_t
iei
,
uint8_t
value
,
uint32_t
len
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c
View file @
9719f5e5
...
...
@@ -35,7 +35,10 @@
#include "TLVDecoder.h"
#include "NrUESecurityCapability.h"
int
encode_nrue_security_capability
(
NrUESecurityCapability
*
nruesecuritycapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_nrue_security_capability
(
const
NrUESecurityCapability
*
nruesecuritycapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
if
(
iei
)
{
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h
View file @
9719f5e5
...
...
@@ -45,6 +45,9 @@ typedef struct {
uint8_t
EIA
;
}
NrUESecurityCapability
;
int
encode_nrue_security_capability
(
NrUESecurityCapability
*
nruesecuritycapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_nrue_security_capability
(
const
NrUESecurityCapability
*
nruesecuritycapability
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* NRUE_SECURITY_CAPABILITY_H_ */
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.c
View file @
9719f5e5
...
...
@@ -30,7 +30,10 @@
//#define NAS_DEBUG 1
int
decode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
decode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
int
decoded
=
0
;
int
decode_result
;
...
...
@@ -61,7 +64,10 @@ int decode_sor_transparent_container(SORTransparentContainer *sortransparentcont
LOG_FUNC_RETURN
(
decoded
);
}
int
encode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_sor_transparent_container
(
const
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint8_t
*
lenPtr
;
uint32_t
encoded
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/IES/SORTransparentContainer.h
View file @
9719f5e5
...
...
@@ -35,9 +35,15 @@ typedef struct SORTransparentContainer_tag {
OctetString
sortransparentcontainercontents
;
}
SORTransparentContainer
;
int
encode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_sor_transparent_container
(
const
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_sor_transparent_container
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
,
const
uint8_t
*
buffer
,
uint32_t
len
);
void
dump_sor_transparent_container_xml
(
SORTransparentContainer
*
sortransparentcontainer
,
uint8_t
iei
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.c
View file @
9719f5e5
...
...
@@ -37,7 +37,9 @@
#include "FGSAuthenticationResponse.h"
int
encode_fgs_authentication_response
(
fgs_authentication_response_msg
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_fgs_authentication_response
(
const
fgs_authentication_response_msg
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
int
encode_result
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSAuthenticationResponse.h
View file @
9719f5e5
...
...
@@ -57,6 +57,8 @@ typedef struct fgs_authentication_response_msg_tag {
AuthenticationResponseParameter
authenticationresponseparameter
;
}
fgs_authentication_response_msg
;
int
encode_fgs_authentication_response
(
fgs_authentication_response_msg
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_fgs_authentication_response
(
const
fgs_authentication_response_msg
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(FGS_AUTHENTICATION_RESPONSE_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.c
View file @
9719f5e5
...
...
@@ -32,12 +32,12 @@
#define IEI_NULL 0x00
int
encode_fgs_deregistration_request_ue_originating
(
fgs_deregistration_request_ue_originating_msg
*
drr
,
int
encode_fgs_deregistration_request_ue_originating
(
const
fgs_deregistration_request_ue_originating_msg
*
drr
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
FGSDeregistrationType
*
dt
=
&
drr
->
deregistrationtype
;
const
FGSDeregistrationType
*
dt
=
&
drr
->
deregistrationtype
;
*
(
buffer
+
encoded
)
=
((
dt
->
switchoff
&
0x1
)
<<
7
)
|
((
dt
->
reregistration_required
&
0x1
)
<<
6
)
|
((
dt
->
access_type
&
0x3
)
<<
4
);
int
encode_result
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSDeregistrationRequestUEOriginating.h
View file @
9719f5e5
...
...
@@ -47,7 +47,7 @@ typedef struct fgs_deregistration_request_ue_originating_msg_tag {
FGSMobileIdentity
fgsmobileidentity
;
}
fgs_deregistration_request_ue_originating_msg
;
int
encode_fgs_deregistration_request_ue_originating
(
fgs_deregistration_request_ue_originating_msg
*
registrationrequest
,
int
encode_fgs_deregistration_request_ue_originating
(
const
fgs_deregistration_request_ue_originating_msg
*
registrationrequest
,
uint8_t
*
buffer
,
uint32_t
len
);
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.c
View file @
9719f5e5
...
...
@@ -33,7 +33,7 @@
#include "FGCNasMessageContainer.h"
#include "FGSMobileIdentity.h"
int
encode_fgs_security_mode_complete
(
fgs_security_mode_complete_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_fgs_security_mode_complete
(
const
fgs_security_mode_complete_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
int
encode_result
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSNASSecurityModeComplete.h
View file @
9719f5e5
...
...
@@ -54,6 +54,6 @@ typedef struct fgs_security_mode_complete_msg_tag {
FGCNasMessageContainer
fgsnasmessagecontainer
;
}
fgs_security_mode_complete_msg
;
int
encode_fgs_security_mode_complete
(
fgs_security_mode_complete_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_fgs_security_mode_complete
(
const
fgs_security_mode_complete_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(FGS_NAS_SECURITY_MODE_COMPLETE_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.c
View file @
9719f5e5
...
...
@@ -34,7 +34,7 @@
#include <string.h>
#include "TLVEncoder.h"
int
encode_fgs_payload_container
(
FGSPayloadContainer
*
paycontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
static
int
encode_fgs_payload_container
(
const
FGSPayloadContainer
*
paycontainer
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
encoded
=
0
;
int
encode_result
;
...
...
@@ -62,7 +62,7 @@ int encode_fgs_payload_container(FGSPayloadContainer *paycontainer, uint8_t iei,
return
encoded
;
}
int
encode_nssai
(
OctetString
*
nssai
,
uint8_t
iei
,
uint8_t
*
buffer
)
static
int
encode_nssai
(
const
OctetString
*
nssai
,
uint8_t
iei
,
uint8_t
*
buffer
)
{
uint32_t
encoded
=
0
;
int
encode_result
;
...
...
@@ -84,7 +84,7 @@ int encode_nssai(OctetString *nssai, uint8_t iei, uint8_t *buffer)
return
encoded
;
}
int
encode_dnn
(
OctetString
*
dnn
,
uint8_t
iei
,
uint8_t
*
buffer
)
static
int
encode_dnn
(
const
OctetString
*
dnn
,
uint8_t
iei
,
uint8_t
*
buffer
)
{
uint32_t
encoded
=
0
;
int
encode_result
;
...
...
@@ -106,7 +106,7 @@ int encode_dnn(OctetString *dnn, uint8_t iei, uint8_t *buffer)
return
encoded
;
}
int
encode_fgs_uplink_nas_transport
(
fgs_uplink_nas_transport_msg
*
fgs_up_nas_transport
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_fgs_uplink_nas_transport
(
const
fgs_uplink_nas_transport_msg
*
fgs_up_nas_transport
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
int
encode_result
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/FGSUplinkNasTransport.h
View file @
9719f5e5
...
...
@@ -66,6 +66,6 @@ typedef struct fgs_uplink_nas_transport_msg_tag {
OctetString
dnn
;
}
fgs_uplink_nas_transport_msg
;
int
encode_fgs_uplink_nas_transport
(
fgs_uplink_nas_transport_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_fgs_uplink_nas_transport
(
const
fgs_uplink_nas_transport_msg
*
fgs_security_mode_comp
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(FGS_UPLINK_NAS_TRANSPORT_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.c
View file @
9719f5e5
...
...
@@ -65,7 +65,7 @@ int decode_registration_accept(registration_accept_msg *registration_accept, con
return
decoded
;
}
int
encode_registration_accept
(
registration_accept_msg
*
registration_accept
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_registration_accept
(
const
registration_accept_msg
*
registration_accept
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.h
View file @
9719f5e5
...
...
@@ -61,6 +61,6 @@ typedef struct registration_accept_msg_tag {
int
decode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
const
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_accept
(
const
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(REGISTRATION_ACCEPT_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.c
View file @
9719f5e5
...
...
@@ -23,14 +23,14 @@
#include <stdint.h>
#include "SORTransparentContainer.h"
int
decode_registration_complete
(
registration_complete_msg
*
registration_complete
,
uint8_t
*
buffer
,
uint32_t
len
)
int
decode_registration_complete
(
registration_complete_msg
*
registration_complete
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
decoded
=
0
;
int
decoded_result
=
0
;
/* Decoding mandatory fields */
if
((
decoded_result
=
decode_sor_transparent_container
(
&
registration_complete
->
sortransparentcontainer
,
0
,
buffer
+
decoded
,
len
-
decoded
))
decode_sor_transparent_container
(
registration_complete
->
sortransparentcontainer
,
0
,
buffer
+
decoded
,
len
-
decoded
))
<
0
)
return
decoded_result
;
else
...
...
@@ -39,7 +39,7 @@ int decode_registration_complete(registration_complete_msg *registration_complet
return
decoded
;
}
int
encode_registration_complete
(
registration_complete_msg
*
registration_complete
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_registration_complete
(
const
registration_complete_msg
*
registration_complete
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
int
encode_result
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationComplete.h
View file @
9719f5e5
...
...
@@ -41,8 +41,8 @@ typedef struct registration_complete_msg_tag {
SORTransparentContainer
*
sortransparentcontainer
;
}
registration_complete_msg
;
int
decode_registration_complete
(
registration_complete_msg
*
registrationcomplete
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_registration_complete
(
registration_complete_msg
*
registrationcomplete
,
const
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_complete
(
registration_complete_msg
*
registrationcomplete
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_complete
(
const
registration_complete_msg
*
registrationcomplete
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(REGISTRATION_COMPLETE_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c
View file @
9719f5e5
...
...
@@ -34,7 +34,7 @@
#define IEI_NULL 0x00
int
decode_registration_request
(
registration_request_msg
*
registration_request
,
uint8_t
*
buffer
,
uint32_t
len
)
int
decode_registration_request
(
registration_request_msg
*
registration_request
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
decoded
=
0
;
int
decoded_result
=
0
;
...
...
@@ -68,7 +68,7 @@ int decode_registration_request(registration_request_msg *registration_request,
return
decoded
;
}
int
encode_registration_request
(
registration_request_msg
*
registration_request
,
uint8_t
*
buffer
,
uint32_t
len
)
int
encode_registration_request
(
const
registration_request_msg
*
registration_request
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
int
encode_result
=
0
;
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.h
View file @
9719f5e5
...
...
@@ -112,8 +112,8 @@ typedef struct registration_request_msg_tag {
NrUESecurityCapability
nruesecuritycapability
;
}
registration_request_msg
;
int
decode_registration_request
(
registration_request_msg
*
registrationrequest
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_registration_request
(
registration_request_msg
*
registrationrequest
,
const
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_request
(
registration_request_msg
*
registrationrequest
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_request
(
const
registration_request_msg
*
registrationrequest
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(REGISTRATION_REQUEST_H_) */
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.c
View file @
9719f5e5
...
...
@@ -38,7 +38,7 @@
/**
* @brief Encode 5GMM NAS Service Request message (8.2.16 of 3GPP TS 24.501)
*/
int
encode_fgs_service_request
(
uint8_t
*
buffer
,
fgs_service_request_msg_t
*
service_request
,
uint32_t
len
)
int
encode_fgs_service_request
(
uint8_t
*
buffer
,
const
fgs_service_request_msg_t
*
service_request
,
uint32_t
len
)
{
// Return if buffer is shorter than min length
if
(
len
<
MIN_LEN_FGS_SERVICE_REQUEST
)
...
...
openair3/NAS/NR_UE/5GS/5GMM/MSG/fgs_service_request.h
View file @
9719f5e5
...
...
@@ -53,7 +53,7 @@ typedef struct {
FGCNasMessageContainer
*
fgsnasmessagecontainer
;
}
fgs_service_request_msg_t
;
int
encode_fgs_service_request
(
uint8_t
*
buffer
,
fgs_service_request_msg_t
*
servicerequest
,
uint32_t
len
);
int
encode_fgs_service_request
(
uint8_t
*
buffer
,
const
fgs_service_request_msg_t
*
servicerequest
,
uint32_t
len
);
int
decode_fgs_service_request
(
fgs_service_request_msg_t
*
sr
,
const
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(FGS_SERVICE_REQUEST_H_) */
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