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
promise
OpenXG-RAN
Commits
f2bb26a9
Commit
f2bb26a9
authored
Oct 28, 2020
by
heshanyun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add decode and encode for registration accept
parent
ca4e8555
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
175 additions
and
0 deletions
+175
-0
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-0
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
+49
-0
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
+45
-0
openair3/NAS/COMMON/IES/FGSRegistrationResult.c
openair3/NAS/COMMON/IES/FGSRegistrationResult.c
+41
-0
openair3/NAS/COMMON/IES/FGSRegistrationResult.h
openair3/NAS/COMMON/IES/FGSRegistrationResult.h
+38
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
f2bb26a9
...
...
@@ -2454,6 +2454,7 @@ if(ITTI_SIM)
set
(
libnrnas_emm_msg_OBJS
${
NAS_SRC
}
COMMON/EMM/MSG/RegistrationRequest.c
${
NAS_SRC
}
COMMON/EMM/MSG/RegistrationAccept.c
)
set
(
libnrnas_ies_OBJS
...
...
@@ -2461,6 +2462,7 @@ if(ITTI_SIM)
${
NAS_SRC
}
COMMON/IES/FGSMobileIdentity.c
${
NAS_SRC
}
COMMON/IES/FGSRegistrationType.c
${
NAS_SRC
}
COMMON/IES/SpareHalfOctet.c
${
NAS_SRC
}
COMMON/IES/FGSRegistrationResult.c
${
NAS_SRC
}
COMMON/IES/FGMMCapability.c
${
NAS_SRC
}
COMMON/IES/NrUESecurityCapability.c
)
...
...
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
0 → 100644
View file @
f2bb26a9
/*! \file RegistrationAccept.c
\brief 5GS registration accept procedures
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "RegistrationAccept.h"
#include "assertions.h"
int
decode_registration_accept
(
registration_accept_msg
*
registration_accept
,
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
decoded
=
0
;
int
decoded_result
=
0
;
/* Decoding mandatory fields */
if
((
decoded_result
=
decode_fgs_registration_result
(
&
registration_accept
->
fgsregistrationresult
,
0
,
*
(
buffer
+
decoded
),
len
-
decoded
))
<
0
)
return
decoded_result
;
decoded
+=
decoded_result
;
// todo ,Decoding optional fields
return
decoded
;
}
int
encode_registration_accept
(
registration_accept_msg
*
registration_accept
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
LOG_FUNC_IN
;
*
(
buffer
+
encoded
)
=
encode_fgs_registration_result
(
&
registration_accept
->
fgsregistrationresult
);
encoded
=
encoded
+
2
;
// todo ,Encoding optional fields
LOG_FUNC_RETURN
(
encoded
);
}
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
0 → 100644
View file @
f2bb26a9
/*! \file RegistrationAccept.h
\brief 5GS registration accept procedures
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "ExtendedProtocolDiscriminator.h"
#include "SecurityHeaderType.h"
#include "SpareHalfOctet.h"
#include "MessageType.h"
#include "FGSRegistrationResult.h"
#ifndef REGISTRATION_ACCEPT_H_
#define REGISTRATION_ACCEPT_H_
/*
* Message name: Registration accept
* Description: The REGISTRATION ACCEPT message is sent by the AMF to the UE. See table 8.2.7.1.1.
* Significance: dual
* Direction: network to UE
*/
typedef
struct
registration_accept_msg_tag
{
/* Mandatory fields */
ExtendedProtocolDiscriminator
protocoldiscriminator
;
SecurityHeaderType
securityheadertype
:
4
;
SpareHalfOctet
sparehalfoctet
:
4
;
MessageType
messagetype
;
FGSRegistrationResult
fgsregistrationresult
;
}
registration_accept_msg
;
int
decode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* ! defined(REGISTRATION_ACCEPT_H_) */
openair3/NAS/COMMON/IES/FGSRegistrationResult.c
0 → 100644
View file @
f2bb26a9
/*! \file FGSRegistrationResult.c
\brief 5GS Registration result for registration request procedures
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "FGSRegistrationResult.h"
int
decode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
,
uint8_t
iei
,
uint16_t
value
,
uint32_t
len
)
{
int
decoded
=
0
;
uint16_t
*
buffer
=
&
value
;
fgsregistrationresult
->
registrationresult
=
*
buffer
&
0x7
;
fgsregistrationresult
->
smsallowed
=
*
buffer
&
0x8
;
decoded
=
decoded
+
2
;
return
decoded
;
}
uint16_t
encode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
)
{
uint16_t
bufferReturn
;
uint16_t
*
buffer
=
&
bufferReturn
;
uint8_t
encoded
=
0
;
*
(
buffer
+
encoded
)
=
0x00
|
(
fgsregistrationresult
->
smsallowed
&
0x8
)
|
(
fgsregistrationresult
->
registrationresult
&
0x7
);
encoded
=
encoded
+
2
;
return
bufferReturn
;
}
openair3/NAS/COMMON/IES/FGSRegistrationResult.h
0 → 100644
View file @
f2bb26a9
/*! \file FGSRegistrationResult.h
\brief 5GS Registration result for registration request procedures
\author Yoshio INOUE, Masayuki HARADA
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
\date 2020
\version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "OctetString.h"
#ifndef FGS_REGISTRATION_RESULT_H_
#define FGS_REGISTRATION_RESULT_H_
#define FGS_REGISTRATION_RESULT_3GPP 0b001
#define FGS_REGISTRATION_RESULT_NON_3GPP 0b010
#define FGS_REGISTRATION_RESULT_3GPP_AND_NON_3GPP 0b011
typedef
struct
{
uint8_t
iei
;
uint8_t
resultlength
;
uint8_t
spare
:
4
;
uint8_t
smsallowed
:
1
;
uint8_t
registrationresult
:
3
;
}
FGSRegistrationResult
;
uint16_t
encode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
);
int
decode_fgs_registration_result
(
FGSRegistrationResult
*
fgsregistrationresult
,
uint8_t
iei
,
uint16_t
value
,
uint32_t
len
);
#endif
/* FGS REGISTRATION RESULT_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