Commit 933e5d7b authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

correct indentation for NAS-messages

parent 7157a7cd
This diff is collapsed.
......@@ -22,7 +22,6 @@
#ifndef NAS_MESSAGE_H_
#define NAS_MESSAGE_H_
#include "mm_msg.h"
#include "sm_msg.h"
#include "common_types.h"
......@@ -42,8 +41,8 @@
/* Structure of security protected header */
typedef struct nas_message_security_header_s {
#ifdef __LITTLE_ENDIAN_BITFIELD
extended_protocol_discriminator_t extended_protocol_discriminator;//3gpp_24.501.h
uint8_t security_header_type:4;
extended_protocol_discriminator_t extended_protocol_discriminator;//3gpp_24.501.h
uint8_t security_header_type:4;
uint8_t spare_half_octet:4;
#endif
#ifdef __BIG_ENDIAN_BITFIELD
......@@ -81,14 +80,14 @@ typedef struct nas_message_decode_status_s {
uint8_t ciphered_message:1;
uint8_t mac_matched:1;
uint8_t security_context_available:1;
int fivegmm_cause;
int fivegmm_cause;
} nas_message_decode_status_t;
int nas_message_encode(
unsigned char *buffer,
unsigned char *buffer,
const nas_message_t * const msg,
size_t length,
void *security);
size_t length,
void *security);
int nas_message_decode (
const unsigned char *const buffer,
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionAuthenticationCommand.h"
int decode_pdu_session_authentication_command( pdu_session_authentication_command_msg *pdu_session_authentication_command, uint8_t* buffer, uint32_t len)
int decode_pdu_session_authentication_command( pdu_session_authentication_command_msg *pdu_session_authentication_command, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -42,7 +42,7 @@ int decode_pdu_session_authentication_command( pdu_session_authentication_comman
}
int encode_pdu_session_authentication_command( pdu_session_authentication_command_msg *pdu_session_authentication_command, uint8_t* buffer, uint32_t len)
int encode_pdu_session_authentication_command( pdu_session_authentication_command_msg *pdu_session_authentication_command, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionAuthenticationComplete.h"
int decode_pdu_session_authentication_complete( pdu_session_authentication_complete_msg *pdu_session_authentication_complete, uint8_t* buffer, uint32_t len)
int decode_pdu_session_authentication_complete( pdu_session_authentication_complete_msg *pdu_session_authentication_complete, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -42,7 +42,7 @@ int decode_pdu_session_authentication_complete( pdu_session_authentication_compl
}
int encode_pdu_session_authentication_complete( pdu_session_authentication_complete_msg *pdu_session_authentication_complete, uint8_t* buffer, uint32_t len)
int encode_pdu_session_authentication_complete( pdu_session_authentication_complete_msg *pdu_session_authentication_complete, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionAuthenticationResult.h"
int decode_pdu_session_authentication_result( pdu_session_authentication_result_msg *pdu_session_authentication_result, uint8_t* buffer, uint32_t len)
int decode_pdu_session_authentication_result( pdu_session_authentication_result_msg *pdu_session_authentication_result, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -44,7 +44,7 @@ int decode_pdu_session_authentication_result( pdu_session_authentication_result_
}
int encode_pdu_session_authentication_result( pdu_session_authentication_result_msg *pdu_session_authentication_result, uint8_t* buffer, uint32_t len)
int encode_pdu_session_authentication_result( pdu_session_authentication_result_msg *pdu_session_authentication_result, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionEstablishmentAccept.h"
int decode_pdu_session_establishment_accept( pdu_session_establishment_accept_msg *pdu_session_establishment_accept, uint8_t* buffer, uint32_t len)
int decode_pdu_session_establishment_accept( pdu_session_establishment_accept_msg *pdu_session_establishment_accept, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -132,7 +132,7 @@ return decoded;
}
int encode_pdu_session_establishment_accept( pdu_session_establishment_accept_msg *pdu_session_establishment_accept, uint8_t* buffer, uint32_t len)
int encode_pdu_session_establishment_accept( pdu_session_establishment_accept_msg *pdu_session_establishment_accept, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionEstablishmentReject.h"
int decode_pdu_session_establishment_reject( pdu_session_establishment_reject_msg *pdu_session_establishment_reject, uint8_t* buffer, uint32_t len)
int decode_pdu_session_establishment_reject( pdu_session_establishment_reject_msg *pdu_session_establishment_reject, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -77,7 +77,7 @@ int decode_pdu_session_establishment_reject( pdu_session_establishment_reject_ms
}
int encode_pdu_session_establishment_reject( pdu_session_establishment_reject_msg *pdu_session_establishment_reject, uint8_t* buffer, uint32_t len)
int encode_pdu_session_establishment_reject( pdu_session_establishment_reject_msg *pdu_session_establishment_reject, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionEstablishmentRequest.h"
int decode_pdu_session_establishment_request( pdu_session_establishment_request_msg *pdu_session_establishment_request, uint8_t* buffer, uint32_t len)
int decode_pdu_session_establishment_request( pdu_session_establishment_request_msg *pdu_session_establishment_request, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -93,7 +93,7 @@ int decode_pdu_session_establishment_request( pdu_session_establishment_request_
}
int encode_pdu_session_establishment_request( pdu_session_establishment_request_msg *pdu_session_establishment_request, uint8_t* buffer, uint32_t len)
int encode_pdu_session_establishment_request( pdu_session_establishment_request_msg *pdu_session_establishment_request, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionModificationCommand.h"
int decode_pdu_session_modification_command( pdu_session_modification_command_msg *pdu_session_modification_command, uint8_t* buffer, uint32_t len)
int decode_pdu_session_modification_command( pdu_session_modification_command_msg *pdu_session_modification_command, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -96,7 +96,7 @@ int decode_pdu_session_modification_command( pdu_session_modification_command_ms
}
int encode_pdu_session_modification_command( pdu_session_modification_command_msg *pdu_session_modification_command, uint8_t* buffer, uint32_t len)
int encode_pdu_session_modification_command( pdu_session_modification_command_msg *pdu_session_modification_command, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionModificationCommandReject.h"
int decode_pdu_session_modification_command_reject( pdu_session_modification_command_reject_msg *pdu_session_modification_command_reject, uint8_t* buffer, uint32_t len)
int decode_pdu_session_modification_command_reject( pdu_session_modification_command_reject_msg *pdu_session_modification_command_reject, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -42,7 +42,7 @@ int decode_pdu_session_modification_command_reject( pdu_session_modification_com
}
int encode_pdu_session_modification_command_reject( pdu_session_modification_command_reject_msg *pdu_session_modification_command_reject, uint8_t* buffer, uint32_t len)
int encode_pdu_session_modification_command_reject( pdu_session_modification_command_reject_msg *pdu_session_modification_command_reject, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionModificationComplete.h"
int decode_pdu_session_modification_complete( pdu_session_modification_complete_msg *pdu_session_modification_complete, uint8_t* buffer, uint32_t len)
int decode_pdu_session_modification_complete( pdu_session_modification_complete_msg *pdu_session_modification_complete, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -36,7 +36,7 @@ int decode_pdu_session_modification_complete( pdu_session_modification_complete_
}
int encode_pdu_session_modification_complete( pdu_session_modification_complete_msg *pdu_session_modification_complete, uint8_t* buffer, uint32_t len)
int encode_pdu_session_modification_complete( pdu_session_modification_complete_msg *pdu_session_modification_complete, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionModificationReject.h"
int decode_pdu_session_modification_reject( pdu_session_modification_reject_msg *pdu_session_modification_reject, uint8_t* buffer, uint32_t len)
int decode_pdu_session_modification_reject( pdu_session_modification_reject_msg *pdu_session_modification_reject, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -58,7 +58,7 @@ int decode_pdu_session_modification_reject( pdu_session_modification_reject_msg
}
int encode_pdu_session_modification_reject( pdu_session_modification_reject_msg *pdu_session_modification_reject, uint8_t* buffer, uint32_t len)
int encode_pdu_session_modification_reject( pdu_session_modification_reject_msg *pdu_session_modification_reject, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionModificationRequest.h"
int decode_pdu_session_modification_request( pdu_session_modification_request_msg *pdu_session_modification_request, uint8_t* buffer, uint32_t len)
int decode_pdu_session_modification_request( pdu_session_modification_request_msg *pdu_session_modification_request, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -106,7 +106,7 @@ int decode_pdu_session_modification_request( pdu_session_modification_request_ms
}
int encode_pdu_session_modification_request( pdu_session_modification_request_msg *pdu_session_modification_request, uint8_t* buffer, uint32_t len)
int encode_pdu_session_modification_request( pdu_session_modification_request_msg *pdu_session_modification_request, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionReleaseCommand.h"
int decode_pdu_session_release_command( pdu_session_release_command_msg *pdu_session_release_command, uint8_t* buffer, uint32_t len)
int decode_pdu_session_release_command( pdu_session_release_command_msg *pdu_session_release_command, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -66,7 +66,7 @@ int decode_pdu_session_release_command( pdu_session_release_command_msg *pdu_ses
}
int encode_pdu_session_release_command( pdu_session_release_command_msg *pdu_session_release_command, uint8_t* buffer, uint32_t len)
int encode_pdu_session_release_command( pdu_session_release_command_msg *pdu_session_release_command, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionReleaseComplete.h"
int decode_pdu_session_release_complete( pdu_session_release_complete_msg *pdu_session_release_complete, uint8_t* buffer, uint32_t len)
int decode_pdu_session_release_complete( pdu_session_release_complete_msg *pdu_session_release_complete, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -44,7 +44,7 @@ int decode_pdu_session_release_complete( pdu_session_release_complete_msg *pdu_s
}
int encode_pdu_session_release_complete( pdu_session_release_complete_msg *pdu_session_release_complete, uint8_t* buffer, uint32_t len)
int encode_pdu_session_release_complete( pdu_session_release_complete_msg *pdu_session_release_complete, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionReleaseReject.h"
int decode_pdu_session_release_reject( pdu_session_release_reject_msg *pdu_session_release_reject, uint8_t* buffer, uint32_t len)
int decode_pdu_session_release_reject( pdu_session_release_reject_msg *pdu_session_release_reject, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -42,7 +42,7 @@ int decode_pdu_session_release_reject( pdu_session_release_reject_msg *pdu_sessi
}
int encode_pdu_session_release_reject( pdu_session_release_reject_msg *pdu_session_release_reject, uint8_t* buffer, uint32_t len)
int encode_pdu_session_release_reject( pdu_session_release_reject_msg *pdu_session_release_reject, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "PDUSessionReleaseRequest.h"
int decode_pdu_session_release_request( pdu_session_release_request_msg *pdu_session_release_request, uint8_t* buffer, uint32_t len)
int decode_pdu_session_release_request( pdu_session_release_request_msg *pdu_session_release_request, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -44,7 +44,7 @@ int decode_pdu_session_release_request( pdu_session_release_request_msg *pdu_ses
}
int encode_pdu_session_release_request( pdu_session_release_request_msg *pdu_session_release_request, uint8_t* buffer, uint32_t len)
int encode_pdu_session_release_request( pdu_session_release_request_msg *pdu_session_release_request, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -6,7 +6,7 @@
#include "TLVDecoder.h"
#include "_5GSMStatus.h"
int decode__5gsm_status( _5gsm_status_msg *_5gsm_status, uint8_t* buffer, uint32_t len)
int decode__5gsm_status( _5gsm_status_msg *_5gsm_status, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
......@@ -23,7 +23,7 @@ int decode__5gsm_status( _5gsm_status_msg *_5gsm_status, uint8_t* buffer, uint32
}
int encode__5gsm_status( _5gsm_status_msg *_5gsm_status, uint8_t* buffer, uint32_t len)
int encode__5gsm_status( _5gsm_status_msg *_5gsm_status, uint8_t *buffer, uint32_t len)
{
uint32_t encoded = 0;
int encoded_result = 0;
......
......@@ -25,16 +25,8 @@
#include "TLVEncoder.h"
//Local definitions
static int _fivegsm_msg_decode_header (
sm_msg_header_t * header,
const uint8_t * buffer,
uint32_t len);
static int _fivegsm_msg_encode_header (
const sm_msg_header_t * header,
uint8_t * buffer,
uint32_t len);
static int _fivegsm_msg_decode_header (sm_msg_header_t *header, const uint8_t *buffer, uint32_t len);
static int _fivegsm_msg_encode_header (const sm_msg_header_t *header, uint8_t *buffer, uint32_t len);
/****************************************************************************
** **
......@@ -54,16 +46,13 @@ static int _fivegsm_msg_encode_header (
** **
***************************************************************************/
int
sm_msg_decode (
SM_msg * msg,
uint8_t * buffer,
uint32_t len)
sm_msg_decode (SM_msg *msg, uint8_t *buffer, uint32_t len)
{
int header_result = 0;
int decode_result = 0;
uint8_t *buffer_log = buffer;
uint32_t len_log = len;
int down_link = 0;
int header_result = 0;
int decode_result = 0;
uint8_t *buffer_log = buffer;
uint32_t len_log = len;
int down_link = 0;
//OAILOG_FUNC_IN (LOG_NAS);
/*
* First decode the SM message header
......@@ -159,15 +148,12 @@ sm_msg_decode (
** **
***************************************************************************/
int
fivegsm_msg_encode (
SM_msg * msg,
uint8_t * buffer,
uint32_t len)
fivegsm_msg_encode (SM_msg * msg, uint8_t * buffer, uint32_t len)
{
int header_result = 0;
int encode_result = 0;
uint8_t *buffer_log = buffer;
int down_link = 1;
int header_result = 0;
int encode_result = 0;
uint8_t *buffer_log = buffer;
int down_link = 1;
/*
* First encode the ESM message header
*/
......@@ -265,12 +251,9 @@ fivegsm_msg_encode (
** **
***************************************************************************/
static int
_fivegsm_msg_decode_header (
sm_msg_header_t * header,
const uint8_t * buffer,
uint32_t len)
_fivegsm_msg_decode_header (sm_msg_header_t *header, const uint8_t *buffer, uint32_t len)
{
int size = 0;
int size = 0;
/*
* Check the buffer length
......@@ -329,12 +312,9 @@ _fivegsm_msg_decode_header (
** **
***************************************************************************/
static int
_fivegsm_msg_encode_header (
const sm_msg_header_t * header,
uint8_t * buffer,
uint32_t len)
_fivegsm_msg_encode_header (const sm_msg_header_t *header, uint8_t *buffer, uint32_t len)
{
int size = 0;
int size = 0;
/*
* Check the buffer length
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment