diff --git a/lib/include/srslte/asn1/liblte_common.h b/lib/include/srslte/asn1/liblte_common.h index 4fde8f644..52e6f4a75 100644 --- a/lib/include/srslte/asn1/liblte_common.h +++ b/lib/include/srslte/asn1/liblte_common.h @@ -40,8 +40,8 @@ INCLUDES *******************************************************************************/ -#include #include +#include #include #include @@ -53,38 +53,40 @@ #define LIBLTE_ASN1_OID_MAXSUBIDS 128 // Caution these values must match SRSLTE_ ones in common.h -#define LIBLTE_MAX_MSG_SIZE_BITS 102048 +#define LIBLTE_MAX_MSG_SIZE_BITS 102048 #define LIBLTE_MAX_MSG_SIZE_BYTES 12756 -#define LIBLTE_MSG_HEADER_OFFSET 1020 +#define LIBLTE_MSG_HEADER_OFFSET 1020 -//Macro to make it easier to convert defines into strings -#define LIBLTE_CASE_STR(code) case code: return #code +// Macro to make it easier to convert defines into strings +#define LIBLTE_CASE_STR(code) \ + case code: \ + return #code /******************************************************************************* TYPEDEFS *******************************************************************************/ -typedef int8_t int8; -typedef uint8_t uint8; -typedef int16_t int16; -typedef uint16_t uint16; -typedef int32_t int32; -typedef uint32_t uint32; -typedef int64_t int64; -typedef uint64_t uint64; +typedef int8_t int8; +typedef uint8_t uint8; +typedef int16_t int16; +typedef uint16_t uint16; +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; -typedef enum{ +typedef enum { LIBLTE_SUCCESS = 0, LIBLTE_ERROR_INVALID_INPUTS, LIBLTE_ERROR_ENCODE_FAIL, LIBLTE_ERROR_DECODE_FAIL, LIBLTE_ERROR_INVALID_CRC, LIBLTE_ERROR_N_ITEMS -}LIBLTE_ERROR_ENUM; +} LIBLTE_ERROR_ENUM; static const char liblte_error_text[LIBLTE_ERROR_N_ITEMS][64] = { - "Invalid inputs", - "Encode failure", - "Decode failure", + "Invalid inputs", + "Encode failure", + "Decode failure", }; #define LIBLTE_STRING_LEN 128 @@ -92,27 +94,26 @@ static const char liblte_error_text[LIBLTE_ERROR_N_ITEMS][64] = { typedef void* LIBLTE_ASN1_OPEN_TYPE_STRUCT; typedef struct { - uint32_t numids; // number of subidentifiers - uint32_t subid[LIBLTE_ASN1_OID_MAXSUBIDS]; // subidentifier values + uint32_t numids; // number of subidentifiers + uint32_t subid[LIBLTE_ASN1_OID_MAXSUBIDS]; // subidentifier values } LIBLTE_ASN1_OID_STRUCT; -typedef struct{ - bool data_valid; - bool data; -}LIBLTE_BOOL_MSG_STRUCT; - -typedef struct{ - uint32 N_bits; - uint8 header[LIBLTE_MSG_HEADER_OFFSET]; - uint8 msg[LIBLTE_MAX_MSG_SIZE_BITS]; -}LIBLTE_BIT_MSG_STRUCT __attribute__ ((aligned (8))); +typedef struct { + bool data_valid; + bool data; +} LIBLTE_BOOL_MSG_STRUCT; -typedef struct{ - uint32 N_bytes; - uint8 header[LIBLTE_MSG_HEADER_OFFSET]; - uint8 msg[LIBLTE_MAX_MSG_SIZE_BYTES]; -}LIBLTE_BYTE_MSG_STRUCT; +typedef struct { + uint32 N_bits; + uint8 header[LIBLTE_MSG_HEADER_OFFSET]; + uint8 msg[LIBLTE_MAX_MSG_SIZE_BITS]; +} LIBLTE_BIT_MSG_STRUCT __attribute__((aligned(8))); +typedef struct { + uint32 N_bytes; + uint8 header[LIBLTE_MSG_HEADER_OFFSET]; + uint8 msg[LIBLTE_MAX_MSG_SIZE_BYTES]; +} LIBLTE_BYTE_MSG_STRUCT; /******************************************************************************* DECLARATIONS @@ -123,54 +124,49 @@ typedef struct{ Description: Converts a value to a bit string *********************************************************************/ -void liblte_value_2_bits(uint32 value, - uint8 **bits, - uint32 N_bits); +void liblte_value_2_bits(uint32 value, uint8** bits, uint32 N_bits); /********************************************************************* Name: liblte_bits_2_value Description: Converts a bit string to a value *********************************************************************/ -uint32 liblte_bits_2_value(uint8 **bits, - uint32 N_bits); +uint32 liblte_bits_2_value(uint8** bits, uint32 N_bits); /********************************************************************* Name: liblte_pack Description: Pack a bit array into a byte array *********************************************************************/ -void liblte_pack(LIBLTE_BIT_MSG_STRUCT *bits, - LIBLTE_BYTE_MSG_STRUCT *bytes); +void liblte_pack(LIBLTE_BIT_MSG_STRUCT* bits, LIBLTE_BYTE_MSG_STRUCT* bytes); /********************************************************************* Name: liblte_unpack Description: Unpack a byte array into a bit array *********************************************************************/ -void liblte_unpack(LIBLTE_BYTE_MSG_STRUCT *bytes, - LIBLTE_BIT_MSG_STRUCT *bits); +void liblte_unpack(LIBLTE_BYTE_MSG_STRUCT* bytes, LIBLTE_BIT_MSG_STRUCT* bits); /********************************************************************* Name: liblte_pack Description: Pack a bit array into a byte array *********************************************************************/ -void liblte_pack(uint8_t *bits, uint32_t n_bits, uint8_t *bytes); +void liblte_pack(uint8_t* bits, uint32_t n_bits, uint8_t* bytes); /********************************************************************* Name: liblte_unpack Description: Unpack a byte array into a bit array *********************************************************************/ -void liblte_unpack(uint8_t *bytes, uint32_t n_bytes, uint8_t *bits); +void liblte_unpack(uint8_t* bytes, uint32_t n_bytes, uint8_t* bits); /********************************************************************* Name: liblte_align_up Description: Aligns a pointer to a multibyte boundary *********************************************************************/ -void liblte_align_up(uint8_t **ptr, uint32_t align); +void liblte_align_up(uint8_t** ptr, uint32_t align); /********************************************************************* Name: liblte_align_up_zero @@ -178,6 +174,6 @@ void liblte_align_up(uint8_t **ptr, uint32_t align); Description: Aligns a pointer to a multibyte boundary and zeros bytes skipped *********************************************************************/ -void liblte_align_up_zero(uint8_t **ptr, uint32_t align); +void liblte_align_up_zero(uint8_t** ptr, uint32_t align); #endif // SRSLTE_LIBLTE_COMMON_H diff --git a/lib/include/srslte/asn1/liblte_m2ap.h b/lib/include/srslte/asn1/liblte_m2ap.h index 755e0ce46..bf7db0eba 100644 --- a/lib/include/srslte/asn1/liblte_m2ap.h +++ b/lib/include/srslte/asn1/liblte_m2ap.h @@ -34,190 +34,181 @@ /******************************************************************************* LOGGING *******************************************************************************/ -typedef void (*log_handler_t)(void *ctx, char *str); -void liblte_log_register_handler(void *ctx, log_handler_t handler); +typedef void (*log_handler_t)(void* ctx, char* str); +void liblte_log_register_handler(void* ctx, log_handler_t handler); /******************************************************************************* * MAX defines *******************************************************************************/ -#define LIBLTE_M2AP_MAXPRIVATEIES 256 -#define LIBLTE_M2AP_MAXNOOFMBSFNAREAS 8 -#define LIBLTE_M2AP_MAXNOOFMBSFN_ALLOCATIONS 15 -#define LIBLTE_M2AP_MAXNOOFPMCHSPERMBSFNAREA 256 -#define LIBLTE_M2AP_MAXNOOFCELLS 256 -#define LIBLTE_M2AP_MAXNOOFMBMSSERVICEAREASPERCELL 256 -#define LIBLTE_M2AP_MAXNOOFSESSIONSPERPMCH 29 -#define LIBLTE_M2AP_MAXNOOFERRORS 256 -#define LIBLTE_M2AP_MAXNROFINDIVIDUALM2CONNECTIONSTORESET 256 -#define LIBLTE_M2AP_MAXNOOFCOUNTINGSERVICE 16 +#define LIBLTE_M2AP_MAXPRIVATEIES 256 +#define LIBLTE_M2AP_MAXNOOFMBSFNAREAS 8 +#define LIBLTE_M2AP_MAXNOOFMBSFN_ALLOCATIONS 15 +#define LIBLTE_M2AP_MAXNOOFPMCHSPERMBSFNAREA 256 +#define LIBLTE_M2AP_MAXNOOFCELLS 256 +#define LIBLTE_M2AP_MAXNOOFMBMSSERVICEAREASPERCELL 256 +#define LIBLTE_M2AP_MAXNOOFSESSIONSPERPMCH 29 +#define LIBLTE_M2AP_MAXNOOFERRORS 256 +#define LIBLTE_M2AP_MAXNROFINDIVIDUALM2CONNECTIONSTORESET 256 +#define LIBLTE_M2AP_MAXNOOFCOUNTINGSERVICE 16 /******************************************************************************* * Elementary Procedures *******************************************************************************/ -typedef enum{ - LIBLTE_M2AP_PROC_ID_SESSIONSTART = 0, - LIBLTE_M2AP_PROC_ID_SESSIONSTOP = 1, - LIBLTE_M2AP_PROC_ID_MBMSSCHEDULINGINFORMATION = 2, - LIBLTE_M2AP_PROC_ID_ERRORINDICATION = 3, - LIBLTE_M2AP_PROC_ID_RESET = 4, - LIBLTE_M2AP_PROC_ID_M2SETUP = 5, - LIBLTE_M2AP_PROC_ID_ENBCONFIGURATIONUPDATE = 6, - LIBLTE_M2AP_PROC_ID_MCECONFIGURATIONUPDATE = 7, - LIBLTE_M2AP_PROC_ID_PRIVATEMESSAGE = 8, - LIBLTE_M2AP_PROC_ID_SESSIONUPDATE = 9, - LIBLTE_M2AP_PROC_ID_MBMSSERVICECOUNTING = 10, - LIBLTE_M2AP_PROC_ID_MBMSSERVICECOUNTINGRESULTSREPORT = 11, +typedef enum { + LIBLTE_M2AP_PROC_ID_SESSIONSTART = 0, + LIBLTE_M2AP_PROC_ID_SESSIONSTOP = 1, + LIBLTE_M2AP_PROC_ID_MBMSSCHEDULINGINFORMATION = 2, + LIBLTE_M2AP_PROC_ID_ERRORINDICATION = 3, + LIBLTE_M2AP_PROC_ID_RESET = 4, + LIBLTE_M2AP_PROC_ID_M2SETUP = 5, + LIBLTE_M2AP_PROC_ID_ENBCONFIGURATIONUPDATE = 6, + LIBLTE_M2AP_PROC_ID_MCECONFIGURATIONUPDATE = 7, + LIBLTE_M2AP_PROC_ID_PRIVATEMESSAGE = 8, + LIBLTE_M2AP_PROC_ID_SESSIONUPDATE = 9, + LIBLTE_M2AP_PROC_ID_MBMSSERVICECOUNTING = 10, + LIBLTE_M2AP_PROC_ID_MBMSSERVICECOUNTINGRESULTSREPORT = 11, LIBLTE_M2AP_PROC_N_ITEMS, -}LIBLTE_M2AP_PROC_ENUM; -static const char liblte_m2ap_proc_text[LIBLTE_M2AP_PROC_N_ITEMS][64] = { - "id-sessionStart", - "id-sessionStop", - "id-mbmsSchedulingInformation", - "id-errorIndication", - "id-reset", - "id-m2Setup", - "id-eNBConfigurationUpdate", - "id-mCEConfigurationUpdate", - "id-privateMessage", - "id-sessionUpdate", - "id-mbmsServiceCounting", - "id-mbmsServiceCountingResultsReport" -}; +} LIBLTE_M2AP_PROC_ENUM; +static const char liblte_m2ap_proc_text[LIBLTE_M2AP_PROC_N_ITEMS][64] = {"id-sessionStart", + "id-sessionStop", + "id-mbmsSchedulingInformation", + "id-errorIndication", + "id-reset", + "id-m2Setup", + "id-eNBConfigurationUpdate", + "id-mCEConfigurationUpdate", + "id-privateMessage", + "id-sessionUpdate", + "id-mbmsServiceCounting", + "id-mbmsServiceCountingResultsReport"}; /******************************************************************************* * ProtocolIE Ids *******************************************************************************/ -typedef enum{ - LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID = 0, - LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID = 1, - LIBLTE_M2AP_IE_ID_TMGI = 2, - LIBLTE_M2AP_IE_ID_MBMS_SESSION_ID = 3, - LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA = 6, - LIBLTE_M2AP_IE_ID_TNL_INFORMATION = 7, - LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS = 8, - LIBLTE_M2AP_IE_ID_CAUSE = 9, - LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST = 10, - LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_LIST = 11, - LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_ITEM = 12, - LIBLTE_M2AP_IE_ID_GLOBALENB_ID = 13, - LIBLTE_M2AP_IE_ID_ENBNAME = 14, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST = 15, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_ITEM = 16, - LIBLTE_M2AP_IE_ID_GLOBALMCE_ID = 17, - LIBLTE_M2AP_IE_ID_MCENAME = 18, - LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA = 19, - LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA_ITEM = 20, - LIBLTE_M2AP_IE_ID_TIMETOWAIT = 21, - LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST = 22, - LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_ITEM = 23, - LIBLTE_M2AP_IE_ID_COMMON_SUBFRAME_ALLOCATION_PERIOD = 24, - LIBLTE_M2AP_IE_ID_MCCH_UPDATE_TIME = 25, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST_CONFIGUPDATE = 26, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM = 27, - LIBLTE_M2AP_IE_ID_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM = 28, - LIBLTE_M2AP_IE_ID_MBSFN_AREA_ID = 29, - LIBLTE_M2AP_IE_ID_RESETTYPE = 30, - LIBLTE_M2AP_IE_ID_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONLISTRESACK = 31, - LIBLTE_M2AP_IE_ID_MBMS_COUNTING_REQUEST_SESSION = 32, - LIBLTE_M2AP_IE_ID_MBMS_COUNTING_REQUEST_SESSION_ITEM = 33, - LIBLTE_M2AP_IE_ID_MBMS_COUNTING_RESULT_LIST = 34, - LIBLTE_M2AP_IE_ID_MBMS_COUNTING_RESULT_ITEM = 35, +typedef enum { + LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID = 0, + LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID = 1, + LIBLTE_M2AP_IE_ID_TMGI = 2, + LIBLTE_M2AP_IE_ID_MBMS_SESSION_ID = 3, + LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA = 6, + LIBLTE_M2AP_IE_ID_TNL_INFORMATION = 7, + LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS = 8, + LIBLTE_M2AP_IE_ID_CAUSE = 9, + LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST = 10, + LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_LIST = 11, + LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_ITEM = 12, + LIBLTE_M2AP_IE_ID_GLOBALENB_ID = 13, + LIBLTE_M2AP_IE_ID_ENBNAME = 14, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST = 15, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_ITEM = 16, + LIBLTE_M2AP_IE_ID_GLOBALMCE_ID = 17, + LIBLTE_M2AP_IE_ID_MCENAME = 18, + LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA = 19, + LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA_ITEM = 20, + LIBLTE_M2AP_IE_ID_TIMETOWAIT = 21, + LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST = 22, + LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_ITEM = 23, + LIBLTE_M2AP_IE_ID_COMMON_SUBFRAME_ALLOCATION_PERIOD = 24, + LIBLTE_M2AP_IE_ID_MCCH_UPDATE_TIME = 25, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST_CONFIGUPDATE = 26, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM = 27, + LIBLTE_M2AP_IE_ID_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM = 28, + LIBLTE_M2AP_IE_ID_MBSFN_AREA_ID = 29, + LIBLTE_M2AP_IE_ID_RESETTYPE = 30, + LIBLTE_M2AP_IE_ID_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONLISTRESACK = 31, + LIBLTE_M2AP_IE_ID_MBMS_COUNTING_REQUEST_SESSION = 32, + LIBLTE_M2AP_IE_ID_MBMS_COUNTING_REQUEST_SESSION_ITEM = 33, + LIBLTE_M2AP_IE_ID_MBMS_COUNTING_RESULT_LIST = 34, + LIBLTE_M2AP_IE_ID_MBMS_COUNTING_RESULT_ITEM = 35, LIBLTE_M2AP_IE_N_ITEMS -}LIBLTE_M2AP_IE_ENUM; +} LIBLTE_M2AP_IE_ENUM; static const char liblte_m2ap_ie_text[LIBLTE_M2AP_IE_N_ITEMS][64] = { - "id-MCE-MBMS-M2AP-ID", - "id-ENB-MBMS-M2AP-ID", - "id-TMGI", - "id-MBMS-Session-ID", - "id-MBMS-Service-Area", - "id-TNL-Information", - "id-CriticalityDiagnostics", - "id-Cause", - "id-MBSFN-Area-Configuration-List", - "id-PMCH-Configuration-List", - "id-PMCH-Configuration-Item", - "id-GlobalENB-ID", - "id-ENBname", - "id-ENB-MBMS-Configuration-data-List", - "id-ENB-MBMS-Configuration-data-Item", - "id-GlobalMCE-ID", - "id-MCEname", - "id-MCCHrelatedBCCH-ConfigPerMBSFNArea", - "id-MCCHrelatedBCCH-ConfigPerMBSFNArea-Item", - "id-TimeToWait", - "id-MBSFN-Subframe-Configuration-List", - "id-MBSFN-Subframe-Configuration-Item", - "id-Common-Subframe-Allocation-Period", - "id-MCCH-Update-Time", - "id-ENB-MBMS-Configuration-data-List-ConfigUpdate", - "id-ENB-MBMS-Configuration-data-ConfigUpdate-Item", - "id-MBMS-Service-associatedLogicalM2-ConnectionItem", - "id-MBSFN-Area-ID", - "id-ResetType", - "id-MBMS-Service-associatedLogicalM2-ConnectionListResAck", - "id-MBMS-Counting-Request-Session", - "id-MBMS-Counting-Request-Session-Item", - "id-MBMS-Counting-Result-List", - "id-MBMS-Counting-Result-Item" -}; + "id-MCE-MBMS-M2AP-ID", + "id-ENB-MBMS-M2AP-ID", + "id-TMGI", + "id-MBMS-Session-ID", + "id-MBMS-Service-Area", + "id-TNL-Information", + "id-CriticalityDiagnostics", + "id-Cause", + "id-MBSFN-Area-Configuration-List", + "id-PMCH-Configuration-List", + "id-PMCH-Configuration-Item", + "id-GlobalENB-ID", + "id-ENBname", + "id-ENB-MBMS-Configuration-data-List", + "id-ENB-MBMS-Configuration-data-Item", + "id-GlobalMCE-ID", + "id-MCEname", + "id-MCCHrelatedBCCH-ConfigPerMBSFNArea", + "id-MCCHrelatedBCCH-ConfigPerMBSFNArea-Item", + "id-TimeToWait", + "id-MBSFN-Subframe-Configuration-List", + "id-MBSFN-Subframe-Configuration-Item", + "id-Common-Subframe-Allocation-Period", + "id-MCCH-Update-Time", + "id-ENB-MBMS-Configuration-data-List-ConfigUpdate", + "id-ENB-MBMS-Configuration-data-ConfigUpdate-Item", + "id-MBMS-Service-associatedLogicalM2-ConnectionItem", + "id-MBSFN-Area-ID", + "id-ResetType", + "id-MBMS-Service-associatedLogicalM2-ConnectionListResAck", + "id-MBMS-Counting-Request-Session", + "id-MBMS-Counting-Request-Session-Item", + "id-MBMS-Counting-Result-List", + "id-MBMS-Counting-Result-Item"}; /******************************************************************************* * ProtocolIE AllocatedSubFramesEnd INTEGER *******************************************************************************/ -//lb:0;ub:1535 -typedef struct{ +// lb:0;ub:1535 +typedef struct { uint16_t allocated_subframes_end; -}LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT; +} LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_allocatedsubframesend( - LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_allocatedsubframesend( - uint8_t **ptr, - LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_allocatedsubframesend(LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_allocatedsubframesend(uint8_t** ptr, + LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT* ie); /******************************************************************************* * ProtocolIE CauseMisc CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CAUSE_MISC_CONTROL_PROCESSING_OVERLOAD, LIBLTE_M2AP_CAUSE_MISC_HARDWARE_FAILURE, LIBLTE_M2AP_CAUSE_MISC_OM_INTERVENTION, LIBLTE_M2AP_CAUSE_MISC_UNSPECIFIED, LIBLTE_M2AP_CAUSE_MISC_N_ITEMS -}LIBLTE_M2AP_CAUSE_CHOICE_MISC_ENUM; +} LIBLTE_M2AP_CAUSE_CHOICE_MISC_ENUM; static const char liblte_s1ap_cause_misc_text[LIBLTE_M2AP_CAUSE_MISC_N_ITEMS][80] = { - "control-processing-overload", - "hardware-failure", - "om-intervention", - "unspecified", + "control-processing-overload", + "hardware-failure", + "om-intervention", + "unspecified", }; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_MISC_ENUM cause; -}LIBLTE_M2AP_CAUSE_MISC_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_MISC_ENUM cause; +} LIBLTE_M2AP_CAUSE_MISC_STRUCT; /******************************************************************************* * ProtocolIE CauseNas CHOICE *******************************************************************************/ -typedef enum{ - LIBLTE_M2AP_CAUSE_NAS_UNSPECIFIED, - LIBLTE_M2AP_CAUSE_NAS_N_ITEMS -}LIBLTE_M2AP_CAUSE_CHOICE_NAS_ENUM; +typedef enum { LIBLTE_M2AP_CAUSE_NAS_UNSPECIFIED, LIBLTE_M2AP_CAUSE_NAS_N_ITEMS } LIBLTE_M2AP_CAUSE_CHOICE_NAS_ENUM; static const char liblte_s1ap_cause_nas_text[LIBLTE_M2AP_CAUSE_NAS_N_ITEMS][80] = { - "unspecified", + "unspecified", }; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_NAS_ENUM cause; -}LIBLTE_M2AP_CAUSE_NAS_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_NAS_ENUM cause; +} LIBLTE_M2AP_CAUSE_NAS_STRUCT; /******************************************************************************* * ProtocolIE CauseProtocol CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CAUSE_PROTOCOL_TRANSFER_SYNTAX_ERROR, LIBLTE_M2AP_CAUSE_PROTOCOL_ABSTRACT_SYNTAX_ERROR_REJECT, LIBLTE_M2AP_CAUSE_PROTOCOL_ABSTRACT_SYNTAX_ERROR_IGNORE_AND_NOTIFY, @@ -226,26 +217,26 @@ typedef enum{ LIBLTE_M2AP_CAUSE_PROTOCOL_ABSTRACT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MESSAGE, LIBLTE_M2AP_CAUSE_PROTOCOL_UNSPECIFIED, LIBLTE_M2AP_CAUSE_PROTOCOL_N_ITEMS -}LIBLTE_M2AP_CAUSE_CHOICE_PROTOCOL_ENUM; +} LIBLTE_M2AP_CAUSE_CHOICE_PROTOCOL_ENUM; static const char liblte_m2ap_cause_protocol_text[LIBLTE_M2AP_CAUSE_PROTOCOL_N_ITEMS][80] = { - "transfer-syntax-error", - "abstract-syntax-error-reject", - "abstract-syntax-error-ignore-and-notify", - "message-not-compatible-with-receiver-state", - "semantic-error", - "abstract-syntax-error-falsely-constructed-message", - "unspecified", + "transfer-syntax-error", + "abstract-syntax-error-reject", + "abstract-syntax-error-ignore-and-notify", + "message-not-compatible-with-receiver-state", + "semantic-error", + "abstract-syntax-error-falsely-constructed-message", + "unspecified", }; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_PROTOCOL_ENUM cause; -}LIBLTE_M2AP_CAUSE_PROTOCOL_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_PROTOCOL_ENUM cause; +} LIBLTE_M2AP_CAUSE_PROTOCOL_STRUCT; /******************************************************************************* * ProtocolIE CauseRadioNetwork CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CAUSE_RADIONETWORK_UNKNOWN_OR_ALREADY_ALLOCATED_MCE_MBMS_M2AP_ID, LIBLTE_M2AP_CAUSE_RADIONETWORK_UNKNOWN_OR_ALREADY_ALLOCATED_ENB_MBMS_M2AP_ID, LIBLTE_M2AP_CAUSE_RADIONETWORK_UNKNOWN_OR_INCONSISTENT_PAIR_OF_MBMS_M2AP_IDS, @@ -253,946 +244,785 @@ typedef enum{ LIBLTE_M2AP_CAUSE_RADIONETWORK_INTERACTION_WITH_OTHER_PROCEDURE, LIBLTE_M2AP_CAUSE_RADIONETWORK_UNSPECIFIED, LIBLTE_M2AP_CAUSE_RADIONETWORK_N_ITEMS -}LIBLTE_M2AP_CAUSE_CHOICE_RADIONETWORK_ENUM; +} LIBLTE_M2AP_CAUSE_CHOICE_RADIONETWORK_ENUM; static const char liblte_m2ap_cause_radionetwork_text[LIBLTE_M2AP_CAUSE_RADIONETWORK_N_ITEMS][80] = { - "unknown-or-already-allocated-MCE-MBMS-M2AP-ID", - "unknown-or-already-allocated-eNB-MBMS-M2AP-ID", - "unknown-or-inconsistent-pair-of-MBMS-M2AP-IDs", - "radio-resources-not-available", - "interaction-with-other-procedure", - "unspecified", + "unknown-or-already-allocated-MCE-MBMS-M2AP-ID", + "unknown-or-already-allocated-eNB-MBMS-M2AP-ID", + "unknown-or-inconsistent-pair-of-MBMS-M2AP-IDs", + "radio-resources-not-available", + "interaction-with-other-procedure", + "unspecified", }; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_RADIONETWORK_ENUM cause; -}LIBLTE_M2AP_CAUSE_RADIONETWORK_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_RADIONETWORK_ENUM cause; +} LIBLTE_M2AP_CAUSE_RADIONETWORK_STRUCT; /******************************************************************************* * ProtocolIE CauseTransport CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CAUSE_TRANSPORT_TRANSPORT_RESOURCE_UNAVAILABLE, LIBLTE_M2AP_CAUSE_TRANSPORT_UNSPECIFIED, LIBLTE_M2AP_CAUSE_TRANSPORT_N_ITEMS -}LIBLTE_M2AP_CAUSE_CHOICE_TRANSPORT_ENUM; +} LIBLTE_M2AP_CAUSE_CHOICE_TRANSPORT_ENUM; static const char liblte_m2ap_cause_transport_text[LIBLTE_M2AP_CAUSE_TRANSPORT_N_ITEMS][80] = { - "transport-resource-unavailable", - "unspecified", + "transport-resource-unavailable", + "unspecified", }; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_TRANSPORT_ENUM cause; -}LIBLTE_M2AP_CAUSE_TRANSPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_TRANSPORT_ENUM cause; +} LIBLTE_M2AP_CAUSE_TRANSPORT_STRUCT; /******************************************************************************* * ProtocolIE Cause CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CAUSE_CHOICE_RADIONETWORK, LIBLTE_M2AP_CAUSE_CHOICE_TRANSPORT, LIBLTE_M2AP_CAUSE_CHOICE_NAS, LIBLTE_M2AP_CAUSE_CHOICE_PROTOCOL, LIBLTE_M2AP_CAUSE_CHOICE_MISC, LIBLTE_M2AP_CAUSE_CHOICE_N_ITEMS, -}LIBLTE_M2AP_CAUSE_CHOICE_ENUM; +} LIBLTE_M2AP_CAUSE_CHOICE_ENUM; static const char liblte_m2ap_cause_choice_text[LIBLTE_M2AP_CAUSE_CHOICE_N_ITEMS][50] = { - "radioNetwork", - "transport", - "nas", - "protocol", - "misc", + "radioNetwork", + "transport", + "nas", + "protocol", + "misc", }; -typedef union{ - LIBLTE_M2AP_CAUSE_RADIONETWORK_STRUCT radioNetwork; - LIBLTE_M2AP_CAUSE_TRANSPORT_STRUCT transport; - LIBLTE_M2AP_CAUSE_NAS_STRUCT nas; - LIBLTE_M2AP_CAUSE_PROTOCOL_STRUCT protocol; - LIBLTE_M2AP_CAUSE_MISC_STRUCT misc; -}LIBLTE_M2AP_CAUSE_CHOICE_UNION; +typedef union { + LIBLTE_M2AP_CAUSE_RADIONETWORK_STRUCT radioNetwork; + LIBLTE_M2AP_CAUSE_TRANSPORT_STRUCT transport; + LIBLTE_M2AP_CAUSE_NAS_STRUCT nas; + LIBLTE_M2AP_CAUSE_PROTOCOL_STRUCT protocol; + LIBLTE_M2AP_CAUSE_MISC_STRUCT misc; +} LIBLTE_M2AP_CAUSE_CHOICE_UNION; -typedef struct{ - bool ext; - LIBLTE_M2AP_CAUSE_CHOICE_UNION choice; - LIBLTE_M2AP_CAUSE_CHOICE_ENUM choice_type; -}LIBLTE_M2AP_CAUSE_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CAUSE_CHOICE_UNION choice; + LIBLTE_M2AP_CAUSE_CHOICE_ENUM choice_type; +} LIBLTE_M2AP_CAUSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cause( - LIBLTE_M2AP_CAUSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cause( - uint8_t **ptr, - LIBLTE_M2AP_CAUSE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cause(LIBLTE_M2AP_CAUSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cause(uint8_t** ptr, LIBLTE_M2AP_CAUSE_STRUCT* ie); /******************************************************************************* * ProtocolIE Criticality ENUMERATED *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CRITICALITY_REJECT, LIBLTE_M2AP_CRITICALITY_IGNORE, LIBLTE_M2AP_CRITICALITY_NOTIFY, LIBLTE_M2AP_CRITICALITY_N_ITEMS, -}LIBLTE_M2AP_CRITICALITY_ENUM; +} LIBLTE_M2AP_CRITICALITY_ENUM; static const char liblte_m2ap_criticality_text[LIBLTE_M2AP_CRITICALITY_N_ITEMS][80] = { - "reject", - "ignore", - "notify", + "reject", + "ignore", + "notify", }; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_criticality( - LIBLTE_M2AP_CRITICALITY_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_criticality( - uint8_t **ptr, - LIBLTE_M2AP_CRITICALITY_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_criticality(LIBLTE_M2AP_CRITICALITY_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_criticality(uint8_t** ptr, LIBLTE_M2AP_CRITICALITY_ENUM* ie); /******************************************************************************* * ProtocolIE ProtocolIE_ID INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint16_t ProtocolIE_ID; -}LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT; +} LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_id( - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_id( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_id(LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_id(uint8_t** ptr, LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE ProtocolExtensionID INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint16_t ProtocolExtensionID; -}LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT; +} LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid( - LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid(LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid(uint8_t** ptr, LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT* ie); /******************************************************************************* * ProtocolIE ProtocolExtensionField SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT id; - LIBLTE_M2AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT extensionValue; -}LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT; +typedef struct { + LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT id; + LIBLTE_M2AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT extensionValue; +} LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionfield( - LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionfield( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionfield(LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionfield(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie); /******************************************************************************* * ProtocolIE ProtocolIE_SingleContainer SEQUENCE *******************************************************************************/ -typedef struct{ - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT id; - LIBLTE_M2AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT value; -}LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT; +typedef struct { + LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT id; + LIBLTE_M2AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT value; +} LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer( - LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer(LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie); /******************************************************************************* * ProtocolIE ProtocolExtensionContainer DYNAMIC SEQUENCE OF *******************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensioncontainer( - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensioncontainer( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensioncontainer(LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensioncontainer(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie); /******************************************************************************* * ProtocolIE PLMNidentity STATIC OCTET STRING *******************************************************************************/ #define LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN 3 -typedef struct{ - uint8_t buffer[LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN]; -}LIBLTE_M2AP_PLMN_IDENTITY_STRUCT; +typedef struct { + uint8_t buffer[LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN]; +} LIBLTE_M2AP_PLMN_IDENTITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_plmnidentity( - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_plmnidentity( - uint8_t **ptr, - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_plmnidentity(LIBLTE_M2AP_PLMN_IDENTITY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_plmnidentity(uint8_t** ptr, LIBLTE_M2AP_PLMN_IDENTITY_STRUCT* ie); /******************************************************************************* * ProtocolIE EUTRANCellIdentifier STATIC BIT STRING *******************************************************************************/ #define LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_BIT_STRING_LEN 28 -typedef struct{ +typedef struct { uint32_t eUTRANCellIdentifier; -}LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT; +} LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_eutrancellidentifier( - LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_eutrancellidentifier( - uint8_t **ptr, - LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_eutrancellidentifier(LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_eutrancellidentifier(uint8_t** ptr, LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT* ie); /******************************************************************************* * ProtocolIE ECGI SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; - LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT EUTRANCellIdentifier; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; + LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT EUTRANCellIdentifier; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_ECGI_STRUCT; +} LIBLTE_M2AP_ECGI_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_ecgi( - LIBLTE_M2AP_ECGI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ecgi( - uint8_t **ptr, - LIBLTE_M2AP_ECGI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_ecgi(LIBLTE_M2AP_ECGI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ecgi(uint8_t** ptr, LIBLTE_M2AP_ECGI_STRUCT* ie); /******************************************************************************* * ProtocolIE CellReservationInfo ENUMERATED *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_CELL_RESERVATION_INFO_RESERVED_CELL, LIBLTE_M2AP_CELL_RESERVATION_INFO_NON_RESERVED_CELL, -}LIBLTE_M2AP_CELL_RESERVATION_INFO_ENUM; +} LIBLTE_M2AP_CELL_RESERVATION_INFO_ENUM; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_CELL_RESERVATION_INFO_ENUM e; -}LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT; +} LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellreservationinfo( - LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellreservationinfo( - uint8_t **ptr, - LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellreservationinfo(LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellreservationinfo(uint8_t** ptr, LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT* ie); /******************************************************************************* * ProtocolIE CellInformation SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_ECGI_STRUCT eCGI; - LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT cellReservationInfo; - bool ie_extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_ECGI_STRUCT eCGI; + LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT cellReservationInfo; + bool ie_extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT ie_extensions; -}LIBLTE_M2AP_CELL_INFORMATION_STRUCT; +} LIBLTE_M2AP_CELL_INFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformation( - LIBLTE_M2AP_CELL_INFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformation( - uint8_t **ptr, - LIBLTE_M2AP_CELL_INFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformation(LIBLTE_M2AP_CELL_INFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformation(uint8_t** ptr, LIBLTE_M2AP_CELL_INFORMATION_STRUCT* ie); /******************************************************************************* * ProtocolIE CellInformationList SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - uint16_t len; - LIBLTE_M2AP_CELL_INFORMATION_STRUCT buffer[32]; //artificial limit to 32 -}LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT; +typedef struct { + bool ext; + uint16_t len; + LIBLTE_M2AP_CELL_INFORMATION_STRUCT buffer[32]; // artificial limit to 32 +} LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformationlist( - LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformationlist( - uint8_t **ptr, - LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformationlist(LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformationlist(uint8_t** ptr, LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT* ie); /******************************************************************************* * ProtocolIE ProcedureCode INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t ProcedureCode; -}LIBLTE_M2AP_PROCEDURECODE_STRUCT; +} LIBLTE_M2AP_PROCEDURECODE_STRUCT; /******************************************************************************* * ProtocolIE TriggeringMessage ENUMERATED *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_TRIGGERINGMESSAGE_INITIATING_MESSAGE, LIBLTE_M2AP_TRIGGERINGMESSAGE_SUCCESSFUL_OUTCOME, LIBLTE_M2AP_TRIGGERINGMESSAGE_UNSUCCESSFULL_OUTCOME, LIBLTE_M2AP_TRIGGERINGMESSAGE_N_ITEMS, -}LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM; +} LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM; static const char liblte_m2ap_triggeringmessage_text[LIBLTE_M2AP_TRIGGERINGMESSAGE_N_ITEMS][80] = { - "initiating-message", - "successful-outcome", - "unsuccessfull-outcome", + "initiating-message", + "successful-outcome", + "unsuccessfull-outcome", }; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_triggeringmessage( - LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_triggeringmessage( - uint8_t **ptr, - LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_triggeringmessage(LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_triggeringmessage(uint8_t** ptr, LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM* ie); /******************************************************************************* * ProtocolIE TypeOfError ENUMERATED *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_TYPEOFERROR_NOT_UNDERSTOOD, LIBLTE_M2AP_TYPEOFERROR_MISSING, LIBLTE_M2AP_TYPEOFERROR_N_ITEMS, -}LIBLTE_M2AP_TYPEOFERROR_ENUM; +} LIBLTE_M2AP_TYPEOFERROR_ENUM; static const char liblte_M2ap_typeoferror_text[LIBLTE_M2AP_TYPEOFERROR_N_ITEMS][80] = { - "not-understood", - "missing", + "not-understood", + "missing", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_TYPEOFERROR_ENUM e; -}LIBLTE_M2AP_TYPEOFERROR_STRUCT; +} LIBLTE_M2AP_TYPEOFERROR_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_typeoferror( - LIBLTE_M2AP_TYPEOFERROR_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_typeoferror( - uint8_t **ptr, - LIBLTE_M2AP_TYPEOFERROR_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_typeoferror(LIBLTE_M2AP_TYPEOFERROR_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_typeoferror(uint8_t** ptr, LIBLTE_M2AP_TYPEOFERROR_STRUCT* ie); /******************************************************************************* * ProtocolIE CriticalityDiagnostics_IE_Item SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_CRITICALITY_ENUM iECriticality; - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT iE_ID; - LIBLTE_M2AP_TYPEOFERROR_STRUCT typeOfError; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_CRITICALITY_ENUM iECriticality; + LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT iE_ID; + LIBLTE_M2AP_TYPEOFERROR_STRUCT typeOfError; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT; /******************************************************************************* * ProtocolIE CriticalityDiagnostics_IE_List DYNAMIC SEQUENCE OF *******************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT; /******************************************************************************* * ProtocolIE CriticalityDiagnostics SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PROCEDURECODE_STRUCT procedureCode; - bool procedureCode_present; - LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM triggeringMessage; - bool triggeringMessage_present; - LIBLTE_M2AP_CRITICALITY_ENUM procedureCriticality; - bool procedureCriticality_present; - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT iEsCriticalityDiagnostics; - bool iEsCriticalityDiagnostics_present; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_PROCEDURECODE_STRUCT procedureCode; + bool procedureCode_present; + LIBLTE_M2AP_TRIGGERINGMESSAGE_ENUM triggeringMessage; + bool triggeringMessage_present; + LIBLTE_M2AP_CRITICALITY_ENUM procedureCriticality; + bool procedureCriticality_present; + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT iEsCriticalityDiagnostics; + bool iEsCriticalityDiagnostics_present; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT; /******************************************************************************* * ProtocolIE ENB-ID STATIC BIT STRING *******************************************************************************/ #define LIBLTE_M2AP_ENBID_BIT_STRING_LEN 20 -typedef struct{ - bool ext; +typedef struct { + bool ext; uint8_t buffer[20]; -}LIBLTE_M2AP_ENB_ID_STRUCT; +} LIBLTE_M2AP_ENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbid( - LIBLTE_M2AP_ENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid( - uint8_t **ptr, - LIBLTE_M2AP_ENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbid(LIBLTE_M2AP_ENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid(uint8_t** ptr, LIBLTE_M2AP_ENB_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MCE-ID STATIC OCTET STRING *******************************************************************************/ #define LIBLTE_M2AP_MCEID_OCTET_STRING_LEN 2 -typedef struct{ - bool ext; +typedef struct { + bool ext; uint8_t buffer[2]; -}LIBLTE_M2AP_MCE_ID_STRUCT; +} LIBLTE_M2AP_MCE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mceid( - LIBLTE_M2AP_MCE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid( - uint8_t **ptr, - LIBLTE_M2AP_MCE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mceid(LIBLTE_M2AP_MCE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid(uint8_t** ptr, LIBLTE_M2AP_MCE_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MCE-Name PRINTABLE STRING *******************************************************************************/ -typedef struct{ +typedef struct { bool ext; uint32_t n_octets; - uint8_t buffer[150]; -}LIBLTE_M2AP_MCE_NAME_STRUCT; + uint8_t buffer[150]; +} LIBLTE_M2AP_MCE_NAME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcename( - LIBLTE_M2AP_MCE_NAME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid( - uint8_t **ptr, - LIBLTE_M2AP_MCE_NAME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcename(LIBLTE_M2AP_MCE_NAME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid(uint8_t** ptr, LIBLTE_M2AP_MCE_NAME_STRUCT* ie); /******************************************************************************* * ProtocolIE MCE-MBMS-M2AP-ID INTEGER *******************************************************************************/ -//lb:0;ub:16777215 -typedef struct{ +// lb:0;ub:16777215 +typedef struct { uint32_t mce_mbms_m2ap_id; -}LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT; - +} LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcembmsm2apid( - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcembmsm2apid( - uint8_t **ptr, - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcembmsm2apid(LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcembmsm2apid(uint8_t** ptr, LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-Synchronization-Area-Id INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint32_t mbsfn_synchronisation_area_id; -}LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT; +} LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronisationareaid( - LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronisationareaid( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronisationareaid(LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronisationareaid(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MBMS-Service-Area DYNAMIC OCTET STRING *******************************************************************************/ // lb:0, ub:512 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[512]; -}LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT; +} LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsservicearea( - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsservicearea( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsservicearea(LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsservicearea(uint8_t** ptr, LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT* ie); /******************************************************************************* * ProtocolIE MBMS-Service-Area-Id-List SEQUENCE *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t len; - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT buffer[32]; //Waring: Artificial limit to reduce memory footprint -}LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT; + LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT buffer[32]; // Waring: Artificial limit to reduce memory footprint +} LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceareaidlist( - LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceareaidlist( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceareaidlist(LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceareaidlist(uint8_t** ptr, + LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT* ie); /******************************************************************************* * ProtocolIE ENB-MBMS-ConfigurationDataItem SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_ECGI_STRUCT eCGI; +typedef struct { + bool ext; + LIBLTE_M2AP_ECGI_STRUCT eCGI; LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT mbsfnSynchronisationArea; - LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT mbmsServiceAreaList; - bool iE_Extensions_present; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT; + LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT mbmsServiceAreaList; + bool iE_Extensions_present; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; +} LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataitem( - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataitem( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataitem(LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_enbmbmsconfigurationdataitem(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE ENB-MBMS-ConfigurationDataConfigUpdateItem SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT mBMSConfigData; - LIBLTE_M2AP_ECGI_STRUCT eCGI; -}LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT; + LIBLTE_M2AP_ECGI_STRUCT eCGI; +} LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT; LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataconfigupdateitem( - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT *ie, - uint8_t **ptr); + LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataconfigupdateitem( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT *ie); + uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_CONFIGUPDATE_ITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE ENB-MBMS-M2AP-ID INTEGER *******************************************************************************/ -//lb:0;ub:65535 -typedef struct{ +// lb:0;ub:65535 +typedef struct { uint16_t enb_mbms_m2ap_id; -}LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT; +} LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsm2apid( - LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsm2apid( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsm2apid(LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsm2apid(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE ENB-NAME PRINTABLE STRING *******************************************************************************/ -typedef struct{ +typedef struct { bool ext; uint32_t n_octets; uint8_t buffer[150]; -}LIBLTE_M2AP_ENBNAME_STRUCT; +} LIBLTE_M2AP_ENBNAME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbname( - LIBLTE_M2AP_ENBNAME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname( - uint8_t **ptr, - LIBLTE_M2AP_ENBNAME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbname(LIBLTE_M2AP_ENBNAME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname(uint8_t** ptr, LIBLTE_M2AP_ENBNAME_STRUCT* ie); /******************************************************************************* * ProtocolIE Global-ENB-Id SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMNidentity; - LIBLTE_M2AP_ENB_ID_STRUCT eNB_ID; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMNidentity; + LIBLTE_M2AP_ENB_ID_STRUCT eNB_ID; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT; +} LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalenbid( - LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalenbid( - uint8_t **ptr, - LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalenbid(LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalenbid(uint8_t** ptr, LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE Global-MCE-Id SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; - LIBLTE_M2AP_MCE_ID_STRUCT mCE_ID; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; + LIBLTE_M2AP_MCE_ID_STRUCT mCE_ID; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_extensions; -}LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT; +} LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalmceid( - LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalmceid( - uint8_t **ptr, - LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalmceid(LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalmceid(uint8_t** ptr, LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE GTP-TEID STATIC OCTET STRING *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t buffer[4]; -}LIBLTE_M2AP_GTP_TEID_STRUCT; +} LIBLTE_M2AP_GTP_TEID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_gtpteid( - LIBLTE_M2AP_GTP_TEID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_gtpteid( - uint8_t **ptr, - LIBLTE_M2AP_GTP_TEID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_gtpteid(LIBLTE_M2AP_GTP_TEID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_gtpteid(uint8_t** ptr, LIBLTE_M2AP_GTP_TEID_STRUCT* ie); /******************************************************************************* * ProtocolIE IPAddress DYNAMIC OCTET STRING *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t len; uint8_t buffer[16]; -}LIBLTE_M2AP_IP_ADDRESS_STRUCT; - -LIBLTE_ERROR_ENUM liblte_m2ap_pack_ipaddress( - LIBLTE_M2AP_IP_ADDRESS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ipaddress( - uint8_t **ptr, - LIBLTE_M2AP_IP_ADDRESS_STRUCT *ie); +} LIBLTE_M2AP_IP_ADDRESS_STRUCT; +LIBLTE_ERROR_ENUM liblte_m2ap_pack_ipaddress(LIBLTE_M2AP_IP_ADDRESS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ipaddress(uint8_t** ptr, LIBLTE_M2AP_IP_ADDRESS_STRUCT* ie); /******************************************************************************* * ProtocolIE LCID INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t lcid; -}LIBLTE_M2AP_LCID_STRUCT; +} LIBLTE_M2AP_LCID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_lcid( - LIBLTE_M2AP_LCID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_lcid( - uint8_t **ptr, - LIBLTE_M2AP_LCID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_lcid(LIBLTE_M2AP_LCID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_lcid(uint8_t** ptr, LIBLTE_M2AP_LCID_STRUCT* ie); /******************************************************************************* * ProtocolIE MBMS-Service-associatedLogicalM2-ConnectionItem SEQUENCE *******************************************************************************/ -typedef struct{ - bool eNB_MBMS_M2AP_ID_present; +typedef struct { + bool eNB_MBMS_M2AP_ID_present; LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT eNB_MBMS_M2AP_ID; - bool mCE_MBMS_M2AP_ID_present; + bool mCE_MBMS_M2AP_ID_present; LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT mCE_MBMS_M2AP_ID; -}LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT; +} LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT; LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceassociatedlogicalm2connectionitem( - LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT *ie, - uint8_t **ptr); + LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceassociatedlogicalm2connectionitem( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT *ie); + uint8_t** ptr, LIBLTE_M2AP_MBMS_SERVICE_ASSOCIATEDLOGICALM2_CONNECTIONITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE MBMS-Session-Id STATIC OCTET STRING *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t buffer[1]; -}LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT; +} LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionid( - LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionid( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionid(LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionid(uint8_t** ptr, LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-Area-ID INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t mbsfn_area_id; -}LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT; +} LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaid( - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaid( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaid(LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaid(uint8_t** ptr, LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-SynchronizationArea-ID INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint32_t mbsfn_synchronization_area_id; -}LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT; +} LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronizationareaid( - LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronizationareaid( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronizationareaid(LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronizationareaid(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SYNCHRONIZATION_AREA_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE RadioframeAllocationPeriod ENUMERATED *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N1, LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N2, LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N4, LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N8, LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N16, LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N32 -}LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_ENUM; +} LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_ENUM e; -}LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT; +} LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationperiod( - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationperiod( - uint8_t **ptr, - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationperiod(LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationperiod(uint8_t** ptr, + LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT* ie); /******************************************************************************* * ProtocolIE RadioframeAllocationOffset INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t radioframeAllocationOffset; -}LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT; +} LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationoffset( - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationoffset( - uint8_t **ptr, - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationoffset(LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationoffset(uint8_t** ptr, + LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT* ie); /******************************************************************************* * ProtocolIE SubframeAllocation CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_SUBFRAME_ALLOCATION_ONE_FRAME, LIBLTE_M2AP_SUBFRAME_ALLOCATION_FOUR_FRAMES -}LIBLTE_M2AP_SUBFRAME_ALLOCATION_ENUM; +} LIBLTE_M2AP_SUBFRAME_ALLOCATION_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_SUBFRAME_ALLOCATION_ENUM choice_type; union { - uint8_t oneFrame[6]; //BIT STRING - uint8_t fourFrames[24]; //BIT STRING + uint8_t oneFrame[6]; // BIT STRING + uint8_t fourFrames[24]; // BIT STRING } choice; -}LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT; +} LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocation( - LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocation( - uint8_t **ptr, - LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocation(LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocation(uint8_t** ptr, LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-Subframe-Configuration SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT radioFrameAllocationPeriod; LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT radioFrameAllocationOffset; - LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT subframeAllocation; - bool iE_Extensions_present; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT; + LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT subframeAllocation; + bool iE_Extensions_present; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; +} LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfiguration( - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfiguration( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfiguration(LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfiguration(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-Subframe-Configuration-List SEQUENCE *******************************************************************************/ -typedef struct{ - uint32_t len; +typedef struct { + uint32_t len; LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT buffer[32]; -}LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT; +} LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfigurationlist( - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_mbsfnsubframeconfigurationlist(LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbsfnsubframeconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT* ie); /******************************************************************************* * ProtocolIE MCCH-Upadte-Time INTEGER *******************************************************************************/ -//lb:0;ub:255 -typedef struct{ +// lb:0;ub:255 +typedef struct { uint8_t mcchUpdateTime; -}LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT; +} LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchupdatetime( - LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchupdatetime( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchupdatetime(LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchupdatetime(uint8_t** ptr, LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT* ie); /******************************************************************************* * ProtocolIE PDCCH-Length ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_PDCCH_LENGTH_S1, LIBLTE_M2AP_PDCCH_LENGTH_S2, -}LIBLTE_M2AP_PDCCH_LENGTH_ENUM; +} LIBLTE_M2AP_PDCCH_LENGTH_ENUM; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_PDCCH_LENGTH_ENUM pdcchLength; -}LIBLTE_M2AP_PDCCH_LENGTH_STRUCT; +} LIBLTE_M2AP_PDCCH_LENGTH_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pdcchlength( - LIBLTE_M2AP_PDCCH_LENGTH_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pdcchlength( - uint8_t **ptr, - LIBLTE_M2AP_PDCCH_LENGTH_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pdcchlength(LIBLTE_M2AP_PDCCH_LENGTH_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pdcchlength(uint8_t** ptr, LIBLTE_M2AP_PDCCH_LENGTH_STRUCT* ie); /******************************************************************************* * ProtocolIE Repetition Period ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_REPETITION_PERIOD_RF32, LIBLTE_M2AP_REPETITION_PERIOD_RF64, LIBLTE_M2AP_REPETITION_PERIOD_RF128, LIBLTE_M2AP_REPETITION_PERIOD_RF256, -}LIBLTE_M2AP_REPETITION_PERIOD_ENUM; +} LIBLTE_M2AP_REPETITION_PERIOD_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_REPETITION_PERIOD_ENUM repetitionPeriod; -}LIBLTE_M2AP_REPETITION_PERIOD_STRUCT; +} LIBLTE_M2AP_REPETITION_PERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_repetiotionperiod( - LIBLTE_M2AP_REPETITION_PERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_repetiotionperiod( - uint8_t **ptr, - LIBLTE_M2AP_REPETITION_PERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_repetiotionperiod(LIBLTE_M2AP_REPETITION_PERIOD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_repetiotionperiod(uint8_t** ptr, LIBLTE_M2AP_REPETITION_PERIOD_STRUCT* ie); /******************************************************************************* * ProtocolIE OFFSET INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t offset; -}LIBLTE_M2AP_OFFSET_STRUCT; +} LIBLTE_M2AP_OFFSET_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_offset( - LIBLTE_M2AP_OFFSET_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_offset( - uint8_t **ptr, - LIBLTE_M2AP_OFFSET_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_offset(LIBLTE_M2AP_OFFSET_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_offset(uint8_t** ptr, LIBLTE_M2AP_OFFSET_STRUCT* ie); /******************************************************************************* * ProtocolIE Modification Period ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_MODIFICATION_PERIOD_RF512, LIBLTE_M2AP_MODIFICATION_PERIOD_RF1024, -}LIBLTE_M2AP_MODIFICATION_PERIOD_ENUM; +} LIBLTE_M2AP_MODIFICATION_PERIOD_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_MODIFICATION_PERIOD_ENUM modificationPeriod; -}LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT; +} LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_modificationperiod( - LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modificationperiod( - uint8_t **ptr, - LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_modificationperiod(LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modificationperiod(uint8_t** ptr, LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT* ie); /******************************************************************************* * ProtocolIE Subframe-Allocation-Info STATIC BIT STRING *******************************************************************************/ #define LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_BIT_STRING_LEN 6 -typedef struct{ +typedef struct { uint8_t buffer[6]; -}LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT; +} LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocationinfo( - LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocationinfo( - uint8_t **ptr, - LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocationinfo(LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocationinfo(uint8_t** ptr, + LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT* ie); /******************************************************************************* * ProtocolIE Modulation-and-Coding-Scheme ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N2, LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N7, LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N13, LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N19 -}LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_ENUM; +} LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_ENUM mcs; -}LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT; +} LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_modulationandcodingscheme( - LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modulationandcodingscheme( - uint8_t **ptr, - LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_modulationandcodingscheme(LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modulationandcodingscheme(uint8_t** ptr, + LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT* ie); /******************************************************************************* * ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea-Item SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT mbsfnArea; - LIBLTE_M2AP_PDCCH_LENGTH_STRUCT pdcchLength; - LIBLTE_M2AP_REPETITION_PERIOD_STRUCT repetitionPeriod; - LIBLTE_M2AP_OFFSET_STRUCT offset; - LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT modificationPeriod; - LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT subframeAllocationInfo; +typedef struct { + bool ext; + LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT mbsfnArea; + LIBLTE_M2AP_PDCCH_LENGTH_STRUCT pdcchLength; + LIBLTE_M2AP_REPETITION_PERIOD_STRUCT repetitionPeriod; + LIBLTE_M2AP_OFFSET_STRUCT offset; + LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT modificationPeriod; + LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT subframeAllocationInfo; LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT modulationAndCodingScheme; - bool cellInformationList_present; - LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT cellInformationList; - bool iE_Extensions_present; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT; + bool cellInformationList_present; + LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT cellInformationList; + bool iE_Extensions_present; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; +} LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT; LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem( - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT *ie, - uint8_t **ptr); + LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT *ie); + uint8_t** ptr, LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie); /******************************************************************************* - * ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea DYNAMIC SEQUENCE + * ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea DYNAMIC SEQUENCE *******************************************************************************/ -typedef struct{ - uint16_t len; +typedef struct { + uint16_t len; LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT buffer[8]; -}LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT; +} LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea( - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea(LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea(uint8_t** ptr, + LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT* ie); /******************************************************************************* * ProtocolIE MCH-Scheduling-Period ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF8, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF16, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF32, @@ -1201,144 +1031,116 @@ typedef enum{ LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF256, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF512, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF1024 -}LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_ENUM; +} LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_ENUM e; -}LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT; +} LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mchschedulingperiod( - LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mchschedulingperiod( - uint8_t **ptr, - LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mchschedulingperiod(LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mchschedulingperiod(uint8_t** ptr, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT* ie); /******************************************************************************* * ProtocolIE OFFSET INTEGER *******************************************************************************/ -typedef struct{ +typedef struct { uint8_t dataMCS; -}LIBLTE_M2AP_DATA_MCS_STRUCT; +} LIBLTE_M2AP_DATA_MCS_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_datamcs( - LIBLTE_M2AP_DATA_MCS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_datamcs( - uint8_t **ptr, - LIBLTE_M2AP_DATA_MCS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_datamcs(LIBLTE_M2AP_DATA_MCS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_datamcs(uint8_t** ptr, LIBLTE_M2AP_DATA_MCS_STRUCT* ie); /******************************************************************************* * ProtocolIE Service Id STATIC OCTET STRING *******************************************************************************/ #define LIBLTE_M2AP_SERVICE_ID_OCTET_STRING_LEN 3 -typedef struct{ +typedef struct { uint8_t buffer[3]; -}LIBLTE_M2AP_SERVICE_ID_STRUCT; +} LIBLTE_M2AP_SERVICE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_serviceid( - LIBLTE_M2AP_SERVICE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_serviceid( - uint8_t **ptr, - LIBLTE_M2AP_SERVICE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_serviceid(LIBLTE_M2AP_SERVICE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_serviceid(uint8_t** ptr, LIBLTE_M2AP_SERVICE_ID_STRUCT* ie); /******************************************************************************* * ProtocolIE TMGI SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; - LIBLTE_M2AP_SERVICE_ID_STRUCT serviceID; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_PLMN_IDENTITY_STRUCT pLMN_Identity; + LIBLTE_M2AP_SERVICE_ID_STRUCT serviceID; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_TMGI_STRUCT; +} LIBLTE_M2AP_TMGI_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_tmgi( - LIBLTE_M2AP_TMGI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tmgi( - uint8_t **ptr, - LIBLTE_M2AP_TMGI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_tmgi(LIBLTE_M2AP_TMGI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tmgi(uint8_t** ptr, LIBLTE_M2AP_TMGI_STRUCT* ie); /******************************************************************************* * ProtocolIE MBMSSessionListPerPMCH-Item SEQUENCE (SIZE(1..maxnoofSessionsPerPMCH)) OF SEQUENCE *******************************************************************************/ -typedef struct{ +typedef struct { uint16_t len; struct { - bool ext; + bool ext; LIBLTE_M2AP_TMGI_STRUCT Tmgi; LIBLTE_M2AP_LCID_STRUCT Lcid; - bool iE_Extensions_present; + bool iE_Extensions_present; } buffer[8]; -}LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT; +} LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionlistperpmchitem( - LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionlistperpmchitem( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionlistperpmchitem(LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionlistperpmchitem(uint8_t** ptr, + LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE PMCH-Configuration SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT allocatedSubframesEnd; - LIBLTE_M2AP_DATA_MCS_STRUCT dataMCS; - LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT mchSchedulingPeriod; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT allocatedSubframesEnd; + LIBLTE_M2AP_DATA_MCS_STRUCT dataMCS; + LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT mchSchedulingPeriod; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT; +} LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfiguration( - LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfiguration( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfiguration(LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfiguration(uint8_t** ptr, LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT* ie); /******************************************************************************* * ProtocolIE PMCH-Configuration-Item SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT PMCHConfiguration; +typedef struct { + bool ext; + LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT PMCHConfiguration; LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT MBMSSessionListPerPMCHItem; - bool iE_Extensions_present; - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT; + bool iE_Extensions_present; + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; +} LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationitem( - LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationitem( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationitem(LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationitem(uint8_t** ptr, + LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE PMCH-Configuration-List SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - uint16_t len; - LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT buffer[32]; - bool iE_Extensions_present; +typedef struct { + bool ext; + uint16_t len; + LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT buffer[32]; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT; +} LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationlist( - LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationlist(LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT* ie); /******************************************************************************* * ProtocolIE Common-Subframe-Scheduling-Period ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF4, LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF8, LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF16, @@ -1346,243 +1148,205 @@ typedef enum{ LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF64, LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF128, LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF256, -}LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_ENUM; +} LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_ENUM e; -}LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT; +} LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_commonsubframeallocationperiod( - LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_commonsubframeallocationperiod( - uint8_t **ptr, - LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_commonsubframeallocationperiod(LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_commonsubframeallocationperiod(uint8_t** ptr, + LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT* ie); /******************************************************************************* * ProtocolIE Time-to-Wait ENUM *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_TIME_TO_WAIT_V1S, LIBLTE_M2AP_TIME_TO_WAIT_V2S, LIBLTE_M2AP_TIME_TO_WAIT_V5S, LIBLTE_M2AP_TIME_TO_WAIT_V10S, LIBLTE_M2AP_TIME_TO_WAIT_V20S, LIBLTE_M2AP_TIME_TO_WAIT_V60S, -}LIBLTE_M2AP_TIME_TO_WAIT_ENUM; +} LIBLTE_M2AP_TIME_TO_WAIT_ENUM; -typedef struct{ +typedef struct { LIBLTE_M2AP_TIME_TO_WAIT_ENUM e; -}LIBLTE_M2AP_TIME_TO_WAIT_STRUCT; - -LIBLTE_ERROR_ENUM liblte_m2ap_pack_timetowait( - LIBLTE_M2AP_TIME_TO_WAIT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_timetowait( - uint8_t **ptr, - LIBLTE_M2AP_TIME_TO_WAIT_STRUCT *ie); - +} LIBLTE_M2AP_TIME_TO_WAIT_STRUCT; +LIBLTE_ERROR_ENUM liblte_m2ap_pack_timetowait(LIBLTE_M2AP_TIME_TO_WAIT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_timetowait(uint8_t** ptr, LIBLTE_M2AP_TIME_TO_WAIT_STRUCT* ie); /******************************************************************************* * ProtocolIE TNL-Information SEQUENCE *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_IP_ADDRESS_STRUCT iPMCAddress; - LIBLTE_M2AP_IP_ADDRESS_STRUCT iPSourceAddress; - LIBLTE_M2AP_GTP_TEID_STRUCT gtpTeid; - bool iE_Extensions_present; +typedef struct { + bool ext; + LIBLTE_M2AP_IP_ADDRESS_STRUCT iPMCAddress; + LIBLTE_M2AP_IP_ADDRESS_STRUCT iPSourceAddress; + LIBLTE_M2AP_GTP_TEID_STRUCT gtpTeid; + bool iE_Extensions_present; LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; -}LIBLTE_M2AP_TNL_INFORMATION_STRUCT; +} LIBLTE_M2AP_TNL_INFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_tnlinformation( - LIBLTE_M2AP_TNL_INFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tnlinformation( - uint8_t **ptr, - LIBLTE_M2AP_TNL_INFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_tnlinformation(LIBLTE_M2AP_TNL_INFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tnlinformation(uint8_t** ptr, LIBLTE_M2AP_TNL_INFORMATION_STRUCT* ie); /******************************************************************************* * ProtocolIE ENB-MBMS-Configuration-data-List SEQUENCE OF ProtocolIE-Single-Container *******************************************************************************/ -//lb:1;ub:maxnofCells (256) -typedef struct{ +// lb:1;ub:maxnofCells (256) +typedef struct { uint8_t len; - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT buffer[32]; //Waring: Artificial limit to reduce memory footprint + LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT buffer[32]; // Waring: Artificial limit to reduce memory footprint } LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist( - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdatalist( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist(LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_enbmbmsconfigurationdatalist(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-AreaConfiguration-Item ProtocolIE-Container *******************************************************************************/ -typedef struct{ - LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT PMCHConfigurationList; +typedef struct { + LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT PMCHConfigurationList; LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT MBSFNSubframeConfigurationList; LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT CommonSubframeAllocationPeriod; - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT MBSFNAreaId; + LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT MBSFNAreaId; } LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationitem( - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationitem( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationitem(LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationitem(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT* ie); /******************************************************************************* * ProtocolIE MBSFN-AreaConfiguration-List SEQUENCE OF ProtocolIE-Single-Container *******************************************************************************/ -//lb:1;ub:maxnofCells (256) -typedef struct{ +// lb:1;ub:maxnofCells (256) +typedef struct { uint8_t len; - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT buffer[32]; //Waring: Artificial limit to reduce memory footprint + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT buffer[32]; // Waring: Artificial limit to reduce memory footprint } LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist( - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist(LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT* ie); /******************************************************************************* * Protocol Message M2SetupRequest STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; - bool eNBname_present; - LIBLTE_M2AP_ENBNAME_STRUCT eNBname; - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT configurationDataList; -}LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; + bool eNBname_present; + LIBLTE_M2AP_ENBNAME_STRUCT eNBname; + LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT configurationDataList; +} LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setuprequest( - LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setuprequest(LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT* ie); /******************************************************************************* * Protocol Message M2SetupResponse STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT Global_MCE_ID; - bool MCEname_present; - LIBLTE_M2AP_MCE_NAME_STRUCT MCEname; - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT MCCHrelatedBCCHConfigPerMBSFNArea; - bool criticalityDiagnosis_present; - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT criticalityDiagnosis; -}LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT Global_MCE_ID; + bool MCEname_present; + LIBLTE_M2AP_MCE_NAME_STRUCT MCEname; + LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT MCCHrelatedBCCHConfigPerMBSFNArea; + bool criticalityDiagnosis_present; + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT criticalityDiagnosis; +} LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse( - LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse(LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT* ie); /******************************************************************************* * Protocol Message MBMSSessionStartRequest STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT MceMbmsM2apId; - LIBLTE_M2AP_TMGI_STRUCT Tmgi; - bool MbmsSessionId_present; - LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT MbmsSessionId; - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT MbmsServiceArea; - LIBLTE_M2AP_TNL_INFORMATION_STRUCT TnlInformation; -}LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT MceMbmsM2apId; + LIBLTE_M2AP_TMGI_STRUCT Tmgi; + bool MbmsSessionId_present; + LIBLTE_M2AP_MBMS_SESSION_ID_STRUCT MbmsSessionId; + LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT MbmsServiceArea; + LIBLTE_M2AP_TNL_INFORMATION_STRUCT TnlInformation; +} LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest(LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest(uint8_t** ptr, + LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT* ie); /******************************************************************************* * Protocol Message MBMSSessionStartResponse STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT MceMbmsM2apId; - LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT EnbMbmsM2apId; - bool CriticalityDiagnostics_present; - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; -}LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT MceMbmsM2apId; + LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT EnbMbmsM2apId; + bool CriticalityDiagnostics_present; + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; +} LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse( - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse(LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse(uint8_t** ptr, + LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT* ie); /******************************************************************************* * Protocol Message MBMSSchedulingInformation STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT MCCHUpdateTime; - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT MbsfnAreaConfigurationList; -}LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT MCCHUpdateTime; + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT MbsfnAreaConfigurationList; +} LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation( - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformation( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation(LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbmsschedulinginformation(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* ie); /******************************************************************************* * Protocol Message MBMSSchedulingInformationResponse STRUCT *******************************************************************************/ -typedef struct{ - bool ext; - bool CriticalityDiagnostics_present; - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; -}LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT; +typedef struct { + bool ext; + bool CriticalityDiagnostics_present; + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; +} LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation( - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformation( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation(LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbmsschedulinginformation(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* ie); /******************************************************************************* * ProtocolIE-Field *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_header( - uint32_t len, - uint32_t ie_id, - LIBLTE_M2AP_CRITICALITY_ENUM crit, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_header( - uint8_t **ptr, - uint32_t *ie_id, - LIBLTE_M2AP_CRITICALITY_ENUM *crit, - uint32_t *len); +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_protocolie_header(uint32_t len, uint32_t ie_id, LIBLTE_M2AP_CRITICALITY_ENUM crit, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_protocolie_header(uint8_t** ptr, uint32_t* ie_id, LIBLTE_M2AP_CRITICALITY_ENUM* crit, uint32_t* len); /******************************************************************************* * Procedure code criticality lookups *******************************************************************************/ - LIBLTE_M2AP_CRITICALITY_ENUM liblte_m2ap_procedure_criticality(uint8_t procedureCode); +LIBLTE_M2AP_CRITICALITY_ENUM liblte_m2ap_procedure_criticality(uint8_t procedureCode); /******************************************************************************* * InitiatingMessage CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSIONSTARTREQUEST, LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSIONSTOPREQUEST, LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSION_UPDATEREQUEST, @@ -1593,49 +1357,44 @@ typedef enum{ LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MCECONFIGURATIONUPDATE, LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSERVICECOUNTINGREQUEST, LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_N_ITEMS, -}LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_ENUM; +} LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_ENUM; static const char liblte_m2ap_initiatingmessage_choice_text[LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_N_ITEMS][50] = { - "MbmsSessionStartRequest", - "MbmsSessionStopRequest", - "MbmsSessionUpdateRequest", - "MbmsSchedulingInformation", - "Reset", - "M2SetupRequest", - "EnbConfigurationUpdate", - "MceConfigurationUpdate", - "MbmsServiceCountingRequest" -}; + "MbmsSessionStartRequest", + "MbmsSessionStopRequest", + "MbmsSessionUpdateRequest", + "MbmsSchedulingInformation", + "Reset", + "M2SetupRequest", + "EnbConfigurationUpdate", + "MceConfigurationUpdate", + "MbmsServiceCountingRequest"}; -typedef union{ - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT MbmsSessionStartRequest; - //LIBLTE_M2AP_MBMS_SESSION_STOP_REQUEST MbmsSessionStopRequest; - //LIBLTE_M2AP_MBMS_SESSION_UPDATE_REQUEST MbmsSessionUpdateRequest; - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT MbmsSchedulingInformation; - //LIBLTE_M2AP_RESET Reset; - LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT M2SetupRequest; - //LIBLTE_M2AP_ENB_CONFIGURATION_UPDATE EnbConfigurationUpdate; - //LIBLTE_M2AP_MCE_CONFIGURATION_UPDATE MceConfigurationUpdate; - //LIBLTE_M2AP_MBMS_SERVICE_COUNTING_REQUEST MbmsServiceCountingRequest -}LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_UNION; - -typedef struct{ - uint8_t procedureCode; - LIBLTE_M2AP_CRITICALITY_ENUM criticality; - LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_UNION choice; - LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_ENUM choice_type; -}LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage( - LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage( - uint8_t **ptr, - LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT *msg); +typedef union { + LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT MbmsSessionStartRequest; + // LIBLTE_M2AP_MBMS_SESSION_STOP_REQUEST MbmsSessionStopRequest; + // LIBLTE_M2AP_MBMS_SESSION_UPDATE_REQUEST MbmsSessionUpdateRequest; + LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT MbmsSchedulingInformation; + // LIBLTE_M2AP_RESET Reset; + LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT M2SetupRequest; + // LIBLTE_M2AP_ENB_CONFIGURATION_UPDATE EnbConfigurationUpdate; + // LIBLTE_M2AP_MCE_CONFIGURATION_UPDATE MceConfigurationUpdate; + // LIBLTE_M2AP_MBMS_SERVICE_COUNTING_REQUEST MbmsServiceCountingRequest +} LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_UNION; + +typedef struct { + uint8_t procedureCode; + LIBLTE_M2AP_CRITICALITY_ENUM criticality; + LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_UNION choice; + LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_ENUM choice_type; +} LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage(LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage(uint8_t** ptr, LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT* msg); /******************************************************************************* * UnsuccessfulOutcome CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_MBMSSESSIONSTARTFAILURE, LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_MBMSSESSIONUPDATEFAILURE, LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_M2SETUPFAILURE, @@ -1643,39 +1402,35 @@ typedef enum{ LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_MCECONFIGURATIONUPDATEFAILURE, LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_MBMSSERVICECOUNTINGFAILURE, LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_N_ITEMS, -}LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM; +} LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM; static const char liblte_m2ap_unsuccessfuloutcome_choice_text[LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_N_ITEMS][50] = { - "MbmsSessionStartFailure", - "Mbmssessionupdatefailure", - "M2SetupFailure", - "EnbConfigurationUpdateFailure", - "MceConfigurationUpdateFailure", + "MbmsSessionStartFailure", + "Mbmssessionupdatefailure", + "M2SetupFailure", + "EnbConfigurationUpdateFailure", + "MceConfigurationUpdateFailure", }; -typedef union{ - //LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT S1SetupFailure; - //LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT HandoverFailure; - //LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT MMEConfigurationUpdateFailure; -}LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_UNION; +typedef union { + // LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT S1SetupFailure; + // LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT HandoverFailure; + // LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT MMEConfigurationUpdateFailure; +} LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_UNION; -typedef struct{ - uint8_t procedureCode; - LIBLTE_M2AP_CRITICALITY_ENUM criticality; - LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_UNION choice; - LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM choice_type; -}LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT; +typedef struct { + uint8_t procedureCode; + LIBLTE_M2AP_CRITICALITY_ENUM criticality; + LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_UNION choice; + LIBLTE_M2AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM choice_type; +} LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_unsuccessfuloutcome( - LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_unsuccessfuloutcome( - uint8_t **ptr, - LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT *msg); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_unsuccessfuloutcome(LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_unsuccessfuloutcome(uint8_t** ptr, LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT* msg); /******************************************************************************* * SuccessfulOutcome CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSESSIONSTARTRESPONSE, LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSESSIONSTOPRESPONSE, LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSESSIONUPDATERESPONSE, @@ -1686,17 +1441,17 @@ typedef enum{ LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MCECONFIGURATIONUPDATEACKNOWLEDGE, LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSERVICECOUNTINGRESPONSE, LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_N_ITEMS, -}LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_ENUM; +} LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_ENUM; static const char liblte_m2ap_successfuloutcome_choice_text[LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_N_ITEMS][50] = { - "MbmsSessionStartResponse", - "MbmsSessionStopResponse", - "MbmsSessionUpdateResponse", - "MbmsSchedulingInformationResponse", - "ResetAcknowledge", - "M2SetupResponse", - "EnbConfigurationUpdateAcknowledge", - "MceConfigurationUpdateAcknowledge", - "MbmsServiceCountingResponse", + "MbmsSessionStartResponse", + "MbmsSessionStopResponse", + "MbmsSessionUpdateResponse", + "MbmsSchedulingInformationResponse", + "ResetAcknowledge", + "M2SetupResponse", + "EnbConfigurationUpdateAcknowledge", + "MceConfigurationUpdateAcknowledge", + "MbmsServiceCountingResponse", }; typedef union { LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT M2SetupResponse; @@ -1704,52 +1459,44 @@ typedef union { LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT MbmsSchedulingInformationResponse; } LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_UNION; -typedef struct{ - uint8_t procedureCode; - LIBLTE_M2AP_CRITICALITY_ENUM criticality; - LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_UNION choice; - LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_ENUM choice_type; -}LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT; +typedef struct { + uint8_t procedureCode; + LIBLTE_M2AP_CRITICALITY_ENUM criticality; + LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_UNION choice; + LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_ENUM choice_type; +} LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT; -LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome( - LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome( - uint8_t **ptr, - LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT *msg); +LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome(LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome(uint8_t** ptr, LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT* msg); /******************************************************************************* * M2AP_PDU CHOICE *******************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_M2AP_M2AP_PDU_CHOICE_INITIATINGMESSAGE, LIBLTE_M2AP_M2AP_PDU_CHOICE_SUCCESSFULOUTCOME, LIBLTE_M2AP_M2AP_PDU_CHOICE_UNSUCCESSFULOUTCOME, LIBLTE_M2AP_M2AP_PDU_CHOICE_N_ITEMS, -}LIBLTE_M2AP_M2AP_PDU_CHOICE_ENUM; +} LIBLTE_M2AP_M2AP_PDU_CHOICE_ENUM; static const char liblte_m2ap_m2ap_pdu_choice_text[LIBLTE_M2AP_M2AP_PDU_CHOICE_N_ITEMS][50] = { - "initiatingMessage", - "successfulOutcome", - "unsuccessfulOutcome", + "initiatingMessage", + "successfulOutcome", + "unsuccessfulOutcome", }; -typedef union{ - LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT initiatingMessage; - LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT successfulOutcome; - LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT unsuccessfulOutcome; -}LIBLTE_M2AP_M2AP_PDU_CHOICE_UNION; +typedef union { + LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT initiatingMessage; + LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT successfulOutcome; + LIBLTE_M2AP_UNSUCCESSFULOUTCOME_STRUCT unsuccessfulOutcome; +} LIBLTE_M2AP_M2AP_PDU_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_M2AP_M2AP_PDU_CHOICE_UNION choice; LIBLTE_M2AP_M2AP_PDU_CHOICE_ENUM choice_type; -}LIBLTE_M2AP_M2AP_PDU_STRUCT; - -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2ap_pdu( - LIBLTE_M2AP_M2AP_PDU_STRUCT *m2ap_pdu, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2ap_pdu( - LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_M2AP_M2AP_PDU_STRUCT *m2ap_pdu); +} LIBLTE_M2AP_M2AP_PDU_STRUCT; + +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2ap_pdu(LIBLTE_M2AP_M2AP_PDU_STRUCT* m2ap_pdu, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2ap_pdu(LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_M2AP_M2AP_PDU_STRUCT* m2ap_pdu); #endif // SRSLTE_LIBLTE_M2AP_H diff --git a/lib/include/srslte/asn1/liblte_mme.h b/lib/include/srslte/asn1/liblte_mme.h index 1382bb67f..74e7ce015 100644 --- a/lib/include/srslte/asn1/liblte_mme.h +++ b/lib/include/srslte/asn1/liblte_mme.h @@ -49,12 +49,10 @@ DEFINES *******************************************************************************/ - /******************************************************************************* TYPEDEFS *******************************************************************************/ - /******************************************************************************* INFORMATION ELEMENT DECLARATIONS *******************************************************************************/ @@ -69,18 +67,18 @@ Document Reference: 24.301 v10.2.0 Section 9.9.2.0 *********************************************************************/ // Defines -#define LIBLTE_MME_ADDITIONAL_INFORMATION_MAX_N_OCTETS (LIBLTE_MAX_MSG_SIZE_BITS/2) +#define LIBLTE_MME_ADDITIONAL_INFORMATION_MAX_N_OCTETS (LIBLTE_MAX_MSG_SIZE_BITS / 2) // Enums // Structs -typedef struct{ - uint8 info[LIBLTE_MME_ADDITIONAL_INFORMATION_MAX_N_OCTETS]; - uint32 N_octets; -}LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT; +typedef struct { + uint8 info[LIBLTE_MME_ADDITIONAL_INFORMATION_MAX_N_OCTETS]; + uint32 N_octets; +} LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_information_ie(LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT *add_info, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8 **ie_ptr, - LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT *add_info); +LIBLTE_ERROR_ENUM liblte_mme_pack_additional_information_ie(LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT* add_info, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8** ie_ptr, + LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT* add_info); /********************************************************************* IE Name: Device Properties @@ -93,21 +91,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_DEVICE_PROPERTIES_NOT_CONFIGURED_FOR_LOW_PRIORITY = 0, - LIBLTE_MME_DEVICE_PROPERTIES_CONFIGURED_FOR_LOW_PRIORITY, - LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS, -}LIBLTE_MME_DEVICE_PROPERTIES_ENUM; -static const char liblte_mme_device_properties_text[LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS][50] = {"Not configured for low priority", - "Configured for low priority"}; +typedef enum { + LIBLTE_MME_DEVICE_PROPERTIES_NOT_CONFIGURED_FOR_LOW_PRIORITY = 0, + LIBLTE_MME_DEVICE_PROPERTIES_CONFIGURED_FOR_LOW_PRIORITY, + LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS, +} LIBLTE_MME_DEVICE_PROPERTIES_ENUM; +static const char liblte_mme_device_properties_text[LIBLTE_MME_DEVICE_PROPERTIES_N_ITEMS][50] = { + "Not configured for low priority", "Configured for low priority"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_device_properties_ie(LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_DEVICE_PROPERTIES_ENUM *device_props); +LIBLTE_ERROR_ENUM + liblte_mme_pack_device_properties_ie(LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_DEVICE_PROPERTIES_ENUM* device_props); /********************************************************************* IE Name: EPS Bearer Context Status @@ -120,14 +117,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8 // Defines // Enums // Structs -typedef struct{ - bool ebi[16]; -}LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT; +typedef struct { + bool ebi[16]; +} LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_bearer_context_status_ie(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT *ebcs, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT *ebcs); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_bearer_context_status_ie(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT* ebcs, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8** ie_ptr, + LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT* ebcs); /********************************************************************* IE Name: Location Area Identification @@ -141,16 +138,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8 // Defines // Enums // Structs -typedef struct{ - uint16 mcc; - uint16 mnc; - uint16 lac; -}LIBLTE_MME_LOCATION_AREA_ID_STRUCT; +typedef struct { + uint16 mcc; + uint16 mnc; + uint16 lac; +} LIBLTE_MME_LOCATION_AREA_ID_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_location_area_id_ie(LIBLTE_MME_LOCATION_AREA_ID_STRUCT *lai, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8 **ie_ptr, - LIBLTE_MME_LOCATION_AREA_ID_STRUCT *lai); +LIBLTE_ERROR_ENUM liblte_mme_pack_location_area_id_ie(LIBLTE_MME_LOCATION_AREA_ID_STRUCT* lai, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8** ie_ptr, LIBLTE_MME_LOCATION_AREA_ID_STRUCT* lai); /********************************************************************* IE Name: Mobile Identity @@ -163,25 +158,23 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8 24.008 v10.2.0 Section 10.5.1.4 *********************************************************************/ // Defines -#define LIBLTE_MME_MOBILE_ID_TYPE_IMSI 0x1 -#define LIBLTE_MME_MOBILE_ID_TYPE_IMEI 0x2 +#define LIBLTE_MME_MOBILE_ID_TYPE_IMSI 0x1 +#define LIBLTE_MME_MOBILE_ID_TYPE_IMEI 0x2 #define LIBLTE_MME_MOBILE_ID_TYPE_IMEISV 0x3 -#define LIBLTE_MME_MOBILE_ID_TYPE_TMSI 0x4 -#define LIBLTE_MME_MOBILE_ID_TYPE_TMGI 0x5 +#define LIBLTE_MME_MOBILE_ID_TYPE_TMSI 0x4 +#define LIBLTE_MME_MOBILE_ID_TYPE_TMGI 0x5 // Enums // Structs -typedef struct{ - uint8 type_of_id; - uint8 imsi[15]; - uint8 imei[15]; - uint8 imeisv[16]; - uint32 tmsi; -}LIBLTE_MME_MOBILE_ID_STRUCT; +typedef struct { + uint8 type_of_id; + uint8 imsi[15]; + uint8 imei[15]; + uint8 imeisv[16]; + uint32 tmsi; +} LIBLTE_MME_MOBILE_ID_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_id_ie(LIBLTE_MME_MOBILE_ID_STRUCT *mobile_id, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_ID_STRUCT *mobile_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_id_ie(LIBLTE_MME_MOBILE_ID_STRUCT* mobile_id, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8** ie_ptr, LIBLTE_MME_MOBILE_ID_STRUCT* mobile_id); /********************************************************************* IE Name: Mobile Station Classmark 2 @@ -194,66 +187,59 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8 **i *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_REVISION_LEVEL_GSM_PHASE_1 = 0, - LIBLTE_MME_REVISION_LEVEL_GSM_PHASE_2, - LIBLTE_MME_REVISION_LEVEL_R99, - LIBLTE_MME_REVISION_LEVEL_RESERVED, - LIBLTE_MME_REVISION_LEVEL_N_ITEMS, -}LIBLTE_MME_REVISION_LEVEL_ENUM; -static const char liblte_mme_revision_level_text[LIBLTE_MME_REVISION_LEVEL_N_ITEMS][20] = {"GSM Phase 1", - "GSM Phase 2", - "R99", - "RESERVED"}; -typedef enum{ - LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_1 = 0, - LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_2, - LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_3, - LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_4, - LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_5, - LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS, -}LIBLTE_MME_RF_POWER_CAPABILITY_ENUM; -static const char liblte_mme_rf_power_capability_text[LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS][20] = {"Class 1", - "Class 2", - "Class 3", - "Class 4", - "Class 5"}; -typedef enum{ - LIBLTE_MME_SS_SCREEN_INDICATOR_0 = 0, - LIBLTE_MME_SS_SCREEN_INDICATOR_1, - LIBLTE_MME_SS_SCREEN_INDICATOR_2, - LIBLTE_MME_SS_SCREEN_INDICATOR_3, - LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS, -}LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM; -static const char liblte_mme_ss_screen_indicator_text[LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS][100] = {"Default Phase 1", - "Ellipsis Notation Phase 2", - "RESERVED", - "RESERVED"}; -// Structs -typedef struct{ - LIBLTE_MME_REVISION_LEVEL_ENUM rev_lev; - LIBLTE_MME_RF_POWER_CAPABILITY_ENUM rf_power_cap; - LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM ss_screen_ind; - bool es_ind; - bool a5_1; - bool ps_cap; - bool sm_cap; - bool vbs; - bool vgcs; - bool fc; - bool cm3; - bool lcsva_cap; - bool ucs2; - bool solsa; - bool cmsp; - bool a5_3; - bool a5_2; -}LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_2_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT *ms_cm2, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT *ms_cm2); +typedef enum { + LIBLTE_MME_REVISION_LEVEL_GSM_PHASE_1 = 0, + LIBLTE_MME_REVISION_LEVEL_GSM_PHASE_2, + LIBLTE_MME_REVISION_LEVEL_R99, + LIBLTE_MME_REVISION_LEVEL_RESERVED, + LIBLTE_MME_REVISION_LEVEL_N_ITEMS, +} LIBLTE_MME_REVISION_LEVEL_ENUM; +static const char liblte_mme_revision_level_text[LIBLTE_MME_REVISION_LEVEL_N_ITEMS][20] = { + "GSM Phase 1", "GSM Phase 2", "R99", "RESERVED"}; +typedef enum { + LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_1 = 0, + LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_2, + LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_3, + LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_4, + LIBLTE_MME_RF_POWER_CAPABILITY_CLASS_5, + LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS, +} LIBLTE_MME_RF_POWER_CAPABILITY_ENUM; +static const char liblte_mme_rf_power_capability_text[LIBLTE_MME_RF_POWER_CAPABILITY_N_ITEMS][20] = { + "Class 1", "Class 2", "Class 3", "Class 4", "Class 5"}; +typedef enum { + LIBLTE_MME_SS_SCREEN_INDICATOR_0 = 0, + LIBLTE_MME_SS_SCREEN_INDICATOR_1, + LIBLTE_MME_SS_SCREEN_INDICATOR_2, + LIBLTE_MME_SS_SCREEN_INDICATOR_3, + LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS, +} LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM; +static const char liblte_mme_ss_screen_indicator_text[LIBLTE_MME_SS_SCREEN_INDICATOR_N_ITEMS][100] = { + "Default Phase 1", "Ellipsis Notation Phase 2", "RESERVED", "RESERVED"}; +// Structs +typedef struct { + LIBLTE_MME_REVISION_LEVEL_ENUM rev_lev; + LIBLTE_MME_RF_POWER_CAPABILITY_ENUM rf_power_cap; + LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM ss_screen_ind; + bool es_ind; + bool a5_1; + bool ps_cap; + bool sm_cap; + bool vbs; + bool vgcs; + bool fc; + bool cm3; + bool lcsva_cap; + bool ucs2; + bool solsa; + bool cmsp; + bool a5_3; + bool a5_2; +} LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_2_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT* ms_cm2, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8** ie_ptr, + LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT* ms_cm2); /********************************************************************* IE Name: Mobile Station Classmark 3 @@ -267,14 +253,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8 // Defines // Enums // Structs -typedef struct{ - // FIXME -}LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT; +typedef struct { + // FIXME +} LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_3_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT *ms_cm3, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT *ms_cm3); +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_3_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT* ms_cm3, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8** ie_ptr, + LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT* ms_cm3); /********************************************************************* IE Name: NAS Security Parameters From E-UTRA @@ -288,10 +274,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_from_eutra_ie(uint8 dl_nas_count, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8 **ie_ptr, - uint8 *dl_nas_count); +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_from_eutra_ie(uint8 dl_nas_count, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8** ie_ptr, uint8* dl_nas_count); /********************************************************************* IE Name: NAS Security Parameters To E-UTRA @@ -305,64 +289,54 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA0 = 0, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA1, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA2, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA3, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA4, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA5, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA6, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA7, - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS, -}LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM; -static const char liblte_mme_type_of_integrity_algorithm_text[LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS][20] = {"EIA0", - "128-EIA1", - "128-EIA2", - "EIA3", - "EIA4", - "EIA5", - "EIA6", - "EIA7"}; -typedef enum{ - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA0 = 0, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA1, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA2, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA3, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA4, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA5, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA6, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA7, - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS, -}LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM; -static const char liblte_mme_type_of_ciphering_algorithm_text[LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS][20] = {"EEA0", - "128-EEA1", - "128-EEA2", - "EEA3", - "EEA4", - "EEA5", - "EEA6", - "EEA7"}; -typedef enum{ - LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE = 0, - LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_MAPPED, - LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_N_ITEMS, -}LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM; -static const char liblte_mme_type_of_security_context_flag_text[LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_N_ITEMS][20] = {"Native", - "Mapped"}; -// Structs -typedef struct{ - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM eea; - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM eia; - LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag; - uint32 nonce_mme; - uint8 nas_ksi; -}LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_to_eutra_ie(LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT *sec_params, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8 **ie_ptr, - LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT *sec_params); +typedef enum { + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA0 = 0, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA1, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_128_EIA2, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA3, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA4, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA5, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA6, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_EIA7, + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS, +} LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM; +static const char liblte_mme_type_of_integrity_algorithm_text[LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_N_ITEMS][20] = { + "EIA0", "128-EIA1", "128-EIA2", "EIA3", "EIA4", "EIA5", "EIA6", "EIA7"}; +typedef enum { + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA0 = 0, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA1, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_128_EEA2, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA3, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA4, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA5, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA6, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_EEA7, + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS, +} LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM; +static const char liblte_mme_type_of_ciphering_algorithm_text[LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_N_ITEMS][20] = { + "EEA0", "128-EEA1", "128-EEA2", "EEA3", "EEA4", "EEA5", "EEA6", "EEA7"}; +typedef enum { + LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_NATIVE = 0, + LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_MAPPED, + LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_N_ITEMS, +} LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM; +static const char liblte_mme_type_of_security_context_flag_text[LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_N_ITEMS][20] = + {"Native", "Mapped"}; +// Structs +typedef struct { + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM eea; + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM eia; + LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag; + uint32 nonce_mme; + uint8 nas_ksi; +} LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT; +// Functions +LIBLTE_ERROR_ENUM +liblte_mme_pack_nas_security_parameters_to_eutra_ie(LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT* sec_params, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8** ie_ptr, + LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT* sec_params); /********************************************************************* IE Name: PLMN List @@ -376,16 +350,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8 #define LIBLTE_MME_PLMN_LIST_MAX_SIZE 15 // Enums // Structs -typedef struct{ - uint32 N_plmns; - uint16 mcc[LIBLTE_MME_PLMN_LIST_MAX_SIZE]; - uint16 mnc[LIBLTE_MME_PLMN_LIST_MAX_SIZE]; -}LIBLTE_MME_PLMN_LIST_STRUCT; +typedef struct { + uint32 N_plmns; + uint16 mcc[LIBLTE_MME_PLMN_LIST_MAX_SIZE]; + uint16 mnc[LIBLTE_MME_PLMN_LIST_MAX_SIZE]; +} LIBLTE_MME_PLMN_LIST_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_plmn_list_ie(LIBLTE_MME_PLMN_LIST_STRUCT *plmn_list, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8 **ie_ptr, - LIBLTE_MME_PLMN_LIST_STRUCT *plmn_list); +LIBLTE_ERROR_ENUM liblte_mme_pack_plmn_list_ie(LIBLTE_MME_PLMN_LIST_STRUCT* plmn_list, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8** ie_ptr, LIBLTE_MME_PLMN_LIST_STRUCT* plmn_list); /********************************************************************* IE Name: Spare Half Octet @@ -411,22 +383,22 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8 **i 24.008 v10.2.0 Section 10.5.4.32 *********************************************************************/ // Defines -#define LIBLTE_MME_MAX_N_SUPPORTED_CODECS (LIBLTE_MAX_MSG_SIZE_BITS/16) +#define LIBLTE_MME_MAX_N_SUPPORTED_CODECS (LIBLTE_MAX_MSG_SIZE_BITS / 16) // Enums // Structs -typedef struct{ - uint8 sys_id; - uint16 codec_bitmap; -}LIBLTE_MME_SUPPORTED_CODEC_STRUCT; -typedef struct{ - LIBLTE_MME_SUPPORTED_CODEC_STRUCT supported_codec[LIBLTE_MME_MAX_N_SUPPORTED_CODECS]; - uint32 N_supported_codecs; -}LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT; +typedef struct { + uint8 sys_id; + uint16 codec_bitmap; +} LIBLTE_MME_SUPPORTED_CODEC_STRUCT; +typedef struct { + LIBLTE_MME_SUPPORTED_CODEC_STRUCT supported_codec[LIBLTE_MME_MAX_N_SUPPORTED_CODECS]; + uint32 N_supported_codecs; +} LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_supported_codec_list_ie(LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT *supported_codec_list, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_supported_codec_list_ie(uint8 **ie_ptr, - LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT *supported_codec_list); +LIBLTE_ERROR_ENUM liblte_mme_pack_supported_codec_list_ie(LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT* supported_codec_list, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_supported_codec_list_ie(uint8** ie_ptr, LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT* supported_codec_list); /********************************************************************* IE Name: Additional Update Result @@ -439,25 +411,23 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_supported_codec_list_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_NO_ADDITIONAL_INFO = 0, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_CS_FALLBACK_NOT_PREFERRED, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_SMS_ONLY, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_RESERVED, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS, -}LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM; -static const char liblte_mme_additional_update_result_text[LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS][100] = {"No Additional Information", - "CS Fallback Not Preferred", - "SMS Only", - "RESERVED"}; +typedef enum { + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_NO_ADDITIONAL_INFO = 0, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_CS_FALLBACK_NOT_PREFERRED, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_SMS_ONLY, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_RESERVED, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS, +} LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM; +static const char liblte_mme_additional_update_result_text[LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_N_ITEMS][100] = { + "No Additional Information", "CS Fallback Not Preferred", "SMS Only", "RESERVED"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM *result); +LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result, + uint8 bit_offset, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM* result); /********************************************************************* IE Name: Additional Update Type @@ -470,21 +440,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_NO_ADDITIONAL_INFO = 0, - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_SMS_ONLY, - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS, -}LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM; -static const char liblte_mme_additional_update_type_text[LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS][20] = {"No additional info", - "SMS Only"}; +typedef enum { + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_NO_ADDITIONAL_INFO = 0, + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_SMS_ONLY, + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS, +} LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM; +static const char liblte_mme_additional_update_type_text[LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_N_ITEMS][20] = { + "No additional info", "SMS Only"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_type_ie(LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM aut, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM *aut); +LIBLTE_ERROR_ENUM + liblte_mme_pack_additional_update_type_ie(LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM aut, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM* aut); /********************************************************************* IE Name: Authentication Failure Parameter @@ -501,10 +470,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_parameter_ie(uint8 *auth_fail_param, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8 **ie_ptr, - uint8 *auth_fail_param); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_parameter_ie(uint8* auth_fail_param, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8** ie_ptr, uint8* auth_fail_param); /********************************************************************* IE Name: Authentication Parameter AUTN @@ -519,10 +486,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8 ** // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_autn_ie(uint8 *autn, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8 **ie_ptr, - uint8 *autn); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_autn_ie(uint8* autn, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8** ie_ptr, uint8* autn); /********************************************************************* IE Name: Authentication Parameter RAND @@ -541,10 +506,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8 **ie_ // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_rand_ie(uint8 *rand_val, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8 **ie_ptr, - uint8 *rand_val); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_rand_ie(uint8* rand_val, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8** ie_ptr, uint8* rand_val); /********************************************************************* IE Name: Authentication Response Parameter @@ -558,10 +521,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8 **ie_ // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8 *res, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_parameter_ie(uint8 **ie_ptr, - uint8 *res); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8* res, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_parameter_ie(uint8** ie_ptr, uint8* res); /********************************************************************* IE Name: Ciphering Key Sequence Number @@ -577,12 +538,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_parameter_ie(uint8 * // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ciphering_key_sequence_number_ie(uint8 key_seq, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ciphering_key_sequence_number_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *key_seq); +LIBLTE_ERROR_ENUM liblte_mme_pack_ciphering_key_sequence_number_ie(uint8 key_seq, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_ciphering_key_sequence_number_ie(uint8** ie_ptr, uint8 bit_offset, uint8* key_seq); /********************************************************************* IE Name: CSFB Response @@ -598,12 +555,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ciphering_key_sequence_number_ie(uint8 **ie_ // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_csfb_response_ie(uint8 csfb_resp, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *csfb_resp); +LIBLTE_ERROR_ENUM liblte_mme_pack_csfb_response_ie(uint8 csfb_resp, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8** ie_ptr, uint8 bit_offset, uint8* csfb_resp); /********************************************************************* IE Name: Daylight Saving Time @@ -615,23 +568,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8 **ie_ptr, *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_DAYLIGHT_SAVING_TIME_NO_ADJUSTMENT = 0, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_PLUS_ONE_HOUR, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_PLUS_TWO_HOURS, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_RESERVED, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS, -}LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM; -static const char liblte_mme_daylight_saving_time_text[LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS][20] = {"No Adjustment", - "+1 Hour", - "+2 Hours", - "RESERVED"}; +typedef enum { + LIBLTE_MME_DAYLIGHT_SAVING_TIME_NO_ADJUSTMENT = 0, + LIBLTE_MME_DAYLIGHT_SAVING_TIME_PLUS_ONE_HOUR, + LIBLTE_MME_DAYLIGHT_SAVING_TIME_PLUS_TWO_HOURS, + LIBLTE_MME_DAYLIGHT_SAVING_TIME_RESERVED, + LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS, +} LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM; +static const char liblte_mme_daylight_saving_time_text[LIBLTE_MME_DAYLIGHT_SAVING_TIME_N_ITEMS][20] = { + "No Adjustment", "+1 Hour", "+2 Hours", "RESERVED"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8 **ie_ptr, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM *dst); +LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8** ie_ptr, LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM* dst); /********************************************************************* IE Name: Detach Type @@ -641,27 +590,25 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.7 *********************************************************************/ // Defines -#define LIBLTE_MME_SO_FLAG_NORMAL_DETACH 0 -#define LIBLTE_MME_SO_FLAG_SWITCH_OFF 1 -#define LIBLTE_MME_TOD_UL_EPS_DETACH 0x1 -#define LIBLTE_MME_TOD_UL_IMSI_DETACH 0x2 -#define LIBLTE_MME_TOD_UL_COMBINED_DETACH 0x3 -#define LIBLTE_MME_TOD_DL_REATTACH_REQUIRED 0x1 +#define LIBLTE_MME_SO_FLAG_NORMAL_DETACH 0 +#define LIBLTE_MME_SO_FLAG_SWITCH_OFF 1 +#define LIBLTE_MME_TOD_UL_EPS_DETACH 0x1 +#define LIBLTE_MME_TOD_UL_IMSI_DETACH 0x2 +#define LIBLTE_MME_TOD_UL_COMBINED_DETACH 0x3 +#define LIBLTE_MME_TOD_DL_REATTACH_REQUIRED 0x1 #define LIBLTE_MME_TOD_DL_REATTACH_NOT_REQUIRED 0x2 -#define LIBLTE_MME_TOD_DL_IMSI_DETACH 0x3 +#define LIBLTE_MME_TOD_DL_IMSI_DETACH 0x3 // Enums // Structs -typedef struct{ - uint8 switch_off; - uint8 type_of_detach; -}LIBLTE_MME_DETACH_TYPE_STRUCT; +typedef struct { + uint8 switch_off; + uint8 type_of_detach; +} LIBLTE_MME_DETACH_TYPE_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_type_ie(LIBLTE_MME_DETACH_TYPE_STRUCT *detach_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_DETACH_TYPE_STRUCT *detach_type); +LIBLTE_ERROR_ENUM +liblte_mme_pack_detach_type_ie(LIBLTE_MME_DETACH_TYPE_STRUCT* detach_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_detach_type_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_DETACH_TYPE_STRUCT* detach_type); /********************************************************************* IE Name: DRX Parameter @@ -673,17 +620,17 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_type_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_NON_DRX_TIMER_NO_NON_DRX_MODE = 0, - LIBLTE_MME_NON_DRX_TIMER_MAX_1S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_2S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_4S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_8S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_16S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_32S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_MAX_64S_NON_DRX_MODE, - LIBLTE_MME_NON_DRX_TIMER_N_ITEMS, -}LIBLTE_MME_NON_DRX_TIMER_ENUM; +typedef enum { + LIBLTE_MME_NON_DRX_TIMER_NO_NON_DRX_MODE = 0, + LIBLTE_MME_NON_DRX_TIMER_MAX_1S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_2S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_4S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_8S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_16S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_32S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_MAX_64S_NON_DRX_MODE, + LIBLTE_MME_NON_DRX_TIMER_N_ITEMS, +} LIBLTE_MME_NON_DRX_TIMER_ENUM; static const char liblte_mme_non_drx_timer_text[LIBLTE_MME_NON_DRX_TIMER_N_ITEMS][100] = {"No Non-DRX Mode", "Max 1s Non-DRX Mode", "Max 2s Non-DRX Mode", @@ -693,17 +640,15 @@ static const char liblte_mme_non_drx_timer_text[LIBLTE_MME_NON_DRX_TIMER_N_ITEMS "Max 32s Non-DRX Mode", "Max 64s Non-DRX Mode"}; // Structs -typedef struct{ - LIBLTE_MME_NON_DRX_TIMER_ENUM non_drx_timer; - uint8 split_pg_cycle_code; - uint8 drx_cycle_len_coeff_and_value; - bool split_on_ccch; -}LIBLTE_MME_DRX_PARAMETER_STRUCT; +typedef struct { + LIBLTE_MME_NON_DRX_TIMER_ENUM non_drx_timer; + uint8 split_pg_cycle_code; + uint8 drx_cycle_len_coeff_and_value; + bool split_on_ccch; +} LIBLTE_MME_DRX_PARAMETER_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_drx_parameter_ie(LIBLTE_MME_DRX_PARAMETER_STRUCT *drx_param, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8 **ie_ptr, - LIBLTE_MME_DRX_PARAMETER_STRUCT *drx_param); +LIBLTE_ERROR_ENUM liblte_mme_pack_drx_parameter_ie(LIBLTE_MME_DRX_PARAMETER_STRUCT* drx_param, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8** ie_ptr, LIBLTE_MME_DRX_PARAMETER_STRUCT* drx_param); /********************************************************************* IE Name: EMM Cause @@ -714,47 +659,45 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.9 *********************************************************************/ // Defines -#define LIBLTE_MME_EMM_CAUSE_IMSI_UNKNOWN_IN_HSS 0x02 -#define LIBLTE_MME_EMM_CAUSE_ILLEGAL_UE 0x03 -#define LIBLTE_MME_EMM_CAUSE_IMEI_NOT_ACCEPTED 0x05 -#define LIBLTE_MME_EMM_CAUSE_ILLEGAL_ME 0x06 -#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED 0x07 -#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED 0x08 -#define LIBLTE_MME_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK 0x09 -#define LIBLTE_MME_EMM_CAUSE_IMPLICITLY_DETACHED 0x0A -#define LIBLTE_MME_EMM_CAUSE_PLMN_NOT_ALLOWED 0x0B -#define LIBLTE_MME_EMM_CAUSE_TRACKING_AREA_NOT_ALLOWED 0x0C -#define LIBLTE_MME_EMM_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA 0x0D -#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN 0x0E -#define LIBLTE_MME_EMM_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA 0x0F -#define LIBLTE_MME_EMM_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE 0x10 -#define LIBLTE_MME_EMM_CAUSE_NETWORK_FAILURE 0x11 -#define LIBLTE_MME_EMM_CAUSE_CS_DOMAIN_NOT_AVAILABLE 0x12 -#define LIBLTE_MME_EMM_CAUSE_ESM_FAILURE 0x13 -#define LIBLTE_MME_EMM_CAUSE_MAC_FAILURE 0x14 -#define LIBLTE_MME_EMM_CAUSE_SYNCH_FAILURE 0x15 -#define LIBLTE_MME_EMM_CAUSE_CONGESTION 0x16 -#define LIBLTE_MME_EMM_CAUSE_UE_SECURITY_CAPABILITIES_MISMATCH 0x17 -#define LIBLTE_MME_EMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED 0x18 -#define LIBLTE_MME_EMM_CAUSE_NOT_AUTHORIZED_FOR_THIS_CSG 0x19 -#define LIBLTE_MME_EMM_CAUSE_NON_EPS_AUTHENTICATION_UNACCEPTABLE 0x1A -#define LIBLTE_MME_EMM_CAUSE_CS_SERVICE_TEMPORARILY_NOT_AVAILABLE 0x27 -#define LIBLTE_MME_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED 0x28 -#define LIBLTE_MME_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 0x5F -#define LIBLTE_MME_EMM_CAUSE_INVALID_MANDATORY_INFORMATION 0x60 -#define LIBLTE_MME_EMM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x61 +#define LIBLTE_MME_EMM_CAUSE_IMSI_UNKNOWN_IN_HSS 0x02 +#define LIBLTE_MME_EMM_CAUSE_ILLEGAL_UE 0x03 +#define LIBLTE_MME_EMM_CAUSE_IMEI_NOT_ACCEPTED 0x05 +#define LIBLTE_MME_EMM_CAUSE_ILLEGAL_ME 0x06 +#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED 0x07 +#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED 0x08 +#define LIBLTE_MME_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK 0x09 +#define LIBLTE_MME_EMM_CAUSE_IMPLICITLY_DETACHED 0x0A +#define LIBLTE_MME_EMM_CAUSE_PLMN_NOT_ALLOWED 0x0B +#define LIBLTE_MME_EMM_CAUSE_TRACKING_AREA_NOT_ALLOWED 0x0C +#define LIBLTE_MME_EMM_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA 0x0D +#define LIBLTE_MME_EMM_CAUSE_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN 0x0E +#define LIBLTE_MME_EMM_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA 0x0F +#define LIBLTE_MME_EMM_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE 0x10 +#define LIBLTE_MME_EMM_CAUSE_NETWORK_FAILURE 0x11 +#define LIBLTE_MME_EMM_CAUSE_CS_DOMAIN_NOT_AVAILABLE 0x12 +#define LIBLTE_MME_EMM_CAUSE_ESM_FAILURE 0x13 +#define LIBLTE_MME_EMM_CAUSE_MAC_FAILURE 0x14 +#define LIBLTE_MME_EMM_CAUSE_SYNCH_FAILURE 0x15 +#define LIBLTE_MME_EMM_CAUSE_CONGESTION 0x16 +#define LIBLTE_MME_EMM_CAUSE_UE_SECURITY_CAPABILITIES_MISMATCH 0x17 +#define LIBLTE_MME_EMM_CAUSE_SECURITY_MODE_REJECTED_UNSPECIFIED 0x18 +#define LIBLTE_MME_EMM_CAUSE_NOT_AUTHORIZED_FOR_THIS_CSG 0x19 +#define LIBLTE_MME_EMM_CAUSE_NON_EPS_AUTHENTICATION_UNACCEPTABLE 0x1A +#define LIBLTE_MME_EMM_CAUSE_CS_SERVICE_TEMPORARILY_NOT_AVAILABLE 0x27 +#define LIBLTE_MME_EMM_CAUSE_NO_EPS_BEARER_CONTEXT_ACTIVATED 0x28 +#define LIBLTE_MME_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 0x5F +#define LIBLTE_MME_EMM_CAUSE_INVALID_MANDATORY_INFORMATION 0x60 +#define LIBLTE_MME_EMM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x61 #define LIBLTE_MME_EMM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x62 #define LIBLTE_MME_EMM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x63 -#define LIBLTE_MME_EMM_CAUSE_CONDITIONAL_IE_ERROR 0x64 -#define LIBLTE_MME_EMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x65 -#define LIBLTE_MME_EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 0x6F +#define LIBLTE_MME_EMM_CAUSE_CONDITIONAL_IE_ERROR 0x64 +#define LIBLTE_MME_EMM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x65 +#define LIBLTE_MME_EMM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 0x6F // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_cause_ie(uint8 emm_cause, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8 **ie_ptr, - uint8 *emm_cause); +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_cause_ie(uint8 emm_cause, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8** ie_ptr, uint8* emm_cause); /********************************************************************* IE Name: EPS Attach Result @@ -764,17 +707,13 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.10 *********************************************************************/ // Defines -#define LIBLTE_MME_EPS_ATTACH_RESULT_EPS_ONLY 0x1 +#define LIBLTE_MME_EPS_ATTACH_RESULT_EPS_ONLY 0x1 #define LIBLTE_MME_EPS_ATTACH_RESULT_COMBINED_EPS_IMSI_ATTACH 0x2 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_result_ie(uint8 result, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *result); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_result_ie(uint8 result, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8** ie_ptr, uint8 bit_offset, uint8* result); /********************************************************************* IE Name: EPS Attach Type @@ -784,18 +723,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.11 *********************************************************************/ // Defines -#define LIBLTE_MME_EPS_ATTACH_TYPE_EPS_ATTACH 0x1 +#define LIBLTE_MME_EPS_ATTACH_TYPE_EPS_ATTACH 0x1 #define LIBLTE_MME_EPS_ATTACH_TYPE_COMBINED_EPS_IMSI_ATTACH 0x2 -#define LIBLTE_MME_EPS_ATTACH_TYPE_EPS_EMERGENCY_ATTACH 0x6 +#define LIBLTE_MME_EPS_ATTACH_TYPE_EPS_EMERGENCY_ATTACH 0x6 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_type_ie(uint8 attach_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *attach_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_type_ie(uint8 attach_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* attach_type); /********************************************************************* IE Name: EPS Mobile Identity @@ -810,24 +745,22 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8 **ie_ptr, #define LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMEI 0x3 // Enums // Structs -typedef struct{ - uint32 m_tmsi; - uint16 mcc; - uint16 mnc; - uint16 mme_group_id; - uint8 mme_code; -}LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT; -typedef struct{ - LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT guti; - uint8 type_of_id; - uint8 imsi[15]; - uint8 imei[15]; -}LIBLTE_MME_EPS_MOBILE_ID_STRUCT; +typedef struct { + uint32 m_tmsi; + uint16 mcc; + uint16 mnc; + uint16 mme_group_id; + uint8 mme_code; +} LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT; +typedef struct { + LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT guti; + uint8 type_of_id; + uint8 imsi[15]; + uint8 imei[15]; +} LIBLTE_MME_EPS_MOBILE_ID_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_mobile_id_ie(LIBLTE_MME_EPS_MOBILE_ID_STRUCT *eps_mobile_id, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_MOBILE_ID_STRUCT *eps_mobile_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_mobile_id_ie(LIBLTE_MME_EPS_MOBILE_ID_STRUCT* eps_mobile_id, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8** ie_ptr, LIBLTE_MME_EPS_MOBILE_ID_STRUCT* eps_mobile_id); /********************************************************************* IE Name: EPS Network Feature Support @@ -839,32 +772,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8 *********************************************************************/ // Defines #define LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_NOT_SUPPORTED 0 -#define LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_SUPPORTED 1 -// Enums -typedef enum{ - LIBLTE_MME_CS_LCS_NO_INFORMATION_AVAILABLE = 0, - LIBLTE_MME_CS_LCS_NOT_SUPPORTED, - LIBLTE_MME_CS_LCS_SUPPORTED, - LIBLTE_MME_CS_LCS_RESERVED, - LIBLTE_MME_CS_LCS_N_ITEMS, -}LIBLTE_MME_CS_LCS_ENUM; -static const char liblte_mme_cs_lcs_text[LIBLTE_MME_CS_LCS_N_ITEMS][100] = {"No Information Available", - "Not Supported", - "Supported", - "RESERVED"}; -// Structs -typedef struct{ - LIBLTE_MME_CS_LCS_ENUM cs_lcs; - bool esrps; - bool epc_lcs; - bool emc_bs; - bool ims_vops; -}LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_network_feature_support_ie(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT *eps_nfs, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_network_feature_support_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT *eps_nfs); +#define LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_SUPPORTED 1 +// Enums +typedef enum { + LIBLTE_MME_CS_LCS_NO_INFORMATION_AVAILABLE = 0, + LIBLTE_MME_CS_LCS_NOT_SUPPORTED, + LIBLTE_MME_CS_LCS_SUPPORTED, + LIBLTE_MME_CS_LCS_RESERVED, + LIBLTE_MME_CS_LCS_N_ITEMS, +} LIBLTE_MME_CS_LCS_ENUM; +static const char liblte_mme_cs_lcs_text[LIBLTE_MME_CS_LCS_N_ITEMS][100] = { + "No Information Available", "Not Supported", "Supported", "RESERVED"}; +// Structs +typedef struct { + LIBLTE_MME_CS_LCS_ENUM cs_lcs; + bool esrps; + bool epc_lcs; + bool emc_bs; + bool ims_vops; +} LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_network_feature_support_ie(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT* eps_nfs, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_eps_network_feature_support_ie(uint8** ie_ptr, + LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT* eps_nfs); /********************************************************************* IE Name: EPS Update Result @@ -875,19 +807,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_network_feature_support_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.13 *********************************************************************/ // Defines -#define LIBLTE_MME_EPS_UPDATE_RESULT_TA_UPDATED 0x0 -#define LIBLTE_MME_EPS_UPDATE_RESULT_COMBINED_TA_LA_UPDATED 0x1 -#define LIBLTE_MME_EPS_UPDATE_RESULT_TA_UPDATED_AND_ISR_ACTIVATED 0x4 +#define LIBLTE_MME_EPS_UPDATE_RESULT_TA_UPDATED 0x0 +#define LIBLTE_MME_EPS_UPDATE_RESULT_COMBINED_TA_LA_UPDATED 0x1 +#define LIBLTE_MME_EPS_UPDATE_RESULT_TA_UPDATED_AND_ISR_ACTIVATED 0x4 #define LIBLTE_MME_EPS_UPDATE_RESULT_COMBINED_TA_LA_UPDATED_AND_ISR_ACTIVATED 0x5 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_result_ie(uint8 eps_update_res, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *eps_update_res); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_result_ie(uint8 eps_update_res, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8** ie_ptr, uint8 bit_offset, uint8* eps_update_res); /********************************************************************* IE Name: EPS Update Type @@ -899,29 +827,27 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8 **ie_ptr, *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_EPS_UPDATE_TYPE_TA_UPDATING = 0, - LIBLTE_MME_EPS_UPDATE_TYPE_COMBINED_TA_LA_UPDATING, - LIBLTE_MME_EPS_UPDATE_TYPE_COMBINED_TA_LA_UPDATING_WITH_IMSI_ATTACH, - LIBLTE_MME_EPS_UPDATE_TYPE_PERIODIC_UPDATING, - LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS, -}LIBLTE_MME_EPS_UPDATE_TYPE_ENUM; -static const char liblte_mme_eps_update_type_text[LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS][100] = {"TA Updating", - "Combined TA/LA Updating", - "Combined TA/LA Updating With IMSI Attach", - "Periodic Updating"}; +typedef enum { + LIBLTE_MME_EPS_UPDATE_TYPE_TA_UPDATING = 0, + LIBLTE_MME_EPS_UPDATE_TYPE_COMBINED_TA_LA_UPDATING, + LIBLTE_MME_EPS_UPDATE_TYPE_COMBINED_TA_LA_UPDATING_WITH_IMSI_ATTACH, + LIBLTE_MME_EPS_UPDATE_TYPE_PERIODIC_UPDATING, + LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS, +} LIBLTE_MME_EPS_UPDATE_TYPE_ENUM; +static const char liblte_mme_eps_update_type_text[LIBLTE_MME_EPS_UPDATE_TYPE_N_ITEMS][100] = { + "TA Updating", "Combined TA/LA Updating", "Combined TA/LA Updating With IMSI Attach", "Periodic Updating"}; // Structs -typedef struct{ - LIBLTE_MME_EPS_UPDATE_TYPE_ENUM type; - bool active_flag; -}LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT; +typedef struct { + LIBLTE_MME_EPS_UPDATE_TYPE_ENUM type; + bool active_flag; +} LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_type_ie(LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT *eps_update_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT *eps_update_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_type_ie(LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT* eps_update_type, + uint8 bit_offset, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT* eps_update_type); /********************************************************************* IE Name: ESM Message Container @@ -935,10 +861,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *esm_msg, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *esm_msg); +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* esm_msg, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* esm_msg); /********************************************************************* IE Name: GPRS Timer @@ -950,20 +874,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8 *********************************************************************/ // Defines #define LIBLTE_MME_GPRS_TIMER_UNIT_2_SECONDS 0x0 -#define LIBLTE_MME_GPRS_TIMER_UNIT_1_MINUTE 0x1 +#define LIBLTE_MME_GPRS_TIMER_UNIT_1_MINUTE 0x1 #define LIBLTE_MME_GPRS_TIMER_UNIT_6_MINUTES 0x2 -#define LIBLTE_MME_GPRS_TIMER_DEACTIVATED 0x7 +#define LIBLTE_MME_GPRS_TIMER_DEACTIVATED 0x7 // Enums // Structs -typedef struct{ - uint8 unit; - uint8 value; -}LIBLTE_MME_GPRS_TIMER_STRUCT; +typedef struct { + uint8 unit; + uint8 value; +} LIBLTE_MME_GPRS_TIMER_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_ie(LIBLTE_MME_GPRS_TIMER_STRUCT *timer, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8 **ie_ptr, - LIBLTE_MME_GPRS_TIMER_STRUCT *timer); +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_ie(LIBLTE_MME_GPRS_TIMER_STRUCT* timer, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8** ie_ptr, LIBLTE_MME_GPRS_TIMER_STRUCT* timer); /********************************************************************* IE Name: GPRS Timer 2 @@ -977,10 +899,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8 * // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_2_ie(uint8 value, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8 **ie_ptr, - uint8 *value); +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_2_ie(uint8 value, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8** ie_ptr, uint8* value); /********************************************************************* IE Name: GPRS Timer 3 @@ -992,20 +912,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8 **ie_ptr, *********************************************************************/ // Defines #define LIBLTE_MME_GPRS_TIMER_3_UNIT_10_MINUTES 0x0 -#define LIBLTE_MME_GPRS_TIMER_3_UNIT_1_HOUR 0x1 -#define LIBLTE_MME_GPRS_TIMER_3_UNIT_10_HOURS 0x2 -#define LIBLTE_MME_GPRS_TIMER_3_DEACTIVATED 0x7 +#define LIBLTE_MME_GPRS_TIMER_3_UNIT_1_HOUR 0x1 +#define LIBLTE_MME_GPRS_TIMER_3_UNIT_10_HOURS 0x2 +#define LIBLTE_MME_GPRS_TIMER_3_DEACTIVATED 0x7 // Enums // Structs -typedef struct{ - uint8 unit; - uint8 value; -}LIBLTE_MME_GPRS_TIMER_3_STRUCT; +typedef struct { + uint8 unit; + uint8 value; +} LIBLTE_MME_GPRS_TIMER_3_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_3_ie(LIBLTE_MME_GPRS_TIMER_3_STRUCT *timer, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8 **ie_ptr, - LIBLTE_MME_GPRS_TIMER_3_STRUCT *timer); +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_3_ie(LIBLTE_MME_GPRS_TIMER_3_STRUCT* timer, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8** ie_ptr, LIBLTE_MME_GPRS_TIMER_3_STRUCT* timer); /********************************************************************* IE Name: Identity Type 2 @@ -1016,19 +934,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8 24.008 v10.2.0 Section 10.5.5.9 *********************************************************************/ // Defines -#define LIBLTE_MME_ID_TYPE_2_IMSI 0x1 -#define LIBLTE_MME_ID_TYPE_2_IMEI 0x2 +#define LIBLTE_MME_ID_TYPE_2_IMSI 0x1 +#define LIBLTE_MME_ID_TYPE_2_IMEI 0x2 #define LIBLTE_MME_ID_TYPE_2_IMEISV 0x3 -#define LIBLTE_MME_ID_TYPE_2_TMSI 0x4 +#define LIBLTE_MME_ID_TYPE_2_TMSI 0x4 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_type_2_ie(uint8 id_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *id_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_type_2_ie(uint8 id_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8** ie_ptr, uint8 bit_offset, uint8* id_type); /********************************************************************* IE Name: IMEISV Request @@ -1042,21 +956,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8 **ie_ptr, *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_IMEISV_NOT_REQUESTED = 0, - LIBLTE_MME_IMEISV_REQUESTED, - LIBLTE_MME_IMEISV_REQUEST_N_ITEMS, -}LIBLTE_MME_IMEISV_REQUEST_ENUM; +typedef enum { + LIBLTE_MME_IMEISV_NOT_REQUESTED = 0, + LIBLTE_MME_IMEISV_REQUESTED, + LIBLTE_MME_IMEISV_REQUEST_N_ITEMS, +} LIBLTE_MME_IMEISV_REQUEST_ENUM; static const char liblte_mme_imeisv_request_text[LIBLTE_MME_IMEISV_REQUEST_N_ITEMS][20] = {"Not Requested", "Requested"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_imeisv_request_ie(LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_imeisv_request_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_IMEISV_REQUEST_ENUM *imeisv_req); +LIBLTE_ERROR_ENUM +liblte_mme_pack_imeisv_request_ie(LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_imeisv_request_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_IMEISV_REQUEST_ENUM* imeisv_req); /********************************************************************* IE Name: KSI And Sequence Number @@ -1072,15 +984,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_imeisv_request_ie(uint8 // Defines // Enums // Structs -typedef struct{ - uint8 ksi; - uint8 seq_num; -}LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT; +typedef struct { + uint8 ksi; + uint8 seq_num; +} LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ksi_and_sequence_number_ie(LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT *ksi_and_seq_num, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ksi_and_sequence_number_ie(uint8 **ie_ptr, - LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT *ksi_and_seq_num); +LIBLTE_ERROR_ENUM liblte_mme_pack_ksi_and_sequence_number_ie(LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT* ksi_and_seq_num, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_ksi_and_sequence_number_ie(uint8** ie_ptr, + LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT* ksi_and_seq_num); /********************************************************************* IE Name: MS Network Capability @@ -1093,41 +1006,39 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ksi_and_sequence_number_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_SS_SCREENING_INDICATOR_PHASE_1 = 0, - LIBLTE_MME_SS_SCREENING_INDICATOR_PHASE_2, - LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_1, - LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_2, - LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS, -}LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM; -static const char liblte_mme_ss_screening_indicator_text[LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS][20] = {"Phase 1", - "Phase 2", - "Reserved 1", - "Reserved 2"}; -// Structs -typedef struct{ - LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM ss_screening; - bool gea[8]; - bool sm_cap_ded; - bool sm_cap_gprs; - bool ucs2; - bool solsa; - bool revision; - bool pfc; - bool lcsva; - bool ho_g2u_via_iu; - bool ho_g2e_via_s1; - bool emm_comb; - bool isr; - bool srvcc; - bool epc; - bool nf; -}LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ms_network_capability_ie(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT *ms_network_cap, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8 **ie_ptr, - LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT *ms_network_cap); +typedef enum { + LIBLTE_MME_SS_SCREENING_INDICATOR_PHASE_1 = 0, + LIBLTE_MME_SS_SCREENING_INDICATOR_PHASE_2, + LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_1, + LIBLTE_MME_SS_SCREENING_INDICATOR_RESERVED_2, + LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS, +} LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM; +static const char liblte_mme_ss_screening_indicator_text[LIBLTE_MME_SS_SCREENING_INDICATOR_N_ITEMS][20] = { + "Phase 1", "Phase 2", "Reserved 1", "Reserved 2"}; +// Structs +typedef struct { + LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM ss_screening; + bool gea[8]; + bool sm_cap_ded; + bool sm_cap_gprs; + bool ucs2; + bool solsa; + bool revision; + bool pfc; + bool lcsva; + bool ho_g2u_via_iu; + bool ho_g2e_via_s1; + bool emm_comb; + bool isr; + bool srvcc; + bool epc; + bool nf; +} LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_ms_network_capability_ie(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT* ms_network_cap, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8** ie_ptr, + LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT* ms_network_cap); /********************************************************************* IE Name: NAS Key Set Identifier @@ -1140,17 +1051,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8 // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag; - uint8 nas_ksi; -}LIBLTE_MME_NAS_KEY_SET_ID_STRUCT; +typedef struct { + LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM tsc_flag; + uint8 nas_ksi; +} LIBLTE_MME_NAS_KEY_SET_ID_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_key_set_id_ie(LIBLTE_MME_NAS_KEY_SET_ID_STRUCT *nas_ksi, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_key_set_id_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT *nas_ksi); +LIBLTE_ERROR_ENUM +liblte_mme_pack_nas_key_set_id_ie(LIBLTE_MME_NAS_KEY_SET_ID_STRUCT* nas_ksi, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_nas_key_set_id_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_NAS_KEY_SET_ID_STRUCT* nas_ksi); /********************************************************************* IE Name: NAS Message Container @@ -1164,10 +1073,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_key_set_id_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *nas_msg, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *nas_msg); +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* nas_msg, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* nas_msg); /********************************************************************* IE Name: NAS Security Algorithms @@ -1180,15 +1087,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8 // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM type_of_eea; - LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM type_of_eia; -}LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT; +typedef struct { + LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM type_of_eea; + LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM type_of_eia; +} LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_algorithms_ie(LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT *nas_sec_algs, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8 **ie_ptr, - LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT *nas_sec_algs); +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_algorithms_ie(LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT* nas_sec_algs, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8** ie_ptr, + LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT* nas_sec_algs); /********************************************************************* IE Name: Network Name @@ -1200,23 +1107,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_ADD_CI_DONT_ADD = 0, - LIBLTE_MME_ADD_CI_ADD, - LIBLTE_MME_ADD_CI_N_ITEMS, -}LIBLTE_MME_ADD_CI_ENUM; -static const char liblte_mme_add_ci_text[LIBLTE_MME_ADD_CI_N_ITEMS][20] = {"Don't add", - "Add"}; +typedef enum { + LIBLTE_MME_ADD_CI_DONT_ADD = 0, + LIBLTE_MME_ADD_CI_ADD, + LIBLTE_MME_ADD_CI_N_ITEMS, +} LIBLTE_MME_ADD_CI_ENUM; +static const char liblte_mme_add_ci_text[LIBLTE_MME_ADD_CI_N_ITEMS][20] = {"Don't add", "Add"}; // Structs -typedef struct{ - char name[LIBLTE_STRING_LEN]; - LIBLTE_MME_ADD_CI_ENUM add_ci; -}LIBLTE_MME_NETWORK_NAME_STRUCT; +typedef struct { + char name[LIBLTE_STRING_LEN]; + LIBLTE_MME_ADD_CI_ENUM add_ci; +} LIBLTE_MME_NETWORK_NAME_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_network_name_ie(LIBLTE_MME_NETWORK_NAME_STRUCT *net_name, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8 **ie_ptr, - LIBLTE_MME_NETWORK_NAME_STRUCT *net_name); +LIBLTE_ERROR_ENUM liblte_mme_pack_network_name_ie(LIBLTE_MME_NETWORK_NAME_STRUCT* net_name, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8** ie_ptr, LIBLTE_MME_NETWORK_NAME_STRUCT* net_name); /********************************************************************* IE Name: Nonce @@ -1230,10 +1134,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_nonce_ie(uint32 nonce, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8 **ie_ptr, - uint32 *nonce); +LIBLTE_ERROR_ENUM liblte_mme_pack_nonce_ie(uint32 nonce, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8** ie_ptr, uint32* nonce); /********************************************************************* IE Name: Paging Identity @@ -1249,10 +1151,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8 **ie_ptr, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_paging_identity_ie(uint8 paging_id, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8 **ie_ptr, - uint8 *paging_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_paging_identity_ie(uint8 paging_id, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8** ie_ptr, uint8* paging_id); /********************************************************************* IE Name: P-TMSI Signature @@ -1266,10 +1166,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8 **ie_ptr, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_p_tmsi_signature_ie(uint32 p_tmsi_signature, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8 **ie_ptr, - uint32 *p_tmsi_signature); +LIBLTE_ERROR_ENUM liblte_mme_pack_p_tmsi_signature_ie(uint32 p_tmsi_signature, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8** ie_ptr, uint32* p_tmsi_signature); /********************************************************************* IE Name: Service Type @@ -1280,19 +1178,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.27 *********************************************************************/ // Defines -#define LIBLTE_MME_SERVICE_TYPE_MO_CSFB 0x0 -#define LIBLTE_MME_SERVICE_TYPE_MT_CSFB 0x1 +#define LIBLTE_MME_SERVICE_TYPE_MO_CSFB 0x0 +#define LIBLTE_MME_SERVICE_TYPE_MT_CSFB 0x1 #define LIBLTE_MME_SERVICE_TYPE_MO_CSFB_EMERGENCY 0x2 -#define LIBLTE_MME_SERVICE_TYPE_PACKET_SERVICES 0x8 +#define LIBLTE_MME_SERVICE_TYPE_PACKET_SERVICES 0x8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_service_type_ie(uint8 value, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *value); +LIBLTE_ERROR_ENUM liblte_mme_pack_service_type_ie(uint8 value, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* value); /********************************************************************* IE Name: Short MAC @@ -1305,10 +1199,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8 **ie_ptr, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_short_mac_ie(uint16 short_mac, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8 **ie_ptr, - uint16 *short_mac); +LIBLTE_ERROR_ENUM liblte_mme_pack_short_mac_ie(uint16 short_mac, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8** ie_ptr, uint16* short_mac); /********************************************************************* IE Name: Time Zone @@ -1323,10 +1215,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8 **ie_ptr, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_ie(uint8 tz, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8 **ie_ptr, - uint8 *tz); +LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_ie(uint8 tz, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8** ie_ptr, uint8* tz); /********************************************************************* IE Name: Time Zone And Time @@ -1342,20 +1232,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8 **ie_ptr, // Defines // Enums // Structs -typedef struct{ - uint16 year; - uint8 month; - uint8 day; - uint8 hour; - uint8 minute; - uint8 second; - uint8 tz; -}LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT; +typedef struct { + uint16 year; + uint8 month; + uint8 day; + uint8 hour; + uint8 minute; + uint8 second; + uint8 tz; +} LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT *ttz, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8 **ie_ptr, - LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT *ttz); +LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT* ttz, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8** ie_ptr, LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT* ttz); /********************************************************************* IE Name: TMSI Status @@ -1368,21 +1256,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_TMSI_STATUS_NO_VALID_TMSI = 0, - LIBLTE_MME_TMSI_STATUS_VALID_TMSI, - LIBLTE_MME_TMSI_STATUS_N_ITEMS, -}LIBLTE_MME_TMSI_STATUS_ENUM; -static const char liblte_mme_tmsi_status_text[LIBLTE_MME_TMSI_STATUS_N_ITEMS][20] = {"No valid TMSI", - "Valid TMSI"}; +typedef enum { + LIBLTE_MME_TMSI_STATUS_NO_VALID_TMSI = 0, + LIBLTE_MME_TMSI_STATUS_VALID_TMSI, + LIBLTE_MME_TMSI_STATUS_N_ITEMS, +} LIBLTE_MME_TMSI_STATUS_ENUM; +static const char liblte_mme_tmsi_status_text[LIBLTE_MME_TMSI_STATUS_N_ITEMS][20] = {"No valid TMSI", "Valid TMSI"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tmsi_status_ie(LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tmsi_status_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_TMSI_STATUS_ENUM *tmsi_status); +LIBLTE_ERROR_ENUM +liblte_mme_pack_tmsi_status_ie(LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tmsi_status_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_TMSI_STATUS_ENUM* tmsi_status); /********************************************************************* IE Name: Tracking Area Identity @@ -1395,16 +1280,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tmsi_status_ie(uint8 * // Defines // Enums // Structs -typedef struct{ - uint16 mcc; - uint16 mnc; - uint16 tac; -}LIBLTE_MME_TRACKING_AREA_ID_STRUCT; +typedef struct { + uint16 mcc; + uint16 mnc; + uint16 tac; +} LIBLTE_MME_TRACKING_AREA_ID_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_id_ie(LIBLTE_MME_TRACKING_AREA_ID_STRUCT *tai, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8 **ie_ptr, - LIBLTE_MME_TRACKING_AREA_ID_STRUCT *tai); +LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_id_ie(LIBLTE_MME_TRACKING_AREA_ID_STRUCT* tai, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8** ie_ptr, LIBLTE_MME_TRACKING_AREA_ID_STRUCT* tai); /********************************************************************* IE Name: Tracking Area Identity List @@ -1417,25 +1300,26 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8 // Defines #define LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_MAX_SIZE 16 // Enums -typedef enum{ - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS = 0, - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_CONSECUTIVE_TACS, - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS, - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS, -}LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM; -static const char liblte_mme_tracking_area_identity_list_type_text[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS][100] = {"One PLMN, Non-Consecutive TACs", - "One PLMN, Consecutive TACs", - "Different PLMNs"}; +typedef enum { + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS = 0, + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_CONSECUTIVE_TACS, + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS, + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS, +} LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM; +static const char + liblte_mme_tracking_area_identity_list_type_text[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_N_ITEMS][100] = { + "One PLMN, Non-Consecutive TACs", "One PLMN, Consecutive TACs", "Different PLMNs"}; // Structs -typedef struct{ - LIBLTE_MME_TRACKING_AREA_ID_STRUCT tai[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_MAX_SIZE]; - uint32 N_tais; -}LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT; +typedef struct { + LIBLTE_MME_TRACKING_AREA_ID_STRUCT tai[LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_MAX_SIZE]; + uint32 N_tais; +} LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_identity_list_ie(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT *tai_list, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_identity_list_ie(uint8 **ie_ptr, - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT *tai_list); +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_identity_list_ie(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT* tai_list, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_identity_list_ie(uint8** ie_ptr, + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT* tai_list); /********************************************************************* IE Name: UE Network Capability @@ -1449,29 +1333,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_identity_list_ie(uint8 // Defines // Enums // Structs -typedef struct{ - bool eea[8]; - bool eia[8]; - bool uea[8]; - bool uea_present; - bool ucs2; - bool ucs2_present; - bool uia[8]; - bool uia_present; - bool lpp; - bool lpp_present; - bool lcs; - bool lcs_present; - bool onexsrvcc; - bool onexsrvcc_present; - bool nf; - bool nf_present; -}LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT; +typedef struct { + bool eea[8]; + bool eia[8]; + bool uea[8]; + bool uea_present; + bool ucs2; + bool ucs2_present; + bool uia[8]; + bool uia_present; + bool lpp; + bool lpp_present; + bool lcs; + bool lcs_present; + bool onexsrvcc; + bool onexsrvcc_present; + bool nf; + bool nf_present; +} LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT *ue_network_cap, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8 **ie_ptr, - LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT *ue_network_cap); +LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT* ue_network_cap, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8** ie_ptr, + LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT* ue_network_cap); /********************************************************************* IE Name: UE Radio Capability Update Needed @@ -1483,16 +1367,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8 *********************************************************************/ // Defines #define LIBLTE_MME_URC_UPDATE_NOT_NEEDED 0 -#define LIBLTE_MME_URC_UPDATE_NEEDED 1 +#define LIBLTE_MME_URC_UPDATE_NEEDED 1 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_radio_capability_update_needed_ie(uint8 urc_update, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *urc_update); +LIBLTE_ERROR_ENUM +liblte_mme_pack_ue_radio_capability_update_needed_ie(uint8 urc_update, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8** ie_ptr, uint8 bit_offset, uint8* urc_update); /********************************************************************* IE Name: UE Security Capability @@ -1505,21 +1387,21 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8 * // Defines // Enums // Structs -typedef struct{ - bool eea[8]; - bool eia[8]; - bool uea[8]; - bool uea_present; - bool uia[8]; - bool uia_present; - bool gea[8]; - bool gea_present; -}LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT; +typedef struct { + bool eea[8]; + bool eia[8]; + bool uea[8]; + bool uea_present; + bool uia[8]; + bool uia_present; + bool gea[8]; + bool gea_present; +} LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_security_capabilities_ie(LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT *ue_sec_cap, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8 **ie_ptr, - LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT *ue_sec_cap); +LIBLTE_ERROR_ENUM liblte_mme_pack_ue_security_capabilities_ie(LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT* ue_sec_cap, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8** ie_ptr, + LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT* ue_sec_cap); /********************************************************************* IE Name: Emergency Number List @@ -1532,41 +1414,42 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8 24.008 v10.2.0 Section 10.5.3.13 *********************************************************************/ // Defines -#define LIBLTE_MME_EMERGENCY_NUMBER_LIST_MAX_SIZE 12 +#define LIBLTE_MME_EMERGENCY_NUMBER_LIST_MAX_SIZE 12 #define LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS 92 // Enums -typedef enum{ - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_POLICE = 0, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_AMBULANCE, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_FIRE, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MANUALLY_INITIATED_ECALL, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_AUTOMATICALLY_INITIATED_ECALL, - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_N_ITEMS, -}LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM; -static const char liblte_mme_emergency_service_category_text[LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_N_ITEMS][100] = {"Police", - "Ambulance", - "Fire", - "Marine Guard", - "Mountain Rescue", - "Manually Initiated ECall", - "Automatically Initiated ECall"}; -// Structs -typedef struct{ - LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM emerg_service_cat; - uint32 N_emerg_num_digits; - uint8 emerg_num[LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS]; -}LIBLTE_MME_EMERGENCY_NUMBER_STRUCT; -typedef struct{ - LIBLTE_MME_EMERGENCY_NUMBER_STRUCT emerg_num[LIBLTE_MME_EMERGENCY_NUMBER_LIST_MAX_SIZE]; - uint32 N_emerg_nums; -}LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_emergency_number_list_ie(LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT *emerg_num_list, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8 **ie_ptr, - LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT *emerg_num_list); +typedef enum { + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_POLICE = 0, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_AMBULANCE, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_FIRE, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_MANUALLY_INITIATED_ECALL, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_AUTOMATICALLY_INITIATED_ECALL, + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_N_ITEMS, +} LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM; +static const char liblte_mme_emergency_service_category_text[LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_N_ITEMS][100] = { + "Police", + "Ambulance", + "Fire", + "Marine Guard", + "Mountain Rescue", + "Manually Initiated ECall", + "Automatically Initiated ECall"}; +// Structs +typedef struct { + LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM emerg_service_cat; + uint32 N_emerg_num_digits; + uint8 emerg_num[LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS]; +} LIBLTE_MME_EMERGENCY_NUMBER_STRUCT; +typedef struct { + LIBLTE_MME_EMERGENCY_NUMBER_STRUCT emerg_num[LIBLTE_MME_EMERGENCY_NUMBER_LIST_MAX_SIZE]; + uint32 N_emerg_nums; +} LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_emergency_number_list_ie(LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT* emerg_num_list, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8** ie_ptr, + LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT* emerg_num_list); /********************************************************************* IE Name: CLI @@ -1595,10 +1478,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_ss_code_ie(uint8 code, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8 **ie_ptr, - uint8 *code); +LIBLTE_ERROR_ENUM liblte_mme_pack_ss_code_ie(uint8 code, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8** ie_ptr, uint8* code); /********************************************************************* IE Name: LCS Indicator @@ -1614,10 +1495,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8 **ie_ptr, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_lcs_indicator_ie(uint8 lcs_ind, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8 **ie_ptr, - uint8 *lcs_ind); +LIBLTE_ERROR_ENUM liblte_mme_pack_lcs_indicator_ie(uint8 lcs_ind, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8** ie_ptr, uint8* lcs_ind); /********************************************************************* IE Name: LCS Client Identity @@ -1642,15 +1521,13 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.42 *********************************************************************/ // Defines -#define LIBLTE_MME_GENERIC_MESSAGE_CONTAINER_TYPE_LPP 0x01 +#define LIBLTE_MME_GENERIC_MESSAGE_CONTAINER_TYPE_LPP 0x01 #define LIBLTE_MME_GENERIC_MESSAGE_CONTAINER_TYPE_LOCATION_SERVICES 0x02 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_type_ie(uint8 msg_cont_type, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8 **ie_ptr, - uint8 *msg_cont_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_type_ie(uint8 msg_cont_type, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8** ie_ptr, uint8* msg_cont_type); /********************************************************************* IE Name: Generic Message Container @@ -1664,10 +1541,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8 **ie // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *msg); +LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* msg, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* msg); /********************************************************************* IE Name: Voice Domain Preference and UE's Usage Setting @@ -1680,34 +1555,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8 *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_UE_USAGE_SETTING_VOICE_CENTRIC = 0, - LIBLTE_MME_UE_USAGE_SETTING_DATA_CENTRIC, - LIBLTE_MME_UE_USAGE_SETTING_N_ITEMS, -}LIBLTE_MME_UE_USAGE_SETTING_ENUM; +typedef enum { + LIBLTE_MME_UE_USAGE_SETTING_VOICE_CENTRIC = 0, + LIBLTE_MME_UE_USAGE_SETTING_DATA_CENTRIC, + LIBLTE_MME_UE_USAGE_SETTING_N_ITEMS, +} LIBLTE_MME_UE_USAGE_SETTING_ENUM; static const char liblte_mme_ue_usage_setting_text[LIBLTE_MME_UE_USAGE_SETTING_N_ITEMS][20] = {"Voice Centric", "Data Centric"}; -typedef enum{ - LIBLTE_MME_VOICE_DOMAIN_PREF_CS_ONLY = 0, - LIBLTE_MME_VOICE_DOMAIN_PREF_PS_ONLY, - LIBLTE_MME_VOICE_DOMAIN_PREF_CS_PREFFERED, - LIBLTE_MME_VOICE_DOMAIN_PREF_PS_PREFFERED, - LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS, -}LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM; -static const char liblte_mme_voice_domain_pref_text[LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS][20] = {"CS Only", - "PS Only", - "CS Preffered", - "PS Preffered"}; -// Structs -typedef struct{ - LIBLTE_MME_UE_USAGE_SETTING_ENUM ue_usage_setting; - LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM voice_domain_pref; -}LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie(LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT *voice_domain_pref_and_ue_usage_setting, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(uint8 **ie_ptr, - LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT *voice_domain_pref_and_ue_usage_setting); +typedef enum { + LIBLTE_MME_VOICE_DOMAIN_PREF_CS_ONLY = 0, + LIBLTE_MME_VOICE_DOMAIN_PREF_PS_ONLY, + LIBLTE_MME_VOICE_DOMAIN_PREF_CS_PREFFERED, + LIBLTE_MME_VOICE_DOMAIN_PREF_PS_PREFFERED, + LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS, +} LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM; +static const char liblte_mme_voice_domain_pref_text[LIBLTE_MME_VOICE_DOMAIN_PREF_N_ITEMS][20] = { + "CS Only", "PS Only", "CS Preffered", "PS Preffered"}; +// Structs +typedef struct { + LIBLTE_MME_UE_USAGE_SETTING_ENUM ue_usage_setting; + LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM voice_domain_pref; +} LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie( + LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie( + uint8** ie_ptr, LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting); /********************************************************************* IE Name: GUTI Type @@ -1721,21 +1594,17 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(ui *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_GUTI_TYPE_NATIVE = 0, - LIBLTE_MME_GUTI_TYPE_MAPPED, - LIBLTE_MME_GUTI_TYPE_N_ITEMS, -}LIBLTE_MME_GUTI_TYPE_ENUM; -static const char liblte_mme_guti_type_text[LIBLTE_MME_GUTI_TYPE_N_ITEMS][20] = {"Native", - "Mapped"}; +typedef enum { + LIBLTE_MME_GUTI_TYPE_NATIVE = 0, + LIBLTE_MME_GUTI_TYPE_MAPPED, + LIBLTE_MME_GUTI_TYPE_N_ITEMS, +} LIBLTE_MME_GUTI_TYPE_ENUM; +static const char liblte_mme_guti_type_text[LIBLTE_MME_GUTI_TYPE_N_ITEMS][20] = {"Native", "Mapped"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_type_ie(LIBLTE_MME_GUTI_TYPE_ENUM guti_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_GUTI_TYPE_ENUM *guti_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_guti_type_ie(LIBLTE_MME_GUTI_TYPE_ENUM guti_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_guti_type_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_GUTI_TYPE_ENUM* guti_type); /********************************************************************* IE Name: Access Point Name @@ -1751,14 +1620,12 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_type_ie(uint8 **ie_ // Defines // Enums // Structs -typedef struct{ - char apn[LIBLTE_STRING_LEN]; -}LIBLTE_MME_ACCESS_POINT_NAME_STRUCT; +typedef struct { + char apn[LIBLTE_STRING_LEN]; +} LIBLTE_MME_ACCESS_POINT_NAME_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_access_point_name_ie(LIBLTE_MME_ACCESS_POINT_NAME_STRUCT *apn, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8 **ie_ptr, - LIBLTE_MME_ACCESS_POINT_NAME_STRUCT *apn); +LIBLTE_ERROR_ENUM liblte_mme_pack_access_point_name_ie(LIBLTE_MME_ACCESS_POINT_NAME_STRUCT* apn, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8** ie_ptr, LIBLTE_MME_ACCESS_POINT_NAME_STRUCT* apn); /********************************************************************* IE Name: APN Aggregate Maximum Bit Rate @@ -1772,21 +1639,23 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8 // Defines // Enums // Structs -typedef struct{ - uint8 apn_ambr_dl; - uint8 apn_ambr_ul; - uint8 apn_ambr_dl_ext; - uint8 apn_ambr_ul_ext; - uint8 apn_ambr_dl_ext2; - uint8 apn_ambr_ul_ext2; - bool ext_present; - bool ext2_present; -}LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT; +typedef struct { + uint8 apn_ambr_dl; + uint8 apn_ambr_ul; + uint8 apn_ambr_dl_ext; + uint8 apn_ambr_ul_ext; + uint8 apn_ambr_dl_ext2; + uint8 apn_ambr_ul_ext2; + bool ext_present; + bool ext2_present; +} LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT *apn_ambr, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8 **ie_ptr, - LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT *apn_ambr); +LIBLTE_ERROR_ENUM +liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT* apn_ambr, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8** ie_ptr, + LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT* apn_ambr); /********************************************************************* IE Name: Connectivity Type @@ -1799,16 +1668,12 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8 *********************************************************************/ // Defines #define LIBLTE_MME_CONNECTIVITY_TYPE_NOT_INDICATED 0x0 -#define LIBLTE_MME_CONNECTIVITY_TYPE_LIPA_PDN 0x1 +#define LIBLTE_MME_CONNECTIVITY_TYPE_LIPA_PDN 0x1 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_connectivity_type_ie(uint8 con_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *con_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_connectivity_type_ie(uint8 con_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* con_type); /********************************************************************* IE Name: EPS Quality Of Service @@ -1821,24 +1686,24 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8 **ie_ptr, // Defines // Enums // Structs -typedef struct{ - uint8 qci; - uint8 mbr_ul; - uint8 mbr_dl; - uint8 gbr_ul; - uint8 gbr_dl; - uint8 mbr_ul_ext; - uint8 mbr_dl_ext; - uint8 gbr_ul_ext; - uint8 gbr_dl_ext; - bool br_present; - bool br_ext_present; -}LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT; +typedef struct { + uint8 qci; + uint8 mbr_ul; + uint8 mbr_dl; + uint8 gbr_ul; + uint8 gbr_dl; + uint8 mbr_ul_ext; + uint8 mbr_dl_ext; + uint8 gbr_ul_ext; + uint8 gbr_dl_ext; + bool br_present; + bool br_ext_present; +} LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_quality_of_service_ie(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT *qos, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT *qos); +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_quality_of_service_ie(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT* qos, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8** ie_ptr, + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT* qos); /********************************************************************* IE Name: ESM Cause @@ -1849,55 +1714,53 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.4 *********************************************************************/ // Defines -#define LIBLTE_MME_ESM_CAUSE_OPERATOR_DETERMINED_BARRING 0x08 -#define LIBLTE_MME_ESM_CAUSE_INSUFFICIENT_RESOURCES 0x1A -#define LIBLTE_MME_ESM_CAUSE_UNKNOWN_OR_MISSING_APN 0x1B -#define LIBLTE_MME_ESM_CAUSE_UNKNOWN_PDN_TYPE 0x1C -#define LIBLTE_MME_ESM_CAUSE_USER_AUTHENTICATION_FAILED 0x1D -#define LIBLTE_MME_ESM_CAUSE_REQUEST_REJECTED_BY_SERVING_OR_PDN_GW 0x1E -#define LIBLTE_MME_ESM_CAUSE_REQUEST_REJECTED_UNSPECIFIED 0x1F -#define LIBLTE_MME_ESM_CAUSE_SERVICE_OPTION_NOT_SUPPORTED 0x20 -#define LIBLTE_MME_ESM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED 0x21 -#define LIBLTE_MME_ESM_CAUSE_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER 0x22 -#define LIBLTE_MME_ESM_CAUSE_PTI_ALREADY_IN_USE 0x23 -#define LIBLTE_MME_ESM_CAUSE_REGULAR_DEACTIVATION 0x24 -#define LIBLTE_MME_ESM_CAUSE_EPS_QOS_NOT_ACCEPTED 0x25 -#define LIBLTE_MME_ESM_CAUSE_NETWORK_FAILURE 0x26 -#define LIBLTE_MME_ESM_CAUSE_REACTIVATION_REQUESTED 0x27 -#define LIBLTE_MME_ESM_CAUSE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION 0x29 -#define LIBLTE_MME_ESM_CAUSE_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION 0x2A -#define LIBLTE_MME_ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY 0x2B -#define LIBLTE_MME_ESM_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTERS 0x2C -#define LIBLTE_MME_ESM_CAUSE_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS 0x2D -#define LIBLTE_MME_ESM_CAUSE_UNUSED 0x2E -#define LIBLTE_MME_ESM_CAUSE_PTI_MISMATCH 0x2F -#define LIBLTE_MME_ESM_CAUSE_LAST_PDN_DISCONNECTION_NOT_ALLOWED 0x31 -#define LIBLTE_MME_ESM_CAUSE_PDN_TYPE_IPV4_ONLY_ALLOWED 0x32 -#define LIBLTE_MME_ESM_CAUSE_PDN_TYPE_IPV6_ONLY_ALLOWED 0x33 -#define LIBLTE_MME_ESM_CAUSE_SINGLE_ADDRESS_BEARERS_ONLY_ALLOWED 0x34 -#define LIBLTE_MME_ESM_CAUSE_ESM_INFORMATION_NOT_RECEIVED 0x35 -#define LIBLTE_MME_ESM_CAUSE_PDN_CONNECTION_DOES_NOT_EXIST 0x36 -#define LIBLTE_MME_ESM_CAUSE_MULTIPLE_PDN_CONNECTIONS_FOR_A_GIVEN_APN_NOT_ALLOWED 0x37 -#define LIBLTE_MME_ESM_CAUSE_COLLISION_WITH_NETWORK_INITIATED_REQUEST 0x38 -#define LIBLTE_MME_ESM_CAUSE_UNSUPPORTED_QCI_VALUE 0x3B -#define LIBLTE_MME_ESM_CAUSE_BEARER_HANDLING_NOT_SUPPORTED 0x3C -#define LIBLTE_MME_ESM_CAUSE_INVALID_PTI_VALUE 0x51 -#define LIBLTE_MME_ESM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 0x5F -#define LIBLTE_MME_ESM_CAUSE_INVALID_MANDATORY_INFORMATION 0x60 -#define LIBLTE_MME_ESM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x61 -#define LIBLTE_MME_ESM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x62 -#define LIBLTE_MME_ESM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x63 -#define LIBLTE_MME_ESM_CAUSE_CONDITIONAL_IE_ERROR 0x64 -#define LIBLTE_MME_ESM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x65 -#define LIBLTE_MME_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 0x6F +#define LIBLTE_MME_ESM_CAUSE_OPERATOR_DETERMINED_BARRING 0x08 +#define LIBLTE_MME_ESM_CAUSE_INSUFFICIENT_RESOURCES 0x1A +#define LIBLTE_MME_ESM_CAUSE_UNKNOWN_OR_MISSING_APN 0x1B +#define LIBLTE_MME_ESM_CAUSE_UNKNOWN_PDN_TYPE 0x1C +#define LIBLTE_MME_ESM_CAUSE_USER_AUTHENTICATION_FAILED 0x1D +#define LIBLTE_MME_ESM_CAUSE_REQUEST_REJECTED_BY_SERVING_OR_PDN_GW 0x1E +#define LIBLTE_MME_ESM_CAUSE_REQUEST_REJECTED_UNSPECIFIED 0x1F +#define LIBLTE_MME_ESM_CAUSE_SERVICE_OPTION_NOT_SUPPORTED 0x20 +#define LIBLTE_MME_ESM_CAUSE_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED 0x21 +#define LIBLTE_MME_ESM_CAUSE_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER 0x22 +#define LIBLTE_MME_ESM_CAUSE_PTI_ALREADY_IN_USE 0x23 +#define LIBLTE_MME_ESM_CAUSE_REGULAR_DEACTIVATION 0x24 +#define LIBLTE_MME_ESM_CAUSE_EPS_QOS_NOT_ACCEPTED 0x25 +#define LIBLTE_MME_ESM_CAUSE_NETWORK_FAILURE 0x26 +#define LIBLTE_MME_ESM_CAUSE_REACTIVATION_REQUESTED 0x27 +#define LIBLTE_MME_ESM_CAUSE_SEMANTIC_ERROR_IN_THE_TFT_OPERATION 0x29 +#define LIBLTE_MME_ESM_CAUSE_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION 0x2A +#define LIBLTE_MME_ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY 0x2B +#define LIBLTE_MME_ESM_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTERS 0x2C +#define LIBLTE_MME_ESM_CAUSE_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS 0x2D +#define LIBLTE_MME_ESM_CAUSE_UNUSED 0x2E +#define LIBLTE_MME_ESM_CAUSE_PTI_MISMATCH 0x2F +#define LIBLTE_MME_ESM_CAUSE_LAST_PDN_DISCONNECTION_NOT_ALLOWED 0x31 +#define LIBLTE_MME_ESM_CAUSE_PDN_TYPE_IPV4_ONLY_ALLOWED 0x32 +#define LIBLTE_MME_ESM_CAUSE_PDN_TYPE_IPV6_ONLY_ALLOWED 0x33 +#define LIBLTE_MME_ESM_CAUSE_SINGLE_ADDRESS_BEARERS_ONLY_ALLOWED 0x34 +#define LIBLTE_MME_ESM_CAUSE_ESM_INFORMATION_NOT_RECEIVED 0x35 +#define LIBLTE_MME_ESM_CAUSE_PDN_CONNECTION_DOES_NOT_EXIST 0x36 +#define LIBLTE_MME_ESM_CAUSE_MULTIPLE_PDN_CONNECTIONS_FOR_A_GIVEN_APN_NOT_ALLOWED 0x37 +#define LIBLTE_MME_ESM_CAUSE_COLLISION_WITH_NETWORK_INITIATED_REQUEST 0x38 +#define LIBLTE_MME_ESM_CAUSE_UNSUPPORTED_QCI_VALUE 0x3B +#define LIBLTE_MME_ESM_CAUSE_BEARER_HANDLING_NOT_SUPPORTED 0x3C +#define LIBLTE_MME_ESM_CAUSE_INVALID_PTI_VALUE 0x51 +#define LIBLTE_MME_ESM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 0x5F +#define LIBLTE_MME_ESM_CAUSE_INVALID_MANDATORY_INFORMATION 0x60 +#define LIBLTE_MME_ESM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x61 +#define LIBLTE_MME_ESM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x62 +#define LIBLTE_MME_ESM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 0x63 +#define LIBLTE_MME_ESM_CAUSE_CONDITIONAL_IE_ERROR 0x64 +#define LIBLTE_MME_ESM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 0x65 +#define LIBLTE_MME_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 0x6F #define LIBLTE_MME_ESM_CAUSE_APN_RESTRICTION_VALUE_INCOMPATIBLE_WITH_ACTIVE_EPS_BEARER_CONTEXT 0x70 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_cause_ie(uint8 cause, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8 **ie_ptr, - uint8 *cause); +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_cause_ie(uint8 cause, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8** ie_ptr, uint8* cause); /********************************************************************* IE Name: ESM Information Transfer Flag @@ -1910,21 +1773,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8 **ie_ptr, *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_NOT_REQUIRED = 0, - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_REQUIRED, - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS, -}LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM; -static const char liblte_mme_esm_info_transfer_flag_text[LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS][20] = {"Not Required", - "Required"}; +typedef enum { + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_NOT_REQUIRED = 0, + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_REQUIRED, + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS, +} LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM; +static const char liblte_mme_esm_info_transfer_flag_text[LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_N_ITEMS][20] = { + "Not Required", "Required"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_info_transfer_flag_ie(LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM *esm_info_transfer_flag); +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_info_transfer_flag_ie( + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie( + uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM* esm_info_transfer_flag); /********************************************************************* IE Name: Linked EPS Bearer Identity @@ -1938,11 +1799,11 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.6 *********************************************************************/ // Defines -#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_5 0x5 -#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_6 0x6 -#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_7 0x7 -#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_8 0x8 -#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_9 0x9 +#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_5 0x5 +#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_6 0x6 +#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_7 0x7 +#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_8 0x8 +#define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_9 0x9 #define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_10 0xA #define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_11 0xB #define LIBLTE_MME_LINKED_EPS_BEARER_IDENTITY_12 0xC @@ -1952,12 +1813,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_linked_eps_bearer_identity_ie(uint8 bearer_id, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *bearer_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_linked_eps_bearer_identity_ie(uint8 bearer_id, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8** ie_ptr, uint8 bit_offset, uint8* bearer_id); /********************************************************************* IE Name: LLC Service Access Point Identifier @@ -1970,17 +1827,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8 **ie_ptr *********************************************************************/ // Defines #define LIBLTE_MME_LLC_SAPI_NOT_ASSIGNED 0x0 -#define LIBLTE_MME_LLC_SAPI_3 0x3 -#define LIBLTE_MME_LLC_SAPI_5 0x5 -#define LIBLTE_MME_LLC_SAPI_9 0x9 -#define LIBLTE_MME_LLC_SAPI_11 0xB +#define LIBLTE_MME_LLC_SAPI_3 0x3 +#define LIBLTE_MME_LLC_SAPI_5 0x5 +#define LIBLTE_MME_LLC_SAPI_9 0x9 +#define LIBLTE_MME_LLC_SAPI_11 0xB // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_llc_service_access_point_identifier_ie(uint8 llc_sapi, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8 **ie_ptr, - uint8 *llc_sapi); +LIBLTE_ERROR_ENUM liblte_mme_pack_llc_service_access_point_identifier_ie(uint8 llc_sapi, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8** ie_ptr, uint8* llc_sapi); /********************************************************************* IE Name: Notification Indicator @@ -1996,10 +1851,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_notification_indicator_ie(uint8 notification_ind, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8 **ie_ptr, - uint8 *notification_ind); +LIBLTE_ERROR_ENUM liblte_mme_pack_notification_indicator_ie(uint8 notification_ind, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8** ie_ptr, uint8* notification_ind); /********************************************************************* IE Name: Packet Flow Identifier @@ -2012,16 +1865,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8 **ie_ptr, *********************************************************************/ // Defines #define LIBLTE_MME_PACKET_FLOW_ID_BEST_EFFORT 0x00 -#define LIBLTE_MME_PACKET_FLOW_ID_SIGNALLING 0x01 -#define LIBLTE_MME_PACKET_FLOW_ID_SMS 0x02 -#define LIBLTE_MME_PACKET_FLOW_ID_TOM8 0x03 +#define LIBLTE_MME_PACKET_FLOW_ID_SIGNALLING 0x01 +#define LIBLTE_MME_PACKET_FLOW_ID_SMS 0x02 +#define LIBLTE_MME_PACKET_FLOW_ID_TOM8 0x03 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_packet_flow_identifier_ie(uint8 packet_flow_id, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8 **ie_ptr, - uint8 *packet_flow_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_packet_flow_identifier_ie(uint8 packet_flow_id, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8** ie_ptr, uint8* packet_flow_id); /********************************************************************* IE Name: PDN Address @@ -2034,20 +1885,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.9 *********************************************************************/ // Defines -#define LIBLTE_MME_PDN_TYPE_IPV4 0x1 -#define LIBLTE_MME_PDN_TYPE_IPV6 0x2 +#define LIBLTE_MME_PDN_TYPE_IPV4 0x1 +#define LIBLTE_MME_PDN_TYPE_IPV6 0x2 #define LIBLTE_MME_PDN_TYPE_IPV4V6 0x3 // Enums // Structs -typedef struct{ - uint8 pdn_type; - uint8 addr[12]; -}LIBLTE_MME_PDN_ADDRESS_STRUCT; +typedef struct { + uint8 pdn_type; + uint8 addr[12]; +} LIBLTE_MME_PDN_ADDRESS_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_address_ie(LIBLTE_MME_PDN_ADDRESS_STRUCT *pdn_addr, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8 **ie_ptr, - LIBLTE_MME_PDN_ADDRESS_STRUCT *pdn_addr); +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_address_ie(LIBLTE_MME_PDN_ADDRESS_STRUCT* pdn_addr, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8** ie_ptr, LIBLTE_MME_PDN_ADDRESS_STRUCT* pdn_addr); /********************************************************************* IE Name: PDN Type @@ -2058,19 +1907,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.10 *********************************************************************/ // Defines -#define LIBLTE_MME_PDN_TYPE_IPV4 0x1 -#define LIBLTE_MME_PDN_TYPE_IPV6 0x2 +#define LIBLTE_MME_PDN_TYPE_IPV4 0x1 +#define LIBLTE_MME_PDN_TYPE_IPV6 0x2 #define LIBLTE_MME_PDN_TYPE_IPV4V6 0x3 #define LIBLTE_MME_PDN_TYPE_UNUSED 0x4 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_type_ie(uint8 pdn_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *pdn_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_type_ie(uint8 pdn_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* pdn_type); /********************************************************************* IE Name: Protocol Configuration Options @@ -2086,55 +1931,57 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8 **ie_ptr, 24.008 v10.2.0 Section 10.5.6.3 *********************************************************************/ // Defines -#define LIBLTE_MME_MAX_PROTOCOL_CONFIG_OPTIONS 83 -#define LIBLTE_MME_MAX_PROTOCOL_CONFIG_LEN 248 -#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_LCP 0xC021 -#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_PAP 0xC023 -#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_CHAP 0xC223 -#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_IPCP 0x8021 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_P_CSCF_IPV6_ADDRESS_REQUEST 0x0001 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IM_CN_SUBSYSTEM_SIGNALLING_FLAG 0x0002 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DNS_SERVER_IPV6_ADDRESS_REQUEST 0x0003 +#define LIBLTE_MME_MAX_PROTOCOL_CONFIG_OPTIONS 83 +#define LIBLTE_MME_MAX_PROTOCOL_CONFIG_LEN 248 +#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_LCP 0xC021 +#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_PAP 0xC023 +#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_CHAP 0xC223 +#define LIBLTE_MME_CONFIGURATION_PROTOCOL_OPTIONS_IPCP 0x8021 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_P_CSCF_IPV6_ADDRESS_REQUEST 0x0001 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IM_CN_SUBSYSTEM_SIGNALLING_FLAG 0x0002 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DNS_SERVER_IPV6_ADDRESS_REQUEST 0x0003 #define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_MS_SUPPORT_OF_NETWORK_REQUESTED_BEARER_CONTROL_INDICATOR 0x0005 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_HOME_AGENT_ADDRESS_REQUEST 0x0007 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_HOME_NETWORK_PREFIX_REQUEST 0x0008 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_IPV4_HOME_AGENT_ADDRESS_REQUEST 0x0009 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING 0x000A -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IPV4_ADDRESS_ALLOCATION_VIA_DHCPV4 0x000B -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_P_CSCF_IPV4_ADDRESS_REQUEST 0x000C -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000D -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_MSISDN_REQUEST 0x000E -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IFOM_SUPPORT_REQUEST 0x000F -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IPV4_LINK_MTU_REQUEST 0x0010 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_P_CSCF_IPV6_ADDRESS 0x0001 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IM_CN_SUBSYSTEM_SIGNALLING_FLAG 0x0002 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DNS_SERVER_IPV6_ADDRESS 0x0003 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_POLICY_CONTROL_REJECTION_CODE 0x0004 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_SELECTED_BEARER_CONTROL_MODE 0x0005 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_HOME_AGENT_ADDRESS 0x0007 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_HOME_NETWORK_PREFIX 0x0008 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_IPV4_HOME_AGENT_ADDRESS 0x0009 -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_P_CSCF_IPV4_ADDRESS 0x000C -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DNS_SERVER_IPV4_ADDRESS 0x000D -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_MSISDN 0x000E -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IFOM_SUPPORT 0x000F -#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IPV4_LINK_MTU 0x0010 -// Enums -// Structs -typedef struct{ - uint16 id; - uint8 len; - uint8 contents[LIBLTE_MME_MAX_PROTOCOL_CONFIG_LEN]; -}LIBLTE_MME_PROTOCOL_CONFIG_STRUCT; -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_STRUCT opt[LIBLTE_MME_MAX_PROTOCOL_CONFIG_OPTIONS]; - uint32 N_opts; -}LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_protocol_config_options_ie(LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT *protocol_cnfg_opts, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_protocol_config_options_ie(uint8 **ie_ptr, - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT *protocol_cnfg_opts); +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_HOME_AGENT_ADDRESS_REQUEST 0x0007 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_HOME_NETWORK_PREFIX_REQUEST 0x0008 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DSMIPV6_IPV4_HOME_AGENT_ADDRESS_REQUEST 0x0009 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IP_ADDRESS_ALLOCATION_VIA_NAS_SIGNALLING 0x000A +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IPV4_ADDRESS_ALLOCATION_VIA_DHCPV4 0x000B +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_P_CSCF_IPV4_ADDRESS_REQUEST 0x000C +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_DNS_SERVER_IPV4_ADDRESS_REQUEST 0x000D +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_MSISDN_REQUEST 0x000E +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IFOM_SUPPORT_REQUEST 0x000F +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_UL_IPV4_LINK_MTU_REQUEST 0x0010 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_P_CSCF_IPV6_ADDRESS 0x0001 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IM_CN_SUBSYSTEM_SIGNALLING_FLAG 0x0002 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DNS_SERVER_IPV6_ADDRESS 0x0003 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_POLICY_CONTROL_REJECTION_CODE 0x0004 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_SELECTED_BEARER_CONTROL_MODE 0x0005 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_HOME_AGENT_ADDRESS 0x0007 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_HOME_NETWORK_PREFIX 0x0008 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DSMIPV6_IPV4_HOME_AGENT_ADDRESS 0x0009 +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_P_CSCF_IPV4_ADDRESS 0x000C +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_DNS_SERVER_IPV4_ADDRESS 0x000D +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_MSISDN 0x000E +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IFOM_SUPPORT 0x000F +#define LIBLTE_MME_ADDITIONAL_PARAMETERS_DL_IPV4_LINK_MTU 0x0010 +// Enums +// Structs +typedef struct { + uint16 id; + uint8 len; + uint8 contents[LIBLTE_MME_MAX_PROTOCOL_CONFIG_LEN]; +} LIBLTE_MME_PROTOCOL_CONFIG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_STRUCT opt[LIBLTE_MME_MAX_PROTOCOL_CONFIG_OPTIONS]; + uint32 N_opts; +} LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT; +// Functions +LIBLTE_ERROR_ENUM +liblte_mme_pack_protocol_config_options_ie(LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT* protocol_cnfg_opts, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_protocol_config_options_ie(uint8** ie_ptr, + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT* protocol_cnfg_opts); /********************************************************************* IE Name: Quality Of Service @@ -2145,150 +1992,148 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_protocol_config_options_ie(uint8 24.008 v10.2.0 Section 10.5.6.5 *********************************************************************/ // Defines -#define LIBLTE_MME_QOS_DELAY_CLASS_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_DELAY_CLASS_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_DELAY_CLASS_1 0x1 -#define LIBLTE_MME_QOS_DELAY_CLASS_2 0x2 -#define LIBLTE_MME_QOS_DELAY_CLASS_3 0x3 -#define LIBLTE_MME_QOS_DELAY_CLASS_4 0x4 -#define LIBLTE_MME_QOS_DELAY_CLASS_RESERVED 0x7 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNUSED 0x1 +#define LIBLTE_MME_QOS_DELAY_CLASS_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_DELAY_CLASS_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_DELAY_CLASS_1 0x1 +#define LIBLTE_MME_QOS_DELAY_CLASS_2 0x2 +#define LIBLTE_MME_QOS_DELAY_CLASS_3 0x3 +#define LIBLTE_MME_QOS_DELAY_CLASS_4 0x4 +#define LIBLTE_MME_QOS_DELAY_CLASS_RESERVED 0x7 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNUSED 0x1 #define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_ACK_LLC_RLC_PROTECTED 0x2 #define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_LLC_ACK_RLC_PROTECTED 0x3 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_LLC_RLC_PROTECTED 0x4 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_LLC_RLC_UNPROTECTED 0x5 -#define LIBLTE_MME_QOS_RELIABILITY_CLASS_RESERVED 0x7 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_1000BPS 0x1 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_2000BPS 0x2 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_4000BPS 0x3 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_8000BPS 0x4 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_16000BPS 0x5 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_32000BPS 0x6 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_64000BPS 0x7 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_128000BPS 0x8 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_256000BPS 0x9 -#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_RESERVED 0xF -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_HIGH_PRIORITY 0x1 -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_NORMAL_PRIORITY 0x2 -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_LOW_PRIORITY 0x3 -#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_RESERVED 0x7 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_UL_SUBSCRIBED 0x00 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_DL_RESERVED 0x00 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_100BPH 0x01 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_200BPH 0x02 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_500BPH 0x03 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_1000BPH 0x04 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_2000BPH 0x05 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_5000BPH 0x06 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_10000BPH 0x07 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_20000BPH 0x08 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_50000BPH 0x09 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_100000BPH 0x0A -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_200000BPH 0x0B -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_500000BPH 0x0C -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_1000000BPH 0x0D -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_2000000BPH 0x0E -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_5000000BPH 0x0F -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_10000000BPH 0x10 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_20000000BPH 0x11 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_50000000BPH 0x12 -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_RESERVED 0x1E -#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_BEST_EFFORT 0x1F -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_CONVERSATIONAL 0x1 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_STREAMING 0x2 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_INTERACTIVE 0x3 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_BACKGROUND 0x4 -#define LIBLTE_MME_QOS_TRAFFIC_CLASS_RESERVED 0x7 -#define LIBLTE_MME_QOS_DELIVERY_ORDER_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_DELIVERY_ORDER_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_DELIVERY_ORDER_WITH_DELIVERY_ORDER_YES 0x1 -#define LIBLTE_MME_QOS_DELIVERY_ORDER_WITHOUT_DELIVERY_ORDER_NO 0x2 -#define LIBLTE_MME_QOS_DELIVERY_ORDER_RESERVED 0x3 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 0x1 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_DELIVERED 0x2 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_NOT_DELIVERED 0x3 -#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_RESERVED 0x7 -#define LIBLTE_MME_QOS_MAX_SDU_SIZE_UL_SUBSCRIBED 0x00 -#define LIBLTE_MME_QOS_MAX_SDU_SIZE_DL_RESERVED 0x00 -#define LIBLTE_MME_QOS_MAX_SDU_SIZE_RESERVED 0xFF -#define LIBLTE_MME_QOS_RESIDUAL_BER_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_RESIDUAL_BER_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_RESIDUAL_BER_5_E_NEG_2 0x1 -#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_2 0x2 -#define LIBLTE_MME_QOS_RESIDUAL_BER_5_E_NEG_3 0x3 -#define LIBLTE_MME_QOS_RESIDUAL_BER_4_E_NEG_3 0x4 -#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_3 0x5 -#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_4 0x6 -#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_5 0x7 -#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_6 0x8 -#define LIBLTE_MME_QOS_RESIDUAL_BER_6_E_NEG_8 0x9 -#define LIBLTE_MME_QOS_RESIDUAL_BER_RESERVED 0xF -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_2 0x1 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_7_E_NEG_3 0x2 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_3 0x3 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_4 0x4 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_5 0x5 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_6 0x6 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_1 0x7 -#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_RESERVED 0xF -#define LIBLTE_MME_QOS_TRANSFER_DELAY_UL_SUBSCRIBED 0x00 -#define LIBLTE_MME_QOS_TRANSFER_DELAY_DL_RESERVED 0x00 -#define LIBLTE_MME_QOS_TRANSFER_DELAY_RESERVED 0x3F -#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_UL_SUBSCRIBED 0x0 -#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_DL_RESERVED 0x0 -#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_1 0x1 -#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_2 0x2 -#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_3 0x3 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_LLC_RLC_PROTECTED 0x4 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_UNACK_GTP_LLC_RLC_UNPROTECTED 0x5 +#define LIBLTE_MME_QOS_RELIABILITY_CLASS_RESERVED 0x7 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_1000BPS 0x1 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_2000BPS 0x2 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_4000BPS 0x3 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_8000BPS 0x4 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_16000BPS 0x5 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_32000BPS 0x6 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_64000BPS 0x7 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_128000BPS 0x8 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_UP_TO_256000BPS 0x9 +#define LIBLTE_MME_QOS_PEAK_THROUGHPUT_RESERVED 0xF +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_HIGH_PRIORITY 0x1 +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_NORMAL_PRIORITY 0x2 +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_LOW_PRIORITY 0x3 +#define LIBLTE_MME_QOS_PRECEDENCE_CLASS_RESERVED 0x7 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_UL_SUBSCRIBED 0x00 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_DL_RESERVED 0x00 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_100BPH 0x01 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_200BPH 0x02 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_500BPH 0x03 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_1000BPH 0x04 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_2000BPH 0x05 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_5000BPH 0x06 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_10000BPH 0x07 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_20000BPH 0x08 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_50000BPH 0x09 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_100000BPH 0x0A +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_200000BPH 0x0B +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_500000BPH 0x0C +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_1000000BPH 0x0D +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_2000000BPH 0x0E +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_5000000BPH 0x0F +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_10000000BPH 0x10 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_20000000BPH 0x11 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_50000000BPH 0x12 +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_RESERVED 0x1E +#define LIBLTE_MME_QOS_MEAN_THROUGHPUT_BEST_EFFORT 0x1F +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_CONVERSATIONAL 0x1 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_STREAMING 0x2 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_INTERACTIVE 0x3 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_BACKGROUND 0x4 +#define LIBLTE_MME_QOS_TRAFFIC_CLASS_RESERVED 0x7 +#define LIBLTE_MME_QOS_DELIVERY_ORDER_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_DELIVERY_ORDER_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_DELIVERY_ORDER_WITH_DELIVERY_ORDER_YES 0x1 +#define LIBLTE_MME_QOS_DELIVERY_ORDER_WITHOUT_DELIVERY_ORDER_NO 0x2 +#define LIBLTE_MME_QOS_DELIVERY_ORDER_RESERVED 0x3 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 0x1 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_DELIVERED 0x2 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_NOT_DELIVERED 0x3 +#define LIBLTE_MME_QOS_DELIVERY_OF_ERRONEOUS_SDU_RESERVED 0x7 +#define LIBLTE_MME_QOS_MAX_SDU_SIZE_UL_SUBSCRIBED 0x00 +#define LIBLTE_MME_QOS_MAX_SDU_SIZE_DL_RESERVED 0x00 +#define LIBLTE_MME_QOS_MAX_SDU_SIZE_RESERVED 0xFF +#define LIBLTE_MME_QOS_RESIDUAL_BER_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_RESIDUAL_BER_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_RESIDUAL_BER_5_E_NEG_2 0x1 +#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_2 0x2 +#define LIBLTE_MME_QOS_RESIDUAL_BER_5_E_NEG_3 0x3 +#define LIBLTE_MME_QOS_RESIDUAL_BER_4_E_NEG_3 0x4 +#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_3 0x5 +#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_4 0x6 +#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_5 0x7 +#define LIBLTE_MME_QOS_RESIDUAL_BER_1_E_NEG_6 0x8 +#define LIBLTE_MME_QOS_RESIDUAL_BER_6_E_NEG_8 0x9 +#define LIBLTE_MME_QOS_RESIDUAL_BER_RESERVED 0xF +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_2 0x1 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_7_E_NEG_3 0x2 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_3 0x3 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_4 0x4 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_5 0x5 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_6 0x6 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_1_E_NEG_1 0x7 +#define LIBLTE_MME_QOS_SDU_ERROR_RATIO_RESERVED 0xF +#define LIBLTE_MME_QOS_TRANSFER_DELAY_UL_SUBSCRIBED 0x00 +#define LIBLTE_MME_QOS_TRANSFER_DELAY_DL_RESERVED 0x00 +#define LIBLTE_MME_QOS_TRANSFER_DELAY_RESERVED 0x3F +#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_UL_SUBSCRIBED 0x0 +#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_DL_RESERVED 0x0 +#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_1 0x1 +#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_2 0x2 +#define LIBLTE_MME_QOS_TRAFFIC_HANDLING_PRIORITY_LEVEL_3 0x3 #define LIBLTE_MME_QOS_SIGNALLING_INDICATOR_NOT_OPTIMIZED_FOR_SIGNALLING 0x0 -#define LIBLTE_MME_QOS_SIGNALLING_INDICATOR_OPTIMIZED_FOR_SIGNALLING 0x1 -#define LIBLTE_MME_QOS_SOURCE_STATISTICS_DESCRIPTOR_UNKNOWN 0x0 -#define LIBLTE_MME_QOS_SOURCE_STATISTICS_DESCRIPTOR_SPEECH 0x1 -// Enums -// Structs -typedef struct{ - uint8 delay_class; - uint8 reliability_class; - uint8 peak_throughput; - uint8 precedence_class; - uint8 mean_throughput; - uint8 traffic_class; - uint8 delivery_order; - uint8 delivery_of_erroneous_sdu; - uint8 max_sdu_size; - uint8 mbr_ul; - uint8 mbr_dl; - uint8 residual_ber; - uint8 sdu_error_ratio; - uint8 transfer_delay; - uint8 traffic_handling_prio; - uint8 gbr_ul; - uint8 gbr_dl; - uint8 signalling_ind; - uint8 source_stats_descriptor; - uint8 mbr_dl_ext; - uint8 gbr_dl_ext; - uint8 mbr_ul_ext; - uint8 gbr_ul_ext; - bool dl_ext_present; - bool ul_ext_present; -}LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_quality_of_service_ie(LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT *qos, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8 **ie_ptr, - LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT *qos); +#define LIBLTE_MME_QOS_SIGNALLING_INDICATOR_OPTIMIZED_FOR_SIGNALLING 0x1 +#define LIBLTE_MME_QOS_SOURCE_STATISTICS_DESCRIPTOR_UNKNOWN 0x0 +#define LIBLTE_MME_QOS_SOURCE_STATISTICS_DESCRIPTOR_SPEECH 0x1 +// Enums +// Structs +typedef struct { + uint8 delay_class; + uint8 reliability_class; + uint8 peak_throughput; + uint8 precedence_class; + uint8 mean_throughput; + uint8 traffic_class; + uint8 delivery_order; + uint8 delivery_of_erroneous_sdu; + uint8 max_sdu_size; + uint8 mbr_ul; + uint8 mbr_dl; + uint8 residual_ber; + uint8 sdu_error_ratio; + uint8 transfer_delay; + uint8 traffic_handling_prio; + uint8 gbr_ul; + uint8 gbr_dl; + uint8 signalling_ind; + uint8 source_stats_descriptor; + uint8 mbr_dl_ext; + uint8 gbr_dl_ext; + uint8 mbr_ul_ext; + uint8 gbr_ul_ext; + bool dl_ext_present; + bool ul_ext_present; +} LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_quality_of_service_ie(LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT* qos, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8** ie_ptr, LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT* qos); /********************************************************************* IE Name: Radio Priority @@ -2309,12 +2154,8 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_radio_priority_ie(uint8 radio_prio, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *radio_prio); +LIBLTE_ERROR_ENUM liblte_mme_pack_radio_priority_ie(uint8 radio_prio, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8** ie_ptr, uint8 bit_offset, uint8* radio_prio); /********************************************************************* IE Name: Request Type @@ -2328,18 +2169,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8 **ie_ptr, *********************************************************************/ // Defines #define LIBLTE_MME_REQUEST_TYPE_INITIAL_REQUEST 0x1 -#define LIBLTE_MME_REQUEST_TYPE_HANDOVER 0x2 -#define LIBLTE_MME_REQUEST_TYPE_UNUSED 0x3 -#define LIBLTE_MME_REQUEST_TYPE_EMERGENCY 0x4 +#define LIBLTE_MME_REQUEST_TYPE_HANDOVER 0x2 +#define LIBLTE_MME_REQUEST_TYPE_UNUSED 0x3 +#define LIBLTE_MME_REQUEST_TYPE_EMERGENCY 0x4 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_request_type_ie(uint8 req_type, - uint8 bit_offset, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *req_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_request_type_ie(uint8 req_type, uint8 bit_offset, uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* req_type); /********************************************************************* IE Name: Traffic Flow Aggregate Description @@ -2350,77 +2187,78 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.15 *********************************************************************/ // Defines -#define LIBLTE_MME_PACKET_FILTER_LIST_MAX_SIZE 15 -#define LIBLTE_MME_PACKET_FILTER_MAX_SIZE 20 -#define LIBLTE_MME_PARAMETER_LIST_MAX_SIZE 15 -#define LIBLTE_MME_PARAMETER_MAX_SIZE 20 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_IPV4_REMOTE_ADDRESS_TYPE 0x10 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_IPV6_REMOTE_ADDRESS_TYPE 0x20 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_PROTOCOL_ID_NEXT_HEADER_TYPE 0x30 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SINGLE_LOCAL_PORT_TYPE 0x40 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_LOCAL_PORT_RANGE_TYPE 0x41 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SINGLE_REMOTE_PORT_TYPE 0x50 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_REMOTE_PORT_RANGE_TYPE 0x51 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SECURITY_PARAMETER_INDEX_TYPE 0x60 +#define LIBLTE_MME_PACKET_FILTER_LIST_MAX_SIZE 15 +#define LIBLTE_MME_PACKET_FILTER_MAX_SIZE 20 +#define LIBLTE_MME_PARAMETER_LIST_MAX_SIZE 15 +#define LIBLTE_MME_PARAMETER_MAX_SIZE 20 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_IPV4_REMOTE_ADDRESS_TYPE 0x10 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_IPV6_REMOTE_ADDRESS_TYPE 0x20 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_PROTOCOL_ID_NEXT_HEADER_TYPE 0x30 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SINGLE_LOCAL_PORT_TYPE 0x40 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_LOCAL_PORT_RANGE_TYPE 0x41 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SINGLE_REMOTE_PORT_TYPE 0x50 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_REMOTE_PORT_RANGE_TYPE 0x51 +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_SECURITY_PARAMETER_INDEX_TYPE 0x60 #define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_TYPE_OF_SERVICE_TRAFFIC_CLASS_TYPE 0x70 -#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_FLOW_LABEL_TYPE 0x80 -// Enums -typedef enum{ - LIBLTE_MME_TFT_OPERATION_CODE_SPARE = 0, - LIBLTE_MME_TFT_OPERATION_CODE_CREATE_NEW_TFT, - LIBLTE_MME_TFT_OPERATION_CODE_DELETE_EXISTING_TFT, - LIBLTE_MME_TFT_OPERATION_CODE_ADD_PACKET_FILTERS_TO_EXISTING_TFT, - LIBLTE_MME_TFT_OPERATION_CODE_REPLACE_PACKET_FILTERS_IN_EXISTING_TFT, - LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT, - LIBLTE_MME_TFT_OPERATION_CODE_NO_TFT_OPERATION, - LIBLTE_MME_TFT_OPERATION_CODE_RESERVED, - LIBLTE_MME_TFT_OPERATION_CODE_N_ITEMS, -}LIBLTE_MME_TFT_OPERATION_CODE_ENUM; -static const char liblte_mme_tft_operation_code_text[LIBLTE_MME_TFT_OPERATION_CODE_N_ITEMS][100] = {"SPARE", - "Create New TFT", - "Delete Existing TFT", - "Add Packet Filters to Existing TFT", - "Replace Packet Filters in Existing TFT", - "Delete Packet Filters from Existing TFT", - "No TFT Operation", - "RESERVED"}; -typedef enum{ - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_PRE_REL_7_TFT_FILTER = 0, - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_DOWNLINK_ONLY, - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_UPLINK_ONLY, - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_BIDIRECTIONAL, - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS, -}LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM; -static const char liblte_mme_tft_packet_filter_direction_text[LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS][100] = {"Pre Rel-7 TFT Filter", - "Downlink Only", - "Uplink Only", - "Bidirectional"}; -// Structs -typedef struct{ - LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM dir; - uint8 id; - uint8 eval_precedence; - uint8 filter[LIBLTE_MME_PACKET_FILTER_MAX_SIZE]; - uint8 filter_size; -}LIBLTE_MME_PACKET_FILTER_STRUCT; -typedef struct{ - uint8 id; - uint8 parameter[LIBLTE_MME_PARAMETER_MAX_SIZE]; - uint8 parameter_size; -}LIBLTE_MME_PARAMETER_STRUCT; -typedef struct{ - LIBLTE_MME_PACKET_FILTER_STRUCT packet_filter_list[LIBLTE_MME_PACKET_FILTER_LIST_MAX_SIZE]; - LIBLTE_MME_PARAMETER_STRUCT parameter_list[LIBLTE_MME_PARAMETER_LIST_MAX_SIZE]; - LIBLTE_MME_TFT_OPERATION_CODE_ENUM tft_op_code; - uint8 packet_filter_list_size; - uint8 parameter_list_size; -}LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT; +#define LIBLTE_MME_TFT_PACKET_FILTER_COMPONENT_TYPE_ID_FLOW_LABEL_TYPE 0x80 +// Enums +typedef enum { + LIBLTE_MME_TFT_OPERATION_CODE_SPARE = 0, + LIBLTE_MME_TFT_OPERATION_CODE_CREATE_NEW_TFT, + LIBLTE_MME_TFT_OPERATION_CODE_DELETE_EXISTING_TFT, + LIBLTE_MME_TFT_OPERATION_CODE_ADD_PACKET_FILTERS_TO_EXISTING_TFT, + LIBLTE_MME_TFT_OPERATION_CODE_REPLACE_PACKET_FILTERS_IN_EXISTING_TFT, + LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT, + LIBLTE_MME_TFT_OPERATION_CODE_NO_TFT_OPERATION, + LIBLTE_MME_TFT_OPERATION_CODE_RESERVED, + LIBLTE_MME_TFT_OPERATION_CODE_N_ITEMS, +} LIBLTE_MME_TFT_OPERATION_CODE_ENUM; +static const char liblte_mme_tft_operation_code_text[LIBLTE_MME_TFT_OPERATION_CODE_N_ITEMS][100] = { + "SPARE", + "Create New TFT", + "Delete Existing TFT", + "Add Packet Filters to Existing TFT", + "Replace Packet Filters in Existing TFT", + "Delete Packet Filters from Existing TFT", + "No TFT Operation", + "RESERVED"}; +typedef enum { + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_PRE_REL_7_TFT_FILTER = 0, + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_DOWNLINK_ONLY, + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_UPLINK_ONLY, + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_BIDIRECTIONAL, + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS, +} LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM; +static const char liblte_mme_tft_packet_filter_direction_text[LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_N_ITEMS][100] = { + "Pre Rel-7 TFT Filter", "Downlink Only", "Uplink Only", "Bidirectional"}; +// Structs +typedef struct { + LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM dir; + uint8 id; + uint8 eval_precedence; + uint8 filter[LIBLTE_MME_PACKET_FILTER_MAX_SIZE]; + uint8 filter_size; +} LIBLTE_MME_PACKET_FILTER_STRUCT; +typedef struct { + uint8 id; + uint8 parameter[LIBLTE_MME_PARAMETER_MAX_SIZE]; + uint8 parameter_size; +} LIBLTE_MME_PARAMETER_STRUCT; +typedef struct { + LIBLTE_MME_PACKET_FILTER_STRUCT packet_filter_list[LIBLTE_MME_PACKET_FILTER_LIST_MAX_SIZE]; + LIBLTE_MME_PARAMETER_STRUCT parameter_list[LIBLTE_MME_PARAMETER_LIST_MAX_SIZE]; + LIBLTE_MME_TFT_OPERATION_CODE_ENUM tft_op_code; + uint8 packet_filter_list_size; + uint8 parameter_list_size; +} LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT; typedef LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_aggregate_description_ie(LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT *tfad, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8 **ie_ptr, - LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT *tfad); +LIBLTE_ERROR_ENUM +liblte_mme_pack_traffic_flow_aggregate_description_ie(LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT* tfad, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8** ie_ptr, + LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT* tfad); /********************************************************************* IE Name: Traffic Flow Template @@ -2438,10 +2276,10 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8 // Structs // Traffic Flow Template structs defined above // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_template_ie(LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *tft, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8 **ie_ptr, - LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *tft); +LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_template_ie(LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8** ie_ptr, + LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft); /********************************************************************* IE Name: Transaction Identifier @@ -2455,20 +2293,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8 *********************************************************************/ // Defines #define LIBLTE_MME_TI_FLAG_SENT_FROM_ORIGINATOR 0 -#define LIBLTE_MME_TI_FLAG_SENT_TO_ORIGINATOR 1 -#define LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE 0x7 +#define LIBLTE_MME_TI_FLAG_SENT_TO_ORIGINATOR 1 +#define LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE 0x7 // Enums // Structs -typedef struct{ - uint8 ti_flag; - uint8 tio; - uint8 tie; -}LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT; +typedef struct { + uint8 ti_flag; + uint8 tio; + uint8 tie; +} LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_transaction_identifier_ie(LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT *trans_id, - uint8 **ie_ptr); -LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8 **ie_ptr, - LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT *trans_id); +LIBLTE_ERROR_ENUM liblte_mme_pack_transaction_identifier_ie(LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT* trans_id, + uint8** ie_ptr); +LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8** ie_ptr, + LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT* trans_id); /******************************************************************************* MESSAGE DECLARATIONS @@ -2482,94 +2320,90 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.1 *********************************************************************/ // Defines -//Protocol Descriptor -#define LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT 0x2 -#define LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT 0x7 -//Header Type -#define LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS 0x0 -#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY 0x1 -#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED 0x2 -#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_WITH_NEW_EPS_SECURITY_CONTEXT 0x3 +// Protocol Descriptor +#define LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT 0x2 +#define LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT 0x7 +// Header Type +#define LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS 0x0 +#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY 0x1 +#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED 0x2 +#define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_WITH_NEW_EPS_SECURITY_CONTEXT 0x3 #define LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED_WITH_NEW_EPS_SECURITY_CONTEXT 0x4 -#define LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST 0xC +#define LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST 0xC const char* liblte_nas_sec_hdr_type_to_string(int code); -//Message Type -#define LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST 0x41 -#define LIBLTE_MME_MSG_TYPE_ATTACH_ACCEPT 0x42 -#define LIBLTE_MME_MSG_TYPE_ATTACH_COMPLETE 0x43 -#define LIBLTE_MME_MSG_TYPE_ATTACH_REJECT 0x44 -#define LIBLTE_MME_MSG_TYPE_DETACH_REQUEST 0x45 -#define LIBLTE_MME_MSG_TYPE_DETACH_ACCEPT 0x46 -#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REQUEST 0x48 -#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_ACCEPT 0x49 -#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_COMPLETE 0x4A -#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REJECT 0x4B -#define LIBLTE_MME_MSG_TYPE_EXTENDED_SERVICE_REQUEST 0x4C -#define LIBLTE_MME_MSG_TYPE_SERVICE_REJECT 0x4E -#define LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMMAND 0x50 -#define LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMPLETE 0x51 -#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REQUEST 0x52 -#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_RESPONSE 0x53 -#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REJECT 0x54 -#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_FAILURE 0x5C -#define LIBLTE_MME_MSG_TYPE_IDENTITY_REQUEST 0x55 -#define LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE 0x56 -#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMMAND 0x5D -#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMPLETE 0x5E -#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_REJECT 0x5F -#define LIBLTE_MME_MSG_TYPE_EMM_STATUS 0x60 -#define LIBLTE_MME_MSG_TYPE_EMM_INFORMATION 0x61 -#define LIBLTE_MME_MSG_TYPE_DOWNLINK_NAS_TRANSPORT 0x62 -#define LIBLTE_MME_MSG_TYPE_UPLINK_NAS_TRANSPORT 0x63 -#define LIBLTE_MME_MSG_TYPE_CS_SERVICE_NOTIFICATION 0x64 -#define LIBLTE_MME_MSG_TYPE_DOWNLINK_GENERIC_NAS_TRANSPORT 0x68 -#define LIBLTE_MME_MSG_TYPE_UPLINK_GENERIC_NAS_TRANSPORT 0x69 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE 0x84 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE_COMPLETE 0x85 -#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_TEST MODE 0x86 -#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_TEST_MODE_COMPLETE 0x87 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0xC1 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT 0xC2 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT 0xC3 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST 0xC5 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT 0xC6 -#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT 0xC7 -#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REQUEST 0xC9 -#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_ACCEPT 0xCA -#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REJECT 0xCB -#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST 0xCD -#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT 0xCE -#define LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REQUEST 0xD0 -#define LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REJECT 0xD1 -#define LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REQUEST 0xD2 -#define LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REJECT 0xD3 -#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REQUEST 0xD4 -#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REJECT 0xD5 -#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REQUEST 0xD6 -#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REJECT 0xD7 -#define LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST 0xD9 -#define LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_RESPONSE 0xDA -#define LIBLTE_MME_MSG_TYPE_NOTIFICATION 0xDB -#define LIBLTE_MME_MSG_TYPE_ESM_STATUS 0xE8 -#define LIBLTE_MME_MSG_TYPE_TEST_MODE_PROTOCOL_DISCRIMINATOR 0xF -#define LIBLTE_MME_MSG_TYPE_TEST_MODE_SKIP_INDICATOR 0x0 +// Message Type +#define LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST 0x41 +#define LIBLTE_MME_MSG_TYPE_ATTACH_ACCEPT 0x42 +#define LIBLTE_MME_MSG_TYPE_ATTACH_COMPLETE 0x43 +#define LIBLTE_MME_MSG_TYPE_ATTACH_REJECT 0x44 +#define LIBLTE_MME_MSG_TYPE_DETACH_REQUEST 0x45 +#define LIBLTE_MME_MSG_TYPE_DETACH_ACCEPT 0x46 +#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REQUEST 0x48 +#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_ACCEPT 0x49 +#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_COMPLETE 0x4A +#define LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REJECT 0x4B +#define LIBLTE_MME_MSG_TYPE_EXTENDED_SERVICE_REQUEST 0x4C +#define LIBLTE_MME_MSG_TYPE_SERVICE_REJECT 0x4E +#define LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMMAND 0x50 +#define LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMPLETE 0x51 +#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REQUEST 0x52 +#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_RESPONSE 0x53 +#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REJECT 0x54 +#define LIBLTE_MME_MSG_TYPE_AUTHENTICATION_FAILURE 0x5C +#define LIBLTE_MME_MSG_TYPE_IDENTITY_REQUEST 0x55 +#define LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE 0x56 +#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMMAND 0x5D +#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMPLETE 0x5E +#define LIBLTE_MME_MSG_TYPE_SECURITY_MODE_REJECT 0x5F +#define LIBLTE_MME_MSG_TYPE_EMM_STATUS 0x60 +#define LIBLTE_MME_MSG_TYPE_EMM_INFORMATION 0x61 +#define LIBLTE_MME_MSG_TYPE_DOWNLINK_NAS_TRANSPORT 0x62 +#define LIBLTE_MME_MSG_TYPE_UPLINK_NAS_TRANSPORT 0x63 +#define LIBLTE_MME_MSG_TYPE_CS_SERVICE_NOTIFICATION 0x64 +#define LIBLTE_MME_MSG_TYPE_DOWNLINK_GENERIC_NAS_TRANSPORT 0x68 +#define LIBLTE_MME_MSG_TYPE_UPLINK_GENERIC_NAS_TRANSPORT 0x69 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE 0x84 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE_COMPLETE 0x85 +#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_TEST MODE 0x86 +#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_TEST_MODE_COMPLETE 0x87 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST 0xC1 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT 0xC2 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT 0xC3 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST 0xC5 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT 0xC6 +#define LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT 0xC7 +#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REQUEST 0xC9 +#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_ACCEPT 0xCA +#define LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REJECT 0xCB +#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST 0xCD +#define LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT 0xCE +#define LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REQUEST 0xD0 +#define LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REJECT 0xD1 +#define LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REQUEST 0xD2 +#define LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REJECT 0xD3 +#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REQUEST 0xD4 +#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REJECT 0xD5 +#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REQUEST 0xD6 +#define LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REJECT 0xD7 +#define LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST 0xD9 +#define LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_RESPONSE 0xDA +#define LIBLTE_MME_MSG_TYPE_NOTIFICATION 0xDB +#define LIBLTE_MME_MSG_TYPE_ESM_STATUS 0xE8 +#define LIBLTE_MME_MSG_TYPE_TEST_MODE_PROTOCOL_DISCRIMINATOR 0xF +#define LIBLTE_MME_MSG_TYPE_TEST_MODE_SKIP_INDICATOR 0x0 const char* liblte_nas_msg_type_to_string(int code); // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_parse_msg_sec_header(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 *pd, - uint8 *sec_hdr_type); -LIBLTE_ERROR_ENUM liblte_mme_parse_msg_header(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 *pd, - uint8 *msg_type); -LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STRUCT *msg, +LIBLTE_ERROR_ENUM liblte_mme_parse_msg_sec_header(LIBLTE_BYTE_MSG_STRUCT* msg, uint8* pd, uint8* sec_hdr_type); +LIBLTE_ERROR_ENUM liblte_mme_parse_msg_header(LIBLTE_BYTE_MSG_STRUCT* msg, uint8* pd, uint8* msg_type); +LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STRUCT* msg, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *sec_msg); + LIBLTE_BYTE_MSG_STRUCT* sec_msg); /********************************************************************* Message Name: Attach Accept @@ -2580,54 +2414,54 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STR Document Reference: 24.301 v10.2.0 Section 8.2.1 *********************************************************************/ // Defines -#define LIBLTE_MME_GUTI_IEI 0x50 +#define LIBLTE_MME_GUTI_IEI 0x50 #define LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI 0x13 -#define LIBLTE_MME_MS_IDENTITY_IEI 0x23 -#define LIBLTE_MME_EMM_CAUSE_IEI 0x53 -#define LIBLTE_MME_T3402_VALUE_IEI 0x17 -#define LIBLTE_MME_T3423_VALUE_IEI 0x59 -#define LIBLTE_MME_EQUIVALENT_PLMNS_IEI 0x4A -#define LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI 0x34 -#define LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI 0x64 -#define LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI 0xF -#define LIBLTE_MME_T3412_EXTENDED_VALUE_IEI 0x5E -// Enums -// Structs -typedef struct{ - LIBLTE_MME_GPRS_TIMER_STRUCT t3412; - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; - LIBLTE_BYTE_MSG_STRUCT esm_msg; - LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; - LIBLTE_MME_LOCATION_AREA_ID_STRUCT lai; - LIBLTE_MME_MOBILE_ID_STRUCT ms_id; - LIBLTE_MME_GPRS_TIMER_STRUCT t3402; - LIBLTE_MME_GPRS_TIMER_STRUCT t3423; - LIBLTE_MME_PLMN_LIST_STRUCT equivalent_plmns; - LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT emerg_num_list; - LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT eps_network_feature_support; - LIBLTE_MME_GPRS_TIMER_3_STRUCT t3412_ext; - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM additional_update_result; - uint8 eps_attach_result; - uint8 emm_cause; - bool guti_present; - bool lai_present; - bool ms_id_present; - bool emm_cause_present; - bool t3402_present; - bool t3423_present; - bool equivalent_plmns_present; - bool emerg_num_list_present; - bool eps_network_feature_support_present; - bool additional_update_result_present; - bool t3412_ext_present; -}LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_accept_msg(LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT *attach_accept, +#define LIBLTE_MME_MS_IDENTITY_IEI 0x23 +#define LIBLTE_MME_EMM_CAUSE_IEI 0x53 +#define LIBLTE_MME_T3402_VALUE_IEI 0x17 +#define LIBLTE_MME_T3423_VALUE_IEI 0x59 +#define LIBLTE_MME_EQUIVALENT_PLMNS_IEI 0x4A +#define LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI 0x34 +#define LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI 0x64 +#define LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI 0xF +#define LIBLTE_MME_T3412_EXTENDED_VALUE_IEI 0x5E +// Enums +// Structs +typedef struct { + LIBLTE_MME_GPRS_TIMER_STRUCT t3412; + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; + LIBLTE_BYTE_MSG_STRUCT esm_msg; + LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; + LIBLTE_MME_LOCATION_AREA_ID_STRUCT lai; + LIBLTE_MME_MOBILE_ID_STRUCT ms_id; + LIBLTE_MME_GPRS_TIMER_STRUCT t3402; + LIBLTE_MME_GPRS_TIMER_STRUCT t3423; + LIBLTE_MME_PLMN_LIST_STRUCT equivalent_plmns; + LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT emerg_num_list; + LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT eps_network_feature_support; + LIBLTE_MME_GPRS_TIMER_3_STRUCT t3412_ext; + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM additional_update_result; + uint8 eps_attach_result; + uint8 emm_cause; + bool guti_present; + bool lai_present; + bool ms_id_present; + bool emm_cause_present; + bool t3402_present; + bool t3423_present; + bool equivalent_plmns_present; + bool emerg_num_list_present; + bool eps_network_feature_support_present; + bool additional_update_result_present; + bool t3412_ext_present; +} LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_accept_msg(LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT* attach_accept, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT *attach_accept); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT* attach_accept); /********************************************************************* Message Name: Attach Complete @@ -2640,16 +2474,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT esm_msg; -}LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT esm_msg; +} LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_complete_msg(LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT *attach_comp, +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_complete_msg(LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT* attach_comp, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT *attach_comp); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT* attach_comp); /********************************************************************* Message Name: Attach Reject @@ -2661,21 +2495,21 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT *********************************************************************/ // Defines #define LIBLTE_MME_ESM_MSG_CONTAINER_IEI 0x78 -#define LIBLTE_MME_T3446_VALUE_IEI 0x5F +#define LIBLTE_MME_T3446_VALUE_IEI 0x5F // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT esm_msg; - uint8 emm_cause; - uint8 t3446_value; - bool esm_msg_present; - bool t3446_value_present; -}LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT esm_msg; + uint8 emm_cause; + uint8 t3446_value; + bool esm_msg_present; + bool t3446_value_present; +} LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_reject_msg(LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT *attach_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT *attach_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_reject_msg(LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT* attach_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT* attach_rej); /********************************************************************* Message Name: Attach Request @@ -2686,65 +2520,65 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.4 *********************************************************************/ // Defines -#define LIBLTE_MME_P_TMSI_SIGNATURE_IEI 0x19 -#define LIBLTE_MME_ADDITIONAL_GUTI_IEI 0x50 -#define LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI 0x52 -#define LIBLTE_MME_DRX_PARAMETER_IEI 0x5C -#define LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI 0x31 -#define LIBLTE_MME_TMSI_STATUS_IEI 0x9 -#define LIBLTE_MME_MS_CLASSMARK_2_IEI 0x11 -#define LIBLTE_MME_MS_CLASSMARK_3_IEI 0x20 -#define LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI 0x40 -#define LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI 0xF +#define LIBLTE_MME_P_TMSI_SIGNATURE_IEI 0x19 +#define LIBLTE_MME_ADDITIONAL_GUTI_IEI 0x50 +#define LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI 0x52 +#define LIBLTE_MME_DRX_PARAMETER_IEI 0x5C +#define LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI 0x31 +#define LIBLTE_MME_TMSI_STATUS_IEI 0x9 +#define LIBLTE_MME_MS_CLASSMARK_2_IEI 0x11 +#define LIBLTE_MME_MS_CLASSMARK_3_IEI 0x20 +#define LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI 0x40 +#define LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI 0xF #define LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI 0x5D -#define LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI 0xD -#define LIBLTE_MME_GUTI_TYPE_IEI 0xE -// Enums -// Structs -typedef struct{ - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; - LIBLTE_MME_EPS_MOBILE_ID_STRUCT eps_mobile_id; - LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT ue_network_cap; - LIBLTE_BYTE_MSG_STRUCT esm_msg; - LIBLTE_MME_EPS_MOBILE_ID_STRUCT additional_guti; - LIBLTE_MME_TRACKING_AREA_ID_STRUCT last_visited_registered_tai; - LIBLTE_MME_DRX_PARAMETER_STRUCT drx_param; - LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT ms_network_cap; - LIBLTE_MME_LOCATION_AREA_ID_STRUCT old_lai; - LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT ms_cm2; - LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT ms_cm3; - LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT supported_codecs; - LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT voice_domain_pref_and_ue_usage_setting; - LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status; - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM additional_update_type; - LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; - LIBLTE_MME_GUTI_TYPE_ENUM old_guti_type; - uint32 old_p_tmsi_signature; - uint8 eps_attach_type; - bool old_p_tmsi_signature_present; - bool additional_guti_present; - bool last_visited_registered_tai_present; - bool drx_param_present; - bool ms_network_cap_present; - bool old_lai_present; - bool tmsi_status_present; - bool ms_cm2_present; - bool ms_cm3_present; - bool supported_codecs_present; - bool additional_update_type_present; - bool voice_domain_pref_and_ue_usage_setting_present; - bool device_properties_present; - bool old_guti_type_present; -}LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req, +#define LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI 0xD +#define LIBLTE_MME_GUTI_TYPE_IEI 0xE +// Enums +// Structs +typedef struct { + LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; + LIBLTE_MME_EPS_MOBILE_ID_STRUCT eps_mobile_id; + LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT ue_network_cap; + LIBLTE_BYTE_MSG_STRUCT esm_msg; + LIBLTE_MME_EPS_MOBILE_ID_STRUCT additional_guti; + LIBLTE_MME_TRACKING_AREA_ID_STRUCT last_visited_registered_tai; + LIBLTE_MME_DRX_PARAMETER_STRUCT drx_param; + LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT ms_network_cap; + LIBLTE_MME_LOCATION_AREA_ID_STRUCT old_lai; + LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT ms_cm2; + LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT ms_cm3; + LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT supported_codecs; + LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT voice_domain_pref_and_ue_usage_setting; + LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status; + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM additional_update_type; + LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; + LIBLTE_MME_GUTI_TYPE_ENUM old_guti_type; + uint32 old_p_tmsi_signature; + uint8 eps_attach_type; + bool old_p_tmsi_signature_present; + bool additional_guti_present; + bool last_visited_registered_tai_present; + bool drx_param_present; + bool ms_network_cap_present; + bool old_lai_present; + bool tmsi_status_present; + bool ms_cm2_present; + bool ms_cm3_present; + bool supported_codecs_present; + bool additional_update_type_present; + bool voice_domain_pref_and_ue_usage_setting_present; + bool device_properties_present; + bool old_guti_type_present; +} LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req); /********************************************************************* Message Name: Authentication Failure @@ -2758,16 +2592,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT #define LIBLTE_MME_AUTHENTICATION_FAILURE_PARAMETER_IEI 0x30 // Enums // Structs -typedef struct{ - uint8 emm_cause; - uint8 auth_fail_param[16]; - bool auth_fail_param_present; -}LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT; +typedef struct { + uint8 emm_cause; + uint8 auth_fail_param[16]; + bool auth_fail_param_present; +} LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_msg(LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT *auth_fail, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT *auth_fail); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_msg(LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT* auth_fail, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT* auth_fail); /********************************************************************* Message Name: Authentication Reject @@ -2781,13 +2615,13 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_S // Defines // Enums // Structs -typedef struct{ -}LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT; +typedef struct { +} LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_reject_msg(LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT *auth_reject, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT *auth_reject); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_reject_msg(LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT* auth_reject, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT* auth_reject); /********************************************************************* Message Name: Authentication Request @@ -2800,16 +2634,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_ST // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; - uint8 autn[16]; - uint8 rand[16]; -}LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; + uint8 autn[16]; + uint8 rand[16]; +} LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_request_msg(LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT *auth_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT *auth_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_request_msg(LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT* auth_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT* auth_req); /********************************************************************* Message Name: Authentication Response @@ -2822,17 +2656,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_S // Defines // Enums // Structs -typedef struct{ - uint8 res[16]; - int res_len; -}LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT; +typedef struct { + uint8 res[16]; + int res_len; +} LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_msg(LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT *auth_resp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT *auth_resp); +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_msg(LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT* auth_resp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT* auth_resp); /********************************************************************* Message Name: CS Service Notification @@ -2861,15 +2696,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_ // Defines // Enums // Structs -typedef struct{ -}LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT; +typedef struct { +} LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_accept_msg(LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT *detach_accept, +LIBLTE_ERROR_ENUM liblte_mme_pack_detach_accept_msg(LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT* detach_accept, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT *detach_accept); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT* detach_accept); /********************************************************************* Message Name: Detach Request @@ -2882,18 +2717,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_DETACH_TYPE_STRUCT detach_type; - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; - LIBLTE_MME_EPS_MOBILE_ID_STRUCT eps_mobile_id; -}LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_DETACH_TYPE_STRUCT detach_type; + LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; + LIBLTE_MME_EPS_MOBILE_ID_STRUCT eps_mobile_id; +} LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_request_msg(LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT *detach_req, +LIBLTE_ERROR_ENUM liblte_mme_pack_detach_request_msg(LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT* detach_req, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT *detach_req); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT* detach_req); /********************************************************************* Message Name: Downlink NAS Transport @@ -2906,16 +2741,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT nas_msg; -}LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT nas_msg; +} LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_nas_transport_msg(LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT *dl_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT *dl_nas_transport); +LIBLTE_ERROR_ENUM +liblte_mme_pack_downlink_nas_transport_msg(LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT* dl_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT* dl_nas_transport); /********************************************************************* Message Name: EMM Information @@ -2926,32 +2763,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_S Document Reference: 24.301 v10.2.0 Section 8.2.13 *********************************************************************/ // Defines -#define LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI 0x43 -#define LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI 0x45 -#define LIBLTE_MME_LOCAL_TIME_ZONE_IEI 0x46 +#define LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI 0x43 +#define LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI 0x45 +#define LIBLTE_MME_LOCAL_TIME_ZONE_IEI 0x46 #define LIBLTE_MME_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_IEI 0x47 -#define LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI 0x49 -// Enums -// Structs -typedef struct{ - LIBLTE_MME_NETWORK_NAME_STRUCT full_net_name; - LIBLTE_MME_NETWORK_NAME_STRUCT short_net_name; - LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT utc_and_local_time_zone; - LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM net_dst; - uint8 local_time_zone; - bool full_net_name_present; - bool short_net_name_present; - bool local_time_zone_present; - bool utc_and_local_time_zone_present; - bool net_dst_present; -}LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_information_msg(LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT *emm_info, +#define LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI 0x49 +// Enums +// Structs +typedef struct { + LIBLTE_MME_NETWORK_NAME_STRUCT full_net_name; + LIBLTE_MME_NETWORK_NAME_STRUCT short_net_name; + LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT utc_and_local_time_zone; + LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM net_dst; + uint8 local_time_zone; + bool full_net_name_present; + bool short_net_name_present; + bool local_time_zone_present; + bool utc_and_local_time_zone_present; + bool net_dst_present; +} LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_information_msg(LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT* emm_info, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT *emm_info); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT* emm_info); /********************************************************************* Message Name: EMM Status @@ -2964,16 +2801,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - uint8 emm_cause; -}LIBLTE_MME_EMM_STATUS_MSG_STRUCT; +typedef struct { + uint8 emm_cause; +} LIBLTE_MME_EMM_STATUS_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_status_msg(LIBLTE_MME_EMM_STATUS_MSG_STRUCT *emm_status, +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_status_msg(LIBLTE_MME_EMM_STATUS_MSG_STRUCT* emm_status, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EMM_STATUS_MSG_STRUCT *emm_status); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EMM_STATUS_MSG_STRUCT* emm_status); /********************************************************************* Message Name: Extended Service Request @@ -2990,29 +2827,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.15 *********************************************************************/ // Defines -#define LIBLTE_MME_CSFB_RESPONSE_IEI 0xB -#define LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI 0x57 +#define LIBLTE_MME_CSFB_RESPONSE_IEI 0xB +#define LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI 0x57 #define LIBLTE_MME_EXTENDED_SERVICE_REQUEST_DEVICE_PROPERTIES_IEI 0xD // Enums // Structs -typedef struct{ - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; - LIBLTE_MME_MOBILE_ID_STRUCT m_tmsi; - LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT eps_bearer_context_status; - LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props; - uint8 service_type; - uint8 csfb_resp; - bool csfb_resp_present; - bool eps_bearer_context_status_present; - bool device_props_present; -}LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_extended_service_request_msg(LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT *ext_service_req, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT *ext_service_req); +typedef struct { + LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; + LIBLTE_MME_MOBILE_ID_STRUCT m_tmsi; + LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT eps_bearer_context_status; + LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props; + uint8 service_type; + uint8 csfb_resp; + bool csfb_resp_present; + bool eps_bearer_context_status_present; + bool device_props_present; +} LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM +liblte_mme_pack_extended_service_request_msg(LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT* ext_service_req, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT* ext_service_req); /********************************************************************* Message Name: GUTI Reallocation Command @@ -3026,18 +2865,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG #define LIBLTE_MME_TAI_LIST_IEI 0x54 // Enums // Structs -typedef struct{ - LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; - bool tai_list_present; -}LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT; +typedef struct { + LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; + bool tai_list_present; +} LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_reallocation_command_msg(LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT *guti_realloc_cmd, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT *guti_realloc_cmd); +LIBLTE_ERROR_ENUM +liblte_mme_pack_guti_reallocation_command_msg(LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT* guti_realloc_cmd, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT* guti_realloc_cmd); /********************************************************************* Message Name: GUTI Reallocation Complete @@ -3050,15 +2891,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MS // Defines // Enums // Structs -typedef struct{ -}LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT; +typedef struct { +} LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_reallocation_complete_msg(LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT *guti_realloc_complete, +LIBLTE_ERROR_ENUM + liblte_mme_pack_guti_reallocation_complete_msg(LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT *guti_realloc_complete); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete); /********************************************************************* Message Name: Identity Request @@ -3071,14 +2913,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg(LIBLTE_BYTE_M // Defines // Enums // Structs -typedef struct{ - uint8 id_type; -}LIBLTE_MME_ID_REQUEST_MSG_STRUCT; +typedef struct { + uint8 id_type; +} LIBLTE_MME_ID_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_request_msg(LIBLTE_MME_ID_REQUEST_MSG_STRUCT *id_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ID_REQUEST_MSG_STRUCT *id_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_request_msg(LIBLTE_MME_ID_REQUEST_MSG_STRUCT* id_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ID_REQUEST_MSG_STRUCT* id_req); /********************************************************************* Message Name: Identity Response @@ -3092,14 +2934,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_MOBILE_ID_STRUCT mobile_id; -}LIBLTE_MME_ID_RESPONSE_MSG_STRUCT; +typedef struct { + LIBLTE_MME_MOBILE_ID_STRUCT mobile_id; +} LIBLTE_MME_ID_RESPONSE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_response_msg(LIBLTE_MME_ID_RESPONSE_MSG_STRUCT *id_resp, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ID_RESPONSE_MSG_STRUCT *id_resp); +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_response_msg(LIBLTE_MME_ID_RESPONSE_MSG_STRUCT* id_resp, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ID_RESPONSE_MSG_STRUCT* id_resp); /********************************************************************* Message Name: Security Mode Command @@ -3110,29 +2952,30 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.20 *********************************************************************/ // Defines -#define LIBLTE_MME_IMEISV_REQUEST_IEI 0xC +#define LIBLTE_MME_IMEISV_REQUEST_IEI 0xC #define LIBLTE_MME_REPLAYED_NONCE_UE_IEI 0x55 -#define LIBLTE_MME_NONCE_MME_IEI 0x56 -// Enums -// Structs -typedef struct{ - LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT selected_nas_sec_algs; - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; - LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT ue_security_cap; - LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req; - uint32 nonce_ue; - uint32 nonce_mme; - bool imeisv_req_present; - bool nonce_ue_present; - bool nonce_mme_present; -}LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_command_msg(LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT *sec_mode_cmd, +#define LIBLTE_MME_NONCE_MME_IEI 0x56 +// Enums +// Structs +typedef struct { + LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT selected_nas_sec_algs; + LIBLTE_MME_NAS_KEY_SET_ID_STRUCT nas_ksi; + LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT ue_security_cap; + LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req; + uint32 nonce_ue; + uint32 nonce_mme; + bool imeisv_req_present; + bool nonce_ue_present; + bool nonce_mme_present; +} LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_command_msg(LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT* sec_mode_cmd, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT *sec_mode_cmd); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT* sec_mode_cmd); /********************************************************************* Message Name: Security Mode Complete @@ -3146,17 +2989,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_ST #define LIBLTE_MME_IMEISV_IEI 0x23 // Enums // Structs -typedef struct{ - LIBLTE_MME_MOBILE_ID_STRUCT imeisv; - bool imeisv_present; -}LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT; +typedef struct { + LIBLTE_MME_MOBILE_ID_STRUCT imeisv; + bool imeisv_present; +} LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_complete_msg(LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT *sec_mode_comp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT *sec_mode_comp); +LIBLTE_ERROR_ENUM +liblte_mme_pack_security_mode_complete_msg(LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT* sec_mode_comp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT* sec_mode_comp); /********************************************************************* Message Name: Security Mode Reject @@ -3170,14 +3015,14 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_S // Defines // Enums // Structs -typedef struct{ - uint8 emm_cause; -}LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT; +typedef struct { + uint8 emm_cause; +} LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_reject_msg(LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT *sec_mode_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT *sec_mode_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_reject_msg(LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT* sec_mode_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT* sec_mode_rej); /********************************************************************* Message Name: Service Reject @@ -3191,20 +3036,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STR #define LIBLTE_MME_T3442_VALUE_IEI 0x5B // Enums // Structs -typedef struct{ - LIBLTE_MME_GPRS_TIMER_STRUCT t3442; - uint8 emm_cause; - uint8 t3446; - bool t3442_present; - bool t3446_present; -}LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_GPRS_TIMER_STRUCT t3442; + uint8 emm_cause; + uint8 t3446; + bool t3442_present; + bool t3446_present; +} LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_service_reject_msg(LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT *service_rej, +LIBLTE_ERROR_ENUM liblte_mme_pack_service_reject_msg(LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT* service_rej, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT *service_rej); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT* service_rej); /********************************************************************* Message Name: Service Request @@ -3218,15 +3063,15 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT ksi_and_seq_num; - uint16 short_mac; -}LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT ksi_and_seq_num; + uint16 short_mac; +} LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_service_request_msg(LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT *service_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT *service_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_service_request_msg(LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT* service_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT* service_req); /********************************************************************* Message Name: Tracking Area Update Accept @@ -3241,44 +3086,46 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT #define LIBLTE_MME_T3412_VALUE_IEI 0x5A // Enums // Structs -typedef struct{ - LIBLTE_MME_GPRS_TIMER_STRUCT t3412; - LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; - LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT eps_bearer_context_status; - LIBLTE_MME_LOCATION_AREA_ID_STRUCT lai; - LIBLTE_MME_MOBILE_ID_STRUCT ms_id; - LIBLTE_MME_GPRS_TIMER_STRUCT t3402; - LIBLTE_MME_GPRS_TIMER_STRUCT t3423; - LIBLTE_MME_PLMN_LIST_STRUCT equivalent_plmns; - LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT emerg_num_list; - LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT eps_network_feature_support; - LIBLTE_MME_GPRS_TIMER_3_STRUCT t3412_ext; - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM additional_update_result; - uint8 eps_update_result; - uint8 emm_cause; - bool t3412_present; - bool guti_present; - bool tai_list_present; - bool eps_bearer_context_status_present; - bool lai_present; - bool ms_id_present; - bool emm_cause_present; - bool t3402_present; - bool t3423_present; - bool equivalent_plmns_present; - bool emerg_num_list_present; - bool eps_network_feature_support_present; - bool additional_update_result_present; - bool t3412_ext_present; -}LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_accept_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT *ta_update_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT *ta_update_accept); +typedef struct { + LIBLTE_MME_GPRS_TIMER_STRUCT t3412; + LIBLTE_MME_EPS_MOBILE_ID_STRUCT guti; + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT tai_list; + LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT eps_bearer_context_status; + LIBLTE_MME_LOCATION_AREA_ID_STRUCT lai; + LIBLTE_MME_MOBILE_ID_STRUCT ms_id; + LIBLTE_MME_GPRS_TIMER_STRUCT t3402; + LIBLTE_MME_GPRS_TIMER_STRUCT t3423; + LIBLTE_MME_PLMN_LIST_STRUCT equivalent_plmns; + LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT emerg_num_list; + LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT eps_network_feature_support; + LIBLTE_MME_GPRS_TIMER_3_STRUCT t3412_ext; + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM additional_update_result; + uint8 eps_update_result; + uint8 emm_cause; + bool t3412_present; + bool guti_present; + bool tai_list_present; + bool eps_bearer_context_status_present; + bool lai_present; + bool ms_id_present; + bool emm_cause_present; + bool t3402_present; + bool t3423_present; + bool equivalent_plmns_present; + bool emerg_num_list_present; + bool eps_network_feature_support_present; + bool additional_update_result_present; + bool t3412_ext_present; +} LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_update_accept_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT* ta_update_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT* ta_update_accept); /********************************************************************* Message Name: Tracking Area Update Complete @@ -3292,15 +3139,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_ // Defines // Enums // Structs -typedef struct{ -}LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT; +typedef struct { +} LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_complete_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT *ta_update_complete, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT *ta_update_complete); +LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_complete_msg( + LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete); /********************************************************************* Message Name: Tracking Area Update Reject @@ -3313,18 +3161,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg(LIBLTE_BYT // Defines // Enums // Structs -typedef struct{ - uint8 emm_cause; - uint8 t3446; - bool t3446_present; -}LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT; +typedef struct { + uint8 emm_cause; + uint8 t3446; + bool t3446_present; +} LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_reject_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT *ta_update_rej, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT *ta_update_rej); +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_update_reject_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT* ta_update_rej, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT* ta_update_rej); /********************************************************************* Message Name: Tracking Area Update Request @@ -3351,16 +3201,17 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_ // Defines // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT nas_msg; -}LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT nas_msg; +} LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_nas_transport_msg(LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT *ul_nas_transport, +LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_nas_transport_msg(LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT* ul_nas_transport, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT *ul_nas_transport); + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT* ul_nas_transport); /********************************************************************* Message Name: Downlink Generic NAS Transport @@ -3373,19 +3224,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STR // Defines // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT generic_msg_cont; - LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT add_info; - uint8 generic_msg_cont_type; - bool add_info_present; -}LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT generic_msg_cont; + LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT add_info; + uint8 generic_msg_cont_type; + bool add_info_present; +} LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_generic_nas_transport_msg(LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *dl_generic_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *dl_generic_nas_transport); +LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_generic_nas_transport_msg( + LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport); /********************************************************************* Message Name: Uplink Generic NAS Transport @@ -3398,19 +3250,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg(LIBLTE_BY // Defines // Enums // Structs -typedef struct{ - LIBLTE_BYTE_MSG_STRUCT generic_msg_cont; - LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT add_info; - uint8 generic_msg_cont_type; - bool add_info_present; -}LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT; +typedef struct { + LIBLTE_BYTE_MSG_STRUCT generic_msg_cont; + LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT add_info; + uint8 generic_msg_cont_type; + bool add_info_present; +} LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_generic_nas_transport_msg(LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *ul_generic_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *ul_generic_nas_transport); +LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_generic_nas_transport_msg( + LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport); /********************************************************************* Message Name: Activate Dedicated EPS Bearer Context Accept @@ -3426,19 +3279,21 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg(LIBLTE_BYTE #define LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI 0x27 // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_accept_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_ded_eps_bearer_context_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_ded_eps_bearer_context_accept); +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_accept_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_ded_eps_bearer_context_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_ded_eps_bearer_context_accept); /********************************************************************* Message Name: Activate Dedicated EPS Bearer Context Reject @@ -3451,18 +3306,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_reject_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_ded_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_ded_eps_bearer_context_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_reject_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_ded_eps_bearer_context_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_ded_eps_bearer_context_rej); /********************************************************************* Message Name: Activate Dedicated EPS Bearer Context Request @@ -3477,30 +3334,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT eps_qos; - LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT tft; - LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT transaction_id; - LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT negotiated_qos; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 linked_eps_bearer_id; - uint8 llc_sapi; - uint8 radio_prio; - uint8 packet_flow_id; - bool transaction_id_present; - bool negotiated_qos_present; - bool llc_sapi_present; - bool radio_prio_present; - bool packet_flow_id_present; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_request_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_ded_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_ded_eps_bearer_context_req); +typedef struct { + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT eps_qos; + LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT tft; + LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT transaction_id; + LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT negotiated_qos; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 linked_eps_bearer_id; + uint8 llc_sapi; + uint8 radio_prio; + uint8 packet_flow_id; + bool transaction_id_present; + bool negotiated_qos_present; + bool llc_sapi_present; + bool radio_prio_present; + bool packet_flow_id_present; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_request_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_ded_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_ded_eps_bearer_context_req); /********************************************************************* Message Name: Activate Default EPS Bearer Context Accept @@ -3513,17 +3372,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reques // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_accept_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_def_eps_bearer_context_accept, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_def_eps_bearer_context_accept); +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_accept_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_def_eps_bearer_context_accept, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_def_eps_bearer_context_accept); /********************************************************************* Message Name: Activate Default EPS Bearer Context Reject @@ -3536,18 +3397,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_m // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_reject_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_def_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_def_eps_bearer_context_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_reject_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_def_eps_bearer_context_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_def_eps_bearer_context_rej); /********************************************************************* Message Name: Activate Default EPS Bearer Context Request @@ -3559,45 +3422,47 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_m *********************************************************************/ // Defines #define LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI 0x5D -#define LIBLTE_MME_QUALITY_OF_SERVICE_IEI 0x30 -#define LIBLTE_MME_LLC_SAPI_IEI 0x32 -#define LIBLTE_MME_RADIO_PRIORITY_IEI 0x8 +#define LIBLTE_MME_QUALITY_OF_SERVICE_IEI 0x30 +#define LIBLTE_MME_LLC_SAPI_IEI 0x32 +#define LIBLTE_MME_RADIO_PRIORITY_IEI 0x8 #define LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI 0x34 -#define LIBLTE_MME_APN_AMBR_IEI 0x5E -#define LIBLTE_MME_ESM_CAUSE_IEI 0x58 -#define LIBLTE_MME_CONNECTIVITY_TYPE_IEI 0xB -// Enums -// Structs -typedef struct{ - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT eps_qos; - LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; - LIBLTE_MME_PDN_ADDRESS_STRUCT pdn_addr; - LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT transaction_id; - LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT negotiated_qos; - LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT apn_ambr; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 llc_sapi; - uint8 radio_prio; - uint8 packet_flow_id; - uint8 esm_cause; - uint8 connectivity_type; - bool transaction_id_present; - bool negotiated_qos_present; - bool llc_sapi_present; - bool radio_prio_present; - bool packet_flow_id_present; - bool apn_ambr_present; - bool esm_cause_present; - bool protocol_cnfg_opts_present; - bool connectivity_type_present; -}LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_request_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_def_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_def_eps_bearer_context_req); +#define LIBLTE_MME_APN_AMBR_IEI 0x5E +#define LIBLTE_MME_ESM_CAUSE_IEI 0x58 +#define LIBLTE_MME_CONNECTIVITY_TYPE_IEI 0xB +// Enums +// Structs +typedef struct { + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT eps_qos; + LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; + LIBLTE_MME_PDN_ADDRESS_STRUCT pdn_addr; + LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT transaction_id; + LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT negotiated_qos; + LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT apn_ambr; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 llc_sapi; + uint8 radio_prio; + uint8 packet_flow_id; + uint8 esm_cause; + uint8 connectivity_type; + bool transaction_id_present; + bool negotiated_qos_present; + bool llc_sapi_present; + bool radio_prio_present; + bool packet_flow_id_present; + bool apn_ambr_present; + bool esm_cause_present; + bool protocol_cnfg_opts_present; + bool connectivity_type_present; +} LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_request_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_def_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_def_eps_bearer_context_req); /********************************************************************* Message Name: Bearer Resource Allocation Reject @@ -3611,20 +3476,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_ #define LIBLTE_MME_T3496_VALUE_IEI 0x37 // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; - bool t3496_present; -}LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; + bool t3496_present; +} LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg(LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT *bearer_res_alloc_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT *bearer_res_alloc_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg( + LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej); /********************************************************************* Message Name: Bearer Resource Allocation Request @@ -3638,22 +3503,22 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg(LIBLTE #define LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_DEVICE_PROPERTIES_IEI 0xC // Enums // Structs -typedef struct{ - LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT tfa; - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT req_tf_qos; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 linked_eps_bearer_id; - bool protocol_cnfg_opts_present; - bool device_properties_present; -}LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT tfa; + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT req_tf_qos; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 linked_eps_bearer_id; + bool protocol_cnfg_opts_present; + bool device_properties_present; +} LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg(LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT *bearer_res_alloc_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT *bearer_res_alloc_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg( + LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req); /********************************************************************* Message Name: Bearer Resource Modification Reject @@ -3666,20 +3531,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg(LIBLT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; - bool t3496_present; -}LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; + bool t3496_present; +} LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg(LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT *bearer_res_mod_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT *bearer_res_mod_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg( + LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej); /********************************************************************* Message Name: Bearer Resource Modification Request @@ -3690,29 +3555,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg(LIBL Document Reference: 24.301 v10.2.0 Section 8.3.10 *********************************************************************/ // Defines -#define LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI 0x5B +#define LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI 0x5B #define LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_DEVICE_PROPERTIES_IEI 0xC // Enums // Structs -typedef struct{ - LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT tfa; - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT req_tf_qos; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 eps_bearer_id_for_packet_filter; - uint8 esm_cause; - bool req_tf_qos_present; - bool esm_cause_present; - bool protocol_cnfg_opts_present; - bool device_properties_present; -}LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT tfa; + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT req_tf_qos; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 eps_bearer_id_for_packet_filter; + uint8 esm_cause; + bool req_tf_qos_present; + bool esm_cause_present; + bool protocol_cnfg_opts_present; + bool device_properties_present; +} LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg(LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT *bearer_res_mod_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT *bearer_res_mod_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg( + LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req); /********************************************************************* Message Name: Deactivate EPS Bearer Context Accept @@ -3726,20 +3591,21 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg(LIB // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; // Functions LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_accept_msg( LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* deact_eps_bearer_context_accept, uint8 sec_hdr_type, uint32 count, LIBLTE_BYTE_MSG_STRUCT* msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *deact_eps_bearer_context_accept); +LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* deact_eps_bearer_context_accept); /********************************************************************* Message Name: Deactivate EPS Bearer Context Request @@ -3752,18 +3618,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg(LIB // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg(LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *deact_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *deact_eps_bearer_context_req); +LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg( + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req); /********************************************************************* Message Name: ESM Information Request @@ -3777,19 +3645,22 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg(LI // Defines // Enums // Structs -typedef struct{ - uint8 eps_bearer_id; - uint8 proc_transaction_id; -}LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT; +typedef struct { + uint8 eps_bearer_id; + uint8 proc_transaction_id; +} LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM srslte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req); +LIBLTE_ERROR_ENUM +srslte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req); /********************************************************************* Message Name: ESM Information Response @@ -3803,23 +3674,26 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_ // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - bool apn_present; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT; +typedef struct { + LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + bool apn_present; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp); -LIBLTE_ERROR_ENUM srslte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp); +LIBLTE_ERROR_ENUM +liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp); +LIBLTE_ERROR_ENUM +srslte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp); /********************************************************************* Message Name: ESM Status @@ -3833,16 +3707,16 @@ LIBLTE_ERROR_ENUM srslte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG // Defines // Enums // Structs -typedef struct{ - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; -}LIBLTE_MME_ESM_STATUS_MSG_STRUCT; +typedef struct { + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; +} LIBLTE_MME_ESM_STATUS_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_status_msg(LIBLTE_MME_ESM_STATUS_MSG_STRUCT *esm_status, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_STATUS_MSG_STRUCT *esm_status); +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_status_msg(LIBLTE_MME_ESM_STATUS_MSG_STRUCT* esm_status, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_STATUS_MSG_STRUCT* esm_status); /********************************************************************* Message Name: Modify EPS Bearer Context Accept @@ -3855,19 +3729,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_accept_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *mod_eps_bearer_context_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *mod_eps_bearer_context_accept); +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_accept_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept); /********************************************************************* Message Name: Modify EPS Bearer Context Reject @@ -3880,18 +3755,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg(LIBLTE_ // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *mod_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *mod_eps_bearer_context_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej); /********************************************************************* Message Name: Modify EPS Bearer Context Request @@ -3903,34 +3778,34 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg(LIBLTE_ *********************************************************************/ // Defines #define LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_IEI 0x36 -#define LIBLTE_MME_QUALITY_OF_SERVICE_IEI 0x30 -// Enums -// Structs -typedef struct{ - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT new_eps_qos; - LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT tft; - LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT new_qos; - LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT apn_ambr; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 negotiated_llc_sapi; - uint8 radio_prio; - uint8 packet_flow_id; - bool new_eps_qos_present; - bool tft_present; - bool new_qos_present; - bool negotiated_llc_sapi_present; - bool radio_prio_present; - bool packet_flow_id_present; - bool apn_ambr_present; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *mod_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *mod_eps_bearer_context_req); +#define LIBLTE_MME_QUALITY_OF_SERVICE_IEI 0x30 +// Enums +// Structs +typedef struct { + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT new_eps_qos; + LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT tft; + LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT new_qos; + LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT apn_ambr; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 negotiated_llc_sapi; + uint8 radio_prio; + uint8 packet_flow_id; + bool new_eps_qos_present; + bool tft_present; + bool new_qos_present; + bool negotiated_llc_sapi_present; + bool radio_prio_present; + bool packet_flow_id_present; + bool apn_ambr_present; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req); /********************************************************************* Message Name: Notification @@ -3945,16 +3820,16 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg(LIBLTE // Defines // Enums // Structs -typedef struct{ - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 notification_ind; -}LIBLTE_MME_NOTIFICATION_MSG_STRUCT; +typedef struct { + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 notification_ind; +} LIBLTE_MME_NOTIFICATION_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_notification_msg(LIBLTE_MME_NOTIFICATION_MSG_STRUCT *notification, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_NOTIFICATION_MSG_STRUCT *notification); +LIBLTE_ERROR_ENUM liblte_mme_pack_notification_msg(LIBLTE_MME_NOTIFICATION_MSG_STRUCT* notification, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_NOTIFICATION_MSG_STRUCT* notification); /********************************************************************* Message Name: PDN Connectivity Reject @@ -3967,20 +3842,22 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; - bool t3496_present; -}LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_GPRS_TIMER_3_STRUCT t3496; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; + bool t3496_present; +} LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_connectivity_reject_msg(LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT *pdn_con_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT *pdn_con_rej); +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_connectivity_reject_msg(LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT* pdn_con_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT* pdn_con_rej); /********************************************************************* Message Name: PDN Connectivity Request @@ -3991,30 +3868,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_ Document Reference: 24.301 v10.2.0 Section 8.3.20 *********************************************************************/ // Defines -#define LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI 0xD -#define LIBLTE_MME_ACCESS_POINT_NAME_IEI 0x28 +#define LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI 0xD +#define LIBLTE_MME_ACCESS_POINT_NAME_IEI 0x28 #define LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_IEI 0xC // Enums // Structs -typedef struct{ - LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag; - LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 pdn_type; - uint8 request_type; - bool esm_info_transfer_flag_present; - bool apn_present; - bool protocol_cnfg_opts_present; - bool device_properties_present; -}LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT; -// Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_connectivity_request_msg(LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req); +typedef struct { + LIBLTE_MME_ACCESS_POINT_NAME_STRUCT apn; + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag; + LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_properties; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 pdn_type; + uint8 request_type; + bool esm_info_transfer_flag_present; + bool apn_present; + bool protocol_cnfg_opts_present; + bool device_properties_present; +} LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT; +// Functions +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_connectivity_request_msg(LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT* pdn_con_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT* pdn_con_req); /********************************************************************* Message Name: PDN Disconnect Reject @@ -4027,18 +3906,19 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 esm_cause; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 esm_cause; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_reject_msg(LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT *pdn_discon_rej, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT *pdn_discon_rej); +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_reject_msg(LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT* pdn_discon_rej, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT* pdn_discon_rej); /********************************************************************* Message Name: PDN Disconnect Request @@ -4051,18 +3931,20 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_ST // Defines // Enums // Structs -typedef struct{ - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; - uint8 eps_bearer_id; - uint8 proc_transaction_id; - uint8 linked_eps_bearer_id; - bool protocol_cnfg_opts_present; -}LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT; +typedef struct { + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts; + uint8 eps_bearer_id; + uint8 proc_transaction_id; + uint8 linked_eps_bearer_id; + bool protocol_cnfg_opts_present; +} LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT; // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_request_msg(LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT *pdn_discon_req, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT *pdn_discon_req); +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_disconnect_request_msg(LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT* pdn_discon_req, + LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_disconnect_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT* pdn_discon_req); /********************************************************************* Message Name: ACTIVATE TEST MODE COMPLETE @@ -4076,9 +3958,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_request_msg(LIBLTE_BYTE_MSG_S // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_test_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 sec_hdr_type, - uint32 count); - +LIBLTE_ERROR_ENUM +liblte_mme_pack_activate_test_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, uint8 sec_hdr_type, uint32 count); #endif // SRSLTE_LIBLTE_MME_H diff --git a/lib/include/srslte/asn1/liblte_s1ap.h b/lib/include/srslte/asn1/liblte_s1ap.h index 3a2d632ff..14d66c885 100644 --- a/lib/include/srslte/asn1/liblte_s1ap.h +++ b/lib/include/srslte/asn1/liblte_s1ap.h @@ -39,869 +39,802 @@ LOGGING *******************************************************************************/ -typedef void (*log_handler_t)(void *ctx, char *str); - -void liblte_log_register_handler(void *ctx, log_handler_t handler); +typedef void (*log_handler_t)(void* ctx, char* str); +void liblte_log_register_handler(void* ctx, log_handler_t handler); /******************************************************************************* /* MAX defines ********************************************************************************/ -#define LIBLTE_S1AP_MAXPRIVATEIES 65535 -#define LIBLTE_S1AP_MAXPROTOCOLIES 65535 -#define LIBLTE_S1AP_MAXNOOFE_RABS 256 -#define LIBLTE_S1AP_MAXNOOFTACS 256 -#define LIBLTE_S1AP_MAXNOOFBPLMNS 6 -#define LIBLTE_S1AP_MAXNOOFEPLMNS 15 -#define LIBLTE_S1AP_MAXNOOFFORBLACS 4096 -#define LIBLTE_S1AP_MAXNOOFINDIVIDUALS1CONNECTIONSTORESET 256 -#define LIBLTE_S1AP_MAXNOOFTAIFORWARNING 65535 -#define LIBLTE_S1AP_MAXNOOFEMERGENCYAREAID 65535 -#define LIBLTE_S1AP_MAXNOOFCELLINEAI 65535 -#define LIBLTE_S1AP_MAXNOOFENBX2EXTTLAS 16 -#define LIBLTE_S1AP_MAXNOOFRATS 8 -#define LIBLTE_S1AP_MAXNOOFMMECS 256 -#define LIBLTE_S1AP_MAXNOOFTAFORMDT 8 -#define LIBLTE_S1AP_MAXNOOFCELLSFORRESTART 256 -#define LIBLTE_S1AP_MAXNOOFRESTARTEMERGENCYAREAIDS 256 -#define LIBLTE_S1AP_MAXNOOFCSGS 256 -#define LIBLTE_S1AP_MAXNOOFERRORS 256 -#define LIBLTE_S1AP_MAXNOOFEPLMNSPLUSONE 16 -#define LIBLTE_S1AP_MAXNOOFCELLS 16 -#define LIBLTE_S1AP_MAXNOOFCELLINTAI 65535 -#define LIBLTE_S1AP_MAXNOOFENBX2GTPTLAS 16 -#define LIBLTE_S1AP_MAXNOOFCELLIDFORMDT 32 -#define LIBLTE_S1AP_MAXNOOFRESTARTTAIS 2048 -#define LIBLTE_S1AP_MAXPROTOCOLEXTENSIONS 65535 -#define LIBLTE_S1AP_MAXNOOFPLMNSPERMME 32 -#define LIBLTE_S1AP_MAXNOOFCELLID 65535 -#define LIBLTE_S1AP_MAXNOOFGROUPIDS 65535 -#define LIBLTE_S1AP_MAXNOOFTAIS 256 -#define LIBLTE_S1AP_MAXNOOFENBX2TLAS 2 -#define LIBLTE_S1AP_MAXNOOFMDTPLMNS 16 -#define LIBLTE_S1AP_MAXNOOFFORBTACS 4096 +#define LIBLTE_S1AP_MAXPRIVATEIES 65535 +#define LIBLTE_S1AP_MAXPROTOCOLIES 65535 +#define LIBLTE_S1AP_MAXNOOFE_RABS 256 +#define LIBLTE_S1AP_MAXNOOFTACS 256 +#define LIBLTE_S1AP_MAXNOOFBPLMNS 6 +#define LIBLTE_S1AP_MAXNOOFEPLMNS 15 +#define LIBLTE_S1AP_MAXNOOFFORBLACS 4096 +#define LIBLTE_S1AP_MAXNOOFINDIVIDUALS1CONNECTIONSTORESET 256 +#define LIBLTE_S1AP_MAXNOOFTAIFORWARNING 65535 +#define LIBLTE_S1AP_MAXNOOFEMERGENCYAREAID 65535 +#define LIBLTE_S1AP_MAXNOOFCELLINEAI 65535 +#define LIBLTE_S1AP_MAXNOOFENBX2EXTTLAS 16 +#define LIBLTE_S1AP_MAXNOOFRATS 8 +#define LIBLTE_S1AP_MAXNOOFMMECS 256 +#define LIBLTE_S1AP_MAXNOOFTAFORMDT 8 +#define LIBLTE_S1AP_MAXNOOFCELLSFORRESTART 256 +#define LIBLTE_S1AP_MAXNOOFRESTARTEMERGENCYAREAIDS 256 +#define LIBLTE_S1AP_MAXNOOFCSGS 256 +#define LIBLTE_S1AP_MAXNOOFERRORS 256 +#define LIBLTE_S1AP_MAXNOOFEPLMNSPLUSONE 16 +#define LIBLTE_S1AP_MAXNOOFCELLS 16 +#define LIBLTE_S1AP_MAXNOOFCELLINTAI 65535 +#define LIBLTE_S1AP_MAXNOOFENBX2GTPTLAS 16 +#define LIBLTE_S1AP_MAXNOOFCELLIDFORMDT 32 +#define LIBLTE_S1AP_MAXNOOFRESTARTTAIS 2048 +#define LIBLTE_S1AP_MAXPROTOCOLEXTENSIONS 65535 +#define LIBLTE_S1AP_MAXNOOFPLMNSPERMME 32 +#define LIBLTE_S1AP_MAXNOOFCELLID 65535 +#define LIBLTE_S1AP_MAXNOOFGROUPIDS 65535 +#define LIBLTE_S1AP_MAXNOOFTAIS 256 +#define LIBLTE_S1AP_MAXNOOFENBX2TLAS 2 +#define LIBLTE_S1AP_MAXNOOFMDTPLMNS 16 +#define LIBLTE_S1AP_MAXNOOFFORBTACS 4096 /******************************************************************************* /* Elementary Procedures ********************************************************************************/ -typedef enum{ - LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION = 0, - LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION = 1, - LIBLTE_S1AP_PROC_ID_HANDOVERNOTIFICATION = 2, - LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST = 3, - LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL = 4, - LIBLTE_S1AP_PROC_ID_E_RABSETUP = 5, - LIBLTE_S1AP_PROC_ID_E_RABMODIFY = 6, - LIBLTE_S1AP_PROC_ID_E_RABRELEASE = 7, - LIBLTE_S1AP_PROC_ID_E_RABRELEASEINDICATION = 8, - LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP = 9, - LIBLTE_S1AP_PROC_ID_PAGING = 10, - LIBLTE_S1AP_PROC_ID_DOWNLINKNASTRANSPORT = 11, - LIBLTE_S1AP_PROC_ID_INITIALUEMESSAGE = 12, - LIBLTE_S1AP_PROC_ID_UPLINKNASTRANSPORT = 13, - LIBLTE_S1AP_PROC_ID_RESET = 14, - LIBLTE_S1AP_PROC_ID_ERRORINDICATION = 15, - LIBLTE_S1AP_PROC_ID_NASNONDELIVERYINDICATION = 16, - LIBLTE_S1AP_PROC_ID_S1SETUP = 17, - LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASEREQUEST = 18, - LIBLTE_S1AP_PROC_ID_DOWNLINKS1CDMA2000TUNNELING = 19, - LIBLTE_S1AP_PROC_ID_UPLINKS1CDMA2000TUNNELING = 20, - LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION = 21, - LIBLTE_S1AP_PROC_ID_UECAPABILITYINFOINDICATION = 22, - LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE = 23, - LIBLTE_S1AP_PROC_ID_ENBSTATUSTRANSFER = 24, - LIBLTE_S1AP_PROC_ID_MMESTATUSTRANSFER = 25, - LIBLTE_S1AP_PROC_ID_DEACTIVATETRACE = 26, - LIBLTE_S1AP_PROC_ID_TRACESTART = 27, - LIBLTE_S1AP_PROC_ID_TRACEFAILUREINDICATION = 28, - LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE = 29, - LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE = 30, - LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGCONTROL = 31, - LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGFAILUREINDICATION = 32, - LIBLTE_S1AP_PROC_ID_LOCATIONREPORT = 33, - LIBLTE_S1AP_PROC_ID_OVERLOADSTART = 34, - LIBLTE_S1AP_PROC_ID_OVERLOADSTOP = 35, - LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING = 36, - LIBLTE_S1AP_PROC_ID_ENBDIRECTINFORMATIONTRANSFER = 37, - LIBLTE_S1AP_PROC_ID_MMEDIRECTINFORMATIONTRANSFER = 38, - LIBLTE_S1AP_PROC_ID_PRIVATEMESSAGE = 39, - LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONTRANSFER = 40, - LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONTRANSFER = 41, - LIBLTE_S1AP_PROC_ID_CELLTRAFFICTRACE = 42, - LIBLTE_S1AP_PROC_ID_KILL = 43, - LIBLTE_S1AP_PROC_ID_DOWNLINKUEASSOCIATEDLPPATRANSPORT = 44, - LIBLTE_S1AP_PROC_ID_UPLINKUEASSOCIATEDLPPATRANSPORT = 45, - LIBLTE_S1AP_PROC_ID_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT = 46, - LIBLTE_S1AP_PROC_ID_UPLINKNONUEASSOCIATEDLPPATRANSPORT = 47, - LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH = 48, - LIBLTE_S1AP_PROC_ID_PWSRESTARTINDICATION = 49, +typedef enum { + LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION = 0, + LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION = 1, + LIBLTE_S1AP_PROC_ID_HANDOVERNOTIFICATION = 2, + LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST = 3, + LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL = 4, + LIBLTE_S1AP_PROC_ID_E_RABSETUP = 5, + LIBLTE_S1AP_PROC_ID_E_RABMODIFY = 6, + LIBLTE_S1AP_PROC_ID_E_RABRELEASE = 7, + LIBLTE_S1AP_PROC_ID_E_RABRELEASEINDICATION = 8, + LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP = 9, + LIBLTE_S1AP_PROC_ID_PAGING = 10, + LIBLTE_S1AP_PROC_ID_DOWNLINKNASTRANSPORT = 11, + LIBLTE_S1AP_PROC_ID_INITIALUEMESSAGE = 12, + LIBLTE_S1AP_PROC_ID_UPLINKNASTRANSPORT = 13, + LIBLTE_S1AP_PROC_ID_RESET = 14, + LIBLTE_S1AP_PROC_ID_ERRORINDICATION = 15, + LIBLTE_S1AP_PROC_ID_NASNONDELIVERYINDICATION = 16, + LIBLTE_S1AP_PROC_ID_S1SETUP = 17, + LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASEREQUEST = 18, + LIBLTE_S1AP_PROC_ID_DOWNLINKS1CDMA2000TUNNELING = 19, + LIBLTE_S1AP_PROC_ID_UPLINKS1CDMA2000TUNNELING = 20, + LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION = 21, + LIBLTE_S1AP_PROC_ID_UECAPABILITYINFOINDICATION = 22, + LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE = 23, + LIBLTE_S1AP_PROC_ID_ENBSTATUSTRANSFER = 24, + LIBLTE_S1AP_PROC_ID_MMESTATUSTRANSFER = 25, + LIBLTE_S1AP_PROC_ID_DEACTIVATETRACE = 26, + LIBLTE_S1AP_PROC_ID_TRACESTART = 27, + LIBLTE_S1AP_PROC_ID_TRACEFAILUREINDICATION = 28, + LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE = 29, + LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE = 30, + LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGCONTROL = 31, + LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGFAILUREINDICATION = 32, + LIBLTE_S1AP_PROC_ID_LOCATIONREPORT = 33, + LIBLTE_S1AP_PROC_ID_OVERLOADSTART = 34, + LIBLTE_S1AP_PROC_ID_OVERLOADSTOP = 35, + LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING = 36, + LIBLTE_S1AP_PROC_ID_ENBDIRECTINFORMATIONTRANSFER = 37, + LIBLTE_S1AP_PROC_ID_MMEDIRECTINFORMATIONTRANSFER = 38, + LIBLTE_S1AP_PROC_ID_PRIVATEMESSAGE = 39, + LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONTRANSFER = 40, + LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONTRANSFER = 41, + LIBLTE_S1AP_PROC_ID_CELLTRAFFICTRACE = 42, + LIBLTE_S1AP_PROC_ID_KILL = 43, + LIBLTE_S1AP_PROC_ID_DOWNLINKUEASSOCIATEDLPPATRANSPORT = 44, + LIBLTE_S1AP_PROC_ID_UPLINKUEASSOCIATEDLPPATRANSPORT = 45, + LIBLTE_S1AP_PROC_ID_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT = 46, + LIBLTE_S1AP_PROC_ID_UPLINKNONUEASSOCIATEDLPPATRANSPORT = 47, + LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH = 48, + LIBLTE_S1AP_PROC_ID_PWSRESTARTINDICATION = 49, LIBLTE_S1AP_PROC_N_ITEMS, -}LIBLTE_S1AP_PROC_ENUM; -static const char liblte_s1ap_proc_text[LIBLTE_S1AP_PROC_N_ITEMS][64] = { - "id-HandoverPreparation", - "id-HandoverResourceAllocation", - "id-HandoverNotification", - "id-PathSwitchRequest", - "id-HandoverCancel", - "id-E-RABSetup", - "id-E-RABModify", - "id-E-RABRelease", - "id-E-RABReleaseIndication", - "id-InitialContextSetup", - "id-Paging", - "id-downlinkNASTransport", - "id-initialUEMessage", - "id-uplinkNASTransport", - "id-Reset", - "id-ErrorIndication", - "id-NASNonDeliveryIndication", - "id-S1Setup", - "id-UEContextReleaseRequest", - "id-DownlinkS1cdma2000tunneling", - "id-UplinkS1cdma2000tunneling", - "id-UEContextModification", - "id-UECapabilityInfoIndication", - "id-UEContextRelease", - "id-eNBStatusTransfer", - "id-MMEStatusTransfer", - "id-DeactivateTrace", - "id-TraceStart", - "id-TraceFailureIndication", - "id-ENBConfigurationUpdate", - "id-MMEConfigurationUpdate", - "id-LocationReportingControl", - "id-LocationReportingFailureIndication", - "id-LocationReport", - "id-OverloadStart", - "id-OverloadStop", - "id-WriteReplaceWarning", - "id-eNBDirectInformationTransfer", - "id-MMEDirectInformationTransfer", - "id-PrivateMessage", - "id-eNBConfigurationTransfer", - "id-MMEConfigurationTransfer", - "id-CellTrafficTrace", - "id-Kill", - "id-downlinkUEAssociatedLPPaTransport", - "id-uplinkUEAssociatedLPPaTransport", - "id-downlinkNonUEAssociatedLPPaTransport", - "id-uplinkNonUEAssociatedLPPaTransport", - "id-UERadioCapabilityMatch", - "id-PWSRestartIndication", +} LIBLTE_S1AP_PROC_ENUM; +static const char liblte_s1ap_proc_text[LIBLTE_S1AP_PROC_N_ITEMS][64] = { + "id-HandoverPreparation", + "id-HandoverResourceAllocation", + "id-HandoverNotification", + "id-PathSwitchRequest", + "id-HandoverCancel", + "id-E-RABSetup", + "id-E-RABModify", + "id-E-RABRelease", + "id-E-RABReleaseIndication", + "id-InitialContextSetup", + "id-Paging", + "id-downlinkNASTransport", + "id-initialUEMessage", + "id-uplinkNASTransport", + "id-Reset", + "id-ErrorIndication", + "id-NASNonDeliveryIndication", + "id-S1Setup", + "id-UEContextReleaseRequest", + "id-DownlinkS1cdma2000tunneling", + "id-UplinkS1cdma2000tunneling", + "id-UEContextModification", + "id-UECapabilityInfoIndication", + "id-UEContextRelease", + "id-eNBStatusTransfer", + "id-MMEStatusTransfer", + "id-DeactivateTrace", + "id-TraceStart", + "id-TraceFailureIndication", + "id-ENBConfigurationUpdate", + "id-MMEConfigurationUpdate", + "id-LocationReportingControl", + "id-LocationReportingFailureIndication", + "id-LocationReport", + "id-OverloadStart", + "id-OverloadStop", + "id-WriteReplaceWarning", + "id-eNBDirectInformationTransfer", + "id-MMEDirectInformationTransfer", + "id-PrivateMessage", + "id-eNBConfigurationTransfer", + "id-MMEConfigurationTransfer", + "id-CellTrafficTrace", + "id-Kill", + "id-downlinkUEAssociatedLPPaTransport", + "id-uplinkUEAssociatedLPPaTransport", + "id-downlinkNonUEAssociatedLPPaTransport", + "id-uplinkNonUEAssociatedLPPaTransport", + "id-UERadioCapabilityMatch", + "id-PWSRestartIndication", }; - - /******************************************************************************* /* ProtocolIE Ids ********************************************************************************/ -typedef enum{ - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID = 0, - LIBLTE_S1AP_IE_ID_HANDOVERTYPE = 1, - LIBLTE_S1AP_IE_ID_CAUSE = 2, - LIBLTE_S1AP_IE_ID_SOURCEID = 3, - LIBLTE_S1AP_IE_ID_TARGETID = 4, - LIBLTE_S1AP_IE_ID_SPARE5 = 5, - LIBLTE_S1AP_IE_ID_SPARE6 = 6, - LIBLTE_S1AP_IE_ID_SPARE7 = 7, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID = 8, - LIBLTE_S1AP_IE_ID_SPARE9 = 9, - LIBLTE_S1AP_IE_ID_SPARE10 = 10, - LIBLTE_S1AP_IE_ID_SPARE11 = 11, - LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST = 12, - LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD = 13, - LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM = 14, - LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP = 15, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ = 16, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ = 17, - LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST = 18, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK = 19, - LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM = 20, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK = 21, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST = 22, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM = 23, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ = 24, - LIBLTE_S1AP_IE_ID_TRACEACTIVATION = 25, - LIBLTE_S1AP_IE_ID_NAS_PDU = 26, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ = 27, - LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES = 28, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES = 29, - LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ = 30, - LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES = 31, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST = 32, - LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST = 33, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST = 34, - LIBLTE_S1AP_IE_ID_E_RABITEM = 35, - LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ = 36, - LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES = 37, - LIBLTE_S1AP_IE_ID_E_RABRELEASEITEM = 38, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES = 39, - LIBLTE_S1AP_IE_ID_SECURITYCONTEXT = 40, - LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST = 41, - LIBLTE_S1AP_IE_ID_SPARE42 = 42, - LIBLTE_S1AP_IE_ID_UEPAGINGID = 43, - LIBLTE_S1AP_IE_ID_PAGINGDRX = 44, - LIBLTE_S1AP_IE_ID_SPARE45 = 45, - LIBLTE_S1AP_IE_ID_TAILIST = 46, - LIBLTE_S1AP_IE_ID_TAIITEM = 47, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES = 48, - LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMHOCMD = 49, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES = 50, - LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES = 51, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ = 52, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ = 53, - LIBLTE_S1AP_IE_ID_SPARE54 = 54, - LIBLTE_S1AP_IE_ID_GERANTOLTEHOINFORMATIONRES = 55, - LIBLTE_S1AP_IE_ID_SPARE56 = 56, - LIBLTE_S1AP_IE_ID_UTRANTOLTEHOINFORMATIONRES = 57, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS = 58, - LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID = 59, - LIBLTE_S1AP_IE_ID_ENBNAME = 60, - LIBLTE_S1AP_IE_ID_MMENAME = 61, - LIBLTE_S1AP_IE_ID_SPARE62 = 62, - LIBLTE_S1AP_IE_ID_SERVEDPLMNS = 63, - LIBLTE_S1AP_IE_ID_SUPPORTEDTAS = 64, - LIBLTE_S1AP_IE_ID_TIMETOWAIT = 65, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE = 66, - LIBLTE_S1AP_IE_ID_TAI = 67, - LIBLTE_S1AP_IE_ID_SPARE68 = 68, - LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP = 69, - LIBLTE_S1AP_IE_ID_CDMA2000PDU = 70, - LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE = 71, - LIBLTE_S1AP_IE_ID_CDMA2000SECTORID = 72, - LIBLTE_S1AP_IE_ID_SECURITYKEY = 73, - LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY = 74, - LIBLTE_S1AP_IE_ID_GUMMEI_ID = 75, - LIBLTE_S1AP_IE_ID_SPARE76 = 76, - LIBLTE_S1AP_IE_ID_SPARE77 = 77, - LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM = 78, - LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY = 79, - LIBLTE_S1AP_IE_ID_UEIDENTITYINDEXVALUE = 80, - LIBLTE_S1AP_IE_ID_SPARE81 = 81, - LIBLTE_S1AP_IE_ID_SPARE82 = 82, - LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS = 83, - LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION = 84, - LIBLTE_S1AP_IE_ID_SPARE85 = 85, - LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID = 86, - LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY = 87, - LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID = 88, - LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM = 89, - LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER = 90, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM = 91, - LIBLTE_S1AP_IE_ID_RESETTYPE = 92, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK = 93, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM = 94, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST = 95, - LIBLTE_S1AP_IE_ID_S_TMSI = 96, - LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND = 97, - LIBLTE_S1AP_IE_ID_REQUESTTYPE = 98, - LIBLTE_S1AP_IE_ID_UE_S1AP_IDS = 99, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI = 100, - LIBLTE_S1AP_IE_ID_OVERLOADRESPONSE = 101, - LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO = 102, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOBERELEASEDLIST = 103, - LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER = 104, - LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS = 105, - LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP = 106, - LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES = 107, - LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR = 108, - LIBLTE_S1AP_IE_ID_CNDOMAIN = 109, - LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST = 110, - LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER = 111, - LIBLTE_S1AP_IE_ID_SERIALNUMBER = 112, - LIBLTE_S1AP_IE_ID_WARNINGAREALIST = 113, - LIBLTE_S1AP_IE_ID_REPETITIONPERIOD = 114, - LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST = 115, - LIBLTE_S1AP_IE_ID_WARNINGTYPE = 116, - LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO = 117, - LIBLTE_S1AP_IE_ID_DATACODINGSCHEME = 118, - LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS = 119, - LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST = 120, - LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEEDT = 121, - LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEMDT = 122, - LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER = 123, - LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE = 124, - LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION = 125, - LIBLTE_S1AP_IE_ID_NAS_DOWNLINKCOUNT = 126, - LIBLTE_S1AP_IE_ID_CSG_ID = 127, - LIBLTE_S1AP_IE_ID_CSG_IDLIST = 128, - LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERECT = 129, - LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERMCT = 130, - LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS = 131, - LIBLTE_S1AP_IE_ID_MSCLASSMARK2 = 132, - LIBLTE_S1AP_IE_ID_MSCLASSMARK3 = 133, - LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE = 134, - LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN = 135, - LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN = 136, - LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX = 137, - LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY = 138, - LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY = 139, - LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO = 140, - LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST = 141, - LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR = 142, - LIBLTE_S1AP_IE_ID_DATA_FORWARDING_NOT_POSSIBLE = 143, - LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD = 144, - LIBLTE_S1AP_IE_ID_CELLACCESSMODE = 145, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS = 146, - LIBLTE_S1AP_IE_ID_LPPA_PDU = 147, - LIBLTE_S1AP_IE_ID_ROUTING_ID = 148, - LIBLTE_S1AP_IE_ID_TIME_SYNCHRONIZATION_INFO = 149, - LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE = 150, - LIBLTE_S1AP_IE_ID_PAGINGPRIORITY = 151, - LIBLTE_S1AP_IE_ID_X2TNLCONFIGURATIONINFO = 152, - LIBLTE_S1AP_IE_ID_ENBX2EXTENDEDTRANSPORTLAYERADDRESSES = 153, - LIBLTE_S1AP_IE_ID_GUMMEILIST = 154, - LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS = 155, - LIBLTE_S1AP_IE_ID_CORRELATION_ID = 156, - LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI = 157, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 = 158, - LIBLTE_S1AP_IE_ID_REGISTEREDLAI = 159, - LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR = 160, - LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION = 161, - LIBLTE_S1AP_IE_ID_MDTCONFIGURATION = 162, - LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR = 163, - LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION = 164, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED = 165, - LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR = 166, - LIBLTE_S1AP_IE_ID_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY = 167, - LIBLTE_S1AP_IE_ID_HO_CAUSE = 168, - LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR = 169, - LIBLTE_S1AP_IE_ID_GUMMEITYPE = 170, - LIBLTE_S1AP_IE_ID_M3CONFIGURATION = 171, - LIBLTE_S1AP_IE_ID_M4CONFIGURATION = 172, - LIBLTE_S1AP_IE_ID_M5CONFIGURATION = 173, - LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO = 174, - LIBLTE_S1AP_IE_ID_MOBILITYINFORMATION = 175, - LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF = 176, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST = 177, - LIBLTE_S1AP_IE_ID_SIGNALLINGBASEDMDTPLMNLIST = 178, - LIBLTE_S1AP_IE_ID_ULCOUNTVALUEEXTENDED = 179, - LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED = 180, - LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED = 181, - LIBLTE_S1AP_IE_ID_ECGILISTFORRESTART = 182, - LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID = 183, - LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS = 184, - LIBLTE_S1AP_IE_ID_TRANSPORTINFORMATION = 185, - LIBLTE_S1AP_IE_ID_LHN_ID = 186, - LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR = 187, - LIBLTE_S1AP_IE_ID_TAILISTFORRESTART = 188, - LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION = 189, - LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART = 190, - LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES = 191, +typedef enum { + LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID = 0, + LIBLTE_S1AP_IE_ID_HANDOVERTYPE = 1, + LIBLTE_S1AP_IE_ID_CAUSE = 2, + LIBLTE_S1AP_IE_ID_SOURCEID = 3, + LIBLTE_S1AP_IE_ID_TARGETID = 4, + LIBLTE_S1AP_IE_ID_SPARE5 = 5, + LIBLTE_S1AP_IE_ID_SPARE6 = 6, + LIBLTE_S1AP_IE_ID_SPARE7 = 7, + LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID = 8, + LIBLTE_S1AP_IE_ID_SPARE9 = 9, + LIBLTE_S1AP_IE_ID_SPARE10 = 10, + LIBLTE_S1AP_IE_ID_SPARE11 = 11, + LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST = 12, + LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD = 13, + LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM = 14, + LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP = 15, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ = 16, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ = 17, + LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST = 18, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK = 19, + LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM = 20, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK = 21, + LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST = 22, + LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM = 23, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ = 24, + LIBLTE_S1AP_IE_ID_TRACEACTIVATION = 25, + LIBLTE_S1AP_IE_ID_NAS_PDU = 26, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ = 27, + LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES = 28, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES = 29, + LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ = 30, + LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES = 31, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST = 32, + LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST = 33, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST = 34, + LIBLTE_S1AP_IE_ID_E_RABITEM = 35, + LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ = 36, + LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES = 37, + LIBLTE_S1AP_IE_ID_E_RABRELEASEITEM = 38, + LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES = 39, + LIBLTE_S1AP_IE_ID_SECURITYCONTEXT = 40, + LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST = 41, + LIBLTE_S1AP_IE_ID_SPARE42 = 42, + LIBLTE_S1AP_IE_ID_UEPAGINGID = 43, + LIBLTE_S1AP_IE_ID_PAGINGDRX = 44, + LIBLTE_S1AP_IE_ID_SPARE45 = 45, + LIBLTE_S1AP_IE_ID_TAILIST = 46, + LIBLTE_S1AP_IE_ID_TAIITEM = 47, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES = 48, + LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMHOCMD = 49, + LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES = 50, + LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES = 51, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ = 52, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ = 53, + LIBLTE_S1AP_IE_ID_SPARE54 = 54, + LIBLTE_S1AP_IE_ID_GERANTOLTEHOINFORMATIONRES = 55, + LIBLTE_S1AP_IE_ID_SPARE56 = 56, + LIBLTE_S1AP_IE_ID_UTRANTOLTEHOINFORMATIONRES = 57, + LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS = 58, + LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID = 59, + LIBLTE_S1AP_IE_ID_ENBNAME = 60, + LIBLTE_S1AP_IE_ID_MMENAME = 61, + LIBLTE_S1AP_IE_ID_SPARE62 = 62, + LIBLTE_S1AP_IE_ID_SERVEDPLMNS = 63, + LIBLTE_S1AP_IE_ID_SUPPORTEDTAS = 64, + LIBLTE_S1AP_IE_ID_TIMETOWAIT = 65, + LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE = 66, + LIBLTE_S1AP_IE_ID_TAI = 67, + LIBLTE_S1AP_IE_ID_SPARE68 = 68, + LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP = 69, + LIBLTE_S1AP_IE_ID_CDMA2000PDU = 70, + LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE = 71, + LIBLTE_S1AP_IE_ID_CDMA2000SECTORID = 72, + LIBLTE_S1AP_IE_ID_SECURITYKEY = 73, + LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY = 74, + LIBLTE_S1AP_IE_ID_GUMMEI_ID = 75, + LIBLTE_S1AP_IE_ID_SPARE76 = 76, + LIBLTE_S1AP_IE_ID_SPARE77 = 77, + LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM = 78, + LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY = 79, + LIBLTE_S1AP_IE_ID_UEIDENTITYINDEXVALUE = 80, + LIBLTE_S1AP_IE_ID_SPARE81 = 81, + LIBLTE_S1AP_IE_ID_SPARE82 = 82, + LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS = 83, + LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION = 84, + LIBLTE_S1AP_IE_ID_SPARE85 = 85, + LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID = 86, + LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY = 87, + LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID = 88, + LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM = 89, + LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER = 90, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM = 91, + LIBLTE_S1AP_IE_ID_RESETTYPE = 92, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK = 93, + LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM = 94, + LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST = 95, + LIBLTE_S1AP_IE_ID_S_TMSI = 96, + LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND = 97, + LIBLTE_S1AP_IE_ID_REQUESTTYPE = 98, + LIBLTE_S1AP_IE_ID_UE_S1AP_IDS = 99, + LIBLTE_S1AP_IE_ID_EUTRAN_CGI = 100, + LIBLTE_S1AP_IE_ID_OVERLOADRESPONSE = 101, + LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO = 102, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOBERELEASEDLIST = 103, + LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER = 104, + LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS = 105, + LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP = 106, + LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES = 107, + LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR = 108, + LIBLTE_S1AP_IE_ID_CNDOMAIN = 109, + LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST = 110, + LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER = 111, + LIBLTE_S1AP_IE_ID_SERIALNUMBER = 112, + LIBLTE_S1AP_IE_ID_WARNINGAREALIST = 113, + LIBLTE_S1AP_IE_ID_REPETITIONPERIOD = 114, + LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST = 115, + LIBLTE_S1AP_IE_ID_WARNINGTYPE = 116, + LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO = 117, + LIBLTE_S1AP_IE_ID_DATACODINGSCHEME = 118, + LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS = 119, + LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST = 120, + LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEEDT = 121, + LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEMDT = 122, + LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER = 123, + LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE = 124, + LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION = 125, + LIBLTE_S1AP_IE_ID_NAS_DOWNLINKCOUNT = 126, + LIBLTE_S1AP_IE_ID_CSG_ID = 127, + LIBLTE_S1AP_IE_ID_CSG_IDLIST = 128, + LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERECT = 129, + LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERMCT = 130, + LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS = 131, + LIBLTE_S1AP_IE_ID_MSCLASSMARK2 = 132, + LIBLTE_S1AP_IE_ID_MSCLASSMARK3 = 133, + LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE = 134, + LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN = 135, + LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN = 136, + LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX = 137, + LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY = 138, + LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY = 139, + LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO = 140, + LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST = 141, + LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR = 142, + LIBLTE_S1AP_IE_ID_DATA_FORWARDING_NOT_POSSIBLE = 143, + LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD = 144, + LIBLTE_S1AP_IE_ID_CELLACCESSMODE = 145, + LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS = 146, + LIBLTE_S1AP_IE_ID_LPPA_PDU = 147, + LIBLTE_S1AP_IE_ID_ROUTING_ID = 148, + LIBLTE_S1AP_IE_ID_TIME_SYNCHRONIZATION_INFO = 149, + LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE = 150, + LIBLTE_S1AP_IE_ID_PAGINGPRIORITY = 151, + LIBLTE_S1AP_IE_ID_X2TNLCONFIGURATIONINFO = 152, + LIBLTE_S1AP_IE_ID_ENBX2EXTENDEDTRANSPORTLAYERADDRESSES = 153, + LIBLTE_S1AP_IE_ID_GUMMEILIST = 154, + LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS = 155, + LIBLTE_S1AP_IE_ID_CORRELATION_ID = 156, + LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI = 157, + LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 = 158, + LIBLTE_S1AP_IE_ID_REGISTEREDLAI = 159, + LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR = 160, + LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION = 161, + LIBLTE_S1AP_IE_ID_MDTCONFIGURATION = 162, + LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR = 163, + LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION = 164, + LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED = 165, + LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR = 166, + LIBLTE_S1AP_IE_ID_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY = 167, + LIBLTE_S1AP_IE_ID_HO_CAUSE = 168, + LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR = 169, + LIBLTE_S1AP_IE_ID_GUMMEITYPE = 170, + LIBLTE_S1AP_IE_ID_M3CONFIGURATION = 171, + LIBLTE_S1AP_IE_ID_M4CONFIGURATION = 172, + LIBLTE_S1AP_IE_ID_M5CONFIGURATION = 173, + LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO = 174, + LIBLTE_S1AP_IE_ID_MOBILITYINFORMATION = 175, + LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF = 176, + LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST = 177, + LIBLTE_S1AP_IE_ID_SIGNALLINGBASEDMDTPLMNLIST = 178, + LIBLTE_S1AP_IE_ID_ULCOUNTVALUEEXTENDED = 179, + LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED = 180, + LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED = 181, + LIBLTE_S1AP_IE_ID_ECGILISTFORRESTART = 182, + LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID = 183, + LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS = 184, + LIBLTE_S1AP_IE_ID_TRANSPORTINFORMATION = 185, + LIBLTE_S1AP_IE_ID_LHN_ID = 186, + LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR = 187, + LIBLTE_S1AP_IE_ID_TAILISTFORRESTART = 188, + LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION = 189, + LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART = 190, + LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES = 191, LIBLTE_S1AP_IE_N_ITEMS, -}LIBLTE_S1AP_IE_ENUM; -static const char liblte_s1ap_ie_text[LIBLTE_S1AP_IE_N_ITEMS][64] = { - "id-MME-UE-S1AP-ID", - "id-HandoverType", - "id-Cause", - "id-SourceID", - "id-TargetID", - "id-spare5", - "id-spare6", - "id-spare7", - "id-eNB-UE-S1AP-ID", - "id-spare9", - "id-spare10", - "id-spare11", - "id-E-RABSubjecttoDataForwardingList", - "id-E-RABtoReleaseListHOCmd", - "id-E-RABDataForwardingItem", - "id-E-RABReleaseItemBearerRelComp", - "id-E-RABToBeSetupListBearerSUReq", - "id-E-RABToBeSetupItemBearerSUReq", - "id-E-RABAdmittedList", - "id-E-RABFailedToSetupListHOReqAck", - "id-E-RABAdmittedItem", - "id-E-RABFailedtoSetupItemHOReqAck", - "id-E-RABToBeSwitchedDLList", - "id-E-RABToBeSwitchedDLItem", - "id-E-RABToBeSetupListCtxtSUReq", - "id-TraceActivation", - "id-NAS-PDU", - "id-E-RABToBeSetupItemHOReq", - "id-E-RABSetupListBearerSURes", - "id-E-RABFailedToSetupListBearerSURes", - "id-E-RABToBeModifiedListBearerModReq", - "id-E-RABModifyListBearerModRes", - "id-E-RABFailedToModifyList", - "id-E-RABToBeReleasedList", - "id-E-RABFailedToReleaseList", - "id-E-RABItem", - "id-E-RABToBeModifiedItemBearerModReq", - "id-E-RABModifyItemBearerModRes", - "id-E-RABReleaseItem", - "id-E-RABSetupItemBearerSURes", - "id-SecurityContext", - "id-HandoverRestrictionList", - "id-spare42", - "id-UEPagingID", - "id-pagingDRX", - "id-spare45", - "id-TAIList", - "id-TAIItem", - "id-E-RABFailedToSetupListCtxtSURes", - "id-E-RABReleaseItemHOCmd", - "id-E-RABSetupItemCtxtSURes", - "id-E-RABSetupListCtxtSURes", - "id-E-RABToBeSetupItemCtxtSUReq", - "id-E-RABToBeSetupListHOReq", - "id-spare54", - "id-GERANtoLTEHOInformationRes", - "id-spare56", - "id-UTRANtoLTEHOInformationRes", - "id-CriticalityDiagnostics", - "id-Global-ENB-ID", - "id-eNBname", - "id-MMEname", - "id-spare62", - "id-ServedPLMNs", - "id-SupportedTAs", - "id-TimeToWait", - "id-uEaggregateMaximumBitrate", - "id-TAI", - "id-spare68", - "id-E-RABReleaseListBearerRelComp", - "id-cdma2000PDU", - "id-cdma2000RATType", - "id-cdma2000SectorID", - "id-SecurityKey", - "id-UERadioCapability", - "id-GUMMEI-ID", - "id-spare76", - "id-spare77", - "id-E-RABInformationListItem", - "id-Direct-Forwarding-Path-Availability", - "id-UEIdentityIndexValue", - "id-spare81", - "id-spare82", - "id-cdma2000HOStatus", - "id-cdma2000HORequiredIndication", - "id-spare85", - "id-E-UTRAN-Trace-ID", - "id-RelativeMMECapacity", - "id-SourceMME-UE-S1AP-ID", - "id-Bearers-SubjectToStatusTransfer-Item", - "id-eNB-StatusTransfer-TransparentContainer", - "id-UE-associatedLogicalS1-ConnectionItem", - "id-ResetType", - "id-UE-associatedLogicalS1-ConnectionListResAck", - "id-E-RABToBeSwitchedULItem", - "id-E-RABToBeSwitchedULList", - "id-S-TMSI", - "id-cdma2000OneXRAND", - "id-RequestType", - "id-UE-S1AP-IDs", - "id-EUTRAN-CGI", - "id-OverloadResponse", - "id-cdma2000OneXSRVCCInfo", - "id-E-RABFailedToBeReleasedList", - "id-Source-ToTarget-TransparentContainer", - "id-ServedGUMMEIs", - "id-SubscriberProfileIDforRFP", - "id-UESecurityCapabilities", - "id-CSFallbackIndicator", - "id-CNDomain", - "id-E-RABReleasedList", - "id-MessageIdentifier", - "id-SerialNumber", - "id-WarningAreaList", - "id-RepetitionPeriod", - "id-NumberofBroadcastRequest", - "id-WarningType", - "id-WarningSecurityInfo", - "id-DataCodingScheme", - "id-WarningMessageContents", - "id-BroadcastCompletedAreaList", - "id-Inter-SystemInformationTransferTypeEDT", - "id-Inter-SystemInformationTransferTypeMDT", - "id-Target-ToSource-TransparentContainer", - "id-SRVCCOperationPossible", - "id-SRVCCHOIndication", - "id-NAS-DownlinkCount", - "id-CSG-Id", - "id-CSG-IdList", - "id-SONConfigurationTransferECT", - "id-SONConfigurationTransferMCT", - "id-TraceCollectionEntityIPAddress", - "id-MSClassmark2", - "id-MSClassmark3", - "id-RRC-Establishment-Cause", - "id-NASSecurityParametersfromE-UTRAN", - "id-NASSecurityParameterstoE-UTRAN", - "id-DefaultPagingDRX", - "id-Source-ToTarget-TransparentContainer-Secondary", - "id-Target-ToSource-TransparentContainer-Secondary", - "id-EUTRANRoundTripDelayEstimationInfo", - "id-BroadcastCancelledAreaList", - "id-ConcurrentWarningMessageIndicator", - "id-Data-Forwarding-Not-Possible", - "id-ExtendedRepetitionPeriod", - "id-CellAccessMode", - "id-CSGMembershipStatus", - "id-LPPa-PDU", - "id-Routing-ID", - "id-Time-Synchronization-Info", - "id-PS-ServiceNotAvailable", - "id-PagingPriority", - "id-x2TNLConfigurationInfo", - "id-eNBX2ExtendedTransportLayerAddresses", - "id-GUMMEIList", - "id-GW-TransportLayerAddress", - "id-Correlation-ID", - "id-SourceMME-GUMMEI", - "id-MME-UE-S1AP-ID-2", - "id-RegisteredLAI", - "id-RelayNode-Indicator", - "id-TrafficLoadReductionIndication", - "id-MDTConfiguration", - "id-MMERelaySupportIndicator", - "id-GWContextReleaseIndication", - "id-ManagementBasedMDTAllowed", - "id-PrivacyIndicator", - "id-Time-UE-StayedInCell-EnhancedGranularity", - "id-HO-Cause", - "id-VoiceSupportMatchIndicator", - "id-GUMMEIType", - "id-M3Configuration", - "id-M4Configuration", - "id-M5Configuration", - "id-MDT-Location-Info", - "id-MobilityInformation", - "id-Tunnel-Information-for-BBF", - "id-ManagementBasedMDTPLMNList", - "id-SignallingBasedMDTPLMNList", - "id-ULCOUNTValueExtended", - "id-DLCOUNTValueExtended", - "id-ReceiveStatusOfULPDCPSDUsExtended", - "id-ECGIListForRestart", - "id-SIPTO-Correlation-ID", - "id-SIPTO-L-GW-TransportLayerAddress", - "id-TransportInformation", - "id-LHN-ID", - "id-AdditionalCSFallbackIndicator", - "id-TAIListForRestart", - "id-UserLocationInformation", - "id-EmergencyAreaIDListForRestart", - "id-KillAllWarningMessages", +} LIBLTE_S1AP_IE_ENUM; +static const char liblte_s1ap_ie_text[LIBLTE_S1AP_IE_N_ITEMS][64] = { + "id-MME-UE-S1AP-ID", + "id-HandoverType", + "id-Cause", + "id-SourceID", + "id-TargetID", + "id-spare5", + "id-spare6", + "id-spare7", + "id-eNB-UE-S1AP-ID", + "id-spare9", + "id-spare10", + "id-spare11", + "id-E-RABSubjecttoDataForwardingList", + "id-E-RABtoReleaseListHOCmd", + "id-E-RABDataForwardingItem", + "id-E-RABReleaseItemBearerRelComp", + "id-E-RABToBeSetupListBearerSUReq", + "id-E-RABToBeSetupItemBearerSUReq", + "id-E-RABAdmittedList", + "id-E-RABFailedToSetupListHOReqAck", + "id-E-RABAdmittedItem", + "id-E-RABFailedtoSetupItemHOReqAck", + "id-E-RABToBeSwitchedDLList", + "id-E-RABToBeSwitchedDLItem", + "id-E-RABToBeSetupListCtxtSUReq", + "id-TraceActivation", + "id-NAS-PDU", + "id-E-RABToBeSetupItemHOReq", + "id-E-RABSetupListBearerSURes", + "id-E-RABFailedToSetupListBearerSURes", + "id-E-RABToBeModifiedListBearerModReq", + "id-E-RABModifyListBearerModRes", + "id-E-RABFailedToModifyList", + "id-E-RABToBeReleasedList", + "id-E-RABFailedToReleaseList", + "id-E-RABItem", + "id-E-RABToBeModifiedItemBearerModReq", + "id-E-RABModifyItemBearerModRes", + "id-E-RABReleaseItem", + "id-E-RABSetupItemBearerSURes", + "id-SecurityContext", + "id-HandoverRestrictionList", + "id-spare42", + "id-UEPagingID", + "id-pagingDRX", + "id-spare45", + "id-TAIList", + "id-TAIItem", + "id-E-RABFailedToSetupListCtxtSURes", + "id-E-RABReleaseItemHOCmd", + "id-E-RABSetupItemCtxtSURes", + "id-E-RABSetupListCtxtSURes", + "id-E-RABToBeSetupItemCtxtSUReq", + "id-E-RABToBeSetupListHOReq", + "id-spare54", + "id-GERANtoLTEHOInformationRes", + "id-spare56", + "id-UTRANtoLTEHOInformationRes", + "id-CriticalityDiagnostics", + "id-Global-ENB-ID", + "id-eNBname", + "id-MMEname", + "id-spare62", + "id-ServedPLMNs", + "id-SupportedTAs", + "id-TimeToWait", + "id-uEaggregateMaximumBitrate", + "id-TAI", + "id-spare68", + "id-E-RABReleaseListBearerRelComp", + "id-cdma2000PDU", + "id-cdma2000RATType", + "id-cdma2000SectorID", + "id-SecurityKey", + "id-UERadioCapability", + "id-GUMMEI-ID", + "id-spare76", + "id-spare77", + "id-E-RABInformationListItem", + "id-Direct-Forwarding-Path-Availability", + "id-UEIdentityIndexValue", + "id-spare81", + "id-spare82", + "id-cdma2000HOStatus", + "id-cdma2000HORequiredIndication", + "id-spare85", + "id-E-UTRAN-Trace-ID", + "id-RelativeMMECapacity", + "id-SourceMME-UE-S1AP-ID", + "id-Bearers-SubjectToStatusTransfer-Item", + "id-eNB-StatusTransfer-TransparentContainer", + "id-UE-associatedLogicalS1-ConnectionItem", + "id-ResetType", + "id-UE-associatedLogicalS1-ConnectionListResAck", + "id-E-RABToBeSwitchedULItem", + "id-E-RABToBeSwitchedULList", + "id-S-TMSI", + "id-cdma2000OneXRAND", + "id-RequestType", + "id-UE-S1AP-IDs", + "id-EUTRAN-CGI", + "id-OverloadResponse", + "id-cdma2000OneXSRVCCInfo", + "id-E-RABFailedToBeReleasedList", + "id-Source-ToTarget-TransparentContainer", + "id-ServedGUMMEIs", + "id-SubscriberProfileIDforRFP", + "id-UESecurityCapabilities", + "id-CSFallbackIndicator", + "id-CNDomain", + "id-E-RABReleasedList", + "id-MessageIdentifier", + "id-SerialNumber", + "id-WarningAreaList", + "id-RepetitionPeriod", + "id-NumberofBroadcastRequest", + "id-WarningType", + "id-WarningSecurityInfo", + "id-DataCodingScheme", + "id-WarningMessageContents", + "id-BroadcastCompletedAreaList", + "id-Inter-SystemInformationTransferTypeEDT", + "id-Inter-SystemInformationTransferTypeMDT", + "id-Target-ToSource-TransparentContainer", + "id-SRVCCOperationPossible", + "id-SRVCCHOIndication", + "id-NAS-DownlinkCount", + "id-CSG-Id", + "id-CSG-IdList", + "id-SONConfigurationTransferECT", + "id-SONConfigurationTransferMCT", + "id-TraceCollectionEntityIPAddress", + "id-MSClassmark2", + "id-MSClassmark3", + "id-RRC-Establishment-Cause", + "id-NASSecurityParametersfromE-UTRAN", + "id-NASSecurityParameterstoE-UTRAN", + "id-DefaultPagingDRX", + "id-Source-ToTarget-TransparentContainer-Secondary", + "id-Target-ToSource-TransparentContainer-Secondary", + "id-EUTRANRoundTripDelayEstimationInfo", + "id-BroadcastCancelledAreaList", + "id-ConcurrentWarningMessageIndicator", + "id-Data-Forwarding-Not-Possible", + "id-ExtendedRepetitionPeriod", + "id-CellAccessMode", + "id-CSGMembershipStatus", + "id-LPPa-PDU", + "id-Routing-ID", + "id-Time-Synchronization-Info", + "id-PS-ServiceNotAvailable", + "id-PagingPriority", + "id-x2TNLConfigurationInfo", + "id-eNBX2ExtendedTransportLayerAddresses", + "id-GUMMEIList", + "id-GW-TransportLayerAddress", + "id-Correlation-ID", + "id-SourceMME-GUMMEI", + "id-MME-UE-S1AP-ID-2", + "id-RegisteredLAI", + "id-RelayNode-Indicator", + "id-TrafficLoadReductionIndication", + "id-MDTConfiguration", + "id-MMERelaySupportIndicator", + "id-GWContextReleaseIndication", + "id-ManagementBasedMDTAllowed", + "id-PrivacyIndicator", + "id-Time-UE-StayedInCell-EnhancedGranularity", + "id-HO-Cause", + "id-VoiceSupportMatchIndicator", + "id-GUMMEIType", + "id-M3Configuration", + "id-M4Configuration", + "id-M5Configuration", + "id-MDT-Location-Info", + "id-MobilityInformation", + "id-Tunnel-Information-for-BBF", + "id-ManagementBasedMDTPLMNList", + "id-SignallingBasedMDTPLMNList", + "id-ULCOUNTValueExtended", + "id-DLCOUNTValueExtended", + "id-ReceiveStatusOfULPDCPSDUsExtended", + "id-ECGIListForRestart", + "id-SIPTO-Correlation-ID", + "id-SIPTO-L-GW-TransportLayerAddress", + "id-TransportInformation", + "id-LHN-ID", + "id-AdditionalCSFallbackIndicator", + "id-TAIListForRestart", + "id-UserLocationInformation", + "id-EmergencyAreaIDListForRestart", + "id-KillAllWarningMessages", }; - /******************************************************************************* /* ProtocolIE Criticality ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_NOTIFY, LIBLTE_S1AP_CRITICALITY_N_ITEMS, -}LIBLTE_S1AP_CRITICALITY_ENUM; +} LIBLTE_S1AP_CRITICALITY_ENUM; static const char liblte_s1ap_criticality_text[LIBLTE_S1AP_CRITICALITY_N_ITEMS][80] = { - "reject", - "ignore", - "notify", + "reject", + "ignore", + "notify", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticality( - LIBLTE_S1AP_CRITICALITY_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticality( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITY_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticality(LIBLTE_S1AP_CRITICALITY_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticality(uint8_t** ptr, LIBLTE_S1AP_CRITICALITY_ENUM* ie); /******************************************************************************* /* ProtocolIE local INTEGER ********************************************************************************/ -typedef struct{ -uint16_t local; -}LIBLTE_S1AP_LOCAL_STRUCT; +typedef struct { + uint16_t local; +} LIBLTE_S1AP_LOCAL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_local( - LIBLTE_S1AP_LOCAL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_local( - uint8_t **ptr, - LIBLTE_S1AP_LOCAL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_local(LIBLTE_S1AP_LOCAL_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_local(uint8_t** ptr, LIBLTE_S1AP_LOCAL_STRUCT* ie); /******************************************************************************* /* ProtocolIE PrivateIE_ID CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_LOCAL, LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_GLOBAL, LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_N_ITEMS, -}LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_ENUM; +} LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_ENUM; static const char liblte_s1ap_privateie_id_choice_text[LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_N_ITEMS][50] = { - "local", - "global", + "local", + "global", }; -typedef union{ - LIBLTE_S1AP_LOCAL_STRUCT local; - LIBLTE_ASN1_OID_STRUCT global; -}LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_LOCAL_STRUCT local; + LIBLTE_ASN1_OID_STRUCT global; +} LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_UNION; -typedef struct{ +typedef struct { LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_UNION choice; LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_PRIVATEIE_ID_STRUCT; +} LIBLTE_S1AP_PRIVATEIE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_id( - LIBLTE_S1AP_PRIVATEIE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_id( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_id(LIBLTE_S1AP_PRIVATEIE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_id(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolExtensionID INTEGER ********************************************************************************/ -typedef struct{ -uint16_t ProtocolExtensionID; -}LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT; +typedef struct { + uint16_t ProtocolExtensionID; +} LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid( - LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid(LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT* ie); /******************************************************************************* /* ProtocolIE TriggeringMessage ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_TRIGGERINGMESSAGE_INITIATING_MESSAGE, LIBLTE_S1AP_TRIGGERINGMESSAGE_SUCCESSFUL_OUTCOME, LIBLTE_S1AP_TRIGGERINGMESSAGE_UNSUCCESSFULL_OUTCOME, LIBLTE_S1AP_TRIGGERINGMESSAGE_N_ITEMS, -}LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM; +} LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM; static const char liblte_s1ap_triggeringmessage_text[LIBLTE_S1AP_TRIGGERINGMESSAGE_N_ITEMS][80] = { - "initiating-message", - "successful-outcome", - "unsuccessfull-outcome", + "initiating-message", + "successful-outcome", + "unsuccessfull-outcome", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_triggeringmessage( - LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_triggeringmessage( - uint8_t **ptr, - LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_triggeringmessage(LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_triggeringmessage(uint8_t** ptr, LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM* ie); /******************************************************************************* /* ProtocolIE Presence ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PRESENCE_OPTIONAL, LIBLTE_S1AP_PRESENCE_CONDITIONAL, LIBLTE_S1AP_PRESENCE_MANDATORY, LIBLTE_S1AP_PRESENCE_N_ITEMS, -}LIBLTE_S1AP_PRESENCE_ENUM; +} LIBLTE_S1AP_PRESENCE_ENUM; static const char liblte_s1ap_presence_text[LIBLTE_S1AP_PRESENCE_N_ITEMS][80] = { - "optional", - "conditional", - "mandatory", + "optional", + "conditional", + "mandatory", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_presence( - LIBLTE_S1AP_PRESENCE_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_presence( - uint8_t **ptr, - LIBLTE_S1AP_PRESENCE_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_presence(LIBLTE_S1AP_PRESENCE_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_presence(uint8_t** ptr, LIBLTE_S1AP_PRESENCE_ENUM* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_ID INTEGER ********************************************************************************/ -typedef struct{ -uint16_t ProtocolIE_ID; -}LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT; +typedef struct { + uint16_t ProtocolIE_ID; +} LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_id( - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_id( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_id(LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_id(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProcedureCode INTEGER ********************************************************************************/ -typedef struct{ -uint8_t ProcedureCode; -}LIBLTE_S1AP_PROCEDURECODE_STRUCT; +typedef struct { + uint8_t ProcedureCode; +} LIBLTE_S1AP_PROCEDURECODE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_procedurecode( - LIBLTE_S1AP_PROCEDURECODE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_procedurecode( - uint8_t **ptr, - LIBLTE_S1AP_PROCEDURECODE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_procedurecode(LIBLTE_S1AP_PROCEDURECODE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_procedurecode(uint8_t** ptr, LIBLTE_S1AP_PROCEDURECODE_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_Field SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT value; -}LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT; +typedef struct { + LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT value; +} LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_field( - LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_field( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_field(LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_field(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolExtensionField SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT id; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT extensionValue; -}LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT; +typedef struct { + LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT id; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT extensionValue; +} LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionfield( - LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionfield( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionfield(LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionfield(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_FieldPair SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; - LIBLTE_S1AP_CRITICALITY_ENUM firstCriticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT firstValue; - LIBLTE_S1AP_CRITICALITY_ENUM secondCriticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT secondValue; -}LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT; +typedef struct { + LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; + LIBLTE_S1AP_CRITICALITY_ENUM firstCriticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT firstValue; + LIBLTE_S1AP_CRITICALITY_ENUM secondCriticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT secondValue; +} LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_fieldpair( - LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_fieldpair( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_fieldpair(LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_fieldpair(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolExtensionContainer DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensioncontainer( - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensioncontainer( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensioncontainer(LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensioncontainer(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_ContainerPair DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:0, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpair( - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpair( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpair(LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpair(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_ContainerPairList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:None, ub:None -typedef struct{ - uint32_t len; - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpairlist( - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpairlist( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpairlist(LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpairlist(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE PrivateIE_Field SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_PRIVATEIE_ID_STRUCT id; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT value; -}LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT; +typedef struct { + LIBLTE_S1AP_PRIVATEIE_ID_STRUCT id; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT value; +} LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_field( - LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_field( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_field(LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_field(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT* ie); /******************************************************************************* /* ProtocolIE ProtocolIE_SingleContainer SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_ASN1_OPEN_TYPE_STRUCT value; -}LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT; +typedef struct { + LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT id; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_ASN1_OPEN_TYPE_STRUCT value; +} LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer( - LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer(LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE PrivateIE_Container DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_container( - LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_container( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_container(LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_container(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE BitRate INTEGER ********************************************************************************/ -typedef struct{ -uint32_t BitRate; -}LIBLTE_S1AP_BITRATE_STRUCT; +typedef struct { + uint32_t BitRate; +} LIBLTE_S1AP_BITRATE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bitrate( - LIBLTE_S1AP_BITRATE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bitrate( - uint8_t **ptr, - LIBLTE_S1AP_BITRATE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_bitrate(LIBLTE_S1AP_BITRATE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bitrate(uint8_t** ptr, LIBLTE_S1AP_BITRATE_STRUCT* ie); /******************************************************************************* /* ProtocolIE CauseMisc ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSEMISC_CONTROL_PROCESSING_OVERLOAD, LIBLTE_S1AP_CAUSEMISC_NOT_ENOUGH_USER_PLANE_PROCESSING_RESOURCES, LIBLTE_S1AP_CAUSEMISC_HARDWARE_FAILURE, @@ -909,32 +842,28 @@ typedef enum{ LIBLTE_S1AP_CAUSEMISC_UNSPECIFIED, LIBLTE_S1AP_CAUSEMISC_UNKNOWN_PLMN, LIBLTE_S1AP_CAUSEMISC_N_ITEMS, -}LIBLTE_S1AP_CAUSEMISC_ENUM; +} LIBLTE_S1AP_CAUSEMISC_ENUM; static const char liblte_s1ap_causemisc_text[LIBLTE_S1AP_CAUSEMISC_N_ITEMS][80] = { - "control-processing-overload", - "not-enough-user-plane-processing-resources", - "hardware-failure", - "om-intervention", - "unspecified", - "unknown-PLMN", + "control-processing-overload", + "not-enough-user-plane-processing-resources", + "hardware-failure", + "om-intervention", + "unspecified", + "unknown-PLMN", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSEMISC_ENUM e; -}LIBLTE_S1AP_CAUSEMISC_ENUM_EXT; +} LIBLTE_S1AP_CAUSEMISC_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causemisc( - LIBLTE_S1AP_CAUSEMISC_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causemisc( - uint8_t **ptr, - LIBLTE_S1AP_CAUSEMISC_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causemisc(LIBLTE_S1AP_CAUSEMISC_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causemisc(uint8_t** ptr, LIBLTE_S1AP_CAUSEMISC_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CauseRadioNetwork ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSERADIONETWORK_UNSPECIFIED, LIBLTE_S1AP_CAUSERADIONETWORK_TX2RELOCOVERALL_EXPIRY, LIBLTE_S1AP_CAUSERADIONETWORK_SUCCESSFUL_HANDOVER, @@ -975,453 +904,378 @@ typedef enum{ LIBLTE_S1AP_CAUSERADIONETWORK_NOT_SUPPORTED_QCI_VALUE, LIBLTE_S1AP_CAUSERADIONETWORK_INVALID_CSG_ID, LIBLTE_S1AP_CAUSERADIONETWORK_N_ITEMS, -}LIBLTE_S1AP_CAUSERADIONETWORK_ENUM; +} LIBLTE_S1AP_CAUSERADIONETWORK_ENUM; static const char liblte_s1ap_causeradionetwork_text[LIBLTE_S1AP_CAUSERADIONETWORK_N_ITEMS][80] = { - "unspecified", - "tx2relocoverall-expiry", - "successful-handover", - "release-due-to-eutran-generated-reason", - "handover-cancelled", - "partial-handover", - "ho-failure-in-target-EPC-eNB-or-target-system", - "ho-target-not-allowed", - "tS1relocoverall-expiry", - "tS1relocprep-expiry", - "cell-not-available", - "unknown-targetID", - "no-radio-resources-available-in-target-cell", - "unknown-mme-ue-s1ap-id", - "unknown-enb-ue-s1ap-id", - "unknown-pair-ue-s1ap-id", - "handover-desirable-for-radio-reason", - "time-critical-handover", - "resource-optimisation-handover", - "reduce-load-in-serving-cell", - "user-inactivity", - "radio-connection-with-ue-lost", - "load-balancing-tau-required", - "cs-fallback-triggered", - "ue-not-available-for-ps-service", - "radio-resources-not-available", - "failure-in-radio-interface-procedure", - "invalid-qos-combination", - "interrat-redirection", - "interaction-with-other-procedure", - "unknown-E-RAB-ID", - "multiple-E-RAB-ID-instances", - "encryption-and-or-integrity-protection-algorithms-not-supported", - "s1-intra-system-handover-triggered", - "s1-inter-system-handover-triggered", - "x2-handover-triggered", - "redirection-towards-1xRTT", - "not-supported-QCI-value", - "invalid-CSG-Id", + "unspecified", + "tx2relocoverall-expiry", + "successful-handover", + "release-due-to-eutran-generated-reason", + "handover-cancelled", + "partial-handover", + "ho-failure-in-target-EPC-eNB-or-target-system", + "ho-target-not-allowed", + "tS1relocoverall-expiry", + "tS1relocprep-expiry", + "cell-not-available", + "unknown-targetID", + "no-radio-resources-available-in-target-cell", + "unknown-mme-ue-s1ap-id", + "unknown-enb-ue-s1ap-id", + "unknown-pair-ue-s1ap-id", + "handover-desirable-for-radio-reason", + "time-critical-handover", + "resource-optimisation-handover", + "reduce-load-in-serving-cell", + "user-inactivity", + "radio-connection-with-ue-lost", + "load-balancing-tau-required", + "cs-fallback-triggered", + "ue-not-available-for-ps-service", + "radio-resources-not-available", + "failure-in-radio-interface-procedure", + "invalid-qos-combination", + "interrat-redirection", + "interaction-with-other-procedure", + "unknown-E-RAB-ID", + "multiple-E-RAB-ID-instances", + "encryption-and-or-integrity-protection-algorithms-not-supported", + "s1-intra-system-handover-triggered", + "s1-inter-system-handover-triggered", + "x2-handover-triggered", + "redirection-towards-1xRTT", + "not-supported-QCI-value", + "invalid-CSG-Id", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSERADIONETWORK_ENUM e; -}LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT; +} LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeradionetwork( - LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeradionetwork( - uint8_t **ptr, - LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeradionetwork(LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeradionetwork(uint8_t** ptr, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CauseNas ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSENAS_NORMAL_RELEASE, LIBLTE_S1AP_CAUSENAS_AUTHENTICATION_FAILURE, LIBLTE_S1AP_CAUSENAS_DETACH, LIBLTE_S1AP_CAUSENAS_UNSPECIFIED, LIBLTE_S1AP_CAUSENAS_CSG_SUBSCRIPTION_EXPIRY, LIBLTE_S1AP_CAUSENAS_N_ITEMS, -}LIBLTE_S1AP_CAUSENAS_ENUM; +} LIBLTE_S1AP_CAUSENAS_ENUM; static const char liblte_s1ap_causenas_text[LIBLTE_S1AP_CAUSENAS_N_ITEMS][80] = { - "normal-release", - "authentication-failure", - "detach", - "unspecified", - "csg-subscription-expiry", + "normal-release", + "authentication-failure", + "detach", + "unspecified", + "csg-subscription-expiry", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSENAS_ENUM e; -}LIBLTE_S1AP_CAUSENAS_ENUM_EXT; +} LIBLTE_S1AP_CAUSENAS_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causenas( - LIBLTE_S1AP_CAUSENAS_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causenas( - uint8_t **ptr, - LIBLTE_S1AP_CAUSENAS_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causenas(LIBLTE_S1AP_CAUSENAS_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causenas(uint8_t** ptr, LIBLTE_S1AP_CAUSENAS_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CellIdentity STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_CELLIDENTITY_BIT_STRING_LEN 28 -typedef struct{ - uint8_t buffer[28]; -}LIBLTE_S1AP_CELLIDENTITY_STRUCT; +typedef struct { + uint8_t buffer[28]; +} LIBLTE_S1AP_CELLIDENTITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidentity( - LIBLTE_S1AP_CELLIDENTITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidentity( - uint8_t **ptr, - LIBLTE_S1AP_CELLIDENTITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidentity(LIBLTE_S1AP_CELLIDENTITY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidentity(uint8_t** ptr, LIBLTE_S1AP_CELLIDENTITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cdma2000PDU DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000PDU_STRUCT; +} LIBLTE_S1AP_CDMA2000PDU_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000pdu( - LIBLTE_S1AP_CDMA2000PDU_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000PDU_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000pdu(LIBLTE_S1AP_CDMA2000PDU_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu(uint8_t** ptr, LIBLTE_S1AP_CDMA2000PDU_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cdma2000SectorID DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000SECTORID_STRUCT; +} LIBLTE_S1AP_CDMA2000SECTORID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000sectorid( - LIBLTE_S1AP_CDMA2000SECTORID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000SECTORID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000sectorid(LIBLTE_S1AP_CDMA2000SECTORID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid(uint8_t** ptr, LIBLTE_S1AP_CDMA2000SECTORID_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cdma2000HORequiredIndication ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_TRUE, LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_N_ITEMS, -}LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM; -static const char liblte_s1ap_cdma2000horequiredindication_text[LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_N_ITEMS][80] = { - "true", +} LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM; +static const char liblte_s1ap_cdma2000horequiredindication_text[LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_N_ITEMS][80] = + { + "true", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM e; -}LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT; +} LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000horequiredindication( - LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000horequiredindication( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000horequiredindication(LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cdma2000horequiredindication(uint8_t** ptr, LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Cdma2000OneXMSI DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT; +} LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmsi( - LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmsi(LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cdma2000OneXRAND DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT; +} LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexrand( - LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexrand(LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT* ie); /******************************************************************************* /* ProtocolIE CNDomain ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CNDOMAIN_PS, LIBLTE_S1AP_CNDOMAIN_CS, LIBLTE_S1AP_CNDOMAIN_N_ITEMS, -}LIBLTE_S1AP_CNDOMAIN_ENUM; +} LIBLTE_S1AP_CNDOMAIN_ENUM; static const char liblte_s1ap_cndomain_text[LIBLTE_S1AP_CNDOMAIN_N_ITEMS][80] = { - "ps", - "cs", + "ps", + "cs", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cndomain( - LIBLTE_S1AP_CNDOMAIN_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cndomain( - uint8_t **ptr, - LIBLTE_S1AP_CNDOMAIN_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cndomain(LIBLTE_S1AP_CNDOMAIN_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cndomain(uint8_t** ptr, LIBLTE_S1AP_CNDOMAIN_ENUM* ie); /******************************************************************************* /* ProtocolIE Correlation_ID STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_CORRELATION_ID_OCTET_STRING_LEN 4 -typedef struct{ - uint8_t buffer[4]; -}LIBLTE_S1AP_CORRELATION_ID_STRUCT; +typedef struct { + uint8_t buffer[4]; +} LIBLTE_S1AP_CORRELATION_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_correlation_id( - LIBLTE_S1AP_CORRELATION_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_correlation_id( - uint8_t **ptr, - LIBLTE_S1AP_CORRELATION_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_correlation_id(LIBLTE_S1AP_CORRELATION_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_correlation_id(uint8_t** ptr, LIBLTE_S1AP_CORRELATION_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE AdditionalCSFallbackIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_NO_RESTRICTION, LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_RESTRICTION, LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_N_ITEMS, -}LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM; -static const char liblte_s1ap_additionalcsfallbackindicator_text[LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_N_ITEMS][80] = { - "no-restriction", - "restriction", +} LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM; +static const char liblte_s1ap_additionalcsfallbackindicator_text[LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_N_ITEMS] + [80] = { + "no-restriction", + "restriction", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM e; -}LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT; +} LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_additionalcsfallbackindicator( - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_additionalcsfallbackindicator( - uint8_t **ptr, - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_additionalcsfallbackindicator(LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_additionalcsfallbackindicator(uint8_t** ptr, LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE DL_Forwarding ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_DL_FORWARDING_DL_FORWARDING_PROPOSED, LIBLTE_S1AP_DL_FORWARDING_N_ITEMS, -}LIBLTE_S1AP_DL_FORWARDING_ENUM; +} LIBLTE_S1AP_DL_FORWARDING_ENUM; static const char liblte_s1ap_dl_forwarding_text[LIBLTE_S1AP_DL_FORWARDING_N_ITEMS][80] = { - "dL-Forwarding-proposed", + "dL-Forwarding-proposed", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_DL_FORWARDING_ENUM e; -}LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT; +} LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_dl_forwarding( - LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_dl_forwarding( - uint8_t **ptr, - LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_dl_forwarding(LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_dl_forwarding(uint8_t** ptr, LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Data_Forwarding_Not_Possible ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_DATA_FORWARDING_NOT_POSSIBLE, LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_N_ITEMS, -}LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM; -static const char liblte_s1ap_data_forwarding_not_possible_text[LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_N_ITEMS][80] = { - "data-Forwarding-not-Possible", +} LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM; +static const char liblte_s1ap_data_forwarding_not_possible_text[LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_N_ITEMS][80] = + { + "data-Forwarding-not-Possible", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM e; -}LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT; +} LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_data_forwarding_not_possible( - LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_data_forwarding_not_possible( - uint8_t **ptr, - LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_data_forwarding_not_possible(LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_data_forwarding_not_possible(uint8_t** ptr, LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaID STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_EMERGENCYAREAID_OCTET_STRING_LEN 3 -typedef struct{ - uint8_t buffer[3]; -}LIBLTE_S1AP_EMERGENCYAREAID_STRUCT; +typedef struct { + uint8_t buffer[3]; +} LIBLTE_S1AP_EMERGENCYAREAID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid( - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid(LIBLTE_S1AP_EMERGENCYAREAID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_STRUCT* ie); /******************************************************************************* /* ProtocolIE macroENB_ID STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_MACROENB_ID_BIT_STRING_LEN 20 -typedef struct{ - uint8_t buffer[20]; -}LIBLTE_S1AP_MACROENB_ID_STRUCT; +typedef struct { + uint8_t buffer[20]; +} LIBLTE_S1AP_MACROENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_macroenb_id( - LIBLTE_S1AP_MACROENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_macroenb_id( - uint8_t **ptr, - LIBLTE_S1AP_MACROENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_macroenb_id(LIBLTE_S1AP_MACROENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_macroenb_id(uint8_t** ptr, LIBLTE_S1AP_MACROENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE homeENB_ID STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_HOMEENB_ID_BIT_STRING_LEN 28 -typedef struct{ - uint8_t buffer[28]; -}LIBLTE_S1AP_HOMEENB_ID_STRUCT; +typedef struct { + uint8_t buffer[28]; +} LIBLTE_S1AP_HOMEENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_homeenb_id( - LIBLTE_S1AP_HOMEENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_homeenb_id( - uint8_t **ptr, - LIBLTE_S1AP_HOMEENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_homeenb_id(LIBLTE_S1AP_HOMEENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_homeenb_id(uint8_t** ptr, LIBLTE_S1AP_HOMEENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENB_ID CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_ENB_ID_CHOICE_MACROENB_ID, LIBLTE_S1AP_ENB_ID_CHOICE_HOMEENB_ID, LIBLTE_S1AP_ENB_ID_CHOICE_N_ITEMS, -}LIBLTE_S1AP_ENB_ID_CHOICE_ENUM; +} LIBLTE_S1AP_ENB_ID_CHOICE_ENUM; static const char liblte_s1ap_enb_id_choice_text[LIBLTE_S1AP_ENB_ID_CHOICE_N_ITEMS][50] = { - "macroENB_ID", - "homeENB_ID", + "macroENB_ID", + "homeENB_ID", }; -typedef union{ - LIBLTE_S1AP_MACROENB_ID_STRUCT macroENB_ID; - LIBLTE_S1AP_HOMEENB_ID_STRUCT homeENB_ID; -}LIBLTE_S1AP_ENB_ID_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_MACROENB_ID_STRUCT macroENB_ID; + LIBLTE_S1AP_HOMEENB_ID_STRUCT homeENB_ID; +} LIBLTE_S1AP_ENB_ID_CHOICE_UNION; -typedef struct{ +typedef struct { bool ext; LIBLTE_S1AP_ENB_ID_CHOICE_UNION choice; LIBLTE_S1AP_ENB_ID_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_ENB_ID_STRUCT; +} LIBLTE_S1AP_ENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_id( - LIBLTE_S1AP_ENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id( - uint8_t **ptr, - LIBLTE_S1AP_ENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_id(LIBLTE_S1AP_ENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id(uint8_t** ptr, LIBLTE_S1AP_ENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENBname PrintableString ********************************************************************************/ -typedef struct{ +typedef struct { bool ext; uint32_t n_octets; uint8_t buffer[150]; -}LIBLTE_S1AP_ENBNAME_STRUCT; +} LIBLTE_S1AP_ENBNAME_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbname( - LIBLTE_S1AP_ENBNAME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname( - uint8_t **ptr, - LIBLTE_S1AP_ENBNAME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbname(LIBLTE_S1AP_ENBNAME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname(uint8_t** ptr, LIBLTE_S1AP_ENBNAME_STRUCT* ie); /******************************************************************************* /* ProtocolIE EncryptionAlgorithms STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_ENCRYPTIONALGORITHMS_BIT_STRING_LEN 16 -typedef struct{ - bool ext; - uint8_t buffer[16]; -}LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT; +typedef struct { + bool ext; + uint8_t buffer[16]; +} LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_encryptionalgorithms( - LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_encryptionalgorithms( - uint8_t **ptr, - LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_encryptionalgorithms(LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_encryptionalgorithms(uint8_t** ptr, LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT* ie); /******************************************************************************* /* ProtocolIE EventType ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_EVENTTYPE_DIRECT, LIBLTE_S1AP_EVENTTYPE_CHANGE_OF_SERVE_CELL, LIBLTE_S1AP_EVENTTYPE_STOP_CHANGE_OF_SERVE_CELL, LIBLTE_S1AP_EVENTTYPE_N_ITEMS, -}LIBLTE_S1AP_EVENTTYPE_ENUM; +} LIBLTE_S1AP_EVENTTYPE_ENUM; static const char liblte_s1ap_eventtype_text[LIBLTE_S1AP_EVENTTYPE_N_ITEMS][80] = { - "direct", - "change-of-serve-cell", - "stop-change-of-serve-cell", + "direct", + "change-of-serve-cell", + "stop-change-of-serve-cell", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_EVENTTYPE_ENUM e; -}LIBLTE_S1AP_EVENTTYPE_ENUM_EXT; +} LIBLTE_S1AP_EVENTTYPE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eventtype( - LIBLTE_S1AP_EVENTTYPE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eventtype( - uint8_t **ptr, - LIBLTE_S1AP_EVENTTYPE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eventtype(LIBLTE_S1AP_EVENTTYPE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eventtype(uint8_t** ptr, LIBLTE_S1AP_EVENTTYPE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE ExtendedRNC_ID INTEGER ********************************************************************************/ -typedef struct{ -uint16_t ExtendedRNC_ID; -}LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT; +typedef struct { + uint16_t ExtendedRNC_ID; +} LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrnc_id( - LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrnc_id( - uint8_t **ptr, - LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrnc_id(LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrnc_id(uint8_t** ptr, LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenInterRATs ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_FORBIDDENINTERRATS_ALL, LIBLTE_S1AP_FORBIDDENINTERRATS_GERAN, LIBLTE_S1AP_FORBIDDENINTERRATS_UTRAN, @@ -1429,163 +1283,132 @@ typedef enum{ LIBLTE_S1AP_FORBIDDENINTERRATS_GERANANDUTRAN, LIBLTE_S1AP_FORBIDDENINTERRATS_CDMA2000ANDUTRAN, LIBLTE_S1AP_FORBIDDENINTERRATS_N_ITEMS, -}LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM; +} LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM; static const char liblte_s1ap_forbiddeninterrats_text[LIBLTE_S1AP_FORBIDDENINTERRATS_N_ITEMS][80] = { - "all", - "geran", - "utran", - "cdma2000", - "geranandutran", - "cdma2000andutran", + "all", + "geran", + "utran", + "cdma2000", + "geranandutran", + "cdma2000andutran", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM e; -}LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT; +} LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddeninterrats( - LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddeninterrats( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddeninterrats(LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddeninterrats(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE GWContextReleaseIndication ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_TRUE, LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_N_ITEMS, -}LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM; +} LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM; static const char liblte_s1ap_gwcontextreleaseindication_text[LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_N_ITEMS][80] = { - "true", + "true", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM e; -}LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT; +} LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gwcontextreleaseindication( - LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gwcontextreleaseindication( - uint8_t **ptr, - LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gwcontextreleaseindication(LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gwcontextreleaseindication(uint8_t** ptr, + LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE HFN INTEGER ********************************************************************************/ -typedef struct{ -uint32_t HFN; -}LIBLTE_S1AP_HFN_STRUCT; +typedef struct { + uint32_t HFN; +} LIBLTE_S1AP_HFN_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfn( - LIBLTE_S1AP_HFN_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfn( - uint8_t **ptr, - LIBLTE_S1AP_HFN_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfn(LIBLTE_S1AP_HFN_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfn(uint8_t** ptr, LIBLTE_S1AP_HFN_STRUCT* ie); /******************************************************************************* /* ProtocolIE IMSI DYNAMIC OCTET STRING ********************************************************************************/ // lb:3, ub:8 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[8]; -}LIBLTE_S1AP_IMSI_STRUCT; +} LIBLTE_S1AP_IMSI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi( - LIBLTE_S1AP_IMSI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi( - uint8_t **ptr, - LIBLTE_S1AP_IMSI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi(LIBLTE_S1AP_IMSI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi(uint8_t** ptr, LIBLTE_S1AP_IMSI_STRUCT* ie); /******************************************************************************* /* ProtocolIE InterfacesToTrace STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_INTERFACESTOTRACE_BIT_STRING_LEN 8 -typedef struct{ - uint8_t buffer[8]; -}LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT; +typedef struct { + uint8_t buffer[8]; +} LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_interfacestotrace( - LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_interfacestotrace( - uint8_t **ptr, - LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_interfacestotrace(LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_interfacestotrace(uint8_t** ptr, LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT* ie); /******************************************************************************* /* ProtocolIE LAC STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_LAC_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_LAC_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_LAC_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lac( - LIBLTE_S1AP_LAC_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lac( - uint8_t **ptr, - LIBLTE_S1AP_LAC_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lac(LIBLTE_S1AP_LAC_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lac(uint8_t** ptr, LIBLTE_S1AP_LAC_STRUCT* ie); /******************************************************************************* /* ProtocolIE LastVisitedUTRANCellInformation DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT; +} LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedutrancellinformation( - LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedutrancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedutrancellinformation(LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedutrancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE L3_Information DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_L3_INFORMATION_STRUCT; +} LIBLTE_S1AP_L3_INFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_l3_information( - LIBLTE_S1AP_L3_INFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information( - uint8_t **ptr, - LIBLTE_S1AP_L3_INFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_l3_information(LIBLTE_S1AP_L3_INFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information(uint8_t** ptr, LIBLTE_S1AP_L3_INFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE LHN_ID DYNAMIC OCTET STRING ********************************************************************************/ // lb:32, ub:256 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[256]; -}LIBLTE_S1AP_LHN_ID_STRUCT; +} LIBLTE_S1AP_LHN_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lhn_id( - LIBLTE_S1AP_LHN_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id( - uint8_t **ptr, - LIBLTE_S1AP_LHN_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lhn_id(LIBLTE_S1AP_LHN_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id(uint8_t** ptr, LIBLTE_S1AP_LHN_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE LoggingDuration ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_LOGGINGDURATION_M10, LIBLTE_S1AP_LOGGINGDURATION_M20, LIBLTE_S1AP_LOGGINGDURATION_M40, @@ -1593,415 +1416,338 @@ typedef enum{ LIBLTE_S1AP_LOGGINGDURATION_M90, LIBLTE_S1AP_LOGGINGDURATION_M120, LIBLTE_S1AP_LOGGINGDURATION_N_ITEMS, -}LIBLTE_S1AP_LOGGINGDURATION_ENUM; +} LIBLTE_S1AP_LOGGINGDURATION_ENUM; static const char liblte_s1ap_loggingduration_text[LIBLTE_S1AP_LOGGINGDURATION_N_ITEMS][80] = { - "m10", - "m20", - "m40", - "m60", - "m90", - "m120", + "m10", + "m20", + "m40", + "m60", + "m90", + "m120", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggingduration( - LIBLTE_S1AP_LOGGINGDURATION_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggingduration( - uint8_t **ptr, - LIBLTE_S1AP_LOGGINGDURATION_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggingduration(LIBLTE_S1AP_LOGGINGDURATION_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggingduration(uint8_t** ptr, LIBLTE_S1AP_LOGGINGDURATION_ENUM* ie); /******************************************************************************* /* ProtocolIE MDT_Activation ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_MDT_ACTIVATION_IMMEDIATE_MDT_ONLY, LIBLTE_S1AP_MDT_ACTIVATION_IMMEDIATE_MDT_AND_TRACE, LIBLTE_S1AP_MDT_ACTIVATION_LOGGED_MDT_ONLY, LIBLTE_S1AP_MDT_ACTIVATION_N_ITEMS, -}LIBLTE_S1AP_MDT_ACTIVATION_ENUM; +} LIBLTE_S1AP_MDT_ACTIVATION_ENUM; static const char liblte_s1ap_mdt_activation_text[LIBLTE_S1AP_MDT_ACTIVATION_N_ITEMS][80] = { - "immediate-MDT-only", - "immediate-MDT-and-Trace", - "logged-MDT-only", + "immediate-MDT-only", + "immediate-MDT-and-Trace", + "logged-MDT-only", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_MDT_ACTIVATION_ENUM e; -}LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT; +} LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_activation( - LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_activation( - uint8_t **ptr, - LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_activation(LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_activation(uint8_t** ptr, LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE ManagementBasedMDTAllowed ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ALLOWED, LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_N_ITEMS, -}LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM; +} LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM; static const char liblte_s1ap_managementbasedmdtallowed_text[LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_N_ITEMS][80] = { - "allowed", + "allowed", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM e; -}LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT; +} LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_managementbasedmdtallowed( - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_managementbasedmdtallowed( - uint8_t **ptr, - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_managementbasedmdtallowed(LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_managementbasedmdtallowed(uint8_t** ptr, + LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE PrivacyIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PRIVACYINDICATOR_IMMEDIATE_MDT, LIBLTE_S1AP_PRIVACYINDICATOR_LOGGED_MDT, LIBLTE_S1AP_PRIVACYINDICATOR_N_ITEMS, -}LIBLTE_S1AP_PRIVACYINDICATOR_ENUM; +} LIBLTE_S1AP_PRIVACYINDICATOR_ENUM; static const char liblte_s1ap_privacyindicator_text[LIBLTE_S1AP_PRIVACYINDICATOR_N_ITEMS][80] = { - "immediate-MDT", - "logged-MDT", + "immediate-MDT", + "logged-MDT", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_PRIVACYINDICATOR_ENUM e; -}LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT; +} LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privacyindicator( - LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privacyindicator( - uint8_t **ptr, - LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privacyindicator(LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privacyindicator(uint8_t** ptr, LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE MeasurementsToActivate STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_BIT_STRING_LEN 8 -typedef struct{ - uint8_t buffer[8]; -}LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT; +typedef struct { + uint8_t buffer[8]; +} LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementstoactivate( - LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementstoactivate( - uint8_t **ptr, - LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementstoactivate(LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementstoactivate(uint8_t** ptr, + LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT* ie); /******************************************************************************* /* ProtocolIE MessageIdentifier STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_MESSAGEIDENTIFIER_BIT_STRING_LEN 16 -typedef struct{ - uint8_t buffer[16]; -}LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT; +typedef struct { + uint8_t buffer[16]; +} LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_messageidentifier( - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_messageidentifier( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_messageidentifier(LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_messageidentifier(uint8_t** ptr, LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT* ie); /******************************************************************************* /* ProtocolIE MMEname PrintableString ********************************************************************************/ -typedef struct{ +typedef struct { bool ext; uint32_t n_octets; uint8_t buffer[150]; -}LIBLTE_S1AP_MMENAME_STRUCT; +} LIBLTE_S1AP_MMENAME_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmename( - LIBLTE_S1AP_MMENAME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename( - uint8_t **ptr, - LIBLTE_S1AP_MMENAME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmename(LIBLTE_S1AP_MMENAME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename(uint8_t** ptr, LIBLTE_S1AP_MMENAME_STRUCT* ie); /******************************************************************************* /* ProtocolIE MME_Group_ID STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_MME_GROUP_ID_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_MME_GROUP_ID_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_MME_GROUP_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_group_id( - LIBLTE_S1AP_MME_GROUP_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_group_id( - uint8_t **ptr, - LIBLTE_S1AP_MME_GROUP_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_group_id(LIBLTE_S1AP_MME_GROUP_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_group_id(uint8_t** ptr, LIBLTE_S1AP_MME_GROUP_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE MME_UE_S1AP_ID INTEGER ********************************************************************************/ -typedef struct{ -uint32_t MME_UE_S1AP_ID; -}LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT; +typedef struct { + uint32_t MME_UE_S1AP_ID; +} LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_ue_s1ap_id( - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_ue_s1ap_id( - uint8_t **ptr, - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_ue_s1ap_id(LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_ue_s1ap_id(uint8_t** ptr, LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE MSClassmark2 DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_MSCLASSMARK2_STRUCT; +} LIBLTE_S1AP_MSCLASSMARK2_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark2( - LIBLTE_S1AP_MSCLASSMARK2_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2( - uint8_t **ptr, - LIBLTE_S1AP_MSCLASSMARK2_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark2(LIBLTE_S1AP_MSCLASSMARK2_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2(uint8_t** ptr, LIBLTE_S1AP_MSCLASSMARK2_STRUCT* ie); /******************************************************************************* /* ProtocolIE NAS_PDU DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_NAS_PDU_STRUCT; +} LIBLTE_S1AP_NAS_PDU_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nas_pdu( - LIBLTE_S1AP_NAS_PDU_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu( - uint8_t **ptr, - LIBLTE_S1AP_NAS_PDU_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nas_pdu(LIBLTE_S1AP_NAS_PDU_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu(uint8_t** ptr, LIBLTE_S1AP_NAS_PDU_STRUCT* ie); /******************************************************************************* /* ProtocolIE NASSecurityParameterstoE_UTRAN DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT; +} LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparameterstoe_utran( - LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparameterstoe_utran( - uint8_t **ptr, - LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparameterstoe_utran(LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_nassecurityparameterstoe_utran(uint8_t** ptr, LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT* ie); /******************************************************************************* /* ProtocolIE NumberOfBroadcasts INTEGER ********************************************************************************/ -typedef struct{ -uint16_t NumberOfBroadcasts; -}LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT; +typedef struct { + uint16_t NumberOfBroadcasts; +} LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcasts( - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcasts( - uint8_t **ptr, - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcasts(LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcasts(uint8_t** ptr, LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT* ie); /******************************************************************************* /* ProtocolIE OverloadAction ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_OVERLOADACTION_REJECT_NON_EMERGENCY_MO_DT, LIBLTE_S1AP_OVERLOADACTION_REJECT_RRC_CR_SIGNALLING, LIBLTE_S1AP_OVERLOADACTION_PERMIT_EMERGENCY_SESSIONS_AND_MOBILE_TERMINATED_SERVICES_ONLY, LIBLTE_S1AP_OVERLOADACTION_PERMIT_HIGH_PRIORITY_SESSIONS_AND_MOBILE_TERMINATED_SERVICES_ONLY, LIBLTE_S1AP_OVERLOADACTION_REJECT_DELAY_TOLERANT_ACCESS, LIBLTE_S1AP_OVERLOADACTION_N_ITEMS, -}LIBLTE_S1AP_OVERLOADACTION_ENUM; +} LIBLTE_S1AP_OVERLOADACTION_ENUM; static const char liblte_s1ap_overloadaction_text[LIBLTE_S1AP_OVERLOADACTION_N_ITEMS][80] = { - "reject-non-emergency-mo-dt", - "reject-rrc-cr-signalling", - "permit-emergency-sessions-and-mobile-terminated-services-only", - "permit-high-priority-sessions-and-mobile-terminated-services-only", - "reject-delay-tolerant-access", + "reject-non-emergency-mo-dt", + "reject-rrc-cr-signalling", + "permit-emergency-sessions-and-mobile-terminated-services-only", + "permit-high-priority-sessions-and-mobile-terminated-services-only", + "reject-delay-tolerant-access", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_OVERLOADACTION_ENUM e; -}LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT; +} LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadaction( - LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadaction( - uint8_t **ptr, - LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadaction(LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadaction(uint8_t** ptr, LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE PagingDRX ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PAGINGDRX_V32, LIBLTE_S1AP_PAGINGDRX_V64, LIBLTE_S1AP_PAGINGDRX_V128, LIBLTE_S1AP_PAGINGDRX_V256, LIBLTE_S1AP_PAGINGDRX_N_ITEMS, -}LIBLTE_S1AP_PAGINGDRX_ENUM; +} LIBLTE_S1AP_PAGINGDRX_ENUM; static const char liblte_s1ap_pagingdrx_text[LIBLTE_S1AP_PAGINGDRX_N_ITEMS][80] = { - "v32", - "v64", - "v128", - "v256", + "v32", + "v64", + "v128", + "v256", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_PAGINGDRX_ENUM e; -}LIBLTE_S1AP_PAGINGDRX_ENUM_EXT; +} LIBLTE_S1AP_PAGINGDRX_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingdrx( - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingdrx( - uint8_t **ptr, - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingdrx(LIBLTE_S1AP_PAGINGDRX_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingdrx(uint8_t** ptr, LIBLTE_S1AP_PAGINGDRX_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE PDCP_SN INTEGER ********************************************************************************/ -typedef struct{ -uint16_t PDCP_SN; -}LIBLTE_S1AP_PDCP_SN_STRUCT; +typedef struct { + uint16_t PDCP_SN; +} LIBLTE_S1AP_PDCP_SN_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_sn( - LIBLTE_S1AP_PDCP_SN_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_sn( - uint8_t **ptr, - LIBLTE_S1AP_PDCP_SN_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_sn(LIBLTE_S1AP_PDCP_SN_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_sn(uint8_t** ptr, LIBLTE_S1AP_PDCP_SN_STRUCT* ie); /******************************************************************************* /* ProtocolIE Port_Number STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_PORT_NUMBER_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_PORT_NUMBER_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_PORT_NUMBER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_port_number( - LIBLTE_S1AP_PORT_NUMBER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_port_number( - uint8_t **ptr, - LIBLTE_S1AP_PORT_NUMBER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_port_number(LIBLTE_S1AP_PORT_NUMBER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_port_number(uint8_t** ptr, LIBLTE_S1AP_PORT_NUMBER_STRUCT* ie); /******************************************************************************* /* ProtocolIE Pre_emptionVulnerability ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_NOT_PRE_EMPTABLE, LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_PRE_EMPTABLE, LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_N_ITEMS, -}LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM; +} LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM; static const char liblte_s1ap_pre_emptionvulnerability_text[LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_N_ITEMS][80] = { - "not-pre-emptable", - "pre-emptable", + "not-pre-emptable", + "pre-emptable", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptionvulnerability( - LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptionvulnerability( - uint8_t **ptr, - LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptionvulnerability(LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptionvulnerability(uint8_t** ptr, + LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM* ie); /******************************************************************************* /* ProtocolIE PS_ServiceNotAvailable ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_PS_SERVICE_NOT_AVAILABLE, LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_N_ITEMS, -}LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM; +} LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM; static const char liblte_s1ap_ps_servicenotavailable_text[LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_N_ITEMS][80] = { - "ps-service-not-available", + "ps-service-not-available", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM e; -}LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT; +} LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ps_servicenotavailable( - LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ps_servicenotavailable( - uint8_t **ptr, - LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ps_servicenotavailable(LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ps_servicenotavailable(uint8_t** ptr, + LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE ReceiveStatusofULPDCPSDUs STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_BIT_STRING_LEN 4096 -typedef struct{ - uint8_t buffer[4096]; -}LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT; +typedef struct { + uint8_t buffer[4096]; +} LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdus( - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdus( - uint8_t **ptr, - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdus(LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdus(uint8_t** ptr, + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT* ie); /******************************************************************************* /* ProtocolIE RelativeMMECapacity INTEGER ********************************************************************************/ -typedef struct{ -uint8_t RelativeMMECapacity; -}LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT; +typedef struct { + uint8_t RelativeMMECapacity; +} LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_relativemmecapacity( - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relativemmecapacity( - uint8_t **ptr, - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_relativemmecapacity(LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relativemmecapacity(uint8_t** ptr, LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE RAC STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_RAC_OCTET_STRING_LEN 1 -typedef struct{ - uint8_t buffer[1]; -}LIBLTE_S1AP_RAC_STRUCT; +typedef struct { + uint8_t buffer[1]; +} LIBLTE_S1AP_RAC_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rac( - LIBLTE_S1AP_RAC_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rac( - uint8_t **ptr, - LIBLTE_S1AP_RAC_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rac(LIBLTE_S1AP_RAC_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rac(uint8_t** ptr, LIBLTE_S1AP_RAC_STRUCT* ie); /******************************************************************************* /* ProtocolIE ReportIntervalMDT ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_REPORTINTERVALMDT_MS120, LIBLTE_S1AP_REPORTINTERVALMDT_MS240, LIBLTE_S1AP_REPORTINTERVALMDT_MS480, @@ -2016,71 +1762,59 @@ typedef enum{ LIBLTE_S1AP_REPORTINTERVALMDT_MIN30, LIBLTE_S1AP_REPORTINTERVALMDT_MIN60, LIBLTE_S1AP_REPORTINTERVALMDT_N_ITEMS, -}LIBLTE_S1AP_REPORTINTERVALMDT_ENUM; +} LIBLTE_S1AP_REPORTINTERVALMDT_ENUM; static const char liblte_s1ap_reportintervalmdt_text[LIBLTE_S1AP_REPORTINTERVALMDT_N_ITEMS][80] = { - "ms120", - "ms240", - "ms480", - "ms640", - "ms1024", - "ms2048", - "ms5120", - "ms10240", - "min1", - "min6", - "min12", - "min30", - "min60", + "ms120", + "ms240", + "ms480", + "ms640", + "ms1024", + "ms2048", + "ms5120", + "ms10240", + "min1", + "min6", + "min12", + "min30", + "min60", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportintervalmdt( - LIBLTE_S1AP_REPORTINTERVALMDT_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportintervalmdt( - uint8_t **ptr, - LIBLTE_S1AP_REPORTINTERVALMDT_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportintervalmdt(LIBLTE_S1AP_REPORTINTERVALMDT_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportintervalmdt(uint8_t** ptr, LIBLTE_S1AP_REPORTINTERVALMDT_ENUM* ie); /******************************************************************************* /* ProtocolIE ReportArea ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_REPORTAREA_ECGI, LIBLTE_S1AP_REPORTAREA_N_ITEMS, -}LIBLTE_S1AP_REPORTAREA_ENUM; +} LIBLTE_S1AP_REPORTAREA_ENUM; static const char liblte_s1ap_reportarea_text[LIBLTE_S1AP_REPORTAREA_N_ITEMS][80] = { - "ecgi", + "ecgi", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_REPORTAREA_ENUM e; -}LIBLTE_S1AP_REPORTAREA_ENUM_EXT; +} LIBLTE_S1AP_REPORTAREA_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportarea( - LIBLTE_S1AP_REPORTAREA_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportarea( - uint8_t **ptr, - LIBLTE_S1AP_REPORTAREA_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportarea(LIBLTE_S1AP_REPORTAREA_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportarea(uint8_t** ptr, LIBLTE_S1AP_REPORTAREA_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE RNC_ID INTEGER ********************************************************************************/ -typedef struct{ -uint16_t RNC_ID; -}LIBLTE_S1AP_RNC_ID_STRUCT; +typedef struct { + uint16_t RNC_ID; +} LIBLTE_S1AP_RNC_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rnc_id( - LIBLTE_S1AP_RNC_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rnc_id( - uint8_t **ptr, - LIBLTE_S1AP_RNC_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rnc_id(LIBLTE_S1AP_RNC_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rnc_id(uint8_t** ptr, LIBLTE_S1AP_RNC_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE RRC_Establishment_Cause ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_EMERGENCY, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_HIGHPRIORITYACCESS, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_MT_ACCESS, @@ -2088,228 +1822,194 @@ typedef enum{ LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_MO_DATA, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_DELAY_TOLERANTACCESS, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_N_ITEMS, -}LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM; +} LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM; static const char liblte_s1ap_rrc_establishment_cause_text[LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_N_ITEMS][80] = { - "emergency", - "highPriorityAccess", - "mt-Access", - "mo-Signalling", - "mo-Data", - "delay-TolerantAccess", + "emergency", + "highPriorityAccess", + "mt-Access", + "mo-Signalling", + "mo-Data", + "delay-TolerantAccess", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM e; -}LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT; +} LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_establishment_cause( - LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_establishment_cause( - uint8_t **ptr, - LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_establishment_cause(LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_establishment_cause(uint8_t** ptr, + LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Routing_ID INTEGER ********************************************************************************/ -typedef struct{ -uint8_t Routing_ID; -}LIBLTE_S1AP_ROUTING_ID_STRUCT; +typedef struct { + uint8_t Routing_ID; +} LIBLTE_S1AP_ROUTING_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_routing_id( - LIBLTE_S1AP_ROUTING_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_routing_id( - uint8_t **ptr, - LIBLTE_S1AP_ROUTING_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_routing_id(LIBLTE_S1AP_ROUTING_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_routing_id(uint8_t** ptr, LIBLTE_S1AP_ROUTING_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE SONInformationRequest ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SONINFORMATIONREQUEST_X2TNL_CONFIGURATION_INFO, LIBLTE_S1AP_SONINFORMATIONREQUEST_TIME_SYNCHRONIZATION_INFO, LIBLTE_S1AP_SONINFORMATIONREQUEST_N_ITEMS, -}LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM; +} LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM; static const char liblte_s1ap_soninformationrequest_text[LIBLTE_S1AP_SONINFORMATIONREQUEST_N_ITEMS][80] = { - "x2TNL-Configuration-Info", - "time-Synchronization-Info", + "x2TNL-Configuration-Info", + "time-Synchronization-Info", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM e; -}LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT; +} LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationrequest( - LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationrequest( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationrequest(LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationrequest(uint8_t** ptr, + LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Source_ToTarget_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_source_totarget_transparentcontainer( - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_source_totarget_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_source_totarget_transparentcontainer(LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_source_totarget_transparentcontainer(uint8_t** ptr, + LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE SRVCCHOIndication ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SRVCCHOINDICATION_PSANDCS, LIBLTE_S1AP_SRVCCHOINDICATION_CSONLY, LIBLTE_S1AP_SRVCCHOINDICATION_N_ITEMS, -}LIBLTE_S1AP_SRVCCHOINDICATION_ENUM; +} LIBLTE_S1AP_SRVCCHOINDICATION_ENUM; static const char liblte_s1ap_srvcchoindication_text[LIBLTE_S1AP_SRVCCHOINDICATION_N_ITEMS][80] = { - "pSandCS", - "cSonly", + "pSandCS", + "cSonly", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_SRVCCHOINDICATION_ENUM e; -}LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT; +} LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvcchoindication( - LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvcchoindication( - uint8_t **ptr, - LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvcchoindication(LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvcchoindication(uint8_t** ptr, LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE SourceRNC_ToTargetRNC_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcernc_totargetrnc_transparentcontainer( - LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE SubscriberProfileIDforRFP INTEGER ********************************************************************************/ -typedef struct{ -uint8_t SubscriberProfileIDforRFP; -}LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT; +typedef struct { + uint8_t SubscriberProfileIDforRFP; +} LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_subscriberprofileidforrfp( - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_subscriberprofileidforrfp( - uint8_t **ptr, - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_subscriberprofileidforrfp(LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_subscriberprofileidforrfp(uint8_t** ptr, + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT* ie); /******************************************************************************* /* ProtocolIE SynchronizationStatus ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_SYNCHRONOUS, LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ASYNCHRONOUS, LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_N_ITEMS, -}LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM; +} LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM; static const char liblte_s1ap_synchronizationstatus_text[LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_N_ITEMS][80] = { - "synchronous", - "asynchronous", + "synchronous", + "asynchronous", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM e; -}LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT; +} LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_synchronizationstatus( - LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_synchronizationstatus( - uint8_t **ptr, - LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_synchronizationstatus(LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_synchronizationstatus(uint8_t** ptr, + LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE TargetRNC_ToSourceRNC_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_tosourcernc_transparentcontainer( - LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE Threshold_RSRQ INTEGER ********************************************************************************/ -typedef struct{ -uint8_t Threshold_RSRQ; -}LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT; +typedef struct { + uint8_t Threshold_RSRQ; +} LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrq( - LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrq( - uint8_t **ptr, - LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrq(LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrq(uint8_t** ptr, LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT* ie); /******************************************************************************* /* ProtocolIE Time_UE_StayedInCell INTEGER ********************************************************************************/ -typedef struct{ -uint16_t Time_UE_StayedInCell; -}LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT; +typedef struct { + uint16_t Time_UE_StayedInCell; +} LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell( - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell( - uint8_t **ptr, - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell(LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell(uint8_t** ptr, LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT* ie); /******************************************************************************* /* ProtocolIE TransportLayerAddress DYNAMIC BIT STRING ********************************************************************************/ // lb:1, ub:160 -typedef struct{ +typedef struct { bool ext; uint32_t n_bits; uint8_t buffer[160]; -}LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT; +} LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportlayeraddress( - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress( - uint8_t **ptr, - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportlayeraddress(LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress(uint8_t** ptr, LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT* ie); /******************************************************************************* /* ProtocolIE TraceDepth ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_TRACEDEPTH_MINIMUM, LIBLTE_S1AP_TRACEDEPTH_MEDIUM, LIBLTE_S1AP_TRACEDEPTH_MAXIMUM, @@ -2317,93 +2017,76 @@ typedef enum{ LIBLTE_S1AP_TRACEDEPTH_MEDIUMWITHOUTVENDORSPECIFICEXTENSION, LIBLTE_S1AP_TRACEDEPTH_MAXIMUMWITHOUTVENDORSPECIFICEXTENSION, LIBLTE_S1AP_TRACEDEPTH_N_ITEMS, -}LIBLTE_S1AP_TRACEDEPTH_ENUM; +} LIBLTE_S1AP_TRACEDEPTH_ENUM; static const char liblte_s1ap_tracedepth_text[LIBLTE_S1AP_TRACEDEPTH_N_ITEMS][80] = { - "minimum", - "medium", - "maximum", - "minimumWithoutVendorSpecificExtension", - "mediumWithoutVendorSpecificExtension", - "maximumWithoutVendorSpecificExtension", + "minimum", + "medium", + "maximum", + "minimumWithoutVendorSpecificExtension", + "mediumWithoutVendorSpecificExtension", + "maximumWithoutVendorSpecificExtension", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_TRACEDEPTH_ENUM e; -}LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT; +} LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracedepth( - LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracedepth( - uint8_t **ptr, - LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracedepth(LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracedepth(uint8_t** ptr, LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE TrafficLoadReductionIndication INTEGER ********************************************************************************/ -typedef struct{ -uint8_t TrafficLoadReductionIndication; -}LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT; +typedef struct { + uint8_t TrafficLoadReductionIndication; +} LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_trafficloadreductionindication( - LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_trafficloadreductionindication( - uint8_t **ptr, - LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_trafficloadreductionindication(LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_trafficloadreductionindication(uint8_t** ptr, LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE UERadioCapability DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT; +} LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapability( - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability( - uint8_t **ptr, - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapability(LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability(uint8_t** ptr, LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE WarningType STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_WARNINGTYPE_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_WARNINGTYPE_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_WARNINGTYPE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningtype( - LIBLTE_S1AP_WARNINGTYPE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningtype( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGTYPE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningtype(LIBLTE_S1AP_WARNINGTYPE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningtype(uint8_t** ptr, LIBLTE_S1AP_WARNINGTYPE_STRUCT* ie); /******************************************************************************* /* ProtocolIE WarningMessageContents DYNAMIC OCTET STRING ********************************************************************************/ // lb:1, ub:9600 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[9600]; -}LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT; +} LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningmessagecontents( - LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningmessagecontents(LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents(uint8_t** ptr, + LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT* ie); /******************************************************************************* /* ProtocolIE CauseProtocol ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSEPROTOCOL_TRANSFER_SYNTAX_ERROR, LIBLTE_S1AP_CAUSEPROTOCOL_ABSTRACT_SYNTAX_ERROR_REJECT, LIBLTE_S1AP_CAUSEPROTOCOL_ABSTRACT_SYNTAX_ERROR_IGNORE_AND_NOTIFY, @@ -2412,455 +2095,382 @@ typedef enum{ LIBLTE_S1AP_CAUSEPROTOCOL_ABSTRACT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MESSAGE, LIBLTE_S1AP_CAUSEPROTOCOL_UNSPECIFIED, LIBLTE_S1AP_CAUSEPROTOCOL_N_ITEMS, -}LIBLTE_S1AP_CAUSEPROTOCOL_ENUM; +} LIBLTE_S1AP_CAUSEPROTOCOL_ENUM; static const char liblte_s1ap_causeprotocol_text[LIBLTE_S1AP_CAUSEPROTOCOL_N_ITEMS][80] = { - "transfer-syntax-error", - "abstract-syntax-error-reject", - "abstract-syntax-error-ignore-and-notify", - "message-not-compatible-with-receiver-state", - "semantic-error", - "abstract-syntax-error-falsely-constructed-message", - "unspecified", + "transfer-syntax-error", + "abstract-syntax-error-reject", + "abstract-syntax-error-ignore-and-notify", + "message-not-compatible-with-receiver-state", + "semantic-error", + "abstract-syntax-error-falsely-constructed-message", + "unspecified", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSEPROTOCOL_ENUM e; -}LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT; +} LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeprotocol( - LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeprotocol( - uint8_t **ptr, - LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeprotocol(LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeprotocol(uint8_t** ptr, LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CellAccessMode ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CELLACCESSMODE_HYBRID, LIBLTE_S1AP_CELLACCESSMODE_N_ITEMS, -}LIBLTE_S1AP_CELLACCESSMODE_ENUM; +} LIBLTE_S1AP_CELLACCESSMODE_ENUM; static const char liblte_s1ap_cellaccessmode_text[LIBLTE_S1AP_CELLACCESSMODE_N_ITEMS][80] = { - "hybrid", + "hybrid", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CELLACCESSMODE_ENUM e; -}LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT; +} LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellaccessmode( - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellaccessmode( - uint8_t **ptr, - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellaccessmode(LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellaccessmode(uint8_t** ptr, LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Cdma2000RATType ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CDMA2000RATTYPE_HRPD, LIBLTE_S1AP_CDMA2000RATTYPE_ONEXRTT, LIBLTE_S1AP_CDMA2000RATTYPE_N_ITEMS, -}LIBLTE_S1AP_CDMA2000RATTYPE_ENUM; +} LIBLTE_S1AP_CDMA2000RATTYPE_ENUM; static const char liblte_s1ap_cdma2000rattype_text[LIBLTE_S1AP_CDMA2000RATTYPE_N_ITEMS][80] = { - "hRPD", - "onexRTT", + "hRPD", + "onexRTT", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CDMA2000RATTYPE_ENUM e; -}LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT; +} LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000rattype( - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000rattype( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000rattype(LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000rattype(uint8_t** ptr, LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Cdma2000OneXMEID DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT; +} LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmeid( - LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmeid(LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cell_Size ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CELL_SIZE_VERYSMALL, LIBLTE_S1AP_CELL_SIZE_SMALL, LIBLTE_S1AP_CELL_SIZE_MEDIUM, LIBLTE_S1AP_CELL_SIZE_LARGE, LIBLTE_S1AP_CELL_SIZE_N_ITEMS, -}LIBLTE_S1AP_CELL_SIZE_ENUM; +} LIBLTE_S1AP_CELL_SIZE_ENUM; static const char liblte_s1ap_cell_size_text[LIBLTE_S1AP_CELL_SIZE_N_ITEMS][80] = { - "verysmall", - "small", - "medium", - "large", + "verysmall", + "small", + "medium", + "large", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CELL_SIZE_ENUM e; -}LIBLTE_S1AP_CELL_SIZE_ENUM_EXT; +} LIBLTE_S1AP_CELL_SIZE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cell_size( - LIBLTE_S1AP_CELL_SIZE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cell_size( - uint8_t **ptr, - LIBLTE_S1AP_CELL_SIZE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cell_size(LIBLTE_S1AP_CELL_SIZE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cell_size(uint8_t** ptr, LIBLTE_S1AP_CELL_SIZE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CI STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_CI_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_CI_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_CI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ci( - LIBLTE_S1AP_CI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ci( - uint8_t **ptr, - LIBLTE_S1AP_CI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ci(LIBLTE_S1AP_CI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ci(uint8_t** ptr, LIBLTE_S1AP_CI_STRUCT* ie); /******************************************************************************* /* ProtocolIE CSFallbackIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CSFALLBACKINDICATOR_CS_FALLBACK_REQUIRED, LIBLTE_S1AP_CSFALLBACKINDICATOR_CS_FALLBACK_HIGH_PRIORITY, LIBLTE_S1AP_CSFALLBACKINDICATOR_N_ITEMS, -}LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM; +} LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM; static const char liblte_s1ap_csfallbackindicator_text[LIBLTE_S1AP_CSFALLBACKINDICATOR_N_ITEMS][80] = { - "cs-fallback-required", - "cs-fallback-high-priority", + "cs-fallback-required", + "cs-fallback-high-priority", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM e; -}LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT; +} LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csfallbackindicator( - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csfallbackindicator( - uint8_t **ptr, - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csfallbackindicator(LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csfallbackindicator(uint8_t** ptr, LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CSGMembershipStatus ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_MEMBER, LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_NOT_MEMBER, LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_N_ITEMS, -}LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM; +} LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM; static const char liblte_s1ap_csgmembershipstatus_text[LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_N_ITEMS][80] = { - "member", - "not-member", + "member", + "not-member", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csgmembershipstatus( - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csgmembershipstatus( - uint8_t **ptr, - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csgmembershipstatus(LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csgmembershipstatus(uint8_t** ptr, LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM* ie); /******************************************************************************* /* ProtocolIE DataCodingScheme STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_DATACODINGSCHEME_BIT_STRING_LEN 8 -typedef struct{ - uint8_t buffer[8]; -}LIBLTE_S1AP_DATACODINGSCHEME_STRUCT; +typedef struct { + uint8_t buffer[8]; +} LIBLTE_S1AP_DATACODINGSCHEME_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_datacodingscheme( - LIBLTE_S1AP_DATACODINGSCHEME_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_datacodingscheme( - uint8_t **ptr, - LIBLTE_S1AP_DATACODINGSCHEME_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_datacodingscheme(LIBLTE_S1AP_DATACODINGSCHEME_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_datacodingscheme(uint8_t** ptr, LIBLTE_S1AP_DATACODINGSCHEME_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaIDList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EMERGENCYAREAID_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlist( - LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlist( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlist(LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlist(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaIDListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EMERGENCYAREAID_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlistforrestart( - LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlistforrestart(LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_emergencyareaidlistforrestart(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENB_UE_S1AP_ID INTEGER ********************************************************************************/ -typedef struct{ -uint32_t ENB_UE_S1AP_ID; -}LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT; +typedef struct { + uint32_t ENB_UE_S1AP_ID; +} LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_ue_s1ap_id( - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_ue_s1ap_id( - uint8_t **ptr, - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_ue_s1ap_id(LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_ue_s1ap_id(uint8_t** ptr, LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RAB_ID INTEGER ********************************************************************************/ -typedef struct{ - bool ext; -uint8_t E_RAB_ID; -}LIBLTE_S1AP_E_RAB_ID_STRUCT; +typedef struct { + bool ext; + uint8_t E_RAB_ID; +} LIBLTE_S1AP_E_RAB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_id( - LIBLTE_S1AP_E_RAB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_id( - uint8_t **ptr, - LIBLTE_S1AP_E_RAB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_id(LIBLTE_S1AP_E_RAB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_id(uint8_t** ptr, LIBLTE_S1AP_E_RAB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABInformationListItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT dL_Forwarding; - bool dL_Forwarding_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT dL_Forwarding; + bool dL_Forwarding_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem( - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem(LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE EUTRANRoundTripDelayEstimationInfo INTEGER ********************************************************************************/ -typedef struct{ -uint16_t EUTRANRoundTripDelayEstimationInfo; -}LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT; +typedef struct { + uint16_t EUTRANRoundTripDelayEstimationInfo; +} LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutranroundtripdelayestimationinfo( - LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutranroundtripdelayestimationinfo( - uint8_t **ptr, - LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_eutranroundtripdelayestimationinfo(LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_eutranroundtripdelayestimationinfo(uint8_t** ptr, + LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenLACs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:4096 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_LAC_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_FORBIDDENLACS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_LAC_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_FORBIDDENLACS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlacs( - LIBLTE_S1AP_FORBIDDENLACS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlacs( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLACS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlacs(LIBLTE_S1AP_FORBIDDENLACS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlacs(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLACS_STRUCT* ie); /******************************************************************************* /* ProtocolIE GTP_TEID STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_GTP_TEID_OCTET_STRING_LEN 4 -typedef struct{ - uint8_t buffer[4]; -}LIBLTE_S1AP_GTP_TEID_STRUCT; +typedef struct { + uint8_t buffer[4]; +} LIBLTE_S1AP_GTP_TEID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gtp_teid( - LIBLTE_S1AP_GTP_TEID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gtp_teid( - uint8_t **ptr, - LIBLTE_S1AP_GTP_TEID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gtp_teid(LIBLTE_S1AP_GTP_TEID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gtp_teid(uint8_t** ptr, LIBLTE_S1AP_GTP_TEID_STRUCT* ie); /******************************************************************************* /* ProtocolIE GUMMEIType ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_GUMMEITYPE_NATIVE, LIBLTE_S1AP_GUMMEITYPE_MAPPED, LIBLTE_S1AP_GUMMEITYPE_N_ITEMS, -}LIBLTE_S1AP_GUMMEITYPE_ENUM; +} LIBLTE_S1AP_GUMMEITYPE_ENUM; static const char liblte_s1ap_gummeitype_text[LIBLTE_S1AP_GUMMEITYPE_N_ITEMS][80] = { - "native", - "mapped", + "native", + "mapped", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_GUMMEITYPE_ENUM e; -}LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT; +} LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeitype( - LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeitype( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeitype(LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeitype(uint8_t** ptr, LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE HandoverType ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_HANDOVERTYPE_INTRALTE, LIBLTE_S1AP_HANDOVERTYPE_LTETOUTRAN, LIBLTE_S1AP_HANDOVERTYPE_LTETOGERAN, LIBLTE_S1AP_HANDOVERTYPE_UTRANTOLTE, LIBLTE_S1AP_HANDOVERTYPE_GERANTOLTE, LIBLTE_S1AP_HANDOVERTYPE_N_ITEMS, -}LIBLTE_S1AP_HANDOVERTYPE_ENUM; +} LIBLTE_S1AP_HANDOVERTYPE_ENUM; static const char liblte_s1ap_handovertype_text[LIBLTE_S1AP_HANDOVERTYPE_N_ITEMS][80] = { - "intralte", - "ltetoutran", - "ltetogeran", - "utrantolte", - "gerantolte", + "intralte", + "ltetoutran", + "ltetogeran", + "utrantolte", + "gerantolte", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_HANDOVERTYPE_ENUM e; -}LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT; +} LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovertype( - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovertype( - uint8_t **ptr, - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovertype(LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovertype(uint8_t** ptr, LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE IntegrityProtectionAlgorithms STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_BIT_STRING_LEN 16 -typedef struct{ - bool ext; - uint8_t buffer[16]; -}LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT; +typedef struct { + bool ext; + uint8_t buffer[16]; +} LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_integrityprotectionalgorithms( - LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_integrityprotectionalgorithms( - uint8_t **ptr, - LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_integrityprotectionalgorithms(LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_integrityprotectionalgorithms(uint8_t** ptr, LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT* ie); -//TODO: Type undefined NULL +// TODO: Type undefined NULL /******************************************************************************* /* ProtocolIE LastVisitedGERANCellInformation CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNDEFINED, LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_N_ITEMS, -}LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_ENUM; -static const char liblte_s1ap_lastvisitedgerancellinformation_choice_text[LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_N_ITEMS][50] = { - "undefined", +} LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_ENUM; +static const char + liblte_s1ap_lastvisitedgerancellinformation_choice_text[LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_N_ITEMS] + [50] = { + "undefined", }; -typedef union{ - //TODO: NULL undefined; -}LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNION; +typedef union { + // TODO: NULL undefined; +} LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNION choice; LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT; +} LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedgerancellinformation( - LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedgerancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedgerancellinformation(LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedgerancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE Links_to_log ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_LINKS_TO_LOG_UPLINK, LIBLTE_S1AP_LINKS_TO_LOG_DOWNLINK, LIBLTE_S1AP_LINKS_TO_LOG_BOTH_UPLINK_AND_DOWNLINK, LIBLTE_S1AP_LINKS_TO_LOG_N_ITEMS, -}LIBLTE_S1AP_LINKS_TO_LOG_ENUM; +} LIBLTE_S1AP_LINKS_TO_LOG_ENUM; static const char liblte_s1ap_links_to_log_text[LIBLTE_S1AP_LINKS_TO_LOG_N_ITEMS][80] = { - "uplink", - "downlink", - "both-uplink-and-downlink", + "uplink", + "downlink", + "both-uplink-and-downlink", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_LINKS_TO_LOG_ENUM e; -}LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT; +} LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_links_to_log( - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_links_to_log( - uint8_t **ptr, - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_links_to_log(LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_links_to_log(uint8_t** ptr, LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE LoggingInterval ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_LOGGINGINTERVAL_MS128, LIBLTE_S1AP_LOGGINGINTERVAL_MS256, LIBLTE_S1AP_LOGGINGINTERVAL_MS512, @@ -2870,1618 +2480,1312 @@ typedef enum{ LIBLTE_S1AP_LOGGINGINTERVAL_MS4096, LIBLTE_S1AP_LOGGINGINTERVAL_MS6144, LIBLTE_S1AP_LOGGINGINTERVAL_N_ITEMS, -}LIBLTE_S1AP_LOGGINGINTERVAL_ENUM; +} LIBLTE_S1AP_LOGGINGINTERVAL_ENUM; static const char liblte_s1ap_logginginterval_text[LIBLTE_S1AP_LOGGINGINTERVAL_N_ITEMS][80] = { - "ms128", - "ms256", - "ms512", - "ms1024", - "ms2048", - "ms3072", - "ms4096", - "ms6144", + "ms128", + "ms256", + "ms512", + "ms1024", + "ms2048", + "ms3072", + "ms4096", + "ms6144", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_logginginterval( - LIBLTE_S1AP_LOGGINGINTERVAL_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_logginginterval( - uint8_t **ptr, - LIBLTE_S1AP_LOGGINGINTERVAL_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_logginginterval(LIBLTE_S1AP_LOGGINGINTERVAL_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_logginginterval(uint8_t** ptr, LIBLTE_S1AP_LOGGINGINTERVAL_ENUM* ie); /******************************************************************************* /* ProtocolIE M3period ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_M3PERIOD_MS100, LIBLTE_S1AP_M3PERIOD_MS1000, LIBLTE_S1AP_M3PERIOD_MS10000, LIBLTE_S1AP_M3PERIOD_N_ITEMS, -}LIBLTE_S1AP_M3PERIOD_ENUM; +} LIBLTE_S1AP_M3PERIOD_ENUM; static const char liblte_s1ap_m3period_text[LIBLTE_S1AP_M3PERIOD_N_ITEMS][80] = { - "ms100", - "ms1000", - "ms10000", + "ms100", + "ms1000", + "ms10000", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_M3PERIOD_ENUM e; -}LIBLTE_S1AP_M3PERIOD_ENUM_EXT; +} LIBLTE_S1AP_M3PERIOD_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3period( - LIBLTE_S1AP_M3PERIOD_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3period( - uint8_t **ptr, - LIBLTE_S1AP_M3PERIOD_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3period(LIBLTE_S1AP_M3PERIOD_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3period(uint8_t** ptr, LIBLTE_S1AP_M3PERIOD_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE M4period ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_M4PERIOD_MS1024, LIBLTE_S1AP_M4PERIOD_MS2048, LIBLTE_S1AP_M4PERIOD_MS5120, LIBLTE_S1AP_M4PERIOD_MS10240, LIBLTE_S1AP_M4PERIOD_MIN1, LIBLTE_S1AP_M4PERIOD_N_ITEMS, -}LIBLTE_S1AP_M4PERIOD_ENUM; +} LIBLTE_S1AP_M4PERIOD_ENUM; static const char liblte_s1ap_m4period_text[LIBLTE_S1AP_M4PERIOD_N_ITEMS][80] = { - "ms1024", - "ms2048", - "ms5120", - "ms10240", - "min1", + "ms1024", + "ms2048", + "ms5120", + "ms10240", + "min1", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_M4PERIOD_ENUM e; -}LIBLTE_S1AP_M4PERIOD_ENUM_EXT; +} LIBLTE_S1AP_M4PERIOD_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4period( - LIBLTE_S1AP_M4PERIOD_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4period( - uint8_t **ptr, - LIBLTE_S1AP_M4PERIOD_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4period(LIBLTE_S1AP_M4PERIOD_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4period(uint8_t** ptr, LIBLTE_S1AP_M4PERIOD_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE M5period ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_M5PERIOD_MS1024, LIBLTE_S1AP_M5PERIOD_MS2048, LIBLTE_S1AP_M5PERIOD_MS5120, LIBLTE_S1AP_M5PERIOD_MS10240, LIBLTE_S1AP_M5PERIOD_MIN1, LIBLTE_S1AP_M5PERIOD_N_ITEMS, -}LIBLTE_S1AP_M5PERIOD_ENUM; +} LIBLTE_S1AP_M5PERIOD_ENUM; static const char liblte_s1ap_m5period_text[LIBLTE_S1AP_M5PERIOD_N_ITEMS][80] = { - "ms1024", - "ms2048", - "ms5120", - "ms10240", - "min1", + "ms1024", + "ms2048", + "ms5120", + "ms10240", + "min1", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_M5PERIOD_ENUM e; -}LIBLTE_S1AP_M5PERIOD_ENUM_EXT; +} LIBLTE_S1AP_M5PERIOD_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5period( - LIBLTE_S1AP_M5PERIOD_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5period( - uint8_t **ptr, - LIBLTE_S1AP_M5PERIOD_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5period(LIBLTE_S1AP_M5PERIOD_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5period(uint8_t** ptr, LIBLTE_S1AP_M5PERIOD_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE MobilityInformation STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_MOBILITYINFORMATION_BIT_STRING_LEN 32 -typedef struct{ - uint8_t buffer[32]; -}LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT; +typedef struct { + uint8_t buffer[32]; +} LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mobilityinformation( - LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mobilityinformation( - uint8_t **ptr, - LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mobilityinformation(LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mobilityinformation(uint8_t** ptr, LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE MME_Code STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_MME_CODE_OCTET_STRING_LEN 1 -typedef struct{ - uint8_t buffer[1]; -}LIBLTE_S1AP_MME_CODE_STRUCT; +typedef struct { + uint8_t buffer[1]; +} LIBLTE_S1AP_MME_CODE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_code( - LIBLTE_S1AP_MME_CODE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_code( - uint8_t **ptr, - LIBLTE_S1AP_MME_CODE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_code(LIBLTE_S1AP_MME_CODE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_code(uint8_t** ptr, LIBLTE_S1AP_MME_CODE_STRUCT* ie); /******************************************************************************* /* ProtocolIE MSClassmark3 DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_MSCLASSMARK3_STRUCT; +} LIBLTE_S1AP_MSCLASSMARK3_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark3( - LIBLTE_S1AP_MSCLASSMARK3_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3( - uint8_t **ptr, - LIBLTE_S1AP_MSCLASSMARK3_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark3(LIBLTE_S1AP_MSCLASSMARK3_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3(uint8_t** ptr, LIBLTE_S1AP_MSCLASSMARK3_STRUCT* ie); /******************************************************************************* /* ProtocolIE NumberofBroadcastRequest INTEGER ********************************************************************************/ -typedef struct{ -uint16_t NumberofBroadcastRequest; -}LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT; +typedef struct { + uint16_t NumberofBroadcastRequest; +} LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcastrequest( - LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcastrequest( - uint8_t **ptr, - LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcastrequest(LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcastrequest(uint8_t** ptr, + LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT* ie); /******************************************************************************* /* ProtocolIE OverloadResponse CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_OVERLOADACTION, LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_ENUM; +} LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_ENUM; static const char liblte_s1ap_overloadresponse_choice_text[LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_N_ITEMS][50] = { - "overloadAction", + "overloadAction", }; -typedef union{ - LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT overloadAction; -}LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT overloadAction; +} LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_UNION choice; LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT; +} LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadresponse( - LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse( - uint8_t **ptr, - LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadresponse(LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse(uint8_t** ptr, LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT* ie); /******************************************************************************* /* ProtocolIE PDCP_SNExtended INTEGER ********************************************************************************/ -typedef struct{ -uint16_t PDCP_SNExtended; -}LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT; +typedef struct { + uint16_t PDCP_SNExtended; +} LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_snextended( - LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_snextended( - uint8_t **ptr, - LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_snextended(LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_snextended(uint8_t** ptr, LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT* ie); /******************************************************************************* /* ProtocolIE Pre_emptionCapability ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_SHALL_NOT_TRIGGER_PRE_EMPTION, LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_MAY_TRIGGER_PRE_EMPTION, LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_N_ITEMS, -}LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM; +} LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM; static const char liblte_s1ap_pre_emptioncapability_text[LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_N_ITEMS][80] = { - "shall-not-trigger-pre-emption", - "may-trigger-pre-emption", + "shall-not-trigger-pre-emption", + "may-trigger-pre-emption", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptioncapability( - LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptioncapability( - uint8_t **ptr, - LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptioncapability(LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptioncapability(uint8_t** ptr, LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM* ie); /******************************************************************************* /* ProtocolIE QCI INTEGER ********************************************************************************/ -typedef struct{ -uint8_t QCI; -}LIBLTE_S1AP_QCI_STRUCT; +typedef struct { + uint8_t QCI; +} LIBLTE_S1AP_QCI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_qci( - LIBLTE_S1AP_QCI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_qci( - uint8_t **ptr, - LIBLTE_S1AP_QCI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_qci(LIBLTE_S1AP_QCI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_qci(uint8_t** ptr, LIBLTE_S1AP_QCI_STRUCT* ie); /******************************************************************************* /* ProtocolIE RelayNode_Indicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_RELAYNODE_INDICATOR_TRUE, LIBLTE_S1AP_RELAYNODE_INDICATOR_N_ITEMS, -}LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM; +} LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM; static const char liblte_s1ap_relaynode_indicator_text[LIBLTE_S1AP_RELAYNODE_INDICATOR_N_ITEMS][80] = { - "true", + "true", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM e; -}LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT; +} LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_relaynode_indicator( - LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relaynode_indicator( - uint8_t **ptr, - LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_relaynode_indicator(LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relaynode_indicator(uint8_t** ptr, LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE M1ReportingTrigger ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_M1REPORTINGTRIGGER_PERIODIC, LIBLTE_S1AP_M1REPORTINGTRIGGER_A2EVENTTRIGGERED, LIBLTE_S1AP_M1REPORTINGTRIGGER_A2EVENTTRIGGERED_PERIODIC, LIBLTE_S1AP_M1REPORTINGTRIGGER_N_ITEMS, -}LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM; +} LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM; static const char liblte_s1ap_m1reportingtrigger_text[LIBLTE_S1AP_M1REPORTINGTRIGGER_N_ITEMS][80] = { - "periodic", - "a2eventtriggered", - "a2eventtriggered-periodic", + "periodic", + "a2eventtriggered", + "a2eventtriggered-periodic", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM e; -}LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT; +} LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1reportingtrigger( - LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1reportingtrigger( - uint8_t **ptr, - LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1reportingtrigger(LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1reportingtrigger(uint8_t** ptr, LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE RIMInformation DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_RIMINFORMATION_STRUCT; +} LIBLTE_S1AP_RIMINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_riminformation( - LIBLTE_S1AP_RIMINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation( - uint8_t **ptr, - LIBLTE_S1AP_RIMINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_riminformation(LIBLTE_S1AP_RIMINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation(uint8_t** ptr, LIBLTE_S1AP_RIMINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE RepetitionPeriod INTEGER ********************************************************************************/ -typedef struct{ -uint16_t RepetitionPeriod; -}LIBLTE_S1AP_REPETITIONPERIOD_STRUCT; +typedef struct { + uint16_t RepetitionPeriod; +} LIBLTE_S1AP_REPETITIONPERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_repetitionperiod( - LIBLTE_S1AP_REPETITIONPERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_repetitionperiod( - uint8_t **ptr, - LIBLTE_S1AP_REPETITIONPERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_repetitionperiod(LIBLTE_S1AP_REPETITIONPERIOD_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_repetitionperiod(uint8_t** ptr, LIBLTE_S1AP_REPETITIONPERIOD_STRUCT* ie); /******************************************************************************* /* ProtocolIE SecurityKey STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_SECURITYKEY_BIT_STRING_LEN 256 -typedef struct{ - uint8_t buffer[256]; -}LIBLTE_S1AP_SECURITYKEY_STRUCT; +typedef struct { + uint8_t buffer[256]; +} LIBLTE_S1AP_SECURITYKEY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitykey( - LIBLTE_S1AP_SECURITYKEY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitykey( - uint8_t **ptr, - LIBLTE_S1AP_SECURITYKEY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitykey(LIBLTE_S1AP_SECURITYKEY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitykey(uint8_t** ptr, LIBLTE_S1AP_SECURITYKEY_STRUCT* ie); /******************************************************************************* /* ProtocolIE SerialNumber STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_SERIALNUMBER_BIT_STRING_LEN 16 -typedef struct{ - uint8_t buffer[16]; -}LIBLTE_S1AP_SERIALNUMBER_STRUCT; +typedef struct { + uint8_t buffer[16]; +} LIBLTE_S1AP_SERIALNUMBER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_serialnumber( - LIBLTE_S1AP_SERIALNUMBER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_serialnumber( - uint8_t **ptr, - LIBLTE_S1AP_SERIALNUMBER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_serialnumber(LIBLTE_S1AP_SERIALNUMBER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_serialnumber(uint8_t** ptr, LIBLTE_S1AP_SERIALNUMBER_STRUCT* ie); /******************************************************************************* /* ProtocolIE SourceBSS_ToTargetBSS_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcebss_totargetbss_transparentcontainer( - LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE SRVCCOperationPossible ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_POSSIBLE, LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_N_ITEMS, -}LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM; +} LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM; static const char liblte_s1ap_srvccoperationpossible_text[LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_N_ITEMS][80] = { - "possible", + "possible", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM e; -}LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT; +} LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvccoperationpossible( - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvccoperationpossible( - uint8_t **ptr, - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvccoperationpossible(LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvccoperationpossible(uint8_t** ptr, + LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE ServedGroupIDs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_MME_GROUP_ID_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_MME_GROUP_ID_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgroupids( - LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgroupids( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgroupids(LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgroupids(uint8_t** ptr, LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT* ie); /******************************************************************************* /* ProtocolIE StratumLevel INTEGER ********************************************************************************/ -typedef struct{ - bool ext; -uint8_t StratumLevel; -}LIBLTE_S1AP_STRATUMLEVEL_STRUCT; +typedef struct { + bool ext; + uint8_t StratumLevel; +} LIBLTE_S1AP_STRATUMLEVEL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_stratumlevel( - LIBLTE_S1AP_STRATUMLEVEL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_stratumlevel( - uint8_t **ptr, - LIBLTE_S1AP_STRATUMLEVEL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_stratumlevel(LIBLTE_S1AP_STRATUMLEVEL_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_stratumlevel(uint8_t** ptr, LIBLTE_S1AP_STRATUMLEVEL_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAC STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_TAC_OCTET_STRING_LEN 2 -typedef struct{ - uint8_t buffer[2]; -}LIBLTE_S1AP_TAC_STRUCT; +typedef struct { + uint8_t buffer[2]; +} LIBLTE_S1AP_TAC_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tac( - LIBLTE_S1AP_TAC_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tac( - uint8_t **ptr, - LIBLTE_S1AP_TAC_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tac(LIBLTE_S1AP_TAC_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tac(uint8_t** ptr, LIBLTE_S1AP_TAC_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAC_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TALISTFORMDT_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAC_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TALISTFORMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_talistformdt( - LIBLTE_S1AP_TALISTFORMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_talistformdt( - uint8_t **ptr, - LIBLTE_S1AP_TALISTFORMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_talistformdt(LIBLTE_S1AP_TALISTFORMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_talistformdt(uint8_t** ptr, LIBLTE_S1AP_TALISTFORMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE TBCD_STRING STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_TBCD_STRING_OCTET_STRING_LEN 3 -typedef struct{ - uint8_t buffer[3]; -}LIBLTE_S1AP_TBCD_STRING_STRUCT; +typedef struct { + uint8_t buffer[3]; +} LIBLTE_S1AP_TBCD_STRING_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tbcd_string( - LIBLTE_S1AP_TBCD_STRING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tbcd_string( - uint8_t **ptr, - LIBLTE_S1AP_TBCD_STRING_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tbcd_string(LIBLTE_S1AP_TBCD_STRING_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tbcd_string(uint8_t** ptr, LIBLTE_S1AP_TBCD_STRING_STRUCT* ie); /******************************************************************************* /* ProtocolIE Target_ToSource_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_target_tosource_transparentcontainer( - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_target_tosource_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_target_tosource_transparentcontainer(LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_target_tosource_transparentcontainer(uint8_t** ptr, + LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE Threshold_RSRP INTEGER ********************************************************************************/ -typedef struct{ -uint8_t Threshold_RSRP; -}LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT; +typedef struct { + uint8_t Threshold_RSRP; +} LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrp( - LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrp( - uint8_t **ptr, - LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrp(LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrp(uint8_t** ptr, LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT* ie); /******************************************************************************* /* ProtocolIE Time_UE_StayedInCell_EnhancedGranularity INTEGER ********************************************************************************/ -typedef struct{ -uint16_t Time_UE_StayedInCell_EnhancedGranularity; -}LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT; +typedef struct { + uint16_t Time_UE_StayedInCell_EnhancedGranularity; +} LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity( - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity( - uint8_t **ptr, - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_UTRAN_Trace_ID STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_E_UTRAN_TRACE_ID_OCTET_STRING_LEN 8 -typedef struct{ - uint8_t buffer[8]; -}LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT; +typedef struct { + uint8_t buffer[8]; +} LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_utran_trace_id( - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_utran_trace_id( - uint8_t **ptr, - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_utran_trace_id(LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_utran_trace_id(uint8_t** ptr, LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE TypeOfError ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_TYPEOFERROR_NOT_UNDERSTOOD, LIBLTE_S1AP_TYPEOFERROR_MISSING, LIBLTE_S1AP_TYPEOFERROR_N_ITEMS, -}LIBLTE_S1AP_TYPEOFERROR_ENUM; +} LIBLTE_S1AP_TYPEOFERROR_ENUM; static const char liblte_s1ap_typeoferror_text[LIBLTE_S1AP_TYPEOFERROR_N_ITEMS][80] = { - "not-understood", - "missing", + "not-understood", + "missing", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_TYPEOFERROR_ENUM e; -}LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT; +} LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_typeoferror( - LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_typeoferror( - uint8_t **ptr, - LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_typeoferror(LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_typeoferror(uint8_t** ptr, LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE UEAggregateMaximumBitrate SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_BITRATE_STRUCT uEaggregateMaximumBitRateDL; - LIBLTE_S1AP_BITRATE_STRUCT uEaggregateMaximumBitRateUL; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_BITRATE_STRUCT uEaggregateMaximumBitRateDL; + LIBLTE_S1AP_BITRATE_STRUCT uEaggregateMaximumBitRateUL; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregatemaximumbitrate( - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregatemaximumbitrate( - uint8_t **ptr, - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregatemaximumbitrate(LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregatemaximumbitrate(uint8_t** ptr, + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT* ie); /******************************************************************************* /* ProtocolIE UE_S1AP_ID_pair SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair( - LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair( - uint8_t **ptr, - LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair(LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair(uint8_t** ptr, LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT* ie); /******************************************************************************* /* ProtocolIE UEIdentityIndexValue STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_UEIDENTITYINDEXVALUE_BIT_STRING_LEN 10 -typedef struct{ - uint8_t buffer[10]; -}LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT; +typedef struct { + uint8_t buffer[10]; +} LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueidentityindexvalue( - LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueidentityindexvalue( - uint8_t **ptr, - LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueidentityindexvalue(LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueidentityindexvalue(uint8_t** ptr, LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT* ie); /******************************************************************************* /* ProtocolIE UESecurityCapabilities SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT encryptionAlgorithms; - LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT integrityProtectionAlgorithms; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT encryptionAlgorithms; + LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT integrityProtectionAlgorithms; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities( - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities( - uint8_t **ptr, - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities(LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities(uint8_t** ptr, + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT* ie); /******************************************************************************* /* ProtocolIE VoiceSupportMatchIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_SUPPORTED, LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_NOT_SUPPORTED, LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_N_ITEMS, -}LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM; +} LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM; static const char liblte_s1ap_voicesupportmatchindicator_text[LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_N_ITEMS][80] = { - "supported", - "not-supported", + "supported", + "not-supported", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM e; -}LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT; +} LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_voicesupportmatchindicator( - LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_voicesupportmatchindicator( - uint8_t **ptr, - LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_voicesupportmatchindicator(LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_voicesupportmatchindicator(uint8_t** ptr, + LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE WarningSecurityInfo STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_WARNINGSECURITYINFO_OCTET_STRING_LEN 50 -typedef struct{ - uint8_t buffer[50]; -}LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT; +typedef struct { + uint8_t buffer[50]; +} LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningsecurityinfo( - LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningsecurityinfo( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningsecurityinfo(LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningsecurityinfo(uint8_t** ptr, LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENBX2GTPTLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2gtptlas( - LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2gtptlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2gtptlas(LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2gtptlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE CauseTransport ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSETRANSPORT_TRANSPORT_RESOURCE_UNAVAILABLE, LIBLTE_S1AP_CAUSETRANSPORT_UNSPECIFIED, LIBLTE_S1AP_CAUSETRANSPORT_N_ITEMS, -}LIBLTE_S1AP_CAUSETRANSPORT_ENUM; +} LIBLTE_S1AP_CAUSETRANSPORT_ENUM; static const char liblte_s1ap_causetransport_text[LIBLTE_S1AP_CAUSETRANSPORT_N_ITEMS][80] = { - "transport-resource-unavailable", - "unspecified", + "transport-resource-unavailable", + "unspecified", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSETRANSPORT_ENUM e; -}LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT; +} LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causetransport( - LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causetransport( - uint8_t **ptr, - LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causetransport(LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causetransport(uint8_t** ptr, LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Cdma2000HOStatus ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CDMA2000HOSTATUS_HOSUCCESS, LIBLTE_S1AP_CDMA2000HOSTATUS_HOFAILURE, LIBLTE_S1AP_CDMA2000HOSTATUS_N_ITEMS, -}LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM; +} LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM; static const char liblte_s1ap_cdma2000hostatus_text[LIBLTE_S1AP_CDMA2000HOSTATUS_N_ITEMS][80] = { - "hOSuccess", - "hOFailure", + "hOSuccess", + "hOFailure", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM e; -}LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT; +} LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000hostatus( - LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000hostatus( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000hostatus(LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000hostatus(uint8_t** ptr, LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Cdma2000OneXPilot DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT; +} LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexpilot( - LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexpilot(LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT* ie); /******************************************************************************* /* ProtocolIE ConcurrentWarningMessageIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_TRUE, LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_N_ITEMS, -}LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM; -static const char liblte_s1ap_concurrentwarningmessageindicator_text[LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_N_ITEMS][80] = { - "true", +} LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM; +static const char + liblte_s1ap_concurrentwarningmessageindicator_text[LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_N_ITEMS][80] = { + "true", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_concurrentwarningmessageindicator( - LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_concurrentwarningmessageindicator( - uint8_t **ptr, - LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_concurrentwarningmessageindicator(LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_concurrentwarningmessageindicator(uint8_t** ptr, + LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM* ie); /******************************************************************************* /* ProtocolIE COUNTvalue SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_PDCP_SN_STRUCT pDCP_SN; - LIBLTE_S1AP_HFN_STRUCT hFN; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_COUNTVALUE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_PDCP_SN_STRUCT pDCP_SN; + LIBLTE_S1AP_HFN_STRUCT hFN; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_COUNTVALUE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue( - LIBLTE_S1AP_COUNTVALUE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue( - uint8_t **ptr, - LIBLTE_S1AP_COUNTVALUE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue(LIBLTE_S1AP_COUNTVALUE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue(uint8_t** ptr, LIBLTE_S1AP_COUNTVALUE_STRUCT* ie); /******************************************************************************* /* ProtocolIE CriticalityDiagnostics_IE_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CRITICALITY_ENUM iECriticality; - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT iE_ID; - LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT typeOfError; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CRITICALITY_ENUM iECriticality; + LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT iE_ID; + LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT typeOfError; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ie_item(uint8_t** ptr, LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENBX2TLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:2 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_ENBX2TLAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_ENBX2TLAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2tlas( - LIBLTE_S1AP_ENBX2TLAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2tlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2TLAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2tlas(LIBLTE_S1AP_ENBX2TLAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2tlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2TLAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE ExtendedRepetitionPeriod INTEGER ********************************************************************************/ -typedef struct{ -uint32_t ExtendedRepetitionPeriod; -}LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT; +typedef struct { + uint32_t ExtendedRepetitionPeriod; +} LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrepetitionperiod( - LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrepetitionperiod( - uint8_t **ptr, - LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrepetitionperiod(LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrepetitionperiod(uint8_t** ptr, + LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenTACs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:4096 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAC_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_FORBIDDENTACS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAC_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_FORBIDDENTACS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentacs( - LIBLTE_S1AP_FORBIDDENTACS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentacs( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTACS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentacs(LIBLTE_S1AP_FORBIDDENTACS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentacs(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTACS_STRUCT* ie); /******************************************************************************* /* ProtocolIE GBR_QosInformation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_BITRATE_STRUCT e_RAB_MaximumBitrateDL; - LIBLTE_S1AP_BITRATE_STRUCT e_RAB_MaximumBitrateUL; - LIBLTE_S1AP_BITRATE_STRUCT e_RAB_GuaranteedBitrateDL; - LIBLTE_S1AP_BITRATE_STRUCT e_RAB_GuaranteedBitrateUL; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation( - LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation( - uint8_t **ptr, - LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_BITRATE_STRUCT e_RAB_MaximumBitrateDL; + LIBLTE_S1AP_BITRATE_STRUCT e_RAB_MaximumBitrateUL; + LIBLTE_S1AP_BITRATE_STRUCT e_RAB_GuaranteedBitrateDL; + LIBLTE_S1AP_BITRATE_STRUCT e_RAB_GuaranteedBitrateUL; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation(LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation(uint8_t** ptr, LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE HFNModified INTEGER ********************************************************************************/ -typedef struct{ -uint32_t HFNModified; -}LIBLTE_S1AP_HFNMODIFIED_STRUCT; +typedef struct { + uint32_t HFNModified; +} LIBLTE_S1AP_HFNMODIFIED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfnmodified( - LIBLTE_S1AP_HFNMODIFIED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfnmodified( - uint8_t **ptr, - LIBLTE_S1AP_HFNMODIFIED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfnmodified(LIBLTE_S1AP_HFNMODIFIED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfnmodified(uint8_t** ptr, LIBLTE_S1AP_HFNMODIFIED_STRUCT* ie); /******************************************************************************* /* ProtocolIE KillAllWarningMessages ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_KILLALLWARNINGMESSAGES_TRUE, LIBLTE_S1AP_KILLALLWARNINGMESSAGES_N_ITEMS, -}LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM; +} LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM; static const char liblte_s1ap_killallwarningmessages_text[LIBLTE_S1AP_KILLALLWARNINGMESSAGES_N_ITEMS][80] = { - "true", + "true", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killallwarningmessages( - LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killallwarningmessages( - uint8_t **ptr, - LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killallwarningmessages(LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killallwarningmessages(uint8_t** ptr, LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM* ie); /******************************************************************************* /* ProtocolIE LPPa_PDU DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_LPPA_PDU_STRUCT; +} LIBLTE_S1AP_LPPA_PDU_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lppa_pdu( - LIBLTE_S1AP_LPPA_PDU_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu( - uint8_t **ptr, - LIBLTE_S1AP_LPPA_PDU_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lppa_pdu(LIBLTE_S1AP_LPPA_PDU_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu(uint8_t** ptr, LIBLTE_S1AP_LPPA_PDU_STRUCT* ie); /******************************************************************************* /* ProtocolIE M3Configuration SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_M3PERIOD_ENUM_EXT m3period; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_M3CONFIGURATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_M3PERIOD_ENUM_EXT m3period; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_M3CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration( - LIBLTE_S1AP_M3CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration( - uint8_t **ptr, - LIBLTE_S1AP_M3CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration(LIBLTE_S1AP_M3CONFIGURATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration(uint8_t** ptr, LIBLTE_S1AP_M3CONFIGURATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE M5Configuration SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_M5PERIOD_ENUM_EXT m5period; - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT m5_links_to_log; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_M5CONFIGURATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_M5PERIOD_ENUM_EXT m5period; + LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT m5_links_to_log; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_M5CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration( - LIBLTE_S1AP_M5CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration( - uint8_t **ptr, - LIBLTE_S1AP_M5CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration(LIBLTE_S1AP_M5CONFIGURATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration(uint8_t** ptr, LIBLTE_S1AP_M5CONFIGURATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE MeasurementThresholdA2 CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRP, LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRQ, LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_N_ITEMS, -}LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_ENUM; -static const char liblte_s1ap_measurementthresholda2_choice_text[LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_N_ITEMS][50] = { - "threshold_RSRP", - "threshold_RSRQ", +} LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_ENUM; +static const char liblte_s1ap_measurementthresholda2_choice_text[LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_N_ITEMS] + [50] = { + "threshold_RSRP", + "threshold_RSRQ", }; -typedef union{ - LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT threshold_RSRP; - LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT threshold_RSRQ; -}LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT threshold_RSRP; + LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT threshold_RSRQ; +} LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_UNION choice; LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT; +} LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementthresholda2( - LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2( - uint8_t **ptr, - LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementthresholda2(LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2(uint8_t** ptr, + LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT* ie); /******************************************************************************* /* ProtocolIE M_TMSI STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_M_TMSI_OCTET_STRING_LEN 4 -typedef struct{ - uint8_t buffer[4]; -}LIBLTE_S1AP_M_TMSI_STRUCT; +typedef struct { + uint8_t buffer[4]; +} LIBLTE_S1AP_M_TMSI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m_tmsi( - LIBLTE_S1AP_M_TMSI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m_tmsi( - uint8_t **ptr, - LIBLTE_S1AP_M_TMSI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m_tmsi(LIBLTE_S1AP_M_TMSI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m_tmsi(uint8_t** ptr, LIBLTE_S1AP_M_TMSI_STRUCT* ie); /******************************************************************************* /* ProtocolIE OldBSS_ToNewBSS_Information DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT; +} LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_oldbss_tonewbss_information( - LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information( - uint8_t **ptr, - LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_oldbss_tonewbss_information(LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information(uint8_t** ptr, + LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE PLMNidentity STATIC OCTET STRING ********************************************************************************/ #define LIBLTE_S1AP_PLMNIDENTITY_OCTET_STRING_LEN 3 -typedef struct{ - uint8_t buffer[3]; -}LIBLTE_S1AP_PLMNIDENTITY_STRUCT; +typedef struct { + uint8_t buffer[3]; +} LIBLTE_S1AP_PLMNIDENTITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_plmnidentity( - LIBLTE_S1AP_PLMNIDENTITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_plmnidentity( - uint8_t **ptr, - LIBLTE_S1AP_PLMNIDENTITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_plmnidentity(LIBLTE_S1AP_PLMNIDENTITY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_plmnidentity(uint8_t** ptr, LIBLTE_S1AP_PLMNIDENTITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE ReceiveStatusOfULPDCPSDUsExtended DYNAMIC BIT STRING ********************************************************************************/ // lb:1, ub:16384 -typedef struct{ +typedef struct { uint32_t n_bits; uint8_t buffer[16384]; -}LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT; +} LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdusextended( - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdusextended( - uint8_t **ptr, - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_receivestatusofulpdcpsdusextended(LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_receivestatusofulpdcpsdusextended(uint8_t** ptr, + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT* ie); /******************************************************************************* /* ProtocolIE RequestType SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EVENTTYPE_ENUM_EXT eventType; - LIBLTE_S1AP_REPORTAREA_ENUM_EXT reportArea; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_REQUESTTYPE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EVENTTYPE_ENUM_EXT eventType; + LIBLTE_S1AP_REPORTAREA_ENUM_EXT reportArea; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_REQUESTTYPE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype( - LIBLTE_S1AP_REQUESTTYPE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype( - uint8_t **ptr, - LIBLTE_S1AP_REQUESTTYPE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype(LIBLTE_S1AP_REQUESTTYPE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype(uint8_t** ptr, LIBLTE_S1AP_REQUESTTYPE_STRUCT* ie); /******************************************************************************* /* ProtocolIE RRC_Container DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_RRC_CONTAINER_STRUCT; +} LIBLTE_S1AP_RRC_CONTAINER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_container( - LIBLTE_S1AP_RRC_CONTAINER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container( - uint8_t **ptr, - LIBLTE_S1AP_RRC_CONTAINER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_container(LIBLTE_S1AP_RRC_CONTAINER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container(uint8_t** ptr, LIBLTE_S1AP_RRC_CONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE nextHopChainingCount INTEGER ********************************************************************************/ -typedef struct{ -uint8_t nextHopChainingCount; -}LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT; +typedef struct { + uint8_t nextHopChainingCount; +} LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nexthopchainingcount( - LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nexthopchainingcount( - uint8_t **ptr, - LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nexthopchainingcount(LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nexthopchainingcount(uint8_t** ptr, LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT* ie); /******************************************************************************* /* ProtocolIE SecurityContext SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT nextHopChainingCount; - LIBLTE_S1AP_SECURITYKEY_STRUCT nextHopParameter; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SECURITYCONTEXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT nextHopChainingCount; + LIBLTE_S1AP_SECURITYKEY_STRUCT nextHopParameter; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SECURITYCONTEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext( - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext( - uint8_t **ptr, - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext(LIBLTE_S1AP_SECURITYCONTEXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext(uint8_t** ptr, LIBLTE_S1AP_SECURITYCONTEXT_STRUCT* ie); /******************************************************************************* /* ProtocolIE ServedMMECs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_MME_CODE_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_SERVEDMMECS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_MME_CODE_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_SERVEDMMECS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedmmecs( - LIBLTE_S1AP_SERVEDMMECS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedmmecs( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDMMECS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedmmecs(LIBLTE_S1AP_SERVEDMMECS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedmmecs(uint8_t** ptr, LIBLTE_S1AP_SERVEDMMECS_STRUCT* ie); /******************************************************************************* /* ProtocolIE TimeSynchronizationInfo SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_STRATUMLEVEL_STRUCT stratumLevel; - LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT synchronizationStatus; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_STRATUMLEVEL_STRUCT stratumLevel; + LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT synchronizationStatus; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo( - LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo( - uint8_t **ptr, - LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo(LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo(uint8_t** ptr, + LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; - LIBLTE_S1AP_TAC_STRUCT tAC; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TAI_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; + LIBLTE_S1AP_TAC_STRUCT tAC; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai( - LIBLTE_S1AP_TAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai( - uint8_t **ptr, - LIBLTE_S1AP_TAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai(LIBLTE_S1AP_TAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai(uint8_t** ptr, LIBLTE_S1AP_TAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE TABasedMDT SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TALISTFORMDT_STRUCT tAListforMDT; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TABASEDMDT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TALISTFORMDT_STRUCT tAListforMDT; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TABASEDMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt( - LIBLTE_S1AP_TABASEDMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_TABASEDMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt(LIBLTE_S1AP_TABASEDMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt(uint8_t** ptr, LIBLTE_S1AP_TABASEDMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE TargeteNB_ToSourceeNB_TransparentContainer SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_RRC_CONTAINER_STRUCT rRC_Container; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_RRC_CONTAINER_STRUCT rRC_Container; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer( - LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE M1ThresholdEventA2 SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT measurementThreshold; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT measurementThreshold; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2( - LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2( - uint8_t **ptr, - LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2(LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2(uint8_t** ptr, LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT* ie); /******************************************************************************* /* ProtocolIE TransportInformation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; -}LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; +} LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportinformation( - LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportinformation( - uint8_t **ptr, - LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportinformation(LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportinformation(uint8_t** ptr, LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE TunnelInformation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_PORT_NUMBER_STRUCT uDP_Port_Number; - bool uDP_Port_Number_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TUNNELINFORMATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_PORT_NUMBER_STRUCT uDP_Port_Number; + bool uDP_Port_Number_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TUNNELINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnelinformation( - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnelinformation( - uint8_t **ptr, - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnelinformation(LIBLTE_S1AP_TUNNELINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnelinformation(uint8_t** ptr, LIBLTE_S1AP_TUNNELINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE UE_S1AP_IDs CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UE_S1AP_ID_PAIR, LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_MME_UE_S1AP_ID, LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_N_ITEMS, -}LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_ENUM; +} LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_ENUM; static const char liblte_s1ap_ue_s1ap_ids_choice_text[LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_N_ITEMS][50] = { - "uE_S1AP_ID_pair", - "mME_UE_S1AP_ID", + "uE_S1AP_ID_pair", + "mME_UE_S1AP_ID", }; -typedef union{ - LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT uE_S1AP_ID_pair; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; -}LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT uE_S1AP_ID_pair; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; +} LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UNION choice; LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_UE_S1AP_IDS_STRUCT; +} LIBLTE_S1AP_UE_S1AP_IDS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_ids( - LIBLTE_S1AP_UE_S1AP_IDS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids( - uint8_t **ptr, - LIBLTE_S1AP_UE_S1AP_IDS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_ids(LIBLTE_S1AP_UE_S1AP_IDS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids(uint8_t** ptr, LIBLTE_S1AP_UE_S1AP_IDS_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENBX2ExtTLA SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT iPsecTLA; - bool iPsecTLA_present; - LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT gTPTLAa; - bool gTPTLAa_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_ENBX2EXTTLA_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla( - LIBLTE_S1AP_ENBX2EXTTLA_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2EXTTLA_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT iPsecTLA; + bool iPsecTLA_present; + LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT gTPTLAa; + bool gTPTLAa_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_ENBX2EXTTLA_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla(LIBLTE_S1AP_ENBX2EXTTLA_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla(uint8_t** ptr, LIBLTE_S1AP_ENBX2EXTTLA_STRUCT* ie); /******************************************************************************* /* ProtocolIE BPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:6 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_BPLMNS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_BPLMNS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bplmns( - LIBLTE_S1AP_BPLMNS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bplmns( - uint8_t **ptr, - LIBLTE_S1AP_BPLMNS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_bplmns(LIBLTE_S1AP_BPLMNS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bplmns(uint8_t** ptr, LIBLTE_S1AP_BPLMNS_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cause CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_CAUSE_CHOICE_RADIONETWORK, LIBLTE_S1AP_CAUSE_CHOICE_TRANSPORT, LIBLTE_S1AP_CAUSE_CHOICE_NAS, LIBLTE_S1AP_CAUSE_CHOICE_PROTOCOL, LIBLTE_S1AP_CAUSE_CHOICE_MISC, LIBLTE_S1AP_CAUSE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_CAUSE_CHOICE_ENUM; +} LIBLTE_S1AP_CAUSE_CHOICE_ENUM; static const char liblte_s1ap_cause_choice_text[LIBLTE_S1AP_CAUSE_CHOICE_N_ITEMS][50] = { - "radioNetwork", - "transport", - "nas", - "protocol", - "misc", + "radioNetwork", + "transport", + "nas", + "protocol", + "misc", }; -typedef union{ - LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT radioNetwork; - LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT transport; - LIBLTE_S1AP_CAUSENAS_ENUM_EXT nas; - LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT protocol; - LIBLTE_S1AP_CAUSEMISC_ENUM_EXT misc; -}LIBLTE_S1AP_CAUSE_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT radioNetwork; + LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT transport; + LIBLTE_S1AP_CAUSENAS_ENUM_EXT nas; + LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT protocol; + LIBLTE_S1AP_CAUSEMISC_ENUM_EXT misc; +} LIBLTE_S1AP_CAUSE_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_CAUSE_CHOICE_UNION choice; LIBLTE_S1AP_CAUSE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_CAUSE_STRUCT; +} LIBLTE_S1AP_CAUSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cause( - LIBLTE_S1AP_CAUSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause( - uint8_t **ptr, - LIBLTE_S1AP_CAUSE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cause(LIBLTE_S1AP_CAUSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause(uint8_t** ptr, LIBLTE_S1AP_CAUSE_STRUCT* ie); /******************************************************************************* /* ProtocolIE Cdma2000OneXSRVCCInfo SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT cdma2000OneXMEID; - LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT cdma2000OneXMSI; - LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT cdma2000OneXPilot; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT cdma2000OneXMEID; + LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT cdma2000OneXMSI; + LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT cdma2000OneXPilot; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo( - LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo(LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT* ie); /******************************************************************************* /* ProtocolIE CGI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; - LIBLTE_S1AP_LAC_STRUCT lAC; - LIBLTE_S1AP_CI_STRUCT cI; - LIBLTE_S1AP_RAC_STRUCT rAC; - bool rAC_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CGI_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi( - LIBLTE_S1AP_CGI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi( - uint8_t **ptr, - LIBLTE_S1AP_CGI_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; + LIBLTE_S1AP_LAC_STRUCT lAC; + LIBLTE_S1AP_CI_STRUCT cI; + LIBLTE_S1AP_RAC_STRUCT rAC; + bool rAC_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CGI_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi(LIBLTE_S1AP_CGI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi(uint8_t** ptr, LIBLTE_S1AP_CGI_STRUCT* ie); /******************************************************************************* /* ProtocolIE COUNTValueExtended SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT pDCP_SNExtended; - LIBLTE_S1AP_HFNMODIFIED_STRUCT hFNModified; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT pDCP_SNExtended; + LIBLTE_S1AP_HFNMODIFIED_STRUCT hFNModified; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended( - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended( - uint8_t **ptr, - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended(LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended(uint8_t** ptr, LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT* ie); /******************************************************************************* /* ProtocolIE CriticalityDiagnostics_IE_List DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_list( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_list( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_list(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ie_list(uint8_t** ptr, LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE Global_ENB_ID SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; - LIBLTE_S1AP_ENB_ID_STRUCT eNB_ID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; + LIBLTE_S1AP_ENB_ID_STRUCT eNB_ID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_global_enb_id( - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_global_enb_id( - uint8_t **ptr, - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_global_enb_id(LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_global_enb_id(uint8_t** ptr, LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE EPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:15 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_EPLMNS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_EPLMNS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eplmns( - LIBLTE_S1AP_EPLMNS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eplmns( - uint8_t **ptr, - LIBLTE_S1AP_EPLMNS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eplmns(LIBLTE_S1AP_EPLMNS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eplmns(uint8_t** ptr, LIBLTE_S1AP_EPLMNS_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_CAUSE_STRUCT cause; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_CAUSE_STRUCT cause; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( - LIBLTE_S1AP_E_RABITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem(LIBLTE_S1AP_E_RABITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem(uint8_t** ptr, LIBLTE_S1AP_E_RABITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE EUTRAN_CGI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; - LIBLTE_S1AP_CELLIDENTITY_STRUCT cell_ID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_EUTRAN_CGI_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; + LIBLTE_S1AP_CELLIDENTITY_STRUCT cell_ID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_EUTRAN_CGI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi( - LIBLTE_S1AP_EUTRAN_CGI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi( - uint8_t **ptr, - LIBLTE_S1AP_EUTRAN_CGI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi(LIBLTE_S1AP_EUTRAN_CGI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi(uint8_t** ptr, LIBLTE_S1AP_EUTRAN_CGI_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenTAs_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; - LIBLTE_S1AP_FORBIDDENTACS_STRUCT forbiddenTACs; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; + LIBLTE_S1AP_FORBIDDENTACS_STRUCT forbiddenTACs; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item( - LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item(LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenLAs_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; - LIBLTE_S1AP_FORBIDDENLACS_STRUCT forbiddenLACs; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; + LIBLTE_S1AP_FORBIDDENLACS_STRUCT forbiddenLACs; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item( - LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item(LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE LAI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; - LIBLTE_S1AP_LAC_STRUCT lAC; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_LAI_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMNidentity; + LIBLTE_S1AP_LAC_STRUCT lAC; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_LAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai( - LIBLTE_S1AP_LAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai( - uint8_t **ptr, - LIBLTE_S1AP_LAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai(LIBLTE_S1AP_LAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai(uint8_t** ptr, LIBLTE_S1AP_LAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE M4Configuration SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_M4PERIOD_ENUM_EXT m4period; - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT m4_links_to_log; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_M4CONFIGURATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_M4PERIOD_ENUM_EXT m4period; + LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT m4_links_to_log; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_M4CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration( - LIBLTE_S1AP_M4CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration( - uint8_t **ptr, - LIBLTE_S1AP_M4CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration(LIBLTE_S1AP_M4CONFIGURATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration(uint8_t** ptr, LIBLTE_S1AP_M4CONFIGURATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE MDTPLMNList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_MDTPLMNLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_MDTPLMNLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtplmnlist( - LIBLTE_S1AP_MDTPLMNLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtplmnlist( - uint8_t **ptr, - LIBLTE_S1AP_MDTPLMNLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtplmnlist(LIBLTE_S1AP_MDTPLMNLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtplmnlist(uint8_t** ptr, LIBLTE_S1AP_MDTPLMNLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE MMERelaySupportIndicator ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_TRUE, LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_N_ITEMS, -}LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM; +} LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM; static const char liblte_s1ap_mmerelaysupportindicator_text[LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_N_ITEMS][80] = { - "true", + "true", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM e; -}LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT; +} LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmerelaysupportindicator( - LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmerelaysupportindicator( - uint8_t **ptr, - LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmerelaysupportindicator(LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmerelaysupportindicator(uint8_t** ptr, + LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE PagingPriority ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_PAGINGPRIORITY_PRIOLEVEL1, LIBLTE_S1AP_PAGINGPRIORITY_PRIOLEVEL2, LIBLTE_S1AP_PAGINGPRIORITY_PRIOLEVEL3, @@ -4491,495 +3795,407 @@ typedef enum{ LIBLTE_S1AP_PAGINGPRIORITY_PRIOLEVEL7, LIBLTE_S1AP_PAGINGPRIORITY_PRIOLEVEL8, LIBLTE_S1AP_PAGINGPRIORITY_N_ITEMS, -}LIBLTE_S1AP_PAGINGPRIORITY_ENUM; +} LIBLTE_S1AP_PAGINGPRIORITY_ENUM; static const char liblte_s1ap_pagingpriority_text[LIBLTE_S1AP_PAGINGPRIORITY_N_ITEMS][80] = { - "priolevel1", - "priolevel2", - "priolevel3", - "priolevel4", - "priolevel5", - "priolevel6", - "priolevel7", - "priolevel8", + "priolevel1", + "priolevel2", + "priolevel3", + "priolevel4", + "priolevel5", + "priolevel6", + "priolevel7", + "priolevel8", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_PAGINGPRIORITY_ENUM e; -}LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT; +} LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingpriority( - LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingpriority( - uint8_t **ptr, - LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingpriority(LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingpriority(uint8_t** ptr, LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE PriorityLevel INTEGER ********************************************************************************/ -typedef struct{ -uint8_t PriorityLevel; -}LIBLTE_S1AP_PRIORITYLEVEL_STRUCT; +typedef struct { + uint8_t PriorityLevel; +} LIBLTE_S1AP_PRIORITYLEVEL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_prioritylevel( - LIBLTE_S1AP_PRIORITYLEVEL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_prioritylevel( - uint8_t **ptr, - LIBLTE_S1AP_PRIORITYLEVEL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_prioritylevel(LIBLTE_S1AP_PRIORITYLEVEL_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_prioritylevel(uint8_t** ptr, LIBLTE_S1AP_PRIORITYLEVEL_STRUCT* ie); /******************************************************************************* /* ProtocolIE ECGIListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilistforrestart( - LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilistforrestart(LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilistforrestart(uint8_t** ptr, LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT* ie); /******************************************************************************* /* ProtocolIE SourceeNB_ID SEQUENCE ********************************************************************************/ -typedef struct{ - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT global_ENB_ID; - LIBLTE_S1AP_TAI_STRUCT selected_TAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SOURCEENB_ID_STRUCT; +typedef struct { + LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT global_ENB_ID; + LIBLTE_S1AP_TAI_STRUCT selected_TAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SOURCEENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id( - LIBLTE_S1AP_SOURCEENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id(LIBLTE_S1AP_SOURCEENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id(uint8_t** ptr, LIBLTE_S1AP_SOURCEENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE ServedPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:32 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_SERVEDPLMNS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TBCD_STRING_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_SERVEDPLMNS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedplmns( - LIBLTE_S1AP_SERVEDPLMNS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedplmns( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDPLMNS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedplmns(LIBLTE_S1AP_SERVEDPLMNS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedplmns(uint8_t** ptr, LIBLTE_S1AP_SERVEDPLMNS_STRUCT* ie); /******************************************************************************* /* ProtocolIE SupportedTAs_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAC_STRUCT tAC; - LIBLTE_S1AP_BPLMNS_STRUCT broadcastPLMNs; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAC_STRUCT tAC; + LIBLTE_S1AP_BPLMNS_STRUCT broadcastPLMNs; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item( - LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item( - uint8_t **ptr, - LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item(LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item(uint8_t** ptr, LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAIListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAILISTFORMDT_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAILISTFORMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistformdt( - LIBLTE_S1AP_TAILISTFORMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistformdt( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistformdt(LIBLTE_S1AP_TAILISTFORMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistformdt(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE CompletedCellinTAI_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item( - LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item(LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item(uint8_t** ptr, + LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE TargeteNB_ID SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT global_ENB_ID; - LIBLTE_S1AP_TAI_STRUCT selected_TAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TARGETENB_ID_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT global_ENB_ID; + LIBLTE_S1AP_TAI_STRUCT selected_TAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TARGETENB_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id( - LIBLTE_S1AP_TARGETENB_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id( - uint8_t **ptr, - LIBLTE_S1AP_TARGETENB_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id(LIBLTE_S1AP_TARGETENB_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id(uint8_t** ptr, LIBLTE_S1AP_TARGETENB_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE TargetBSS_ToSourceBSS_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT; +} LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetbss_tosourcebss_transparentcontainer( - LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAIListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:2048 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAILISTFORRESTART_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAILISTFORRESTART_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforrestart( - LIBLTE_S1AP_TAILISTFORRESTART_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORRESTART_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforrestart(LIBLTE_S1AP_TAILISTFORRESTART_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforrestart(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORRESTART_STRUCT* ie); /******************************************************************************* /* ProtocolIE UserLocationInformation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eutran_cgi; - LIBLTE_S1AP_TAI_STRUCT tai; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eutran_cgi; + LIBLTE_S1AP_TAI_STRUCT tai; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation( - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation( - uint8_t **ptr, - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation(LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation(uint8_t** ptr, + LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENBX2ExtTLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_ENBX2EXTTLA_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_ENBX2EXTTLA_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttlas( - LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttlas(LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE AllocationAndRetentionPriority SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_PRIORITYLEVEL_STRUCT priorityLevel; - LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM pre_emptionCapability; - LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM pre_emptionVulnerability; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_PRIORITYLEVEL_STRUCT priorityLevel; + LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM pre_emptionCapability; + LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM pre_emptionVulnerability; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority( - LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority( - uint8_t **ptr, - LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority(LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_allocationandretentionpriority(uint8_t** ptr, LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT* ie); /******************************************************************************* /* ProtocolIE CancelledCellinEAI_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item( - LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item(LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item(uint8_t** ptr, + LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE CancelledCellinTAI_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item( - LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item(LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item(uint8_t** ptr, + LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellID_Broadcast_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item( - LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item(LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellID_Cancelled_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT numberOfBroadcasts; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item( - LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item(LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellIdListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:32 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidlistformdt( - LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidlistformdt( - uint8_t **ptr, - LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidlistformdt(LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidlistformdt(uint8_t** ptr, LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE CSG_Id STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_CSG_ID_BIT_STRING_LEN 27 -typedef struct{ - uint8_t buffer[27]; -}LIBLTE_S1AP_CSG_ID_STRUCT; +typedef struct { + uint8_t buffer[27]; +} LIBLTE_S1AP_CSG_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_id( - LIBLTE_S1AP_CSG_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_id( - uint8_t **ptr, - LIBLTE_S1AP_CSG_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_id(LIBLTE_S1AP_CSG_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_id(uint8_t** ptr, LIBLTE_S1AP_CSG_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE CSG_IdList_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CSG_ID_STRUCT cSG_Id; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CSG_ID_STRUCT cSG_Id; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item( - LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item( - uint8_t **ptr, - LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item(LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item(uint8_t** ptr, LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE Direct_Forwarding_Path_Availability ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_DIRECTPATHAVAILABLE, LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_N_ITEMS, -}LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM; -static const char liblte_s1ap_direct_forwarding_path_availability_text[LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_N_ITEMS][80] = { - "directPathAvailable", +} LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM; +static const char + liblte_s1ap_direct_forwarding_path_availability_text[LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_N_ITEMS][80] = + { + "directPathAvailable", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM e; -}LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT; +} LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_direct_forwarding_path_availability( - LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_direct_forwarding_path_availability( - uint8_t **ptr, - LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_direct_forwarding_path_availability(LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_direct_forwarding_path_availability(uint8_t** ptr, + LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE CompletedCellinEAI_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT eCGI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item( - LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item(LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item(uint8_t** ptr, + LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABInformationList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( - LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist(LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist(uint8_t** ptr, LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenTAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_FORBIDDENTAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_FORBIDDENTAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas( - LIBLTE_S1AP_FORBIDDENTAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas(LIBLTE_S1AP_FORBIDDENTAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE GUMMEI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; - LIBLTE_S1AP_MME_GROUP_ID_STRUCT mME_Group_ID; - LIBLTE_S1AP_MME_CODE_STRUCT mME_Code; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_GUMMEI_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT pLMN_Identity; + LIBLTE_S1AP_MME_GROUP_ID_STRUCT mME_Group_ID; + LIBLTE_S1AP_MME_CODE_STRUCT mME_Code; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_GUMMEI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei( - LIBLTE_S1AP_GUMMEI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei(LIBLTE_S1AP_GUMMEI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei(uint8_t** ptr, LIBLTE_S1AP_GUMMEI_STRUCT* ie); /******************************************************************************* /* ProtocolIE LoggedMDT SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_LOGGINGINTERVAL_ENUM loggingInterval; - LIBLTE_S1AP_LOGGINGDURATION_ENUM loggingDuration; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_LOGGEDMDT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_LOGGINGINTERVAL_ENUM loggingInterval; + LIBLTE_S1AP_LOGGINGDURATION_ENUM loggingDuration; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_LOGGEDMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt( - LIBLTE_S1AP_LOGGEDMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt( - uint8_t **ptr, - LIBLTE_S1AP_LOGGEDMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt(LIBLTE_S1AP_LOGGEDMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt(uint8_t** ptr, LIBLTE_S1AP_LOGGEDMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE NASSecurityParametersfromE_UTRAN DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT; +} LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparametersfrome_utran( - LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparametersfrome_utran( - uint8_t **ptr, - LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_nassecurityparametersfrome_utran(LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_nassecurityparametersfrome_utran(uint8_t** ptr, + LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT* ie); /******************************************************************************* /* ProtocolIE ReportAmountMDT ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_REPORTAMOUNTMDT_R1, LIBLTE_S1AP_REPORTAMOUNTMDT_R2, LIBLTE_S1AP_REPORTAMOUNTMDT_R4, @@ -4989,898 +4205,744 @@ typedef enum{ LIBLTE_S1AP_REPORTAMOUNTMDT_R64, LIBLTE_S1AP_REPORTAMOUNTMDT_RINFINITY, LIBLTE_S1AP_REPORTAMOUNTMDT_N_ITEMS, -}LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM; +} LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM; static const char liblte_s1ap_reportamountmdt_text[LIBLTE_S1AP_REPORTAMOUNTMDT_N_ITEMS][80] = { - "r1", - "r2", - "r4", - "r8", - "r16", - "r32", - "r64", - "rinfinity", + "r1", + "r2", + "r4", + "r8", + "r16", + "r32", + "r64", + "rinfinity", }; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportamountmdt( - LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportamountmdt( - uint8_t **ptr, - LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportamountmdt(LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportamountmdt(uint8_t** ptr, LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM* ie); /******************************************************************************* /* ProtocolIE ServedGUMMEIsItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_SERVEDPLMNS_STRUCT servedPLMNs; - LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT servedGroupIDs; - LIBLTE_S1AP_SERVEDMMECS_STRUCT servedMMECs; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_SERVEDPLMNS_STRUCT servedPLMNs; + LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT servedGroupIDs; + LIBLTE_S1AP_SERVEDMMECS_STRUCT servedMMECs; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem( - LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem(LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem(uint8_t** ptr, LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE S_TMSI SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_CODE_STRUCT mMEC; - LIBLTE_S1AP_M_TMSI_STRUCT m_TMSI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_S_TMSI_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_CODE_STRUCT mMEC; + LIBLTE_S1AP_M_TMSI_STRUCT m_TMSI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_S_TMSI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi( - LIBLTE_S1AP_S_TMSI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi( - uint8_t **ptr, - LIBLTE_S1AP_S_TMSI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi(LIBLTE_S1AP_S_TMSI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi(uint8_t** ptr, LIBLTE_S1AP_S_TMSI_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAIListforWarning DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAILISTFORWARNING_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAILISTFORWARNING_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforwarning( - LIBLTE_S1AP_TAILISTFORWARNING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforwarning( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORWARNING_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforwarning(LIBLTE_S1AP_TAILISTFORWARNING_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforwarning(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORWARNING_STRUCT* ie); /******************************************************************************* /* ProtocolIE CompletedCellinTAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai( - LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai(LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai(uint8_t** ptr, LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE TargetRNC_ID SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_LAI_STRUCT lAI; - LIBLTE_S1AP_RAC_STRUCT rAC; - bool rAC_present; - LIBLTE_S1AP_RNC_ID_STRUCT rNC_ID; - LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT extendedRNC_ID; - bool extendedRNC_ID_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TARGETRNC_ID_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id( - LIBLTE_S1AP_TARGETRNC_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id( - uint8_t **ptr, - LIBLTE_S1AP_TARGETRNC_ID_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_LAI_STRUCT lAI; + LIBLTE_S1AP_RAC_STRUCT rAC; + bool rAC_present; + LIBLTE_S1AP_RNC_ID_STRUCT rNC_ID; + LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT extendedRNC_ID; + bool extendedRNC_ID_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TARGETRNC_ID_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id(LIBLTE_S1AP_TARGETRNC_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id(uint8_t** ptr, LIBLTE_S1AP_TARGETRNC_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE UE_associatedLogicalS1_ConnectionItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; - bool mME_UE_S1AP_ID_present; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - bool eNB_UE_S1AP_ID_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT mME_UE_S1AP_ID; + bool mME_UE_S1AP_ID_present; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + bool eNB_UE_S1AP_ID_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(uint8_t** ptr, + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE UEPagingID CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_UEPAGINGID_CHOICE_S_TMSI, LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI, LIBLTE_S1AP_UEPAGINGID_CHOICE_N_ITEMS, -}LIBLTE_S1AP_UEPAGINGID_CHOICE_ENUM; +} LIBLTE_S1AP_UEPAGINGID_CHOICE_ENUM; static const char liblte_s1ap_uepagingid_choice_text[LIBLTE_S1AP_UEPAGINGID_CHOICE_N_ITEMS][50] = { - "s_TMSI", - "iMSI", + "s_TMSI", + "iMSI", }; -typedef union{ - LIBLTE_S1AP_S_TMSI_STRUCT s_TMSI; - LIBLTE_S1AP_IMSI_STRUCT iMSI; -}LIBLTE_S1AP_UEPAGINGID_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_S_TMSI_STRUCT s_TMSI; + LIBLTE_S1AP_IMSI_STRUCT iMSI; +} LIBLTE_S1AP_UEPAGINGID_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_UEPAGINGID_CHOICE_UNION choice; LIBLTE_S1AP_UEPAGINGID_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_UEPAGINGID_STRUCT; +} LIBLTE_S1AP_UEPAGINGID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uepagingid( - LIBLTE_S1AP_UEPAGINGID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid( - uint8_t **ptr, - LIBLTE_S1AP_UEPAGINGID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uepagingid(LIBLTE_S1AP_UEPAGINGID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid(uint8_t** ptr, LIBLTE_S1AP_UEPAGINGID_STRUCT* ie); /******************************************************************************* /* ProtocolIE Bearers_SubjectToStatusTransfer_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_COUNTVALUE_STRUCT uL_COUNTvalue; - LIBLTE_S1AP_COUNTVALUE_STRUCT dL_COUNTvalue; - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT receiveStatusofULPDCPSDUs; - bool receiveStatusofULPDCPSDUs_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( - uint8_t **ptr, - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_COUNTVALUE_STRUCT uL_COUNTvalue; + LIBLTE_S1AP_COUNTVALUE_STRUCT dL_COUNTvalue; + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT receiveStatusofULPDCPSDUs; + bool receiveStatusofULPDCPSDUs_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_bearers_subjecttostatustransfer_item(LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(uint8_t** ptr, + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE CancelledCellinEAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai( - LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai(LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai(uint8_t** ptr, LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellID_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CELLID_BROADCAST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CELLID_BROADCAST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast( - LIBLTE_S1AP_CELLID_BROADCAST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_BROADCAST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast(LIBLTE_S1AP_CELLID_BROADCAST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast(uint8_t** ptr, LIBLTE_S1AP_CELLID_BROADCAST_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellBasedMDT SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT cellIdListforMDT; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CELLBASEDMDT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT cellIdListforMDT; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CELLBASEDMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt( - LIBLTE_S1AP_CELLBASEDMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_CELLBASEDMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt(LIBLTE_S1AP_CELLBASEDMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt(uint8_t** ptr, LIBLTE_S1AP_CELLBASEDMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE CSG_IdList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CSG_IDLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CSG_IDLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist( - LIBLTE_S1AP_CSG_IDLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist( - uint8_t **ptr, - LIBLTE_S1AP_CSG_IDLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist(LIBLTE_S1AP_CSG_IDLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist(uint8_t** ptr, LIBLTE_S1AP_CSG_IDLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE ECGIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_ECGILIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_ECGILIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilist( - LIBLTE_S1AP_ECGILIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilist( - uint8_t **ptr, - LIBLTE_S1AP_ECGILIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilist(LIBLTE_S1AP_ECGILIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilist(uint8_t** ptr, LIBLTE_S1AP_ECGILIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaID_Cancelled_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT emergencyAreaID; - LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT cancelledCellinEAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EMERGENCYAREAID_STRUCT emergencyAreaID; + LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT cancelledCellinEAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item( - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item(LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_emergencyareaid_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE GERAN_Cell_ID SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_LAI_STRUCT lAI; - LIBLTE_S1AP_RAC_STRUCT rAC; - LIBLTE_S1AP_CI_STRUCT cI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_GERAN_CELL_ID_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_LAI_STRUCT lAI; + LIBLTE_S1AP_RAC_STRUCT rAC; + LIBLTE_S1AP_CI_STRUCT cI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_GERAN_CELL_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id( - LIBLTE_S1AP_GERAN_CELL_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id( - uint8_t **ptr, - LIBLTE_S1AP_GERAN_CELL_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id(LIBLTE_S1AP_GERAN_CELL_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id(uint8_t** ptr, LIBLTE_S1AP_GERAN_CELL_ID_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablist( - LIBLTE_S1AP_E_RABLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablist(LIBLTE_S1AP_E_RABLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablist(uint8_t** ptr, LIBLTE_S1AP_E_RABLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE ForbiddenLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_FORBIDDENLAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_FORBIDDENLAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas( - LIBLTE_S1AP_FORBIDDENLAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas(LIBLTE_S1AP_FORBIDDENLAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE MDT_Location_Info STATIC BIT STRING ********************************************************************************/ #define LIBLTE_S1AP_MDT_LOCATION_INFO_BIT_STRING_LEN 8 -typedef struct{ - uint8_t buffer[8]; -}LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT; +typedef struct { + uint8_t buffer[8]; +} LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_location_info( - LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_location_info( - uint8_t **ptr, - LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_location_info(LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_location_info(uint8_t** ptr, LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT* ie); /******************************************************************************* /* ProtocolIE M1PeriodicReporting SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_REPORTINTERVALMDT_ENUM reportInterval; - LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM reportAmount; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_REPORTINTERVALMDT_ENUM reportInterval; + LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM reportAmount; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting( - LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting( - uint8_t **ptr, - LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting(LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting(uint8_t** ptr, LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT* ie); /******************************************************************************* /* ProtocolIE eHRPD_Sector_ID DYNAMIC OCTET STRING ********************************************************************************/ // lb:0, ub:16318 -typedef struct{ +typedef struct { uint32_t n_octets; uint8_t buffer[16318]; -}LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT; +} LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ehrpd_sector_id( - LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id( - uint8_t **ptr, - LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ehrpd_sector_id(LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id(uint8_t** ptr, LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT* ie); /******************************************************************************* /* ProtocolIE RIMRoutingAddress CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_GERAN_CELL_ID, LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_TARGETRNC_ID, LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_EHRPD_SECTOR_ID, LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_N_ITEMS, -}LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_ENUM; +} LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_ENUM; static const char liblte_s1ap_rimroutingaddress_choice_text[LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_N_ITEMS][50] = { - "gERAN_Cell_ID", - "targetRNC_ID", - "eHRPD_Sector_ID", + "gERAN_Cell_ID", + "targetRNC_ID", + "eHRPD_Sector_ID", }; -typedef union{ - LIBLTE_S1AP_GERAN_CELL_ID_STRUCT gERAN_Cell_ID; - LIBLTE_S1AP_TARGETRNC_ID_STRUCT targetRNC_ID; - LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT eHRPD_Sector_ID; -}LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_GERAN_CELL_ID_STRUCT gERAN_Cell_ID; + LIBLTE_S1AP_TARGETRNC_ID_STRUCT targetRNC_ID; + LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT eHRPD_Sector_ID; +} LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_UNION choice; LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT; +} LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimroutingaddress( - LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress( - uint8_t **ptr, - LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimroutingaddress(LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress(uint8_t** ptr, LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT* ie); /******************************************************************************* /* ProtocolIE ServedGUMMEIs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeis( - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeis( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeis(LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeis(uint8_t** ptr, LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAIBasedMDT SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAILISTFORMDT_STRUCT tAIListforMDT; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TAIBASEDMDT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAILISTFORMDT_STRUCT tAIListforMDT; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TAIBASEDMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt( - LIBLTE_S1AP_TAIBASEDMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_TAIBASEDMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt(LIBLTE_S1AP_TAIBASEDMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt(uint8_t** ptr, LIBLTE_S1AP_TAIBASEDMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAI_Broadcast_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAI_STRUCT tAI; - LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT completedCellinTAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAI_STRUCT tAI; + LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT completedCellinTAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item( - LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item(LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE TargetID CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_TARGETID_CHOICE_TARGETENB_ID, LIBLTE_S1AP_TARGETID_CHOICE_TARGETRNC_ID, LIBLTE_S1AP_TARGETID_CHOICE_CGI, LIBLTE_S1AP_TARGETID_CHOICE_N_ITEMS, -}LIBLTE_S1AP_TARGETID_CHOICE_ENUM; +} LIBLTE_S1AP_TARGETID_CHOICE_ENUM; static const char liblte_s1ap_targetid_choice_text[LIBLTE_S1AP_TARGETID_CHOICE_N_ITEMS][50] = { - "targeteNB_ID", - "targetRNC_ID", - "cGI", + "targeteNB_ID", + "targetRNC_ID", + "cGI", }; -typedef union{ - LIBLTE_S1AP_TARGETENB_ID_STRUCT targeteNB_ID; - LIBLTE_S1AP_TARGETRNC_ID_STRUCT targetRNC_ID; - LIBLTE_S1AP_CGI_STRUCT cGI; -}LIBLTE_S1AP_TARGETID_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_TARGETENB_ID_STRUCT targeteNB_ID; + LIBLTE_S1AP_TARGETRNC_ID_STRUCT targetRNC_ID; + LIBLTE_S1AP_CGI_STRUCT cGI; +} LIBLTE_S1AP_TARGETID_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_TARGETID_CHOICE_UNION choice; LIBLTE_S1AP_TARGETID_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_TARGETID_STRUCT; +} LIBLTE_S1AP_TARGETID_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetid( - LIBLTE_S1AP_TARGETID_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid( - uint8_t **ptr, - LIBLTE_S1AP_TARGETID_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetid(LIBLTE_S1AP_TARGETID_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid(uint8_t** ptr, LIBLTE_S1AP_TARGETID_STRUCT* ie); /******************************************************************************* /* ProtocolIE WarningAreaList CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_WARNINGAREALIST_CHOICE_CELLIDLIST, LIBLTE_S1AP_WARNINGAREALIST_CHOICE_TRACKINGAREALISTFORWARNING, LIBLTE_S1AP_WARNINGAREALIST_CHOICE_EMERGENCYAREAIDLIST, LIBLTE_S1AP_WARNINGAREALIST_CHOICE_N_ITEMS, -}LIBLTE_S1AP_WARNINGAREALIST_CHOICE_ENUM; +} LIBLTE_S1AP_WARNINGAREALIST_CHOICE_ENUM; static const char liblte_s1ap_warningarealist_choice_text[LIBLTE_S1AP_WARNINGAREALIST_CHOICE_N_ITEMS][50] = { - "cellIDList", - "trackingAreaListforWarning", - "emergencyAreaIDList", + "cellIDList", + "trackingAreaListforWarning", + "emergencyAreaIDList", }; -typedef union{ - LIBLTE_S1AP_ECGILIST_STRUCT cellIDList; - LIBLTE_S1AP_TAILISTFORWARNING_STRUCT trackingAreaListforWarning; - LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT emergencyAreaIDList; -}LIBLTE_S1AP_WARNINGAREALIST_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_ECGILIST_STRUCT cellIDList; + LIBLTE_S1AP_TAILISTFORWARNING_STRUCT trackingAreaListforWarning; + LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT emergencyAreaIDList; +} LIBLTE_S1AP_WARNINGAREALIST_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_WARNINGAREALIST_CHOICE_UNION choice; LIBLTE_S1AP_WARNINGAREALIST_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_WARNINGAREALIST_STRUCT; +} LIBLTE_S1AP_WARNINGAREALIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningarealist( - LIBLTE_S1AP_WARNINGAREALIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGAREALIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningarealist(LIBLTE_S1AP_WARNINGAREALIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist(uint8_t** ptr, LIBLTE_S1AP_WARNINGAREALIST_STRUCT* ie); -//TODO: Type pLMNWide NULL +// TODO: Type pLMNWide NULL /******************************************************************************* /* ProtocolIE AreaScopeOfMDT CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_CELLBASED, LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TABASED, LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_PLMNWIDE, LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TAIBASED, LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_N_ITEMS, -}LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_ENUM; +} LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_ENUM; static const char liblte_s1ap_areascopeofmdt_choice_text[LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_N_ITEMS][50] = { - "cellBased", - "tABased", - "pLMNWide", - "tAIBased", + "cellBased", + "tABased", + "pLMNWide", + "tAIBased", }; -typedef union{ - LIBLTE_S1AP_CELLBASEDMDT_STRUCT cellBased; - LIBLTE_S1AP_TABASEDMDT_STRUCT tABased; - //TODO: NULL pLMNWide; - LIBLTE_S1AP_TAIBASEDMDT_STRUCT tAIBased; -}LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_CELLBASEDMDT_STRUCT cellBased; + LIBLTE_S1AP_TABASEDMDT_STRUCT tABased; + // TODO: NULL pLMNWide; + LIBLTE_S1AP_TAIBASEDMDT_STRUCT tAIBased; +} LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_UNION choice; LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT; +} LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_areascopeofmdt( - LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt( - uint8_t **ptr, - LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_areascopeofmdt(LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt(uint8_t** ptr, LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE CancelledCellinTAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai( - LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai(LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai(uint8_t** ptr, LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellType SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CELL_SIZE_ENUM_EXT cell_Size; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CELLTYPE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CELL_SIZE_ENUM_EXT cell_Size; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CELLTYPE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype( - LIBLTE_S1AP_CELLTYPE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype( - uint8_t **ptr, - LIBLTE_S1AP_CELLTYPE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype(LIBLTE_S1AP_CELLTYPE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype(uint8_t** ptr, LIBLTE_S1AP_CELLTYPE_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaID_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled( - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled(LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled(uint8_t** ptr, + LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT* ie); /******************************************************************************* /* ProtocolIE GUMMEIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_GUMMEI_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_GUMMEILIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_GUMMEI_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_GUMMEILIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeilist( - LIBLTE_S1AP_GUMMEILIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeilist( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEILIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeilist(LIBLTE_S1AP_GUMMEILIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeilist(uint8_t** ptr, LIBLTE_S1AP_GUMMEILIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABLevelQoSParameters SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_QCI_STRUCT qCI; - LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT allocationRetentionPriority; - LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT gbrQosInformation; - bool gbrQosInformation_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablevelqosparameters( - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablevelqosparameters( - uint8_t **ptr, - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_QCI_STRUCT qCI; + LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT allocationRetentionPriority; + LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT gbrQosInformation; + bool gbrQosInformation_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablevelqosparameters(LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablevelqosparameters(uint8_t** ptr, + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT* ie); /******************************************************************************* /* ProtocolIE LastVisitedEUTRANCellInformation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT global_Cell_ID; - LIBLTE_S1AP_CELLTYPE_STRUCT cellType; - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT time_UE_StayedInCell; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT global_Cell_ID; + LIBLTE_S1AP_CELLTYPE_STRUCT cellType; + LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT time_UE_StayedInCell; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation( - LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedeutrancellinformation(LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedeutrancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE RIMTransfer SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_RIMINFORMATION_STRUCT rIMInformation; - LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT rIMRoutingAddress; - bool rIMRoutingAddress_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_RIMTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_RIMINFORMATION_STRUCT rIMInformation; + LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT rIMRoutingAddress; + bool rIMRoutingAddress_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_RIMTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer( - LIBLTE_S1AP_RIMTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer( - uint8_t **ptr, - LIBLTE_S1AP_RIMTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer(LIBLTE_S1AP_RIMTRANSFER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer(uint8_t** ptr, LIBLTE_S1AP_RIMTRANSFER_STRUCT* ie); /******************************************************************************* /* ProtocolIE SupportedTAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_SUPPORTEDTAS_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_SUPPORTEDTAS_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas( - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas( - uint8_t **ptr, - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas(LIBLTE_S1AP_SUPPORTEDTAS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas(uint8_t** ptr, LIBLTE_S1AP_SUPPORTEDTAS_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAI_Cancelled_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAI_STRUCT tAI; - LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT cancelledCellinTAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAI_STRUCT tAI; + LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT cancelledCellinTAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item( - LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item(LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE X2TNLConfigurationInfo SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENBX2TLAS_STRUCT eNBX2TransportLayerAddresses; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ENBX2TLAS_STRUCT eNBX2TransportLayerAddresses; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo( - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo( - uint8_t **ptr, - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo(LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo(uint8_t** ptr, + LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT* ie); /******************************************************************************* /* Protocol Container List Bearers_SubjectToStatusTransferList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT + buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransferlist( - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransferlist( - uint8_t **ptr, - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_bearers_subjecttostatustransferlist(LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_bearers_subjecttostatustransferlist(uint8_t** ptr, + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE CellID_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_CELLID_CANCELLED_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_CELLID_CANCELLED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled( - LIBLTE_S1AP_CELLID_CANCELLED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_CANCELLED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled(LIBLTE_S1AP_CELLID_CANCELLED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled(uint8_t** ptr, LIBLTE_S1AP_CELLID_CANCELLED_STRUCT* ie); /******************************************************************************* /* ProtocolIE CompletedCellinEAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai( - LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai(LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai(uint8_t** ptr, LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT* ie); /******************************************************************************* /* ProtocolIE HandoverRestrictionList SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TBCD_STRING_STRUCT servingPLMN; - LIBLTE_S1AP_EPLMNS_STRUCT equivalentPLMNs; - bool equivalentPLMNs_present; - LIBLTE_S1AP_FORBIDDENTAS_STRUCT forbiddenTAs; - bool forbiddenTAs_present; - LIBLTE_S1AP_FORBIDDENLAS_STRUCT forbiddenLAs; - bool forbiddenLAs_present; - LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT forbiddenInterRATs; - bool forbiddenInterRATs_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist( - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist( - uint8_t **ptr, - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_TBCD_STRING_STRUCT servingPLMN; + LIBLTE_S1AP_EPLMNS_STRUCT equivalentPLMNs; + bool equivalentPLMNs_present; + LIBLTE_S1AP_FORBIDDENTAS_STRUCT forbiddenTAs; + bool forbiddenTAs_present; + LIBLTE_S1AP_FORBIDDENLAS_STRUCT forbiddenLAs; + bool forbiddenLAs_present; + LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT forbiddenInterRATs; + bool forbiddenInterRATs_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist(LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist(uint8_t** ptr, + LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE LastVisitedCell_Item CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_E_UTRAN_CELL, LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UTRAN_CELL, LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_GERAN_CELL, LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_N_ITEMS, -}LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_ENUM; +} LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_ENUM; static const char liblte_s1ap_lastvisitedcell_item_choice_text[LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_N_ITEMS][50] = { - "e_UTRAN_Cell", - "uTRAN_Cell", - "gERAN_Cell", + "e_UTRAN_Cell", + "uTRAN_Cell", + "gERAN_Cell", }; -typedef union{ - LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT e_UTRAN_Cell; - LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT uTRAN_Cell; - LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT gERAN_Cell; -}LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT e_UTRAN_Cell; + LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT uTRAN_Cell; + LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT gERAN_Cell; +} LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UNION choice; LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT; +} LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedcell_item( - LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedcell_item(LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item(uint8_t** ptr, LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE SONInformationReply SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT x2TNLConfigurationInfo; - bool x2TNLConfigurationInfo_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT x2TNLConfigurationInfo; + bool x2TNLConfigurationInfo_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply( - LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply(LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply(uint8_t** ptr, LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAI_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAI_BROADCAST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAI_BROADCAST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast( - LIBLTE_S1AP_TAI_BROADCAST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_TAI_BROADCAST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast(LIBLTE_S1AP_TAI_BROADCAST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast(uint8_t** ptr, LIBLTE_S1AP_TAI_BROADCAST_STRUCT* ie); /******************************************************************************* /* ProtocolIE TimeToWait ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_TIMETOWAIT_V1S, LIBLTE_S1AP_TIMETOWAIT_V2S, LIBLTE_S1AP_TIMETOWAIT_V5S, @@ -5888,4153 +4950,3610 @@ typedef enum{ LIBLTE_S1AP_TIMETOWAIT_V20S, LIBLTE_S1AP_TIMETOWAIT_V60S, LIBLTE_S1AP_TIMETOWAIT_N_ITEMS, -}LIBLTE_S1AP_TIMETOWAIT_ENUM; +} LIBLTE_S1AP_TIMETOWAIT_ENUM; static const char liblte_s1ap_timetowait_text[LIBLTE_S1AP_TIMETOWAIT_N_ITEMS][80] = { - "v1s", - "v2s", - "v5s", - "v10s", - "v20s", - "v60s", + "v1s", + "v2s", + "v5s", + "v10s", + "v20s", + "v60s", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_TIMETOWAIT_ENUM e; -}LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT; +} LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timetowait( - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timetowait( - uint8_t **ptr, - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_timetowait(LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timetowait(uint8_t** ptr, LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE UE_HistoryInformation DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_historyinformation( - LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_historyinformation( - uint8_t **ptr, - LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_historyinformation(LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_historyinformation(uint8_t** ptr, LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE CriticalityDiagnostics SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_PROCEDURECODE_STRUCT procedureCode; - bool procedureCode_present; - LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM triggeringMessage; - bool triggeringMessage_present; - LIBLTE_S1AP_CRITICALITY_ENUM procedureCriticality; - bool procedureCriticality_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT iEsCriticalityDiagnostics; - bool iEsCriticalityDiagnostics_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_PROCEDURECODE_STRUCT procedureCode; + bool procedureCode_present; + LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM triggeringMessage; + bool triggeringMessage_present; + LIBLTE_S1AP_CRITICALITY_ENUM procedureCriticality; + bool procedureCriticality_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT iEsCriticalityDiagnostics; + bool iEsCriticalityDiagnostics_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics(uint8_t** ptr, + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaID_Broadcast_Item SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT emergencyAreaID; - LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT completedCellinEAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_EMERGENCYAREAID_STRUCT emergencyAreaID; + LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT completedCellinEAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item( - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item(LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_emergencyareaid_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE ImmediateMDT SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT measurementsToActivate; - LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT m1reportingTrigger; - LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT m1thresholdeventA2; - bool m1thresholdeventA2_present; - LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT m1periodicReporting; - bool m1periodicReporting_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_IMMEDIATEMDT_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt( - LIBLTE_S1AP_IMMEDIATEMDT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt( - uint8_t **ptr, - LIBLTE_S1AP_IMMEDIATEMDT_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT measurementsToActivate; + LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT m1reportingTrigger; + LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT m1thresholdeventA2; + bool m1thresholdeventA2_present; + LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT m1periodicReporting; + bool m1periodicReporting_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_IMMEDIATEMDT_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt(LIBLTE_S1AP_IMMEDIATEMDT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt(uint8_t** ptr, LIBLTE_S1AP_IMMEDIATEMDT_STRUCT* ie); /******************************************************************************* /* ProtocolIE MDTMode CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_MDTMODE_CHOICE_IMMEDIATEMDT, LIBLTE_S1AP_MDTMODE_CHOICE_LOGGEDMDT, LIBLTE_S1AP_MDTMODE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_MDTMODE_CHOICE_ENUM; +} LIBLTE_S1AP_MDTMODE_CHOICE_ENUM; static const char liblte_s1ap_mdtmode_choice_text[LIBLTE_S1AP_MDTMODE_CHOICE_N_ITEMS][50] = { - "immediateMDT", - "loggedMDT", + "immediateMDT", + "loggedMDT", }; -typedef union{ - LIBLTE_S1AP_IMMEDIATEMDT_STRUCT immediateMDT; - LIBLTE_S1AP_LOGGEDMDT_STRUCT loggedMDT; -}LIBLTE_S1AP_MDTMODE_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_IMMEDIATEMDT_STRUCT immediateMDT; + LIBLTE_S1AP_LOGGEDMDT_STRUCT loggedMDT; +} LIBLTE_S1AP_MDTMODE_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_MDTMODE_CHOICE_UNION choice; LIBLTE_S1AP_MDTMODE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_MDTMODE_STRUCT; +} LIBLTE_S1AP_MDTMODE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtmode( - LIBLTE_S1AP_MDTMODE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode( - uint8_t **ptr, - LIBLTE_S1AP_MDTMODE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtmode(LIBLTE_S1AP_MDTMODE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode(uint8_t** ptr, LIBLTE_S1AP_MDTMODE_STRUCT* ie); /******************************************************************************* /* ProtocolIE SourceeNB_ToTargeteNB_TransparentContainer SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_RRC_CONTAINER_STRUCT rRC_Container; - LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT e_RABInformationList; - bool e_RABInformationList_present; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT targetCell_ID; - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT subscriberProfileIDforRFP; - bool subscriberProfileIDforRFP_present; - LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT uE_HistoryInformation; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_RRC_CONTAINER_STRUCT rRC_Container; + LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT e_RABInformationList; + bool e_RABInformationList_present; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT targetCell_ID; + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT subscriberProfileIDforRFP; + bool subscriberProfileIDforRFP_present; + LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT uE_HistoryInformation; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer( - LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE EmergencyAreaID_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast( - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast(LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast(uint8_t** ptr, + LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT* ie); /******************************************************************************* /* ProtocolIE MDT_Configuration SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT mdt_Activation; - LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT areaScopeOfMDT; - LIBLTE_S1AP_MDTMODE_STRUCT mDTMode; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT mdt_Activation; + LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT areaScopeOfMDT; + LIBLTE_S1AP_MDTMODE_STRUCT mDTMode; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration( - LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration( - uint8_t **ptr, - LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration(LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration(uint8_t** ptr, LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAI_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAI_CANCELLED_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAI_CANCELLED_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled( - LIBLTE_S1AP_TAI_CANCELLED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_TAI_CANCELLED_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled(LIBLTE_S1AP_TAI_CANCELLED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled(uint8_t** ptr, LIBLTE_S1AP_TAI_CANCELLED_STRUCT* ie); /******************************************************************************* /* ProtocolIE BroadcastCancelledAreaList CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_CELLID_CANCELLED, LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_TAI_CANCELLED, LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_EMERGENCYAREAID_CANCELLED, LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_N_ITEMS, -}LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_ENUM; -static const char liblte_s1ap_broadcastcancelledarealist_choice_text[LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_N_ITEMS][50] = { - "cellID_Cancelled", - "tAI_Cancelled", - "emergencyAreaID_Cancelled", +} LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_ENUM; +static const char + liblte_s1ap_broadcastcancelledarealist_choice_text[LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_N_ITEMS][50] = { + "cellID_Cancelled", + "tAI_Cancelled", + "emergencyAreaID_Cancelled", }; -typedef union{ - LIBLTE_S1AP_CELLID_CANCELLED_STRUCT cellID_Cancelled; - LIBLTE_S1AP_TAI_CANCELLED_STRUCT tAI_Cancelled; - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT emergencyAreaID_Cancelled; -}LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_CELLID_CANCELLED_STRUCT cellID_Cancelled; + LIBLTE_S1AP_TAI_CANCELLED_STRUCT tAI_Cancelled; + LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT emergencyAreaID_Cancelled; +} LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_UNION choice; LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT; +} LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcancelledarealist( - LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist( - uint8_t **ptr, - LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcancelledarealist(LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist(uint8_t** ptr, + LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE ENB_StatusTransfer_TransparentContainer SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT bearers_SubjectToStatusTransferList; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer( - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr); +typedef struct { + bool ext; + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT bearers_SubjectToStatusTransferList; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT; + +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_enb_statustransfer_transparentcontainer(LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie); /******************************************************************************* /* ProtocolIE TraceActivation SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT e_UTRAN_Trace_ID; - LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT interfacesToTrace; - LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT traceDepth; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT traceCollectionEntityIPAddress; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TRACEACTIVATION_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation( - LIBLTE_S1AP_TRACEACTIVATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation( - uint8_t **ptr, - LIBLTE_S1AP_TRACEACTIVATION_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT e_UTRAN_Trace_ID; + LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT interfacesToTrace; + LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT traceDepth; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT traceCollectionEntityIPAddress; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TRACEACTIVATION_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation(LIBLTE_S1AP_TRACEACTIVATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation(uint8_t** ptr, LIBLTE_S1AP_TRACEACTIVATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE BroadcastCompletedAreaList CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_CELLID_BROADCAST, LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_TAI_BROADCAST, LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_EMERGENCYAREAID_BROADCAST, LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_N_ITEMS, -}LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_ENUM; -static const char liblte_s1ap_broadcastcompletedarealist_choice_text[LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_N_ITEMS][50] = { - "cellID_Broadcast", - "tAI_Broadcast", - "emergencyAreaID_Broadcast", +} LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_ENUM; +static const char + liblte_s1ap_broadcastcompletedarealist_choice_text[LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_N_ITEMS][50] = { + "cellID_Broadcast", + "tAI_Broadcast", + "emergencyAreaID_Broadcast", }; -typedef union{ - LIBLTE_S1AP_CELLID_BROADCAST_STRUCT cellID_Broadcast; - LIBLTE_S1AP_TAI_BROADCAST_STRUCT tAI_Broadcast; - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT emergencyAreaID_Broadcast; -}LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_CELLID_BROADCAST_STRUCT cellID_Broadcast; + LIBLTE_S1AP_TAI_BROADCAST_STRUCT tAI_Broadcast; + LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT emergencyAreaID_Broadcast; +} LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_UNION choice; LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT; +} LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcompletedarealist( - LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist( - uint8_t **ptr, - LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcompletedarealist(LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist(uint8_t** ptr, + LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE SONInformation CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREQUEST, LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREPLY, LIBLTE_S1AP_SONINFORMATION_CHOICE_N_ITEMS, -}LIBLTE_S1AP_SONINFORMATION_CHOICE_ENUM; +} LIBLTE_S1AP_SONINFORMATION_CHOICE_ENUM; static const char liblte_s1ap_soninformation_choice_text[LIBLTE_S1AP_SONINFORMATION_CHOICE_N_ITEMS][50] = { - "sONInformationRequest", - "sONInformationReply", + "sONInformationRequest", + "sONInformationReply", }; -typedef union{ - LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT sONInformationRequest; - LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT sONInformationReply; -}LIBLTE_S1AP_SONINFORMATION_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT sONInformationRequest; + LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT sONInformationReply; +} LIBLTE_S1AP_SONINFORMATION_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_SONINFORMATION_CHOICE_UNION choice; LIBLTE_S1AP_SONINFORMATION_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_SONINFORMATION_STRUCT; +} LIBLTE_S1AP_SONINFORMATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformation( - LIBLTE_S1AP_SONINFORMATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformation(LIBLTE_S1AP_SONINFORMATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation(uint8_t** ptr, LIBLTE_S1AP_SONINFORMATION_STRUCT* ie); /******************************************************************************* /* ProtocolIE SONConfigurationTransfer SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TARGETENB_ID_STRUCT targeteNB_ID; - LIBLTE_S1AP_SOURCEENB_ID_STRUCT sourceeNB_ID; - LIBLTE_S1AP_SONINFORMATION_STRUCT sONInformation; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TARGETENB_ID_STRUCT targeteNB_ID; + LIBLTE_S1AP_SOURCEENB_ID_STRUCT sourceeNB_ID; + LIBLTE_S1AP_SONINFORMATION_STRUCT sONInformation; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer( - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer(LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT* ie); /******************************************************************************* /* ProtocolIE ResetAll ENUMERATED ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_RESETALL_RESET_ALL, LIBLTE_S1AP_RESETALL_N_ITEMS, -}LIBLTE_S1AP_RESETALL_ENUM; +} LIBLTE_S1AP_RESETALL_ENUM; static const char liblte_s1ap_resetall_text[LIBLTE_S1AP_RESETALL_N_ITEMS][80] = { - "reset-all", + "reset-all", }; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_RESETALL_ENUM e; -}LIBLTE_S1AP_RESETALL_ENUM_EXT; +} LIBLTE_S1AP_RESETALL_ENUM_EXT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetall( - LIBLTE_S1AP_RESETALL_ENUM_EXT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetall( - uint8_t **ptr, - LIBLTE_S1AP_RESETALL_ENUM_EXT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetall(LIBLTE_S1AP_RESETALL_ENUM_EXT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetall(uint8_t** ptr, LIBLTE_S1AP_RESETALL_ENUM_EXT* ie); /******************************************************************************* /* ProtocolIE Inter_SystemInformationTransferType CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_RIMTRANSFER, LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_ENUM; -static const char liblte_s1ap_inter_systeminformationtransfertype_choice_text[LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_N_ITEMS][50] = { - "rIMTransfer", +} LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_ENUM; +static const char liblte_s1ap_inter_systeminformationtransfertype_choice_text + [LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_N_ITEMS][50] = { + "rIMTransfer", }; -typedef union{ - LIBLTE_S1AP_RIMTRANSFER_STRUCT rIMTransfer; -}LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_RIMTRANSFER_STRUCT rIMTransfer; +} LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_UNION choice; LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT; +} LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_inter_systeminformationtransfertype( - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_inter_systeminformationtransfertype( - uint8_t **ptr, - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_inter_systeminformationtransfertype(LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_inter_systeminformationtransfertype(uint8_t** ptr, + LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RAB_IE_ContainerPairList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_ie_containerpairlist( - LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_ie_containerpairlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_ie_containerpairlist(LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_ie_containerpairlist(uint8_t** ptr, + LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABDataForwardingItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT dL_transportLayerAddress; - bool dL_transportLayerAddress_present; - LIBLTE_S1AP_GTP_TEID_STRUCT dL_gTP_TEID; - bool dL_gTP_TEID_present; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT uL_TransportLayerAddress; - bool uL_TransportLayerAddress_present; - LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; - bool uL_GTP_TEID_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT dL_transportLayerAddress; + bool dL_transportLayerAddress_present; + LIBLTE_S1AP_GTP_TEID_STRUCT dL_gTP_TEID; + bool dL_gTP_TEID_present; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT uL_TransportLayerAddress; + bool uL_TransportLayerAddress_present; + LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; + bool uL_GTP_TEID_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem(LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemHOReq SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQosParameters; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQosParameters; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq(LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABAdmittedItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT dL_transportLayerAddress; - bool dL_transportLayerAddress_present; - LIBLTE_S1AP_GTP_TEID_STRUCT dL_gTP_TEID; - bool dL_gTP_TEID_present; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT uL_TransportLayerAddress; - bool uL_TransportLayerAddress_present; - LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; - bool uL_GTP_TEID_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT dL_transportLayerAddress; + bool dL_transportLayerAddress_present; + LIBLTE_S1AP_GTP_TEID_STRUCT dL_gTP_TEID; + bool dL_gTP_TEID_present; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT uL_TransportLayerAddress; + bool uL_TransportLayerAddress_present; + LIBLTE_S1AP_GTP_TEID_STRUCT uL_GTP_TEID; + bool uL_GTP_TEID_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem(LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem(uint8_t** ptr, LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABFailedToSetupItemHOReqAck SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_CAUSE_STRUCT cause; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_CAUSE_STRUCT cause; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( - uint8_t **ptr, - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(uint8_t** ptr, LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeSwitchedDLItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem(LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeSwitchedULItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem(LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemBearerSUReq SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQoSParameters; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQoSParameters; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq(LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitembearersureq(uint8_t** ptr, LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABSetupItemBearerSURes SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures(LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeModifiedItemBearerModReq SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABLevelQoSParameters; - LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABLevelQoSParameters; + LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABModifyItemBearerModRes SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( - uint8_t **ptr, - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres(LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres(uint8_t** ptr, + LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABReleaseItemBearerRelComp SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(uint8_t** ptr, LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemCtxtSUReq SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQoSParameters; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; - bool nAS_PDU_present; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT e_RABlevelQoSParameters; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_NAS_PDU_STRUCT nAS_PDU; + bool nAS_PDU_present; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie); /******************************************************************************* /* ProtocolIE E_RABSetupItemCtxtSURes SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; - LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RAB_ID_STRUCT e_RAB_ID; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT transportLayerAddress; + LIBLTE_S1AP_GTP_TEID_STRUCT gTP_TEID; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures(LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT* ie); /******************************************************************************* /* ProtocolIE TAIItem SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAI_STRUCT tAI; - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; - bool iE_Extensions_present; -}LIBLTE_S1AP_TAIITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAI_STRUCT tAI; + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT iE_Extensions; + bool iE_Extensions_present; +} LIBLTE_S1AP_TAIITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( - LIBLTE_S1AP_TAIITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( - uint8_t **ptr, - LIBLTE_S1AP_TAIITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem(LIBLTE_S1AP_TAIITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem(uint8_t** ptr, LIBLTE_S1AP_TAIITEM_STRUCT* ie); /******************************************************************************* /* Protocol Container List UE_associatedLogicalS1_ConnectionListRes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT + buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie); /******************************************************************************* /* Protocol Container List UE_associatedLogicalS1_ConnectionListResAck DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT + buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie); /******************************************************************************* /* ProtocolIE PrivateMessage SEQUENCE ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT privateIEs; -}LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT privateIEs; +} LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( - LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage(LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage(uint8_t** ptr, LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT* ie); /******************************************************************************* /* ProtocolIE ResetType CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_RESETTYPE_CHOICE_S1_INTERFACE, LIBLTE_S1AP_RESETTYPE_CHOICE_PARTOFS1_INTERFACE, LIBLTE_S1AP_RESETTYPE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_RESETTYPE_CHOICE_ENUM; +} LIBLTE_S1AP_RESETTYPE_CHOICE_ENUM; static const char liblte_s1ap_resettype_choice_text[LIBLTE_S1AP_RESETTYPE_CHOICE_N_ITEMS][50] = { - "s1_Interface", - "partOfS1_Interface", + "s1_Interface", + "partOfS1_Interface", }; -typedef union{ - LIBLTE_S1AP_RESETALL_ENUM_EXT s1_Interface; - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT partOfS1_Interface; -}LIBLTE_S1AP_RESETTYPE_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_RESETALL_ENUM_EXT s1_Interface; + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT partOfS1_Interface; +} LIBLTE_S1AP_RESETTYPE_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_RESETTYPE_CHOICE_UNION choice; LIBLTE_S1AP_RESETTYPE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_RESETTYPE_STRUCT; +} LIBLTE_S1AP_RESETTYPE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resettype( - LIBLTE_S1AP_RESETTYPE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype( - uint8_t **ptr, - LIBLTE_S1AP_RESETTYPE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resettype(LIBLTE_S1AP_RESETTYPE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype(uint8_t** ptr, LIBLTE_S1AP_RESETTYPE_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABSubjecttoDataForwardingList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsubjecttodataforwardinglist( - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(uint8_t** ptr, + LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeSetupListHOReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplisthoreq( - LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplisthoreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplisthoreq(LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplisthoreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABAdmittedList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmittedlist( - LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmittedlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmittedlist(LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmittedlist(uint8_t** ptr, LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeSwitchedDLList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddllist( - LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddllist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddllist(LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddllist(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeSwitchedULList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedullist( - LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedullist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedullist(LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedullist(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeSetupListBearerSUReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistbearersureq( - LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistbearersureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistbearersureq(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetuplistbearersureq(uint8_t** ptr, LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABSetupListBearerSURes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistbearersures( - LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistbearersures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistbearersures(LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistbearersures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeModifiedListBearerModReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT + buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq( - LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq(LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABModifyListBearerModRes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifylistbearermodres( - LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifylistbearermodres( - uint8_t **ptr, - LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifylistbearermodres(LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifylistbearermodres(uint8_t** ptr, + LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABReleaseListBearerRelComp DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaselistbearerrelcomp( - LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaselistbearerrelcomp(LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp(uint8_t** ptr, LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABToBeSetupListCtxtSUReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistctxtsureq( - LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistctxtsureq(LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABSetupListCtxtSURes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistctxtsures( - LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistctxtsures(LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistctxtsures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT* ie); /******************************************************************************* /* Protocol Container List TAIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_TAIITEM_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_TAILIST_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_TAIITEM_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_TAILIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailist( - LIBLTE_S1AP_TAILIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailist( - uint8_t **ptr, - LIBLTE_S1AP_TAILIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailist(LIBLTE_S1AP_TAILIST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailist(uint8_t** ptr, LIBLTE_S1AP_TAILIST_STRUCT* ie); /******************************************************************************* /* Protocol Container List E_RABFailedtoSetupListHOReqAck DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -typedef struct{ - uint32_t len; - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT buffer[32]; //WARNING: Artificial limit to reduce memory footprint -}LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT; +typedef struct { + uint32_t len; + LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT buffer[32]; // WARNING: Artificial limit to reduce memory footprint +} LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack( - LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack( - uint8_t **ptr, - LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack(LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack(uint8_t** ptr, LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT* ie); /******************************************************************************* /* Protocol Message AllocationAndRetentionPriority_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority_ext( - LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_allocationandretentionpriority_ext(LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CancelledCellinEAI_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item_ext( - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_cancelledcellineai_item_ext(LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cancelledcellineai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CancelledCellinTAI_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item_ext( - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_cancelledcellintai_item_ext(LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cancelledcellintai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CellID_Broadcast_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cellid_broadcast_item_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CellID_Cancelled_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cellid_cancelled_item_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CellBasedMDT_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt_ext( - LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt_ext(LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message Cdma2000OneXSRVCCInfo_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo_ext( - LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo_ext(LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CellType_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype_ext( - LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype_ext(LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CGI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi_ext( - LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi_ext(LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CSG_IdList_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item_ext( - LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item_ext(LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message COUNTvalue_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue_ext( - LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue_ext(LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message COUNTValueExtended_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended_ext( - LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended_ext(LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CriticalityDiagnostics_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ext( - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CriticalityDiagnostics_IE_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext( - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message EmergencyAreaID_Broadcast_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_emergencyareaid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message EmergencyAreaID_Cancelled_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_emergencyareaid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CompletedCellinEAI_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item_ext( - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_completedcellineai_item_ext(LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_completedcellineai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message GERAN_Cell_ID_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id_ext( - LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id_ext(LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message GlobalENB_ID_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_globalenb_id_ext( - LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_globalenb_id_ext(LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message ENB_StatusTransfer_TransparentContainer_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABInformationListItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabinformationlistitem_ext(LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabinformationlistitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem_ext(LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABQoSParameters_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabqosparameters_ext( - LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabqosparameters_ext(LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message EUTRAN_CGI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi_ext( - LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi_ext(LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message ForbiddenTAs_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item_ext( - LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item_ext(LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message ForbiddenLAs_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item_ext( - LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item_ext(LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message GBR_QosInformation_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation_ext( - LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation_ext(LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message GUMMEI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei_ext( - LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei_ext(LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverRestrictionList_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist_ext( - LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_handoverrestrictionlist_ext(LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverrestrictionlist_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message LAI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai_ext( - LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai_ext(LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message LoggedMDT_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt_ext( - LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt_ext(LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message M3Configuration_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration_ext( - LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration_ext(LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message M4Configuration_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration_ext( - LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration_ext(LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message M5Configuration_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration_ext( - LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration_ext(LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message M1PeriodicReporting_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting_ext( - LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting_ext(LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message RequestType_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype_ext( - LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype_ext(LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message RIMTransfer_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer_ext( - LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer_ext(LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SecurityContext_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext_ext( - LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext_ext(LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SourceeNB_ID_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id_ext( - LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id_ext(LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message ServedGUMMEIsItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem_ext( - LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem_ext(LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SupportedTAs_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item_ext( - LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item_ext(LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TimeSynchronizationInfo_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo_ext( - LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_timesynchronizationinfo_ext(LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_timesynchronizationinfo_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message S_TMSI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi_ext( - LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi_ext(LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TAIBasedMDT_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt_ext( - LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt_ext(LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TAI_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_ext( - LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_ext(LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TAI_Broadcast_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TAI_Cancelled_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TABasedMDT_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt_ext( - LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt_ext(LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message CompletedCellinTAI_Item_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item_ext( - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_completedcellintai_item_ext(LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_completedcellintai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TargeteNB_ID_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id_ext( - LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id_ext(LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TargetRNC_ID_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id_ext( - LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id_ext(LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TargeteNB_ToSourceeNB_TransparentContainer_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message M1ThresholdEventA2_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2_ext( - LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2_ext(LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message Tunnel_Information_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnel_information_ext( - LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnel_information_ext(LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UEAggregate_MaximumBitrates_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregate_maximumbitrates_ext( - LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueaggregate_maximumbitrates_ext(LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UE_S1AP_ID_pair_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair_ext( - LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair_ext(LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UE_associatedLogicalS1_ConnectionItemExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UESecurityCapabilities_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities_ext( - LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities_ext(LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uesecuritycapabilities_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UserLocationInformation_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation_ext( - LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_userlocationinformation_ext(LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_userlocationinformation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBX2ExtTLA_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla_ext( - LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla_ext(LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SourceeNB_ToTargeteNB_TransparentContainer_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT MobilityInformation; - bool MobilityInformation_present; -}LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT MobilityInformation; + bool MobilityInformation_present; +} LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABInformationList STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT E_RABInformationListItem; -}LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT E_RABInformationListItem; +} LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist(LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT* ie); /******************************************************************************* /* Protocol Message LastVisitedEUTRANCellInformation_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT Time_UE_StayedInCell_EnhancedGranularity; - bool Time_UE_StayedInCell_EnhancedGranularity_present; - LIBLTE_S1AP_CAUSE_STRUCT HO_Cause; - bool HO_Cause_present; -}LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT Time_UE_StayedInCell_EnhancedGranularity; + bool Time_UE_StayedInCell_EnhancedGranularity_present; + LIBLTE_S1AP_CAUSE_STRUCT HO_Cause; + bool HO_Cause_present; +} LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext( - LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SONInformationReply_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT Time_Synchronization_Info; - bool Time_Synchronization_Info_present; -}LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT Time_Synchronization_Info; + bool Time_Synchronization_Info_present; +} LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply_ext( - LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply_ext(LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message Bearers_SubjectToStatusTransfer_ItemExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT ULCOUNTValueExtended; - bool ULCOUNTValueExtended_present; - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT DLCOUNTValueExtended; - bool DLCOUNTValueExtended_present; - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT ReceiveStatusOfULPDCPSDUsExtended; - bool ReceiveStatusOfULPDCPSDUsExtended_present; -}LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT ULCOUNTValueExtended; + bool ULCOUNTValueExtended_present; + LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT DLCOUNTValueExtended; + bool DLCOUNTValueExtended_present; + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT ReceiveStatusOfULPDCPSDUsExtended; + bool ReceiveStatusOfULPDCPSDUsExtended_present; +} LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABITEM_STRUCT E_RABItem; -}LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABITEM_STRUCT E_RABItem; +} LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( - LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem(LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message MDT_Configuration_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MDTPLMNLIST_STRUCT SignallingBasedMDTPLMNList; - bool SignallingBasedMDTPLMNList_present; -}LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MDTPLMNLIST_STRUCT SignallingBasedMDTPLMNList; + bool SignallingBasedMDTPLMNList_present; +} LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration_ext( - LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration_ext(LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message X2TNLConfigurationInfo_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT eNBX2ExtendedTransportLayerAddresses; - bool eNBX2ExtendedTransportLayerAddresses_present; -}LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT eNBX2ExtendedTransportLayerAddresses; + bool eNBX2ExtendedTransportLayerAddresses_present; +} LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo_ext( - LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo_ext(LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_x2tnlconfigurationinfo_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message Bearers_SubjectToStatusTransfer_Item STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT Bearers_SubjectToStatusTransfer_Item; -}LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT Bearers_SubjectToStatusTransfer_Item; +} LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message ImmediateMDT_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_M3CONFIGURATION_STRUCT M3Configuration; - bool M3Configuration_present; - LIBLTE_S1AP_M4CONFIGURATION_STRUCT M4Configuration; - bool M4Configuration_present; - LIBLTE_S1AP_M5CONFIGURATION_STRUCT M5Configuration; - bool M5Configuration_present; - LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT MDT_Location_Info; - bool MDT_Location_Info_present; -}LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( - LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_M3CONFIGURATION_STRUCT M3Configuration; + bool M3Configuration_present; + LIBLTE_S1AP_M4CONFIGURATION_STRUCT M4Configuration; + bool M4Configuration_present; + LIBLTE_S1AP_M5CONFIGURATION_STRUCT M5Configuration; + bool M5Configuration_present; + LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT MDT_Location_Info; + bool MDT_Location_Info_present; +} LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext(LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message SONConfigurationTransfer_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT x2TNLConfigurationInfo; - bool x2TNLConfigurationInfo_present; -}LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT x2TNLConfigurationInfo; + bool x2TNLConfigurationInfo_present; +} LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer_ext( - LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_sonconfigurationtransfer_ext(LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_sonconfigurationtransfer_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message TraceActivation_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT MDTConfiguration; - bool MDTConfiguration_present; -}LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT MDTConfiguration; + bool MDTConfiguration_present; +} LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation_ext( - LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation_ext(LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverRequired STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_TARGETID_STRUCT TargetID; - LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT Direct_Forwarding_Path_Availability; - bool Direct_Forwarding_Path_Availability_present; - LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT SRVCCHOIndication; - bool SRVCCHOIndication_present; - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer; - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer_Secondary; - bool Source_ToTarget_TransparentContainer_Secondary_present; - LIBLTE_S1AP_MSCLASSMARK2_STRUCT MSClassmark2; - bool MSClassmark2_present; - LIBLTE_S1AP_MSCLASSMARK3_STRUCT MSClassmark3; - bool MSClassmark3_present; - LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; - bool CSG_Id_present; - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; - bool CellAccessMode_present; - LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT PS_ServiceNotAvailable; - bool PS_ServiceNotAvailable_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_TARGETID_STRUCT TargetID; + LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT Direct_Forwarding_Path_Availability; + bool Direct_Forwarding_Path_Availability_present; + LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT SRVCCHOIndication; + bool SRVCCHOIndication_present; + LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer; + LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer_Secondary; + bool Source_ToTarget_TransparentContainer_Secondary_present; + LIBLTE_S1AP_MSCLASSMARK2_STRUCT MSClassmark2; + bool MSClassmark2_present; + LIBLTE_S1AP_MSCLASSMARK3_STRUCT MSClassmark3; + bool MSClassmark3_present; + LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; + bool CSG_Id_present; + LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; + bool CellAccessMode_present; + LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT PS_ServiceNotAvailable; + bool PS_ServiceNotAvailable_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired(LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABDataForwardingItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabdataforwardingitem_ext(LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabdataforwardingitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverPreparationFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverpreparationfailure( - LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverpreparationfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverpreparationfailure(LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverpreparationfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemHOReq_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT Data_Forwarding_Not_Possible; - bool Data_Forwarding_Not_Possible_present; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT Data_Forwarding_Not_Possible; + bool Data_Forwarding_Not_Possible_present; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemhoreq_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABAdmittedItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem_ext( - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem_ext(LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABFailedToSetupItemHOReqAckExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqackext( - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabfailedtosetupitemhoreqackext(LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverfailure( - LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverfailure(LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverNotify STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_TAI_STRUCT TAI; - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; - bool Tunnel_Information_for_BBF_present; - LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; - bool LHN_ID_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify( - LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_TAI_STRUCT TAI; + LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; + bool Tunnel_Information_for_BBF_present; + LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; + bool LHN_ID_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify(LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSwitchedDLItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobeswitcheddlitem_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSwitchedULItem_Ext STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobeswitchedulitem_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT* ie); /******************************************************************************* /* Protocol Message PathSwitchRequestFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestfailure( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestfailure(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverCancel STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; -}LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; +} LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel( - LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel(LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverCancelAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancelacknowledge( - LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancelacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancelacknowledge(LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handovercancelacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemBearerSUReqExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CORRELATION_ID_STRUCT Correlation_ID; - bool Correlation_ID_present; - LIBLTE_S1AP_CORRELATION_ID_STRUCT SIPTO_Correlation_ID; - bool SIPTO_Correlation_ID_present; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CORRELATION_ID_STRUCT Correlation_ID; + bool Correlation_ID_present; + LIBLTE_S1AP_CORRELATION_ID_STRUCT SIPTO_Correlation_ID; + bool SIPTO_Correlation_ID_present; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitembearersureqext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitembearersureqext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupItemBearerSUResExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersuresext( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersuresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabsetupitembearersuresext(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitembearersuresext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeModifyItemBearerModReqExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT TransportInformation; - bool TransportInformation_present; -}LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT TransportInformation; + bool TransportInformation_present; +} LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABModifyItemBearerModResExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodresext( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabmodifyitembearermodresext(LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabmodifyitembearermodresext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABReleaseCommand STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - bool uEaggregateMaximumBitrate_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABToBeReleasedList; - LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; - bool NAS_PDU_present; -}LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand( - LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + bool uEaggregateMaximumBitrate_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABToBeReleasedList; + LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; + bool NAS_PDU_present; +} LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand(LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABReleaseItemBearerRelCompExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcompext( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabreleaseitembearerrelcompext(LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABReleaseIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABReleasedList; - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; - bool UserLocationInformation_present; -}LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABReleasedList; + LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; + bool UserLocationInformation_present; +} LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseindication( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseindication(LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemCtxtSUReqExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CORRELATION_ID_STRUCT Correlation_ID; - bool Correlation_ID_present; - LIBLTE_S1AP_CORRELATION_ID_STRUCT SIPTO_Correlation_ID; - bool SIPTO_Correlation_ID_present; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CORRELATION_ID_STRUCT Correlation_ID; + bool Correlation_ID_present; + LIBLTE_S1AP_CORRELATION_ID_STRUCT SIPTO_Correlation_ID; + bool SIPTO_Correlation_ID_present; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupItemCtxtSUResExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsuresext( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsuresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsuresext(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitemctxtsuresext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message InitialContextSetupFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupfailure( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupfailure(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetupfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message TAIItemExt STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitemext( - LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitemext(LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextReleaseRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT GWContextReleaseIndication; - bool GWContextReleaseIndication_present; -}LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT GWContextReleaseIndication; + bool GWContextReleaseIndication_present; +} LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleaserequest( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleaserequest(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextReleaseCommand STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_UE_S1AP_IDS_STRUCT UE_S1AP_IDs; - LIBLTE_S1AP_CAUSE_STRUCT Cause; -}LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_UE_S1AP_IDS_STRUCT UE_S1AP_IDs; + LIBLTE_S1AP_CAUSE_STRUCT Cause; +} LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextReleaseComplete STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; - bool UserLocationInformation_present; -}LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; + LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; + bool UserLocationInformation_present; +} LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextModificationRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_SECURITYKEY_STRUCT SecurityKey; - bool SecurityKey_present; - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; - bool SubscriberProfileIDforRFP_present; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - bool uEaggregateMaximumBitrate_present; - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT CSFallbackIndicator; - bool CSFallbackIndicator_present; - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; - bool UESecurityCapabilities_present; - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; - bool CSGMembershipStatus_present; - LIBLTE_S1AP_LAI_STRUCT RegisteredLAI; - bool RegisteredLAI_present; - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT AdditionalCSFallbackIndicator; - bool AdditionalCSFallbackIndicator_present; -}LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_SECURITYKEY_STRUCT SecurityKey; + bool SecurityKey_present; + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; + bool SubscriberProfileIDforRFP_present; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + bool uEaggregateMaximumBitrate_present; + LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT CSFallbackIndicator; + bool CSFallbackIndicator_present; + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; + bool UESecurityCapabilities_present; + LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; + bool CSGMembershipStatus_present; + LIBLTE_S1AP_LAI_STRUCT RegisteredLAI; + bool RegisteredLAI_present; + LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT AdditionalCSFallbackIndicator; + bool AdditionalCSFallbackIndicator_present; +} LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationrequest(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextModificationResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationresponse( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationresponse(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message UEContextModificationFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationfailure( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationfailure(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationfailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message UERadioCapabilityMatchRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; - bool UERadioCapability_present; -}LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; + bool UERadioCapability_present; +} LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchrequest( - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueradiocapabilitymatchrequest(LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueradiocapabilitymatchrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message UERadioCapabilityMatchResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT VoiceSupportMatchIndicator; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT VoiceSupportMatchIndicator; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchresponse( - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueradiocapabilitymatchresponse(LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueradiocapabilitymatchresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message DownlinkNASTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; - bool HandoverRestrictionList_present; - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; - bool SubscriberProfileIDforRFP_present; -}LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; + LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; + bool HandoverRestrictionList_present; + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; + bool SubscriberProfileIDforRFP_present; +} LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport(LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message InitialUEMessage STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; - LIBLTE_S1AP_TAI_STRUCT TAI; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT RRC_Establishment_Cause; - LIBLTE_S1AP_S_TMSI_STRUCT S_TMSI; - bool S_TMSI_present; - LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; - bool CSG_Id_present; - LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; - bool GUMMEI_ID_present; - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; - bool CellAccessMode_present; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT GW_TransportLayerAddress; - bool GW_TransportLayerAddress_present; - LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT RelayNode_Indicator; - bool RelayNode_Indicator_present; - LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT GUMMEIType; - bool GUMMEIType_present; - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; - bool Tunnel_Information_for_BBF_present; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT SIPTO_L_GW_TransportLayerAddress; - bool SIPTO_L_GW_TransportLayerAddress_present; - LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; - bool LHN_ID_present; -}LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( - LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; + LIBLTE_S1AP_TAI_STRUCT TAI; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT RRC_Establishment_Cause; + LIBLTE_S1AP_S_TMSI_STRUCT S_TMSI; + bool S_TMSI_present; + LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; + bool CSG_Id_present; + LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; + bool GUMMEI_ID_present; + LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; + bool CellAccessMode_present; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT GW_TransportLayerAddress; + bool GW_TransportLayerAddress_present; + LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT RelayNode_Indicator; + bool RelayNode_Indicator_present; + LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT GUMMEIType; + bool GUMMEIType_present; + LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; + bool Tunnel_Information_for_BBF_present; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT SIPTO_L_GW_TransportLayerAddress; + bool SIPTO_L_GW_TransportLayerAddress_present; + LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; + bool LHN_ID_present; +} LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT* ie); /******************************************************************************* /* Protocol Message UplinkNASTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_TAI_STRUCT TAI; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT GW_TransportLayerAddress; - bool GW_TransportLayerAddress_present; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT SIPTO_L_GW_TransportLayerAddress; - bool SIPTO_L_GW_TransportLayerAddress_present; - LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; - bool LHN_ID_present; -}LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport( - LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_TAI_STRUCT TAI; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT GW_TransportLayerAddress; + bool GW_TransportLayerAddress_present; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT SIPTO_L_GW_TransportLayerAddress; + bool SIPTO_L_GW_TransportLayerAddress_present; + LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; + bool LHN_ID_present; +} LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message NASNonDeliveryIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; - LIBLTE_S1AP_CAUSE_STRUCT Cause; -}LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_NAS_PDU_STRUCT NAS_PDU; + LIBLTE_S1AP_CAUSE_STRUCT Cause; +} LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication( - LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication(LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message UE_associatedLogicalS1_ConnectionItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT UE_associatedLogicalS1_ConnectionItem; -}LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT UE_associatedLogicalS1_ConnectionItem; +} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message UE_associatedLogicalS1_ConnectionItemRes STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT UE_associatedLogicalS1_ConnectionItem; -}LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT UE_associatedLogicalS1_ConnectionItem; +} LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* ie); /******************************************************************************* /* Protocol Message ErrorIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - bool MME_UE_S1AP_ID_present; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - bool eNB_UE_S1AP_ID_present; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - bool Cause_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( - LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + bool MME_UE_S1AP_ID_present; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + bool eNB_UE_S1AP_ID_present; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + bool Cause_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication(LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message S1SetupRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; - LIBLTE_S1AP_ENBNAME_STRUCT eNBname; - bool eNBname_present; - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT SupportedTAs; - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT DefaultPagingDRX; - LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; - bool CSG_IdList_present; -}LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest( - LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; + LIBLTE_S1AP_ENBNAME_STRUCT eNBname; + bool eNBname_present; + LIBLTE_S1AP_SUPPORTEDTAS_STRUCT SupportedTAs; + LIBLTE_S1AP_PAGINGDRX_ENUM_EXT DefaultPagingDRX; + LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; + bool CSG_IdList_present; +} LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message S1SetupResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MMENAME_STRUCT MMEname; - bool MMEname_present; - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT ServedGUMMEIs; - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT RelativeMMECapacity; - LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT MMERelaySupportIndicator; - bool MMERelaySupportIndicator_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse( - LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MMENAME_STRUCT MMEname; + bool MMEname_present; + LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT ServedGUMMEIs; + LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT RelativeMMECapacity; + LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT MMERelaySupportIndicator; + bool MMERelaySupportIndicator_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse(LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message S1SetupFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; - bool TimeToWait_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; + bool TimeToWait_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure( - LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure(LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBConfigurationUpdate STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENBNAME_STRUCT eNBname; - bool eNBname_present; - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT SupportedTAs; - bool SupportedTAs_present; - LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; - bool CSG_IdList_present; - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT DefaultPagingDRX; - bool DefaultPagingDRX_present; -}LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_ENBNAME_STRUCT eNBname; + bool eNBname_present; + LIBLTE_S1AP_SUPPORTEDTAS_STRUCT SupportedTAs; + bool SupportedTAs_present; + LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; + bool CSG_IdList_present; + LIBLTE_S1AP_PAGINGDRX_ENUM_EXT DefaultPagingDRX; + bool DefaultPagingDRX_present; +} LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBConfigurationUpdateAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdateacknowledge( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdateacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbconfigurationupdateacknowledge(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbconfigurationupdateacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBConfigurationUpdateFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; - bool TimeToWait_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; + bool TimeToWait_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdatefailure( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdatefailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbconfigurationupdatefailure(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbconfigurationupdatefailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEConfigurationUpdate STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MMENAME_STRUCT MMEname; - bool MMEname_present; - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT ServedGUMMEIs; - bool ServedGUMMEIs_present; - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT RelativeMMECapacity; - bool RelativeMMECapacity_present; -}LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MMENAME_STRUCT MMEname; + bool MMEname_present; + LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT ServedGUMMEIs; + bool ServedGUMMEIs_present; + LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT RelativeMMECapacity; + bool RelativeMMECapacity_present; +} LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEConfigurationUpdateAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdateacknowledge( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdateacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmeconfigurationupdateacknowledge(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmeconfigurationupdateacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEConfigurationUpdateFailure STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; - bool TimeToWait_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT TimeToWait; + bool TimeToWait_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdatefailure( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdatefailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmeconfigurationupdatefailure(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmeconfigurationupdatefailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT* ie); /******************************************************************************* /* Protocol Message UplinkS1cdma2000tunneling STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT cdma2000RATType; - LIBLTE_S1AP_CDMA2000SECTORID_STRUCT cdma2000SectorID; - LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT cdma2000HORequiredIndication; - bool cdma2000HORequiredIndication_present; - LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT cdma2000OneXSRVCCInfo; - bool cdma2000OneXSRVCCInfo_present; - LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT cdma2000OneXRAND; - bool cdma2000OneXRAND_present; - LIBLTE_S1AP_CDMA2000PDU_STRUCT cdma2000PDU; - LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT EUTRANRoundTripDelayEstimationInfo; - bool EUTRANRoundTripDelayEstimationInfo_present; -}LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( - LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinks1cdma2000tunneling( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT cdma2000RATType; + LIBLTE_S1AP_CDMA2000SECTORID_STRUCT cdma2000SectorID; + LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT cdma2000HORequiredIndication; + bool cdma2000HORequiredIndication_present; + LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT cdma2000OneXSRVCCInfo; + bool cdma2000OneXSRVCCInfo_present; + LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT cdma2000OneXRAND; + bool cdma2000OneXRAND_present; + LIBLTE_S1AP_CDMA2000PDU_STRUCT cdma2000PDU; + LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT EUTRANRoundTripDelayEstimationInfo; + bool EUTRANRoundTripDelayEstimationInfo_present; +} LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling(LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uplinks1cdma2000tunneling(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT* ie); /******************************************************************************* /* Protocol Message UECapabilityInfoIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; -}LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; +} LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecapabilityinfoindication( - LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecapabilityinfoindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecapabilityinfoindication(LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecapabilityinfoindication(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBStatusTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT eNB_StatusTransfer_TransparentContainer; -}LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT eNB_StatusTransfer_TransparentContainer; +} LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer( - LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer(LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEStatusTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT eNB_StatusTransfer_TransparentContainer; -}LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT eNB_StatusTransfer_TransparentContainer; +} LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer( - LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer(LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message TraceStart STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; -}LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; +} LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart( - LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart(LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT* ie); /******************************************************************************* /* Protocol Message TraceFailureIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; -}LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; +} LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication( - LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication(LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message DeactivateTrace STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; -}LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; +} LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace( - LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace(LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT* ie); /******************************************************************************* /* Protocol Message CellTrafficTrace STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT TraceCollectionEntityIPAddress; - LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT PrivacyIndicator; - bool PrivacyIndicator_present; -}LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltraffictrace( - LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT E_UTRAN_Trace_ID; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT TraceCollectionEntityIPAddress; + LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT PrivacyIndicator; + bool PrivacyIndicator_present; +} LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltraffictrace(LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT* ie); /******************************************************************************* /* Protocol Message LocationReportingControl STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; -}LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; +} LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT* ie); /******************************************************************************* /* Protocol Message LocationReportingFailureIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_CAUSE_STRUCT Cause; -}LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingfailureindication( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT *ie, - uint8_t **ptr); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_CAUSE_STRUCT Cause; +} LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT; + +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_locationreportingfailureindication(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message LocationReport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_TAI_STRUCT TAI; - LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; -}LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_TAI_STRUCT TAI; + LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; +} LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport(LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message OverloadStart STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT OverloadResponse; - LIBLTE_S1AP_GUMMEILIST_STRUCT GUMMEIList; - bool GUMMEIList_present; - LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT TrafficLoadReductionIndication; - bool TrafficLoadReductionIndication_present; -}LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT OverloadResponse; + LIBLTE_S1AP_GUMMEILIST_STRUCT GUMMEIList; + bool GUMMEIList_present; + LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT TrafficLoadReductionIndication; + bool TrafficLoadReductionIndication_present; +} LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart( - LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart(LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT* ie); /******************************************************************************* /* Protocol Message OverloadStop STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_GUMMEILIST_STRUCT GUMMEIList; - bool GUMMEIList_present; -}LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_GUMMEILIST_STRUCT GUMMEIList; + bool GUMMEIList_present; +} LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstop( - LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstop(LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT* ie); /******************************************************************************* /* Protocol Message WriteReplaceWarningRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; - LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; - LIBLTE_S1AP_WARNINGAREALIST_STRUCT WarningAreaList; - bool WarningAreaList_present; - LIBLTE_S1AP_REPETITIONPERIOD_STRUCT RepetitionPeriod; - LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT ExtendedRepetitionPeriod; - bool ExtendedRepetitionPeriod_present; - LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT NumberofBroadcastRequest; - LIBLTE_S1AP_WARNINGTYPE_STRUCT WarningType; - bool WarningType_present; - LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT WarningSecurityInfo; - bool WarningSecurityInfo_present; - LIBLTE_S1AP_DATACODINGSCHEME_STRUCT DataCodingScheme; - bool DataCodingScheme_present; - LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT WarningMessageContents; - bool WarningMessageContents_present; - LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM ConcurrentWarningMessageIndicator; - bool ConcurrentWarningMessageIndicator_present; -}LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; + LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; + LIBLTE_S1AP_WARNINGAREALIST_STRUCT WarningAreaList; + bool WarningAreaList_present; + LIBLTE_S1AP_REPETITIONPERIOD_STRUCT RepetitionPeriod; + LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT ExtendedRepetitionPeriod; + bool ExtendedRepetitionPeriod_present; + LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT NumberofBroadcastRequest; + LIBLTE_S1AP_WARNINGTYPE_STRUCT WarningType; + bool WarningType_present; + LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT WarningSecurityInfo; + bool WarningSecurityInfo_present; + LIBLTE_S1AP_DATACODINGSCHEME_STRUCT DataCodingScheme; + bool DataCodingScheme_present; + LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT WarningMessageContents; + bool WarningMessageContents_present; + LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM ConcurrentWarningMessageIndicator; + bool ConcurrentWarningMessageIndicator_present; +} LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest(LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_writereplacewarningrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message WriteReplaceWarningResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; - LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; - LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT BroadcastCompletedAreaList; - bool BroadcastCompletedAreaList_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningresponse( - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; + LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; + LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT BroadcastCompletedAreaList; + bool BroadcastCompletedAreaList_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_writereplacewarningresponse(LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_writereplacewarningresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEDirectInformationTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT Inter_SystemInformationTransferTypeMDT; -}LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT Inter_SystemInformationTransferTypeMDT; +} LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmedirectinformationtransfer( - LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmedirectinformationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmedirectinformationtransfer(LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmedirectinformationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBConfigurationTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT SONConfigurationTransferECT; - bool SONConfigurationTransferECT_present; -}LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT SONConfigurationTransferECT; + bool SONConfigurationTransferECT_present; +} LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationtransfer( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationtransfer(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message MMEConfigurationTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT SONConfigurationTransferMCT; - bool SONConfigurationTransferMCT_present; -}LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT SONConfigurationTransferMCT; + bool SONConfigurationTransferMCT_present; +} LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationtransfer( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationtransfer(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message PrivateMessage STRUCT ********************************************************************************/ -typedef struct{ - bool ext; -}LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT; +typedef struct { + bool ext; +} LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( - LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage(LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT* ie); /******************************************************************************* /* Protocol Message KillRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; - LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; - LIBLTE_S1AP_WARNINGAREALIST_STRUCT WarningAreaList; - bool WarningAreaList_present; - LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM KillAllWarningMessages; - bool KillAllWarningMessages_present; -}LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest( - LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; + LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; + LIBLTE_S1AP_WARNINGAREALIST_STRUCT WarningAreaList; + bool WarningAreaList_present; + LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM KillAllWarningMessages; + bool KillAllWarningMessages_present; +} LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest(LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message KillResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; - LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; - LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT BroadcastCancelledAreaList; - bool BroadcastCancelledAreaList_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse( - LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT MessageIdentifier; + LIBLTE_S1AP_SERIALNUMBER_STRUCT SerialNumber; + LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT BroadcastCancelledAreaList; + bool BroadcastCancelledAreaList_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse(LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message PWSRestartIndication STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT ECGIListForRestart; - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; - LIBLTE_S1AP_TAILISTFORRESTART_STRUCT TAIListForRestart; - LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT EmergencyAreaIDListForRestart; - bool EmergencyAreaIDListForRestart_present; -}LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT ECGIListForRestart; + LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT Global_ENB_ID; + LIBLTE_S1AP_TAILISTFORRESTART_STRUCT TAIListForRestart; + LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT EmergencyAreaIDListForRestart; + bool EmergencyAreaIDListForRestart_present; +} LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pwsrestartindication( - LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pwsrestartindication(LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT* ie); /******************************************************************************* /* Protocol Message DownlinkUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; - LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; -}LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; + LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; +} LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinkueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinkueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_downlinkueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_downlinkueassociatedlppatransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message UplinkUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; - LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; -}LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; + LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; +} LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinkueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinkueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uplinkueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uplinkueassociatedlppatransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message DownlinkNonUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; - LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; -}LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; + LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; +} LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT; LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *ie, - uint8_t **ptr); + LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message UplinkNonUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; - LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; -}LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_ROUTING_ID_STRUCT Routing_ID; + LIBLTE_S1AP_LPPA_PDU_STRUCT LPPa_PDU; +} LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknonueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *ie, - uint8_t **ptr); +LIBLTE_ERROR_ENUM + liblte_s1ap_pack_uplinknonueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie, + uint8_t** ptr); LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *ie); + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* ie); /******************************************************************************* /* Protocol Message ENBDirectInformationTransfer STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT Inter_SystemInformationTransferTypeEDT; -}LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT Inter_SystemInformationTransferTypeEDT; +} LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbdirectinformationtransfer( - LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbdirectinformationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbdirectinformationtransfer(LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbdirectinformationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABDataForwardingItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT E_RABDataForwardingItem; -}LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT E_RABDataForwardingItem; +} LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem(LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemHOReq STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT E_RABToBeSetupItemHOReq; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT E_RABToBeSetupItemHOReq; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABAdmittedItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT E_RABAdmittedItem; -}LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT E_RABAdmittedItem; +} LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem(LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABFailedtoSetupItemHOReqAck STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT E_RABFailedtoSetupItemHOReqAck; -}LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT E_RABFailedtoSetupItemHOReqAck; +} LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSwitchedDLItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT E_RABToBeSwitchedDLItem; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT E_RABToBeSwitchedDLItem; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSwitchedULItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT E_RABToBeSwitchedULItem; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT E_RABToBeSwitchedULItem; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemBearerSUReq STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT E_RABToBeSetupItemBearerSUReq; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT E_RABToBeSetupItemBearerSUReq; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitembearersureq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitembearersureq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupItemBearerSURes STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT E_RABSetupItemBearerSURes; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT E_RABSetupItemBearerSURes; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitembearersures(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeModifiedItemBearerModReq STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT E_RABToBeModifiedItemBearerModReq; -}LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT E_RABToBeModifiedItemBearerModReq; +} LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABModifyItemBearerModRes STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT E_RABModifyItemBearerModRes; -}LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT E_RABModifyItemBearerModRes; +} LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabmodifyitembearermodres(LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabmodifyitembearermodres(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABReleaseItemBearerRelComp STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT E_RABReleaseItemBearerRelComp; -}LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT E_RABReleaseItemBearerRelComp; +} LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABToBeSetupItemCtxtSUReq STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT E_RABToBeSetupItemCtxtSUReq; -}LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT E_RABToBeSetupItemCtxtSUReq; +} LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupItemCtxtSURes STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT E_RABSetupItemCtxtSURes; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT E_RABSetupItemCtxtSURes; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT* ie); /******************************************************************************* /* Protocol Message TAIItem STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_TAIITEM_STRUCT TAIItem; -}LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_TAIITEM_STRUCT TAIItem; +} LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( - LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem(LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT* ie); /******************************************************************************* /* Protocol Message ResetAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT UE_associatedLogicalS1_ConnectionListResAck; - bool UE_associatedLogicalS1_ConnectionListResAck_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT; + bool UE_associatedLogicalS1_ConnectionListResAck_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge( - LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge(LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Protocol Message Reset STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_RESETTYPE_STRUCT ResetType; -}LIBLTE_S1AP_MESSAGE_RESET_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_RESETTYPE_STRUCT ResetType; +} LIBLTE_S1AP_MESSAGE_RESET_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset( - LIBLTE_S1AP_MESSAGE_RESET_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RESET_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset(LIBLTE_S1AP_MESSAGE_RESET_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RESET_STRUCT* ie); /******************************************************************************* /* Protocol Message DownlinkS1cdma2000tunneling STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT E_RABSubjecttoDataForwardingList; - bool E_RABSubjecttoDataForwardingList_present; - LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT cdma2000HOStatus; - bool cdma2000HOStatus_present; - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT cdma2000RATType; - LIBLTE_S1AP_CDMA2000PDU_STRUCT cdma2000PDU; -}LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinks1cdma2000tunneling( - LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinks1cdma2000tunneling( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT E_RABSubjecttoDataForwardingList; + bool E_RABSubjecttoDataForwardingList_present; + LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT cdma2000HOStatus; + bool cdma2000HOStatus_present; + LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT cdma2000RATType; + LIBLTE_S1AP_CDMA2000PDU_STRUCT cdma2000PDU; +} LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_downlinks1cdma2000tunneling(LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_downlinks1cdma2000tunneling(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverCommand STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; - LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT NASSecurityParametersfromE_UTRAN; - bool NASSecurityParametersfromE_UTRAN_present; - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT E_RABSubjecttoDataForwardingList; - bool E_RABSubjecttoDataForwardingList_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABtoReleaseListHOCmd; - bool E_RABtoReleaseListHOCmd_present; - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer; - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer_Secondary; - bool Target_ToSource_TransparentContainer_Secondary_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( - LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; + LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT NASSecurityParametersfromE_UTRAN; + bool NASSecurityParametersfromE_UTRAN_present; + LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT E_RABSubjecttoDataForwardingList; + bool E_RABSubjecttoDataForwardingList_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABtoReleaseListHOCmd; + bool E_RABtoReleaseListHOCmd_present; + LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer; + LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer_Secondary; + bool Target_ToSource_TransparentContainer_Secondary_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand(LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; - LIBLTE_S1AP_CAUSE_STRUCT Cause; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT E_RABToBeSetupListHOReq; - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer; - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; - bool HandoverRestrictionList_present; - LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; - bool TraceActivation_present; - LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; - bool RequestType_present; - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT SRVCCOperationPossible; - bool SRVCCOperationPossible_present; - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT SecurityContext; - LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT NASSecurityParameterstoE_UTRAN; - bool NASSecurityParameterstoE_UTRAN_present; - LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; - bool CSG_Id_present; - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; - bool CSGMembershipStatus_present; - LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; - bool GUMMEI_ID_present; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; - bool MME_UE_S1AP_ID_2_present; - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT ManagementBasedMDTAllowed; - bool ManagementBasedMDTAllowed_present; - LIBLTE_S1AP_MDTPLMNLIST_STRUCT ManagementBasedMDTPLMNList; - bool ManagementBasedMDTPLMNList_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT HandoverType; + LIBLTE_S1AP_CAUSE_STRUCT Cause; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT E_RABToBeSetupListHOReq; + LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT Source_ToTarget_TransparentContainer; + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; + LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; + bool HandoverRestrictionList_present; + LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; + bool TraceActivation_present; + LIBLTE_S1AP_REQUESTTYPE_STRUCT RequestType; + bool RequestType_present; + LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT SRVCCOperationPossible; + bool SRVCCOperationPossible_present; + LIBLTE_S1AP_SECURITYCONTEXT_STRUCT SecurityContext; + LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT NASSecurityParameterstoE_UTRAN; + bool NASSecurityParameterstoE_UTRAN_present; + LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; + bool CSG_Id_present; + LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; + bool CSGMembershipStatus_present; + LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; + bool GUMMEI_ID_present; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; + bool MME_UE_S1AP_ID_2_present; + LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT ManagementBasedMDTAllowed; + bool ManagementBasedMDTAllowed_present; + LIBLTE_S1AP_MDTPLMNLIST_STRUCT ManagementBasedMDTPLMNList; + bool ManagementBasedMDTPLMNList_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest(LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message PathSwitchRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT E_RABToBeSwitchedDLList; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT SourceMME_UE_S1AP_ID; - LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; - LIBLTE_S1AP_TAI_STRUCT TAI; - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; - LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; - bool CSG_Id_present; - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; - bool CellAccessMode_present; - LIBLTE_S1AP_GUMMEI_STRUCT SourceMME_GUMMEI; - bool SourceMME_GUMMEI_present; - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; - bool CSGMembershipStatus_present; - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; - bool Tunnel_Information_for_BBF_present; - LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; - bool LHN_ID_present; -}LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT E_RABToBeSwitchedDLList; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT SourceMME_UE_S1AP_ID; + LIBLTE_S1AP_EUTRAN_CGI_STRUCT EUTRAN_CGI; + LIBLTE_S1AP_TAI_STRUCT TAI; + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; + LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; + bool CSG_Id_present; + LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; + bool CellAccessMode_present; + LIBLTE_S1AP_GUMMEI_STRUCT SourceMME_GUMMEI; + bool SourceMME_GUMMEI_present; + LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; + bool CSGMembershipStatus_present; + LIBLTE_S1AP_TUNNELINFORMATION_STRUCT Tunnel_Information_for_BBF; + bool Tunnel_Information_for_BBF_present; + LIBLTE_S1AP_LHN_ID_STRUCT LHN_ID; + bool LHN_ID_present; +} LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message PathSwitchRequestAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - bool uEaggregateMaximumBitrate_present; - LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT E_RABToBeSwitchedULList; - bool E_RABToBeSwitchedULList_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABToBeReleasedList; - bool E_RABToBeReleasedList_present; - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT SecurityContext; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; - bool MME_UE_S1AP_ID_2_present; - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; - bool CSGMembershipStatus_present; -}LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + bool uEaggregateMaximumBitrate_present; + LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT E_RABToBeSwitchedULList; + bool E_RABToBeSwitchedULList_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABToBeReleasedList; + bool E_RABToBeReleasedList_present; + LIBLTE_S1AP_SECURITYCONTEXT_STRUCT SecurityContext; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; + bool MME_UE_S1AP_ID_2_present; + LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; + bool CSGMembershipStatus_present; +} LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_pathswitchrequestacknowledge(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_pathswitchrequestacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - bool uEaggregateMaximumBitrate_present; - LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT E_RABToBeSetupListBearerSUReq; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + bool uEaggregateMaximumBitrate_present; + LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT E_RABToBeSetupListBearerSUReq; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest( - LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest(LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABSetupResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT E_RABSetupListBearerSURes; - bool E_RABSetupListBearerSURes_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToSetupListBearerSURes; - bool E_RABFailedToSetupListBearerSURes_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse( - LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT E_RABSetupListBearerSURes; + bool E_RABSetupListBearerSURes_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToSetupListBearerSURes; + bool E_RABFailedToSetupListBearerSURes_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse(LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABModifyRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - bool uEaggregateMaximumBitrate_present; - LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT E_RABToBeModifiedListBearerModReq; -}LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT; +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + bool uEaggregateMaximumBitrate_present; + LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT E_RABToBeModifiedListBearerModReq; +} LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT; -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT *ie); +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest(LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABModifyResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT E_RABModifyListBearerModRes; - bool E_RABModifyListBearerModRes_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToModifyList; - bool E_RABFailedToModifyList_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT E_RABModifyListBearerModRes; + bool E_RABModifyListBearerModRes_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToModifyList; + bool E_RABFailedToModifyList_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse(LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message E_RABReleaseResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT E_RABReleaseListBearerRelComp; - bool E_RABReleaseListBearerRelComp_present; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToReleaseList; - bool E_RABFailedToReleaseList_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; - bool UserLocationInformation_present; -}LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( - LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT E_RABReleaseListBearerRelComp; + bool E_RABReleaseListBearerRelComp_present; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToReleaseList; + bool E_RABFailedToReleaseList_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; + LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT UserLocationInformation; + bool UserLocationInformation_present; +} LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse(LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message InitialContextSetupRequest STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; - LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT E_RABToBeSetupListCtxtSUReq; - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; - LIBLTE_S1AP_SECURITYKEY_STRUCT SecurityKey; - LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; - bool TraceActivation_present; - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; - bool HandoverRestrictionList_present; - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; - bool UERadioCapability_present; - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; - bool SubscriberProfileIDforRFP_present; - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT CSFallbackIndicator; - bool CSFallbackIndicator_present; - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT SRVCCOperationPossible; - bool SRVCCOperationPossible_present; - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; - bool CSGMembershipStatus_present; - LIBLTE_S1AP_LAI_STRUCT RegisteredLAI; - bool RegisteredLAI_present; - LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; - bool GUMMEI_ID_present; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; - bool MME_UE_S1AP_ID_2_present; - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT ManagementBasedMDTAllowed; - bool ManagementBasedMDTAllowed_present; - LIBLTE_S1AP_MDTPLMNLIST_STRUCT ManagementBasedMDTPLMNList; - bool ManagementBasedMDTPLMNList_present; - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT AdditionalCSFallbackIndicator; - bool AdditionalCSFallbackIndicator_present; -}LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT uEaggregateMaximumBitrate; + LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT E_RABToBeSetupListCtxtSUReq; + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT UESecurityCapabilities; + LIBLTE_S1AP_SECURITYKEY_STRUCT SecurityKey; + LIBLTE_S1AP_TRACEACTIVATION_STRUCT TraceActivation; + bool TraceActivation_present; + LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT HandoverRestrictionList; + bool HandoverRestrictionList_present; + LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT UERadioCapability; + bool UERadioCapability_present; + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT SubscriberProfileIDforRFP; + bool SubscriberProfileIDforRFP_present; + LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT CSFallbackIndicator; + bool CSFallbackIndicator_present; + LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT SRVCCOperationPossible; + bool SRVCCOperationPossible_present; + LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM CSGMembershipStatus; + bool CSGMembershipStatus_present; + LIBLTE_S1AP_LAI_STRUCT RegisteredLAI; + bool RegisteredLAI_present; + LIBLTE_S1AP_GUMMEI_STRUCT GUMMEI_ID; + bool GUMMEI_ID_present; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID_2; + bool MME_UE_S1AP_ID_2_present; + LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT ManagementBasedMDTAllowed; + bool ManagementBasedMDTAllowed_present; + LIBLTE_S1AP_MDTPLMNLIST_STRUCT ManagementBasedMDTPLMNList; + bool ManagementBasedMDTPLMNList_present; + LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT AdditionalCSFallbackIndicator; + bool AdditionalCSFallbackIndicator_present; +} LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT* ie); /******************************************************************************* /* Protocol Message InitialContextSetupResponse STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT E_RABSetupListCtxtSURes; - LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToSetupListCtxtSURes; - bool E_RABFailedToSetupListCtxtSURes_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; -}LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupresponse( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT E_RABSetupListCtxtSURes; + LIBLTE_S1AP_E_RABLIST_STRUCT E_RABFailedToSetupListCtxtSURes; + bool E_RABFailedToSetupListCtxtSURes_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; +} LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT; + +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_initialcontextsetupresponse(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetupresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT* ie); /******************************************************************************* /* Protocol Message Paging STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT UEIdentityIndexValue; - LIBLTE_S1AP_UEPAGINGID_STRUCT UEPagingID; - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT pagingDRX; - bool pagingDRX_present; - LIBLTE_S1AP_CNDOMAIN_ENUM CNDomain; - LIBLTE_S1AP_TAILIST_STRUCT TAIList; - LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; - bool CSG_IdList_present; - LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT PagingPriority; - bool PagingPriority_present; -}LIBLTE_S1AP_MESSAGE_PAGING_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging( - LIBLTE_S1AP_MESSAGE_PAGING_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PAGING_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT UEIdentityIndexValue; + LIBLTE_S1AP_UEPAGINGID_STRUCT UEPagingID; + LIBLTE_S1AP_PAGINGDRX_ENUM_EXT pagingDRX; + bool pagingDRX_present; + LIBLTE_S1AP_CNDOMAIN_ENUM CNDomain; + LIBLTE_S1AP_TAILIST_STRUCT TAIList; + LIBLTE_S1AP_CSG_IDLIST_STRUCT CSG_IdList; + bool CSG_IdList_present; + LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT PagingPriority; + bool PagingPriority_present; +} LIBLTE_S1AP_MESSAGE_PAGING_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging(LIBLTE_S1AP_MESSAGE_PAGING_STRUCT* ie, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PAGING_STRUCT* ie); /******************************************************************************* /* Protocol Message HandoverRequestAcknowledge STRUCT ********************************************************************************/ -typedef struct{ - bool ext; - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; - LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT E_RABAdmittedList; - LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT E_RABFailedToSetupListHOReqAck; - bool E_RABFailedToSetupListHOReqAck_present; - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer; - LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; - bool CSG_Id_present; - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; - bool CriticalityDiagnostics_present; - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; - bool CellAccessMode_present; -}LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT *ie, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequestacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT *ie); +typedef struct { + bool ext; + LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT MME_UE_S1AP_ID; + LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT eNB_UE_S1AP_ID; + LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT E_RABAdmittedList; + LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT E_RABFailedToSetupListHOReqAck; + bool E_RABFailedToSetupListHOReqAck_present; + LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT Target_ToSource_TransparentContainer; + LIBLTE_S1AP_CSG_ID_STRUCT CSG_Id; + bool CSG_Id_present; + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT CriticalityDiagnostics; + bool CriticalityDiagnostics_present; + LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT CellAccessMode; + bool CellAccessMode_present; +} LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge(LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT* ie, + uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverrequestacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT* ie); /******************************************************************************* /* Procedure code criticality lookups ********************************************************************************/ static const LIBLTE_S1AP_CRITICALITY_ENUM liblte_s1ap_procedure_criticality[50] = { - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - LIBLTE_S1AP_CRITICALITY_REJECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, LIBLTE_S1AP_CRITICALITY_IGNORE, + LIBLTE_S1AP_CRITICALITY_REJECT, LIBLTE_S1AP_CRITICALITY_IGNORE, }; /******************************************************************************* /* ProtocolIE-Field ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_header( - uint32_t len, - uint32_t ie_id, - LIBLTE_S1AP_CRITICALITY_ENUM crit, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_header( - uint8_t **ptr, - uint32_t *ie_id, - LIBLTE_S1AP_CRITICALITY_ENUM *crit, - uint32_t *len); +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_protocolie_header(uint32_t len, uint32_t ie_id, LIBLTE_S1AP_CRITICALITY_ENUM crit, uint8_t** ptr); +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_protocolie_header(uint8_t** ptr, uint32_t* ie_id, LIBLTE_S1AP_CRITICALITY_ENUM* crit, uint32_t* len); /******************************************************************************* /* InitiatingMessage CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGCONTROL, LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKS1CDMA2000TUNNELING, LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_S1SETUPREQUEST, @@ -10086,131 +8605,127 @@ typedef enum{ LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBSTATUSTRANSFER, LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ERRORINDICATION, LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_N_ITEMS, -}LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENUM; +} LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENUM; static const char liblte_s1ap_initiatingmessage_choice_text[LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_N_ITEMS][50] = { - "LocationReportingControl", - "DownlinkS1cdma2000tunneling", - "S1SetupRequest", - "UECapabilityInfoIndication", - "LocationReport", - "UplinkNonUEAssociatedLPPaTransport", - "UplinkS1cdma2000tunneling", - "MMEConfigurationTransfer", - "TraceStart", - "HandoverCancel", - "UERadioCapabilityMatchRequest", - "DownlinkNASTransport", - "InitialContextSetupRequest", - "HandoverRequired", - "MMEDirectInformationTransfer", - "TraceFailureIndication", - "MMEConfigurationUpdate", - "WriteReplaceWarningRequest", - "ENBDirectInformationTransfer", - "DownlinkUEAssociatedLPPaTransport", - "E-RABReleaseCommand", - "NASNonDeliveryIndication", - "ENBConfigurationUpdate", - "UplinkUEAssociatedLPPaTransport", - "InitialUEMessage", - "E-RABModifyRequest", - "UEContextModificationRequest", - "E-RABSetupRequest", - "Reset", - "OverloadStart", - "E-RABReleaseIndication", - "LocationReportingFailureIndication", - "DeactivateTrace", - "PathSwitchRequest", - "HandoverRequest", - "DownlinkNonUEAssociatedLPPaTransport", - "OverloadStop", - "Paging", - "HandoverNotify", - "PWSRestartIndication", - "UEContextReleaseRequest", - "UplinkNASTransport", - "ENBConfigurationTransfer", - "MMEStatusTransfer", - "CellTrafficTrace", - "UEContextReleaseCommand", - "KillRequest", - "PrivateMessage", - "ENBStatusTransfer", - "ErrorIndication", + "LocationReportingControl", + "DownlinkS1cdma2000tunneling", + "S1SetupRequest", + "UECapabilityInfoIndication", + "LocationReport", + "UplinkNonUEAssociatedLPPaTransport", + "UplinkS1cdma2000tunneling", + "MMEConfigurationTransfer", + "TraceStart", + "HandoverCancel", + "UERadioCapabilityMatchRequest", + "DownlinkNASTransport", + "InitialContextSetupRequest", + "HandoverRequired", + "MMEDirectInformationTransfer", + "TraceFailureIndication", + "MMEConfigurationUpdate", + "WriteReplaceWarningRequest", + "ENBDirectInformationTransfer", + "DownlinkUEAssociatedLPPaTransport", + "E-RABReleaseCommand", + "NASNonDeliveryIndication", + "ENBConfigurationUpdate", + "UplinkUEAssociatedLPPaTransport", + "InitialUEMessage", + "E-RABModifyRequest", + "UEContextModificationRequest", + "E-RABSetupRequest", + "Reset", + "OverloadStart", + "E-RABReleaseIndication", + "LocationReportingFailureIndication", + "DeactivateTrace", + "PathSwitchRequest", + "HandoverRequest", + "DownlinkNonUEAssociatedLPPaTransport", + "OverloadStop", + "Paging", + "HandoverNotify", + "PWSRestartIndication", + "UEContextReleaseRequest", + "UplinkNASTransport", + "ENBConfigurationTransfer", + "MMEStatusTransfer", + "CellTrafficTrace", + "UEContextReleaseCommand", + "KillRequest", + "PrivateMessage", + "ENBStatusTransfer", + "ErrorIndication", }; -typedef union{ - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT LocationReportingControl; - LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT DownlinkS1cdma2000tunneling; - LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT S1SetupRequest; - LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT UECapabilityInfoIndication; - LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT LocationReport; - LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT UplinkNonUEAssociatedLPPaTransport; - LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT UplinkS1cdma2000tunneling; - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT MMEConfigurationTransfer; - LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT TraceStart; - LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT HandoverCancel; - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT UERadioCapabilityMatchRequest; - LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT DownlinkNASTransport; - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT InitialContextSetupRequest; - LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT HandoverRequired; - LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT MMEDirectInformationTransfer; - LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT TraceFailureIndication; - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT MMEConfigurationUpdate; - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT WriteReplaceWarningRequest; - LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT ENBDirectInformationTransfer; - LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT DownlinkUEAssociatedLPPaTransport; - LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT E_RABReleaseCommand; - LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT NASNonDeliveryIndication; - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT ENBConfigurationUpdate; - LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT UplinkUEAssociatedLPPaTransport; - LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT InitialUEMessage; - LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT E_RABModifyRequest; - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT UEContextModificationRequest; - LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT E_RABSetupRequest; - LIBLTE_S1AP_MESSAGE_RESET_STRUCT Reset; - LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT OverloadStart; - LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT E_RABReleaseIndication; - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT LocationReportingFailureIndication; - LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT DeactivateTrace; - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT PathSwitchRequest; - LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT HandoverRequest; - LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT DownlinkNonUEAssociatedLPPaTransport; - LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT OverloadStop; - LIBLTE_S1AP_MESSAGE_PAGING_STRUCT Paging; - LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT HandoverNotify; - LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT PWSRestartIndication; - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT UEContextReleaseRequest; - LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT UplinkNASTransport; - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT ENBConfigurationTransfer; - LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT MMEStatusTransfer; - LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT CellTrafficTrace; - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT UEContextReleaseCommand; - LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT KillRequest; - LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT PrivateMessage; - LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT ENBStatusTransfer; - LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT ErrorIndication; -}LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UNION; - -typedef struct{ - uint8_t procedureCode; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UNION choice; - LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage( - LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage( - uint8_t **ptr, - LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg); +typedef union { + LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT LocationReportingControl; + LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT DownlinkS1cdma2000tunneling; + LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT S1SetupRequest; + LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT UECapabilityInfoIndication; + LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT LocationReport; + LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT UplinkNonUEAssociatedLPPaTransport; + LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT UplinkS1cdma2000tunneling; + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT MMEConfigurationTransfer; + LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT TraceStart; + LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT HandoverCancel; + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT UERadioCapabilityMatchRequest; + LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT DownlinkNASTransport; + LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT InitialContextSetupRequest; + LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT HandoverRequired; + LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT MMEDirectInformationTransfer; + LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT TraceFailureIndication; + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT MMEConfigurationUpdate; + LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT WriteReplaceWarningRequest; + LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT ENBDirectInformationTransfer; + LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT DownlinkUEAssociatedLPPaTransport; + LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT E_RABReleaseCommand; + LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT NASNonDeliveryIndication; + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT ENBConfigurationUpdate; + LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT UplinkUEAssociatedLPPaTransport; + LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT InitialUEMessage; + LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT E_RABModifyRequest; + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT UEContextModificationRequest; + LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT E_RABSetupRequest; + LIBLTE_S1AP_MESSAGE_RESET_STRUCT Reset; + LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT OverloadStart; + LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT E_RABReleaseIndication; + LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT LocationReportingFailureIndication; + LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT DeactivateTrace; + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT PathSwitchRequest; + LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT HandoverRequest; + LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT DownlinkNonUEAssociatedLPPaTransport; + LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT OverloadStop; + LIBLTE_S1AP_MESSAGE_PAGING_STRUCT Paging; + LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT HandoverNotify; + LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT PWSRestartIndication; + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT UEContextReleaseRequest; + LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT UplinkNASTransport; + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT ENBConfigurationTransfer; + LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT MMEStatusTransfer; + LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT CellTrafficTrace; + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT UEContextReleaseCommand; + LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT KillRequest; + LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT PrivateMessage; + LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT ENBStatusTransfer; + LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT ErrorIndication; +} LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UNION; + +typedef struct { + uint8_t procedureCode; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UNION choice; + LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENUM choice_type; +} LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage(LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage(uint8_t** ptr, LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT* msg); /******************************************************************************* /* UnsuccessfulOutcome CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_S1SETUPFAILURE, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTFAILURE, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONFAILURE, @@ -10220,47 +8735,43 @@ typedef enum{ LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERFAILURE, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEFAILURE, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_N_ITEMS, -}LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM; +} LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM; static const char liblte_s1ap_unsuccessfuloutcome_choice_text[LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_N_ITEMS][50] = { - "S1SetupFailure", - "PathSwitchRequestFailure", - "UEContextModificationFailure", - "InitialContextSetupFailure", - "ENBConfigurationUpdateFailure", - "HandoverPreparationFailure", - "HandoverFailure", - "MMEConfigurationUpdateFailure", + "S1SetupFailure", + "PathSwitchRequestFailure", + "UEContextModificationFailure", + "InitialContextSetupFailure", + "ENBConfigurationUpdateFailure", + "HandoverPreparationFailure", + "HandoverFailure", + "MMEConfigurationUpdateFailure", }; -typedef union{ - LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT S1SetupFailure; - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT PathSwitchRequestFailure; - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT UEContextModificationFailure; - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT InitialContextSetupFailure; - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT ENBConfigurationUpdateFailure; - LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT HandoverPreparationFailure; - LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT HandoverFailure; - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT MMEConfigurationUpdateFailure; -}LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UNION; - -typedef struct{ - uint8_t procedureCode; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UNION choice; - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome( - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome( - uint8_t **ptr, - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT *msg); +typedef union { + LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT S1SetupFailure; + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT PathSwitchRequestFailure; + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT UEContextModificationFailure; + LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT InitialContextSetupFailure; + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT ENBConfigurationUpdateFailure; + LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT HandoverPreparationFailure; + LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT HandoverFailure; + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT MMEConfigurationUpdateFailure; +} LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UNION; + +typedef struct { + uint8_t procedureCode; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UNION choice; + LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENUM choice_type; +} LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome(LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome(uint8_t** ptr, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT* msg); /******************************************************************************* /* SuccessfulOutcome CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERREQUESTACKNOWLEDGE, LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTRELEASECOMPLETE, LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UERADIOCAPABILITYMATCHRESPONSE, @@ -10279,92 +8790,84 @@ typedef enum{ LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCANCELACKNOWLEDGE, LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABRELEASERESPONSE, LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_N_ITEMS, -}LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENUM; +} LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENUM; static const char liblte_s1ap_successfuloutcome_choice_text[LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_N_ITEMS][50] = { - "HandoverRequestAcknowledge", - "UEContextReleaseComplete", - "UERadioCapabilityMatchResponse", - "InitialContextSetupResponse", - "E-RABSetupResponse", - "PathSwitchRequestAcknowledge", - "MMEConfigurationUpdateAcknowledge", - "ResetAcknowledge", - "ENBConfigurationUpdateAcknowledge", - "E-RABModifyResponse", - "WriteReplaceWarningResponse", - "S1SetupResponse", - "KillResponse", - "UEContextModificationResponse", - "HandoverCommand", - "HandoverCancelAcknowledge", - "E-RABReleaseResponse", + "HandoverRequestAcknowledge", + "UEContextReleaseComplete", + "UERadioCapabilityMatchResponse", + "InitialContextSetupResponse", + "E-RABSetupResponse", + "PathSwitchRequestAcknowledge", + "MMEConfigurationUpdateAcknowledge", + "ResetAcknowledge", + "ENBConfigurationUpdateAcknowledge", + "E-RABModifyResponse", + "WriteReplaceWarningResponse", + "S1SetupResponse", + "KillResponse", + "UEContextModificationResponse", + "HandoverCommand", + "HandoverCancelAcknowledge", + "E-RABReleaseResponse", }; -typedef union{ - LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT HandoverRequestAcknowledge; - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT UEContextReleaseComplete; - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT UERadioCapabilityMatchResponse; - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT InitialContextSetupResponse; - LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT E_RABSetupResponse; - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT PathSwitchRequestAcknowledge; - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT MMEConfigurationUpdateAcknowledge; - LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT ResetAcknowledge; - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT ENBConfigurationUpdateAcknowledge; - LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT E_RABModifyResponse; - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT WriteReplaceWarningResponse; - LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT S1SetupResponse; - LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT KillResponse; - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT UEContextModificationResponse; - LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT HandoverCommand; - LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT HandoverCancelAcknowledge; - LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT E_RABReleaseResponse; -}LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UNION; - -typedef struct{ - uint8_t procedureCode; - LIBLTE_S1AP_CRITICALITY_ENUM criticality; - LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UNION choice; - LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome( - LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_successfuloutcome( - uint8_t **ptr, - LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg); +typedef union { + LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT HandoverRequestAcknowledge; + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT UEContextReleaseComplete; + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT UERadioCapabilityMatchResponse; + LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT InitialContextSetupResponse; + LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT E_RABSetupResponse; + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT PathSwitchRequestAcknowledge; + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT MMEConfigurationUpdateAcknowledge; + LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT ResetAcknowledge; + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT ENBConfigurationUpdateAcknowledge; + LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT E_RABModifyResponse; + LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT WriteReplaceWarningResponse; + LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT S1SetupResponse; + LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT KillResponse; + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT UEContextModificationResponse; + LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT HandoverCommand; + LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT HandoverCancelAcknowledge; + LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT E_RABReleaseResponse; +} LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UNION; + +typedef struct { + uint8_t procedureCode; + LIBLTE_S1AP_CRITICALITY_ENUM criticality; + LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UNION choice; + LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENUM choice_type; +} LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome(LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_successfuloutcome(uint8_t** ptr, LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT* msg); /******************************************************************************* /* S1AP_PDU CHOICE ********************************************************************************/ -typedef enum{ +typedef enum { LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE, LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME, LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME, LIBLTE_S1AP_S1AP_PDU_CHOICE_N_ITEMS, -}LIBLTE_S1AP_S1AP_PDU_CHOICE_ENUM; +} LIBLTE_S1AP_S1AP_PDU_CHOICE_ENUM; static const char liblte_s1ap_s1ap_pdu_choice_text[LIBLTE_S1AP_S1AP_PDU_CHOICE_N_ITEMS][50] = { - "initiatingMessage", - "successfulOutcome", - "unsuccessfulOutcome", + "initiatingMessage", + "successfulOutcome", + "unsuccessfulOutcome", }; -typedef union{ - LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT initiatingMessage; - LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT successfulOutcome; - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT unsuccessfulOutcome; -}LIBLTE_S1AP_S1AP_PDU_CHOICE_UNION; +typedef union { + LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT initiatingMessage; + LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT successfulOutcome; + LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT unsuccessfulOutcome; +} LIBLTE_S1AP_S1AP_PDU_CHOICE_UNION; -typedef struct{ - bool ext; +typedef struct { + bool ext; LIBLTE_S1AP_S1AP_PDU_CHOICE_UNION choice; LIBLTE_S1AP_S1AP_PDU_CHOICE_ENUM choice_type; -}LIBLTE_S1AP_S1AP_PDU_STRUCT; - -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1ap_pdu( - LIBLTE_S1AP_S1AP_PDU_STRUCT *s1ap_pdu, - LIBLTE_BYTE_MSG_STRUCT *msg); -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1ap_pdu( - LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_S1AP_S1AP_PDU_STRUCT *s1ap_pdu); +} LIBLTE_S1AP_S1AP_PDU_STRUCT; + +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1ap_pdu(LIBLTE_S1AP_S1AP_PDU_STRUCT* s1ap_pdu, LIBLTE_BYTE_MSG_STRUCT* msg); +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1ap_pdu(LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_S1AP_S1AP_PDU_STRUCT* s1ap_pdu); #endif // SRSLTE_LIBLTE_S1AP_H diff --git a/lib/include/srslte/common/liblte_security.h b/lib/include/srslte/common/liblte_security.h index b82168696..5c5ba0794 100644 --- a/lib/include/srslte/common/liblte_security.h +++ b/lib/include/srslte/common/liblte_security.h @@ -42,12 +42,10 @@ DEFINES *******************************************************************************/ - /******************************************************************************* TYPEDEFS *******************************************************************************/ - /******************************************************************************* DECLARATIONS *******************************************************************************/ @@ -59,9 +57,7 @@ Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k, - uint8 *op, - uint8 *op_c); +LIBLTE_ERROR_ENUM liblte_compute_opc(uint8* k, uint8* op, uint8* op_c); /********************************************************************* Name: liblte_security_generate_k_asme @@ -74,13 +70,8 @@ LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck, - uint8 *ik, - uint8 *ak, - uint8 *sqn, - uint16 mcc, - uint16 mnc, - uint8 *k_asme); +LIBLTE_ERROR_ENUM +liblte_security_generate_k_asme(uint8* ck, uint8* ik, uint8* ak, uint8* sqn, uint16 mcc, uint16 mnc, uint8* k_asme); /********************************************************************* Name: liblte_security_generate_k_enb @@ -93,18 +84,11 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8 *k_asme, - uint32 nas_count, - uint8 *k_enb); +LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8* k_asme, uint32 nas_count, uint8* k_enb); -LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8 *k_enb, - uint32 pci, - uint32_t earfcn, - uint8 *k_enb_star); +LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8* k_enb, uint32 pci, uint32_t earfcn, uint8* k_enb_star); -LIBLTE_ERROR_ENUM liblte_security_generate_nh( uint8_t *k_asme, - uint8_t *sync, - uint8_t *nh); +LIBLTE_ERROR_ENUM liblte_security_generate_nh(uint8_t* k_asme, uint8_t* sync, uint8_t* nh); /********************************************************************* Name: liblte_security_generate_k_nas @@ -115,33 +99,29 @@ LIBLTE_ERROR_ENUM liblte_security_generate_nh( uint8_t *k_asme, *********************************************************************/ // Defines // Enums -typedef enum{ - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_EEA0 = 0, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA1, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS, -}LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM; -static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = {"EEA0", - "128-EEA1", - "128-EEA2"}; -typedef enum{ - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS, -}LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM; -static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = {"EIA0", - "128-EIA1", - "128-EIA2"}; +typedef enum { + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_EEA0 = 0, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA1, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_128_EEA2, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS, +} LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM; +static const char liblte_security_ciphering_algorithm_id_text[LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_N_ITEMS][20] = { + "EEA0", "128-EEA1", "128-EEA2"}; +typedef enum { + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_EIA0 = 0, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA1, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS, +} LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM; +static const char liblte_security_integrity_algorithm_id_text[LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_N_ITEMS][20] = { + "EIA0", "128-EIA1", "128-EIA2"}; // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8 *k_asme, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_nas_enc, - uint8 *k_nas_int); - - +LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_nas_enc, + uint8* k_nas_int); /********************************************************************* Name: liblte_security_generate_k_rrc @@ -154,11 +134,11 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8 *k_enb, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_rrc_enc, - uint8 *k_rrc_int); +LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8* k_enb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_rrc_enc, + uint8* k_rrc_int); /********************************************************************* Name: liblte_security_generate_k_up @@ -172,11 +152,11 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8 *k_enb, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_up_enc, - uint8 *k_up_int); +LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8* k_enb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_up_enc, + uint8* k_up_int); /********************************************************************* Name: liblte_security_128_eia2 @@ -188,24 +168,15 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8 RFC4493 *********************************************************************/ // Defines -#define LIBLTE_SECURITY_DIRECTION_UPLINK 0 +#define LIBLTE_SECURITY_DIRECTION_UPLINK 0 #define LIBLTE_SECURITY_DIRECTION_DOWNLINK 1 // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *mac); -LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - LIBLTE_BIT_MSG_STRUCT *msg, - uint8 *mac); +LIBLTE_ERROR_ENUM liblte_security_128_eia2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* mac); +LIBLTE_ERROR_ENUM liblte_security_128_eia2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, LIBLTE_BIT_MSG_STRUCT* msg, uint8* mac); /********************************************************************* Name: liblte_security_encryption_eea1 @@ -217,13 +188,8 @@ LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D1 v2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *out); +LIBLTE_ERROR_ENUM liblte_security_encryption_eea1( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out); /********************************************************************* Name: liblte_security_decryption_eea1 @@ -235,13 +201,8 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key, Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D1 v2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *ct, - uint32 ct_len, - uint8 *out); +LIBLTE_ERROR_ENUM liblte_security_decryption_eea1( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out); /********************************************************************* Name: liblte_security_encryption_eea2 @@ -250,13 +211,8 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key, Document Reference: 33.401 v13.1.0 Annex B.1.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *out); +LIBLTE_ERROR_ENUM liblte_security_encryption_eea2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out); /********************************************************************* Name: liblte_security_decryption_eea2 @@ -265,14 +221,8 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key, Document Reference: 33.401 v13.1.0 Annex B.1.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *ct, - uint32 ct_len, - uint8 *out); - +LIBLTE_ERROR_ENUM liblte_security_decryption_eea2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out); /********************************************************************* Name: liblte_security_milenage_f1 @@ -288,12 +238,7 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k, - uint8 *op, - uint8 *rand, - uint8 *sqn, - uint8 *amf, - uint8 *mac_a); +LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8* k, uint8* op, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_a); /********************************************************************* Name: liblte_security_milenage_f1_star @@ -309,12 +254,8 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k, - uint8 *op, - uint8 *rand, - uint8 *sqn, - uint8 *amf, - uint8 *mac_s); +LIBLTE_ERROR_ENUM +liblte_security_milenage_f1_star(uint8* k, uint8* op, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_s); /********************************************************************* Name: liblte_security_milenage_f2345 @@ -330,13 +271,8 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k, - uint8 *op, - uint8 *rand, - uint8 *res, - uint8 *ck, - uint8 *ik, - uint8 *ak); +LIBLTE_ERROR_ENUM +liblte_security_milenage_f2345(uint8* k, uint8* op, uint8* rand, uint8* res, uint8* ck, uint8* ik, uint8* ak); /********************************************************************* Name: liblte_security_milenage_f5_star @@ -351,9 +287,6 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k, // Enums // Structs // Functions -LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8 *k, - uint8 *op, - uint8 *rand, - uint8 *ak); +LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8* k, uint8* op, uint8* rand, uint8* ak); #endif // SRSLTE_LIBLTE_SECURITY_H diff --git a/lib/include/srslte/common/liblte_ssl.h b/lib/include/srslte/common/liblte_ssl.h index a28e25bcd..6ea0b751e 100644 --- a/lib/include/srslte/common/liblte_ssl.h +++ b/lib/include/srslte/common/liblte_ssl.h @@ -24,12 +24,15 @@ #ifdef HAVE_POLARSSL -#include "polarssl/sha256.h" #include "polarssl/aes.h" +#include "polarssl/sha256.h" -void sha256(const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char output[32], int is224 ) +void sha256(const unsigned char* key, + size_t keylen, + const unsigned char* input, + size_t ilen, + unsigned char output[32], + int is224) { sha256_hmac(key, keylen, input, ilen, output, is224); } @@ -38,47 +41,43 @@ void sha256(const unsigned char *key, size_t keylen, #ifdef HAVE_MBEDTLS -#include "mbedtls/md.h" #include "mbedtls/aes.h" +#include "mbedtls/md.h" typedef mbedtls_aes_context aes_context; -#define AES_ENCRYPT 1 -#define AES_DECRYPT 0 +#define AES_ENCRYPT 1 +#define AES_DECRYPT 0 -int aes_setkey_enc( aes_context *ctx, const unsigned char *key, unsigned int keysize ) +int aes_setkey_enc(aes_context* ctx, const unsigned char* key, unsigned int keysize) { return mbedtls_aes_setkey_enc(ctx, key, keysize); } -int aes_crypt_ecb( aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ) +int aes_crypt_ecb(aes_context* ctx, int mode, const unsigned char input[16], unsigned char output[16]) { return mbedtls_aes_crypt_ecb(ctx, mode, input, output); } -int aes_crypt_ctr(aes_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ) +int aes_crypt_ctr(aes_context* ctx, + size_t length, + size_t* nc_off, + unsigned char nonce_counter[16], + unsigned char stream_block[16], + const unsigned char* input, + unsigned char* output) { - return mbedtls_aes_crypt_ctr(ctx, length, nc_off, nonce_counter, - stream_block, input, output); + return mbedtls_aes_crypt_ctr(ctx, length, nc_off, nonce_counter, stream_block, input, output); } -void sha256(const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char output[32], int is224 ) +void sha256(const unsigned char* key, + size_t keylen, + const unsigned char* input, + size_t ilen, + unsigned char output[32], + int is224) { - mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), - key, keylen, - input, ilen, - output ); + mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), key, keylen, input, ilen, output); } #endif // HAVE_MBEDTLS diff --git a/lib/src/asn1/liblte_common.cc b/lib/src/asn1/liblte_common.cc index 0e618bf35..ac3794a72 100644 --- a/lib/src/asn1/liblte_common.cc +++ b/lib/src/asn1/liblte_common.cc @@ -39,17 +39,14 @@ DEFINES *******************************************************************************/ - /******************************************************************************* TYPEDEFS *******************************************************************************/ - /******************************************************************************* GLOBAL VARIABLES *******************************************************************************/ - /******************************************************************************* FUNCTIONS *******************************************************************************/ @@ -59,17 +56,14 @@ Description: Converts a value to a bit string *********************************************************************/ -void liblte_value_2_bits(uint32 value, - uint8 **bits, - uint32 N_bits) +void liblte_value_2_bits(uint32 value, uint8** bits, uint32 N_bits) { - uint32 i; + uint32 i; - for(i=0; i> (N_bits-i-1)) & 0x1; - } - *bits += N_bits; + for (i = 0; i < N_bits; i++) { + (*bits)[i] = (value >> (N_bits - i - 1)) & 0x1; + } + *bits += N_bits; } /********************************************************************* @@ -77,19 +71,17 @@ void liblte_value_2_bits(uint32 value, Description: Converts a bit string to a value *********************************************************************/ -uint32 liblte_bits_2_value(uint8 **bits, - uint32 N_bits) +uint32 liblte_bits_2_value(uint8** bits, uint32 N_bits) { - uint32 value = 0; - uint32 i; + uint32 value = 0; + uint32 i; - for(i=0; imsg; - uint32_t i; - - for(i=0; iN_bits/8; i++) - { - bytes->msg[i] = liblte_bits_2_value(&bit_ptr, 8); - } - bytes->N_bytes = bits->N_bits/8; - if(bits->N_bits%8 > 0) - { - bytes->msg[bytes->N_bytes] = liblte_bits_2_value(&bit_ptr, bits->N_bits%8); - bytes->N_bytes++; - } + uint8_t* bit_ptr = bits->msg; + uint32_t i; + + for (i = 0; i < bits->N_bits / 8; i++) { + bytes->msg[i] = liblte_bits_2_value(&bit_ptr, 8); + } + bytes->N_bytes = bits->N_bits / 8; + if (bits->N_bits % 8 > 0) { + bytes->msg[bytes->N_bytes] = liblte_bits_2_value(&bit_ptr, bits->N_bits % 8); + bytes->N_bytes++; + } } /********************************************************************* @@ -120,17 +109,15 @@ void liblte_pack(LIBLTE_BIT_MSG_STRUCT *bits, Description: Unpack a byte array into a bit array *********************************************************************/ -void liblte_unpack(LIBLTE_BYTE_MSG_STRUCT *bytes, - LIBLTE_BIT_MSG_STRUCT *bits) +void liblte_unpack(LIBLTE_BYTE_MSG_STRUCT* bytes, LIBLTE_BIT_MSG_STRUCT* bits) { - uint8_t *bit_ptr = bits->msg; - uint32_t i; - - for(i=0; iN_bytes; i++) - { - liblte_value_2_bits(bytes->msg[i], &bit_ptr, 8); - } - bits->N_bits = bytes->N_bytes*8; + uint8_t* bit_ptr = bits->msg; + uint32_t i; + + for (i = 0; i < bytes->N_bytes; i++) { + liblte_value_2_bits(bytes->msg[i], &bit_ptr, 8); + } + bits->N_bits = bytes->N_bytes * 8; } /********************************************************************* @@ -138,19 +125,17 @@ void liblte_unpack(LIBLTE_BYTE_MSG_STRUCT *bytes, Description: Pack a bit array into a byte array *********************************************************************/ -void liblte_pack(uint8_t *bits, uint32_t n_bits, uint8_t *bytes) +void liblte_pack(uint8_t* bits, uint32_t n_bits, uint8_t* bytes) { - uint8_t* bit_ptr = bits; - uint32_t i; - - for(i=0; i 0) - { - bytes[n_bits/8] = liblte_bits_2_value(&bit_ptr, n_bits%8); - } + uint8_t* bit_ptr = bits; + uint32_t i; + + for (i = 0; i < n_bits / 8; i++) { + bytes[i] = liblte_bits_2_value(&bit_ptr, 8); + } + if (n_bits % 8 > 0) { + bytes[n_bits / 8] = liblte_bits_2_value(&bit_ptr, n_bits % 8); + } } /********************************************************************* @@ -158,15 +143,14 @@ void liblte_pack(uint8_t *bits, uint32_t n_bits, uint8_t *bytes) Description: Unpack a byte array into a bit array *********************************************************************/ -void liblte_unpack(uint8_t *bytes, uint32_t n_bytes, uint8_t *bits) +void liblte_unpack(uint8_t* bytes, uint32_t n_bytes, uint8_t* bits) { - uint8_t *bit_ptr = bits; - uint32_t i; + uint8_t* bit_ptr = bits; + uint32_t i; - for(i=0; i 0) - { + while ((uint64_t)(*ptr) % align > 0) { (*ptr)++; } } @@ -188,10 +171,9 @@ void liblte_align_up(uint8_t **ptr, uint32_t align) Description: Aligns a pointer to a multibyte boundary and zeros bytes skipped *********************************************************************/ -void liblte_align_up_zero(uint8_t **ptr, uint32_t align) +void liblte_align_up_zero(uint8_t** ptr, uint32_t align) { - while( (uint64_t)(*ptr) % align > 0) - { + while ((uint64_t)(*ptr) % align > 0) { **ptr = 0; (*ptr)++; } diff --git a/lib/src/asn1/liblte_m2ap.cc b/lib/src/asn1/liblte_m2ap.cc index 74c250c80..d7f819066 100644 --- a/lib/src/asn1/liblte_m2ap.cc +++ b/lib/src/asn1/liblte_m2ap.cc @@ -19,27 +19,29 @@ * */ #include "srslte/asn1/liblte_m2ap.h" -#include #include +#include /******************************************************************************* LOGGING *******************************************************************************/ static log_handler_t log_handler; -static void *callback_ctx = NULL; +static void* callback_ctx = NULL; -void liblte_log_register_handler(void *ctx, log_handler_t handler) { +void liblte_log_register_handler(void* ctx, log_handler_t handler) +{ log_handler = handler; callback_ctx = ctx; } -static void liblte_log_print(const char *format, ...) { - va_list args; +static void liblte_log_print(const char* format, ...) +{ + va_list args; va_start(args, format); if (log_handler) { - char *args_msg = NULL; - if(vasprintf(&args_msg, format, args) > 0) { + char* args_msg = NULL; + if (vasprintf(&args_msg, format, args) > 0) { log_handler(callback_ctx, args_msg); } if (args_msg) { @@ -88,21 +90,18 @@ LIBLTE_M2AP_CRITICALITY_ENUM liblte_m2ap_procedure_criticality(uint8_t procedure /******************************************************************************* * ProtocolIE-Field *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_header( - uint32_t len, - uint32_t ie_id, - LIBLTE_M2AP_CRITICALITY_ENUM crit, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_protocolie_header(uint32_t len, uint32_t ie_id, LIBLTE_M2AP_CRITICALITY_ENUM crit, uint8_t** ptr) { liblte_value_2_bits(ie_id, ptr, 16); // ProtocolIE-ID - liblte_value_2_bits(crit, ptr, 2); // Criticality + liblte_value_2_bits(crit, ptr, 2); // Criticality liblte_align_up_zero(ptr, 8); - if(len < 128) { // Length - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { // Length + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -111,19 +110,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_header( return LIBLTE_SUCCESS; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_header( - uint8_t **ptr, - uint32_t *ie_id, - LIBLTE_M2AP_CRITICALITY_ENUM *crit, - uint32_t *len) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_protocolie_header(uint8_t** ptr, uint32_t* ie_id, LIBLTE_M2AP_CRITICALITY_ENUM* crit, uint32_t* len) { - *ie_id = liblte_bits_2_value(ptr, 16); // ProtocolIE-ID - *crit = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); // Criticality + *ie_id = liblte_bits_2_value(ptr, 16); // ProtocolIE-ID + *crit = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); // Criticality liblte_align_up(ptr, 8); - if(0 == liblte_bits_2_value(ptr, 1)) { // Length + if (0 == liblte_bits_2_value(ptr, 1)) { // Length *len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { *len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -135,19 +131,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_header( /******************************************************************************* * ProtocolIE ProtocolIE_ID INTEGER *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_id( - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_id(LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolIE_ID // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->ProtocolIE_ID, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -155,20 +147,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_id( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_id( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_id(uint8_t** ptr, LIBLTE_M2AP_PROTOCOLIE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolIE_ID // lb:0, ub:65535 liblte_align_up(ptr, 8); ie->ProtocolIE_ID = (uint16_t)liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -176,41 +164,35 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_id( /******************************************************************************* * ProtocolIE ProtocolIE_SingleContainer SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_singlecontainer( - LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolie_singlecontainer(LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { liblte_value_2_bits(ie->id.ProtocolIE_ID, ptr, 16); // ProtocolIE-ID - liblte_value_2_bits(ie->criticality, ptr, 2); // Criticality + liblte_value_2_bits(ie->criticality, ptr, 2); // Criticality liblte_align_up_zero(ptr, 8); - //if(liblte_m2ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { + // if(liblte_m2ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { // return LIBLTE_ERROR_ENCODE_FAIL; //} // Enum - ie->criticality - //liblte_value_2_bits(ie->criticality, ptr, 8); + // liblte_value_2_bits(ie->criticality, ptr, 8); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_singlecontainer( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_singlecontainer(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_m2ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -226,19 +208,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolie_singlecontainer( /******************************************************************************* * ProtocolIE ProtocolExtensionID INTEGER *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionid( - LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionid(LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolExtensionID // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->ProtocolExtensionID, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -246,19 +224,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionid( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionid(uint8_t** ptr, LIBLTE_M2AP_PROTOCOLEXTENSIONID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolExtensionID // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->ProtocolExtensionID = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->ProtocolExtensionID = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -268,17 +242,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionid( /******************************************************************************* * ProtocolIE ProtocolExtensionField SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionfield( - LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionfield(LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_m2ap_pack_protocolextensionid(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolextensionid(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -290,17 +260,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensionfield( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionfield( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionfield(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_m2ap_unpack_protocolextensionid(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_protocolextensionid(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -316,25 +283,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensionfield( * ProtocolIE ProtocolExtensionContainer DYNAMIC SEQUENCE OF *******************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensioncontainer( - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensioncontainer(LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ProtocolExtensionContainer pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "ProtocolExtensionContainer pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_m2ap_pack_protocolextensionfield(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_m2ap_pack_protocolextensionfield(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -343,25 +309,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_protocolextensioncontainer( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensioncontainer( - uint8_t **ptr, - LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensioncontainer(uint8_t** ptr, + LIBLTE_M2AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ProtocolExtensionContainer unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "ProtocolExtensionContainer unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_m2ap_unpack_protocolextensionfield(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_m2ap_unpack_protocolextensionfield(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -373,54 +338,43 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_protocolextensioncontainer( /******************************************************************************* * ProtocolIE Criticality Diagnostics SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_criticalitydiagnostics( - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_criticalitydiagnostics(LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_log_print("CriticalityDiagnostics pack error - Criticality Diagnostics not supported yet\n"); - return LIBLTE_ERROR_ENCODE_FAIL; + if (ie != NULL && ptr != NULL) { + liblte_log_print("CriticalityDiagnostics pack error - Criticality Diagnostics not supported yet\n"); + return LIBLTE_ERROR_ENCODE_FAIL; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_criticalitydiagnostics( - uint8_t **ptr, - LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_criticalitydiagnostics(uint8_t** ptr, + LIBLTE_M2AP_CRITICALITYDIAGNOSTICS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_log_print("CriticalityDiagnostics unpack error - criticality diagnostics not supported yet\n"); - return LIBLTE_ERROR_DECODE_FAIL; + if (ie != NULL && ptr != NULL) { + liblte_log_print("CriticalityDiagnostics unpack error - criticality diagnostics not supported yet\n"); + return LIBLTE_ERROR_DECODE_FAIL; } return err; } /******************************************************************************* * ProtocolIE PLMNidentity STATIC OCTET STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_plmnidentity( - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_plmnidentity(LIBLTE_M2AP_PLMN_IDENTITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -428,23 +382,19 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_plmnidentity( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_plmnidentity( - uint8_t **ptr, - LIBLTE_M2AP_PLMN_IDENTITY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_plmnidentity(uint8_t** ptr, LIBLTE_M2AP_PLMN_IDENTITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_PLMN_IDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -455,20 +405,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_plmnidentity( /******************************************************************************* * ProtocolIE IP address OCTET STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_ipaddress( - LIBLTE_M2AP_IP_ADDRESS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_ipaddress(LIBLTE_M2AP_IP_ADDRESS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->len-4, ptr,4); - liblte_align_up_zero(ptr,8); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->len - 4, ptr, 4); + liblte_align_up_zero(ptr, 8); // Octets uint32_t i; - for(i=0;ilen;i++) { + for (i = 0; i < ie->len; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -476,23 +422,19 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_ipaddress( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ipaddress( - uint8_t **ptr, - LIBLTE_M2AP_IP_ADDRESS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ipaddress(uint8_t** ptr, LIBLTE_M2AP_IP_ADDRESS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - ie->len = liblte_bits_2_value(ptr,4)+4; - liblte_align_up(ptr,8); - if(ie->len > 16) { + ie->len = liblte_bits_2_value(ptr, 4) + 4; + liblte_align_up(ptr, 8); + if (ie->len > 16) { return LIBLTE_ERROR_DECODE_FAIL; - } - for(int i=0; ilen; i++) { - ie->buffer[i] = liblte_bits_2_value(ptr,8); + } + for (int i = 0; i < ie->len; i++) { + ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; } @@ -502,19 +444,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ipaddress( /******************************************************************************* * ProtocolIE GTP TEID OCTET STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_gtpteid( - LIBLTE_M2AP_GTP_TEID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_gtpteid(LIBLTE_M2AP_GTP_TEID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - + if (ie != NULL && ptr != NULL) { + // Octets uint32_t i; - for(i=0;i<4;i++) { + for (i = 0; i < 4; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -522,17 +460,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_gtpteid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_gtpteid( - uint8_t **ptr, - LIBLTE_M2AP_GTP_TEID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_gtpteid(uint8_t** ptr, LIBLTE_M2AP_GTP_TEID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - for(int i=0; i<4; i++) { - ie->buffer[i] = liblte_bits_2_value(ptr,8); + if (ie != NULL && ptr != NULL) { + for (int i = 0; i < 4; i++) { + ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; } @@ -541,22 +475,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_gtpteid( /******************************************************************************* * ProtocolIE Service Id STATIC OCTET STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_serviceid( - LIBLTE_M2AP_SERVICE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_serviceid(LIBLTE_M2AP_SERVICE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_SERVICE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_SERVICE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -564,22 +494,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_serviceid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_serviceid( - uint8_t **ptr, - LIBLTE_M2AP_SERVICE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_serviceid(uint8_t** ptr, LIBLTE_M2AP_SERVICE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_SERVICE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_SERVICE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -589,29 +515,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_serviceid( /******************************************************************************* * ProtocolIE ENBname PrintableString *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbname( - LIBLTE_M2AP_ENBNAME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbname(LIBLTE_M2AP_ENBNAME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->n_octets-1, ptr, 8); + liblte_value_2_bits(ie->n_octets - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -619,19 +541,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbname( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname( - uint8_t **ptr, - LIBLTE_M2AP_ENBNAME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname(uint8_t** ptr, LIBLTE_M2AP_ENBNAME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -641,7 +559,7 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname( liblte_align_up(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -652,29 +570,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbname( /******************************************************************************* * ProtocolIE MCEname PrintableString *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcename( - LIBLTE_M2AP_MCE_NAME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcename(LIBLTE_M2AP_MCE_NAME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MCEname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->n_octets-1, ptr, 8); + liblte_value_2_bits(ie->n_octets - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -682,19 +596,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcename( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcename( - uint8_t **ptr, - LIBLTE_M2AP_MCE_NAME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcename(uint8_t** ptr, LIBLTE_M2AP_MCE_NAME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MCEname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -704,7 +614,7 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcename( liblte_align_up(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -715,26 +625,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcename( /******************************************************************************* * ProtocolIE ENB-ID STATIC BIT STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbid( - LIBLTE_M2AP_ENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbid(LIBLTE_M2AP_ENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up(ptr, 8); - + // Static bit string - eNB-Id uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -742,18 +648,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid( - uint8_t **ptr, - LIBLTE_M2AP_ENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid(uint8_t** ptr, LIBLTE_M2AP_ENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -761,7 +663,7 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid( // Static bit string - eNB-Id liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -773,35 +675,31 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbid( /******************************************************************************* * ProtocolIE Global_ENB_ID SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalenbid( - LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalenbid(LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - liblte_align_up_zero(ptr,8); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + liblte_align_up_zero(ptr, 8); - if(liblte_m2ap_pack_plmnidentity(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_plmnidentity(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_m2ap_pack_enbid(&ie->eNB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_enbid(&ie->eNB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -810,77 +708,68 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalenbid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalenbid( - uint8_t **ptr, - LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalenbid(uint8_t** ptr, LIBLTE_M2AP_GLOBAL_ENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_enbid(ptr, &ie->eNB_ID) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_enbid(ptr, &ie->eNB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } - /******************************************************************************* * ProtocolIE ECGI SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_ecgi( - LIBLTE_M2AP_ECGI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_ecgi(LIBLTE_M2AP_ECGI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("eNB-MBMS-Configuration-Data Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("eNB-MBMS-Configuration-Data Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //PLMN Identity - if(liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + // PLMN Identity + if (liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - //E-UTRAN Cell Identifier - if(liblte_m2ap_pack_eutrancellidentifier(&ie->EUTRANCellIdentifier,ptr) != LIBLTE_SUCCESS) { + // E-UTRAN Cell Identifier + if (liblte_m2ap_pack_eutrancellidentifier(&ie->EUTRANCellIdentifier, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -889,33 +778,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_ecgi( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ecgi( - uint8_t **ptr, - LIBLTE_M2AP_ECGI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ecgi(uint8_t** ptr, LIBLTE_M2AP_ECGI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ECGI error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - - if(liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + + if (liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_eutrancellidentifier(ptr, &ie->EUTRANCellIdentifier) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_eutrancellidentifier(ptr, &ie->EUTRANCellIdentifier) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -927,22 +812,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_ecgi( /******************************************************************************* * ProtocolIE MCE-ID STATIC OCTET STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mceid( - LIBLTE_M2AP_MCE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mceid(LIBLTE_M2AP_MCE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_MCEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_MCEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -950,22 +831,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mceid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid( - uint8_t **ptr, - LIBLTE_M2AP_MCE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid(uint8_t** ptr, LIBLTE_M2AP_MCE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - if(LIBLTE_M2AP_MCEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_M2AP_MCEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -975,34 +852,30 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mceid( /******************************************************************************* * ProtocolIE Global_MCE_ID SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalmceid( - LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalmceid(LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - + if (ie != NULL && ptr != NULL) { + // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_align_up_zero(ptr,8); + liblte_align_up_zero(ptr, 8); - if(liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_m2ap_pack_mceid(&ie->mCE_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mceid(&ie->mCE_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_extensions, ptr) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_extensions, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -1011,34 +884,30 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_globalmceid( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalmceid( - uint8_t **ptr, - LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalmceid(uint8_t** ptr, LIBLTE_M2AP_GLOBAL_MCE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_mceid(ptr, &ie->mCE_ID) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mceid(ptr, &ie->mCE_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -1049,15 +918,11 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_globalmceid( /******************************************************************************* * ProtocolIE EUTRANCellIdentifier STATIC BIT STRING *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_eutrancellidentifier( - LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_eutrancellidentifier(LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - E-UTRAN Cell Identifier liblte_value_2_bits(ie->eUTRANCellIdentifier, ptr, LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_BIT_STRING_LEN); err = LIBLTE_SUCCESS; @@ -1065,18 +930,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_eutrancellidentifier( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_eutrancellidentifier( - uint8_t **ptr, - LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_eutrancellidentifier(uint8_t** ptr, LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - E-UTRAN Cell Identifier ie->eUTRANCellIdentifier = liblte_bits_2_value(ptr, LIBLTE_M2AP_EUTRAN_CELL_IDENTIFIER_BIT_STRING_LEN); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1084,35 +945,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_eutrancellidentifier( /******************************************************************************* * ProtocolIE MBSFN-Synchronization-Area-Id INTEGER *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronisationareaid( - LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsynchronisationareaid(LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->local // lb:0, ub:65535 - liblte_align_up_zero(ptr,8); - liblte_value_2_bits(ie->mbsfn_synchronisation_area_id, ptr,16); + liblte_align_up_zero(ptr, 8); + liblte_value_2_bits(ie->mbsfn_synchronisation_area_id, ptr, 16); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronisationareaid( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronisationareaid(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SYNCHRONISATION_AREA_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->local // lb:0, ub:65535 - liblte_align_up(ptr,8); - ie->mbsfn_synchronisation_area_id = liblte_bits_2_value(ptr,16); - err = LIBLTE_SUCCESS; + liblte_align_up(ptr, 8); + ie->mbsfn_synchronisation_area_id = liblte_bits_2_value(ptr, 16); + err = LIBLTE_SUCCESS; } return err; } @@ -1121,33 +976,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsynchronisationareaid( * ProtocolIE MBMS-Service-Area-List DYNAMIC OCTET STRING *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceareaidlist( - LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsserviceareaidlist(LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - liblte_value_2_bits(ie->len-1, ptr,8); - for (int i = 0; i < ie->len; i++ ){ + liblte_value_2_bits(ie->len - 1, ptr, 8); + for (int i = 0; i < ie->len; i++) { liblte_m2ap_pack_mbmsservicearea(&ie->buffer[i], ptr); } err = LIBLTE_SUCCESS; return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceareaidlist( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceareaidlist(uint8_t** ptr, + LIBLTE_M2AP_MBMS_SERVICE_AREA_ID_LIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - ie->len = liblte_bits_2_value(ptr,8)+1; - for (int i = 0; i < ie->len; i++ ){ - liblte_m2ap_unpack_mbmsservicearea(ptr,&ie->buffer[i]); - } - err = LIBLTE_SUCCESS; + if (ie != NULL && ptr != NULL) { + ie->len = liblte_bits_2_value(ptr, 8) + 1; + for (int i = 0; i < ie->len; i++) { + liblte_m2ap_unpack_mbmsservicearea(ptr, &ie->buffer[i]); } + err = LIBLTE_SUCCESS; + } return err; } @@ -1155,53 +1006,45 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsserviceareaidlist( * ProtocolIE MBMS-Service-Area DYNAMIC OCTET STRING *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsservicearea( - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsservicearea(LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->n_octets < 127) { // Length + if (ie != NULL && ptr != NULL) { + if (ie->n_octets < 127) { // Length liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); } else { - if(ie->n_octets < 16384 ) { - liblte_value_2_bits( 0, ptr, 1); + if (ie->n_octets < 16384) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // too large return LIBLTE_ERROR_ENCODE_FAIL; } } - for(int i = 0; i < ie->n_octets; i++){ - liblte_value_2_bits(ie->buffer[i], ptr,8); + for (int i = 0; i < ie->n_octets; i++) { + liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsservicearea( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsservicearea(uint8_t** ptr, LIBLTE_M2AP_MBMS_SERVICE_AREA_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(0 == liblte_bits_2_value(ptr, 1)) { // Length + if (ie != NULL && ptr != NULL) { + if (0 == liblte_bits_2_value(ptr, 1)) { // Length ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } } - //ie->n_octets = liblte_bits_2_value(ptr,8); - for(int i = 0; i < ie->n_octets; i++){ - ie->buffer[i] = liblte_bits_2_value(ptr,8); + // ie->n_octets = liblte_bits_2_value(ptr,8); + for (int i = 0; i < ie->n_octets; i++) { + ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; } @@ -1211,40 +1054,37 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsservicearea( /******************************************************************************* * ProtocolIE ENB-MBMS-ConfigurationDataItem SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataitem( - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataitem(LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("eNB-MBMS-Configuration-Data Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("eNB-MBMS-Configuration-Data Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // eCGI - err = liblte_m2ap_pack_ecgi(&ie->eCGI,ptr); - if(err != LIBLTE_SUCCESS) + err = liblte_m2ap_pack_ecgi(&ie->eCGI, ptr); + if (err != LIBLTE_SUCCESS) return err; - + // MBSFN Synchronization Area Id - if(liblte_m2ap_pack_mbsfnsynchronisationareaid(&ie->mbsfnSynchronisationArea, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mbsfnsynchronisationareaid(&ie->mbsfnSynchronisationArea, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } // MBMS Service area id - if(liblte_m2ap_pack_mbmsserviceareaidlist(&ie->mbmsServiceAreaList, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mbmsserviceareaidlist(&ie->mbmsServiceAreaList, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -1252,33 +1092,30 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdataitem( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataitem( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_enbmbmsconfigurationdataitem(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("eNB-MBMS-Configuration-Data Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_m2ap_unpack_ecgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_ecgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_mbsfnsynchronisationareaid(ptr, &ie->mbsfnSynchronisationArea) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mbsfnsynchronisationareaid(ptr, &ie->mbsfnSynchronisationArea) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_mbmsserviceareaidlist(ptr, &ie->mbmsServiceAreaList) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mbmsserviceareaidlist(ptr, &ie->mbmsServiceAreaList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -1291,26 +1128,19 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdataitem( * ProtocolIE MCCH-Update-Time INTEGER (0..255) *******************************************************************************/ // lb:0, ub:255 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchupdatetime( - LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchupdatetime(LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->mcchUpdateTime,ptr,8); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->mcchUpdateTime, ptr, 8); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchupdatetime( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchupdatetime(uint8_t** ptr, LIBLTE_M2AP_MCCH_UPDATE_TIME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->mcchUpdateTime = liblte_bits_2_value(ptr, 8); err = LIBLTE_SUCCESS; } @@ -1321,26 +1151,19 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchupdatetime( * ProtocolIE MBSFN-Area-Id INTEGER (0..255) *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaid( - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaid(LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->mbsfn_area_id,ptr,8); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->mbsfn_area_id, ptr, 8); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaid( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaid(uint8_t** ptr, LIBLTE_M2AP_MBSFN_AREA_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->mbsfn_area_id = liblte_bits_2_value(ptr, 8); err = LIBLTE_SUCCESS; } @@ -1351,28 +1174,21 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaid( * ProtocolIE LCID INTEGER (0..28) *******************************************************************************/ // lb:0, ub:28 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_lcid( - LIBLTE_M2AP_LCID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_lcid(LIBLTE_M2AP_LCID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->lcid, ptr,5); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->lcid, ptr, 5); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_lcid( - uint8_t **ptr, - LIBLTE_M2AP_LCID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_lcid(uint8_t** ptr, LIBLTE_M2AP_LCID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->lcid = liblte_bits_2_value(ptr, 5); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1381,28 +1197,21 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_lcid( * ProtocolIE Data MCS INTEGER (0..28) *******************************************************************************/ // lb:0, ub:28 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_datamcs( - LIBLTE_M2AP_DATA_MCS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_datamcs(LIBLTE_M2AP_DATA_MCS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->dataMCS, ptr,5); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->dataMCS, ptr, 5); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_datamcs( - uint8_t **ptr, - LIBLTE_M2AP_DATA_MCS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_datamcs(uint8_t** ptr, LIBLTE_M2AP_DATA_MCS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->dataMCS = liblte_bits_2_value(ptr, 5); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1411,28 +1220,23 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_datamcs( * ProtocolIE Radio Frame Allocation Offset INTEGER (0..7) *******************************************************************************/ // lb:0, ub:7 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationoffset( - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationoffset(LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->radioframeAllocationOffset, ptr,3); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->radioframeAllocationOffset, ptr, 3); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationoffset( - uint8_t **ptr, - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationoffset(uint8_t** ptr, + LIBLTE_M2AP_RADIOFRAME_ALLOCATION_OFFSET_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->radioframeAllocationOffset = liblte_bits_2_value(ptr, 3); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1441,52 +1245,42 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationoffset( * ProtocolIE AllocatedSubframesEnd INTEGER (0..1535) *******************************************************************************/ // lb:0, ub:1535 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_allocatedsubframesend( - LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_allocatedsubframesend(LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->allocated_subframes_end, ptr,16); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->allocated_subframes_end, ptr, 16); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_allocatedsubframesend( - uint8_t **ptr, - LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_allocatedsubframesend(uint8_t** ptr, + LIBLTE_M2AP_ALLOCATED_SUBFRAMES_END_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->allocated_subframes_end = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } /******************************************************************************* * ProtocolIE MCE-MBMS-M2AP-ID INTEGER (0..16777215) *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcembmsm2apid( - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcembmsm2apid(LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->mce_mbms_m2ap_id < 256) { - liblte_value_2_bits(0,ptr,2); + if (ie != NULL && ptr != NULL) { + if (ie->mce_mbms_m2ap_id < 256) { + liblte_value_2_bits(0, ptr, 2); liblte_align_up_zero(ptr, 8); liblte_value_2_bits(ie->mce_mbms_m2ap_id, ptr, 8); } else if (ie->mce_mbms_m2ap_id < 65536) { - liblte_value_2_bits(1,ptr,2); + liblte_value_2_bits(1, ptr, 2); liblte_align_up_zero(ptr, 8); liblte_value_2_bits(ie->mce_mbms_m2ap_id, ptr, 16); } else if (ie->mce_mbms_m2ap_id < 16777215) { - liblte_value_2_bits(2,ptr,2); + liblte_value_2_bits(2, ptr, 2); liblte_align_up_zero(ptr, 8); liblte_value_2_bits(ie->mce_mbms_m2ap_id, ptr, 24); } else { @@ -1496,25 +1290,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcembmsm2apid( } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcembmsm2apid( - uint8_t **ptr, - LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcembmsm2apid(uint8_t** ptr, LIBLTE_M2AP_MCE_MBMS_M2AP_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint8_t value = liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); - if(value == 0){ + if (value == 0) { ie->mce_mbms_m2ap_id = liblte_bits_2_value(ptr, 8); - } else if (value == 1){ + } else if (value == 1) { ie->mce_mbms_m2ap_id = liblte_bits_2_value(ptr, 16); - } else if(value == 2){ + } else if (value == 2) { ie->mce_mbms_m2ap_id = liblte_bits_2_value(ptr, 24); } else { return LIBLTE_ERROR_DECODE_FAIL; } - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1522,20 +1313,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcembmsm2apid( /******************************************************************************* * ProtocolIE ENB-MBMS-M2AP-ID INTEGER (0..65535) *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsm2apid( - LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsm2apid(LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->enb_mbms_m2ap_id < 256) { - liblte_value_2_bits(0,ptr,2); + if (ie != NULL && ptr != NULL) { + if (ie->enb_mbms_m2ap_id < 256) { + liblte_value_2_bits(0, ptr, 2); liblte_align_up_zero(ptr, 8); liblte_value_2_bits(ie->enb_mbms_m2ap_id, ptr, 8); } else if (ie->enb_mbms_m2ap_id < 65535) { - liblte_value_2_bits(1,ptr,2); + liblte_value_2_bits(1, ptr, 2); liblte_align_up_zero(ptr, 8); liblte_value_2_bits(ie->enb_mbms_m2ap_id, ptr, 16); } else { @@ -1545,23 +1332,20 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsm2apid( } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsm2apid( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsm2apid(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_M2AP_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint8_t value = liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); - if(value == 0){ + if (value == 0) { ie->enb_mbms_m2ap_id = liblte_bits_2_value(ptr, 8); - } else if (value == 1){ + } else if (value == 1) { ie->enb_mbms_m2ap_id = liblte_bits_2_value(ptr, 16); } else { return LIBLTE_ERROR_DECODE_FAIL; } - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1569,39 +1353,32 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsm2apid( * ProtocolIE PDCCH-Length ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pdcchlength( - LIBLTE_M2AP_PDCCH_LENGTH_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pdcchlength(LIBLTE_M2AP_PDCCH_LENGTH_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->ext, ptr,1); - liblte_value_2_bits(ie->pdcchLength, ptr,1); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->ext, ptr, 1); + liblte_value_2_bits(ie->pdcchLength, ptr, 1); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pdcchlength( - uint8_t **ptr, - LIBLTE_M2AP_PDCCH_LENGTH_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pdcchlength(uint8_t** ptr, LIBLTE_M2AP_PDCCH_LENGTH_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("PDCCH-Length error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t tmp = liblte_bits_2_value(ptr, 1); - if(tmp == LIBLTE_M2AP_PDCCH_LENGTH_S1){ + if (tmp == LIBLTE_M2AP_PDCCH_LENGTH_S1) { ie->pdcchLength = LIBLTE_M2AP_PDCCH_LENGTH_S1; - } else if(tmp == LIBLTE_M2AP_PDCCH_LENGTH_S2) { + } else if (tmp == LIBLTE_M2AP_PDCCH_LENGTH_S2) { ie->pdcchLength = LIBLTE_M2AP_PDCCH_LENGTH_S2; - } else{ + } else { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -1613,36 +1390,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pdcchlength( * ProtocolIE Repetition-Period ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_repetitionperiod( - LIBLTE_M2AP_REPETITION_PERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_repetitionperiod(LIBLTE_M2AP_REPETITION_PERIOD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->repetitionPeriod, ptr,2); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->repetitionPeriod, ptr, 2); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_repetitionperiod( - uint8_t **ptr, - LIBLTE_M2AP_REPETITION_PERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_repetitionperiod(uint8_t** ptr, LIBLTE_M2AP_REPETITION_PERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 2); - if(tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF32){ + if (tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF32) { ie->repetitionPeriod = LIBLTE_M2AP_REPETITION_PERIOD_RF32; - } else if(tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF64) { + } else if (tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF64) { ie->repetitionPeriod = LIBLTE_M2AP_REPETITION_PERIOD_RF64; - } else if(tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF128) { + } else if (tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF128) { ie->repetitionPeriod = LIBLTE_M2AP_REPETITION_PERIOD_RF128; - } else if(tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF256) { + } else if (tmp == LIBLTE_M2AP_REPETITION_PERIOD_RF256) { ie->repetitionPeriod = LIBLTE_M2AP_REPETITION_PERIOD_RF256; - } else{ + } else { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -1654,28 +1424,21 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_repetitionperiod( * ProtocolIE Offset ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_offset( - LIBLTE_M2AP_OFFSET_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_offset(LIBLTE_M2AP_OFFSET_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->offset, ptr,4); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->offset, ptr, 4); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_offset( - uint8_t **ptr, - LIBLTE_M2AP_OFFSET_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_offset(uint8_t** ptr, LIBLTE_M2AP_OFFSET_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->offset = liblte_bits_2_value(ptr, 4); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -1683,32 +1446,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_offset( * ProtocolIE Modification Period ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_modificationperiod( - LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_modificationperiod(LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->modificationPeriod, ptr,1); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->modificationPeriod, ptr, 1); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modificationperiod( - uint8_t **ptr, - LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modificationperiod(uint8_t** ptr, LIBLTE_M2AP_MODIFICATION_PERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 1); - if(tmp == LIBLTE_M2AP_MODIFICATION_PERIOD_RF512){ + if (tmp == LIBLTE_M2AP_MODIFICATION_PERIOD_RF512) { ie->modificationPeriod = LIBLTE_M2AP_MODIFICATION_PERIOD_RF512; - } else if(tmp == LIBLTE_M2AP_MODIFICATION_PERIOD_RF1024) { + } else if (tmp == LIBLTE_M2AP_MODIFICATION_PERIOD_RF1024) { ie->modificationPeriod = LIBLTE_M2AP_MODIFICATION_PERIOD_RF1024; - } else{ + } else { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -1719,29 +1475,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modificationperiod( * ProtocolIE Subframe Allocation Info STATIC BIT STRING *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocationinfo( - LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocationinfo(LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - for (int i = 0; i < LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_BIT_STRING_LEN;i++){ - liblte_value_2_bits(ie->buffer[i], ptr,1); + if (ie != NULL && ptr != NULL) { + for (int i = 0; i < LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_BIT_STRING_LEN; i++) { + liblte_value_2_bits(ie->buffer[i], ptr, 1); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocationinfo( - uint8_t **ptr, - LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocationinfo(uint8_t** ptr, + LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { - for (int i = 0; i < LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_BIT_STRING_LEN;i++){ + if (ie != NULL && ptr != NULL) { + for (int i = 0; i < LIBLTE_M2AP_SUBFRAME_ALLOCATION_INFO_BIT_STRING_LEN; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -1753,44 +1504,37 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocationinfo( * ProtocolIE Subframe Allocation CHOICE *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocation( - LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_subframeallocation(LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->choice_type , ptr, 1); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->choice_type, ptr, 1); if (ie->choice_type == LIBLTE_M2AP_SUBFRAME_ALLOCATION_ONE_FRAME) { for (int i = 0; i < 6; i++) { liblte_value_2_bits(ie->choice.oneFrame[i], ptr, 1); } } else if (ie->choice_type == LIBLTE_M2AP_SUBFRAME_ALLOCATION_FOUR_FRAMES) { for (int i = 0; i < 24; i++) { - liblte_value_2_bits(ie->choice.fourFrames[i], ptr,1); + liblte_value_2_bits(ie->choice.fourFrames[i], ptr, 1); } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocation( - uint8_t **ptr, - LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocation(uint8_t** ptr, LIBLTE_M2AP_SUBFRAME_ALLOCATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint8_t tmp = liblte_bits_2_value(ptr, 1); - if (tmp == LIBLTE_M2AP_SUBFRAME_ALLOCATION_ONE_FRAME){ + if (tmp == LIBLTE_M2AP_SUBFRAME_ALLOCATION_ONE_FRAME) { ie->choice_type = LIBLTE_M2AP_SUBFRAME_ALLOCATION_ONE_FRAME; - for (int i = 0; i < 6; i++){ + for (int i = 0; i < 6; i++) { ie->choice.oneFrame[i] = liblte_bits_2_value(ptr, 1); } - } else{ + } else { ie->choice_type = LIBLTE_M2AP_SUBFRAME_ALLOCATION_FOUR_FRAMES; - for (int i = 0; i < 24; i++){ + for (int i = 0; i < 24; i++) { ie->choice.fourFrames[i] = liblte_bits_2_value(ptr, 1); } } @@ -1802,34 +1546,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_subframeallocation( * ProtocolIE Modulation and Coding Scheme ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_modulationandcodingscheme( - LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_modulationandcodingscheme(LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->mcs, ptr,2); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->mcs, ptr, 2); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modulationandcodingscheme( - uint8_t **ptr, - LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modulationandcodingscheme(uint8_t** ptr, + LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 2); - if(tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N2) { + if (tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N2) { ie->mcs = LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N2; - } else if(tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N7) { + } else if (tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N7) { ie->mcs = LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N7; - } else if(tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N13) { + } else if (tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N13) { ie->mcs = LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N13; - } else if(tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N19) { + } else if (tmp == LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N19) { ie->mcs = LIBLTE_M2AP_MODULATION_AND_CODING_SCHEME_N19; } else { return LIBLTE_ERROR_ENCODE_FAIL; @@ -1842,38 +1581,33 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_modulationandcodingscheme( * ProtocolIE RadioframeAllocationPeriod ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationperiod( - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_radioframeallocationperiod(LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->e, ptr,3); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->e, ptr, 3); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationperiod( - uint8_t **ptr, - LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationperiod(uint8_t** ptr, + LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 3); - if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N1) { + if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N1) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N1; - } else if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N2) { + } else if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N2) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N2; - } else if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N4) { + } else if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N4) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N4; - } else if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N8) { + } else if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N8) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N8; - } else if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N16) { + } else if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N16) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N16; - } else if(tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N32) { + } else if (tmp == LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N32) { ie->e = LIBLTE_M2AP_RADIOFRAME_ALLOCATION_PERIOD_N32; } else { return LIBLTE_ERROR_DECODE_FAIL; @@ -1887,38 +1621,34 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_radioframeallocationperiod( * ProtocolIE Common-Subframe-Scheduling-Period ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_commonsubframeallocationperiod( - LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_commonsubframeallocationperiod(LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->e, ptr,3); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->e, ptr, 3); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_commonsubframeallocationperiod( - uint8_t **ptr, - LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_commonsubframeallocationperiod(uint8_t** ptr, + LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 3); - if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF8) { + if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF8) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF8; - } else if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF16) { + } else if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF16) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF16; - } else if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF32) { + } else if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF32) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF32; - } else if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF64) { + } else if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF64) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF64; - } else if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF128) { + } else if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF128) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF128; - } else if(tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF256) { + } else if (tmp == LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF256) { ie->e = LIBLTE_M2AP_COMMON_SUBFRAME_ALLOCATION_PERIOD_RF256; } else { return LIBLTE_ERROR_DECODE_FAIL; @@ -1931,42 +1661,35 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_commonsubframeallocationperiod( * ProtocolIE MCH Scheduling Period ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mchschedulingperiod( - LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mchschedulingperiod(LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->e, ptr,3); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->e, ptr, 3); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mchschedulingperiod( - uint8_t **ptr, - LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mchschedulingperiod(uint8_t** ptr, LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { + if (ie != NULL && ptr != NULL) { uint32_t tmp = liblte_bits_2_value(ptr, 3); - if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF8) { + if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF8) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF8; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF16) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF16) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF16; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF32) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF32) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF32; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF64) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF64) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF64; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF128) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF128) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF128; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF256) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF256) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF256; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF512) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF512) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF512; - } else if(tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF1024) { + } else if (tmp == LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF1024) { ie->e = LIBLTE_M2AP_MCH_SCHEDULING_PERIOD_RF1024; } else { return LIBLTE_ERROR_DECODE_FAIL; @@ -1979,32 +1702,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mchschedulingperiod( * ProtocolIE Cell-Reservation-Info ENUM *******************************************************************************/ // lb:0, ub:512 -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellreservationinfo( - LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellreservationinfo(LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->ext, ptr,1); - liblte_value_2_bits(ie->e, ptr,1); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->ext, ptr, 1); + liblte_value_2_bits(ie->e, ptr, 1); err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellreservationinfo( - uint8_t **ptr, - LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellreservationinfo(uint8_t** ptr, LIBLTE_M2AP_CELL_RESERVATION_INFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (ie != NULL && ptr != NULL) - { - ie->ext = liblte_bits_2_value(ptr, 1); + if (ie != NULL && ptr != NULL) { + ie->ext = liblte_bits_2_value(ptr, 1); uint32_t tmp = liblte_bits_2_value(ptr, 1); - if(tmp == LIBLTE_M2AP_CELL_RESERVATION_INFO_RESERVED_CELL) { + if (tmp == LIBLTE_M2AP_CELL_RESERVATION_INFO_RESERVED_CELL) { ie->e = LIBLTE_M2AP_CELL_RESERVATION_INFO_RESERVED_CELL; - } else if(tmp == LIBLTE_M2AP_CELL_RESERVATION_INFO_NON_RESERVED_CELL) { + } else if (tmp == LIBLTE_M2AP_CELL_RESERVATION_INFO_NON_RESERVED_CELL) { ie->e = LIBLTE_M2AP_CELL_RESERVATION_INFO_NON_RESERVED_CELL; } else { return LIBLTE_ERROR_ENCODE_FAIL; @@ -2016,27 +1732,23 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellreservationinfo( /*************************************************************************************** * ProtocolIE TMGI SEQUENCE ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_tmgi( - LIBLTE_M2AP_TMGI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_tmgi(LIBLTE_M2AP_TMGI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension liblte_value_2_bits(ie->ext, ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("Cell-Information Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //Bools + // Bools liblte_value_2_bits(ie->iE_Extensions_present, ptr, 1); - if(liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_plmnidentity(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_m2ap_pack_serviceid(&ie->serviceID, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_serviceid(&ie->serviceID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -2044,30 +1756,26 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_tmgi( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tmgi( - uint8_t **ptr, - LIBLTE_M2AP_TMGI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tmgi(uint8_t** ptr, LIBLTE_M2AP_TMGI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("TMGI error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; - } - //Bools + } + // Bools ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - liblte_align_up(ptr,8); - - //PLMN Identity - if(liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + liblte_align_up(ptr, 8); + + // PLMN Identity + if (liblte_m2ap_unpack_plmnidentity(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_serviceid(ptr, &ie->serviceID) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_serviceid(ptr, &ie->serviceID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -2077,31 +1785,27 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tmgi( /*************************************************************************************** * ProtocolIE TNL Information SEQUENCE ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_tnlinformation( - LIBLTE_M2AP_TNL_INFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_tnlinformation(LIBLTE_M2AP_TNL_INFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension liblte_value_2_bits(ie->ext, ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("TNL-Information Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //Bools + // Bools liblte_value_2_bits(ie->iE_Extensions_present, ptr, 1); - if(liblte_m2ap_pack_ipaddress(&ie->iPMCAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_ipaddress(&ie->iPMCAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_pack_ipaddress(&ie->iPSourceAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_ipaddress(&ie->iPSourceAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_pack_gtpteid(&ie->gtpTeid, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_gtpteid(&ie->gtpTeid, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2109,32 +1813,28 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_tnlinformation( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tnlinformation( - uint8_t **ptr, - LIBLTE_M2AP_TNL_INFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tnlinformation(uint8_t** ptr, LIBLTE_M2AP_TNL_INFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("Cell-Information Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools + // Bools ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - - if(liblte_m2ap_unpack_ipaddress(ptr, &ie->iPMCAddress) != LIBLTE_SUCCESS) { + + if (liblte_m2ap_unpack_ipaddress(ptr, &ie->iPMCAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_ipaddress(ptr, &ie->iPSourceAddress) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_ipaddress(ptr, &ie->iPSourceAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_gtpteid(ptr, &ie->gtpTeid) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_gtpteid(ptr, &ie->gtpTeid) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -2144,27 +1844,23 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_tnlinformation( /*************************************************************************************** * ProtocolIE CellInformation SEQUENCE ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformation( - LIBLTE_M2AP_CELL_INFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformation(LIBLTE_M2AP_CELL_INFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension liblte_value_2_bits(ie->ext, ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("Cell-Information Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //Bools + // Bools liblte_value_2_bits(ie->ie_extensions_present, ptr, 1); - if(liblte_m2ap_pack_ecgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_ecgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_m2ap_pack_cellreservationinfo(&ie->cellReservationInfo, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_cellreservationinfo(&ie->cellReservationInfo, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -2172,28 +1868,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformation( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformation( - uint8_t **ptr, - LIBLTE_M2AP_CELL_INFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformation(uint8_t** ptr, LIBLTE_M2AP_CELL_INFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("Cell-Information Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools + // Bools ie->ie_extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_m2ap_unpack_ecgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_ecgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_m2ap_unpack_cellreservationinfo(ptr, &ie->cellReservationInfo) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_cellreservationinfo(ptr, &ie->cellReservationInfo) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -2204,27 +1896,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformation( /*************************************************************************************** * ProtocolIE CellInformation-List SEQUENCE ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformationlist( - LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformationlist(LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length - liblte_align_up_zero(ptr,8); - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_align_up_zero(ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); if (ie->len > 32) { - liblte_log_print( - "Cell-Information-List pack error - max supported dynamic sequence length = 32, ie->len = %d\n", - ie->len); + liblte_log_print("Cell-Information-List pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } - for(uint16_t i =0; i < ie->len; i++){ + for (uint16_t i = 0; i < ie->len; i++) { err = liblte_m2ap_pack_cellinformation(&ie->buffer[i], ptr); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -2232,28 +1919,23 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_cellinformationlist( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformationlist( - uint8_t **ptr, - LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformationlist(uint8_t** ptr, LIBLTE_M2AP_CELL_INFORMATION_LIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length - liblte_align_up(ptr,8); + liblte_align_up(ptr, 8); ie->len = liblte_bits_2_value(ptr, 8) + 1; if (ie->len > 32) { liblte_log_print( - "Cell-Information-List unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", - ie->len); + "Cell-Information-List unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } - for(uint16_t i =0; i < ie->len; i++){ + for (uint16_t i = 0; i < ie->len; i++) { err = liblte_m2ap_unpack_cellinformation(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -2264,72 +1946,69 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_cellinformationlist( * ProtocolIE MCCHRelatedBCCH-ConfigPerMBSFNArea-Item SEQUENCE *******************************************************************************/ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem( - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT *ie, - uint8_t **ptr) + LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MCCHRelatedBCCH-ConfigPerMBSFNArea Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //Bools - liblte_value_2_bits(ie->cellInformationList_present?1:0, ptr, 1); - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // Bools + liblte_value_2_bits(ie->cellInformationList_present ? 1 : 0, ptr, 1); + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("MCCHRelatedBCCH-ConfigPerMBSFNArea Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_align_up_zero(ptr,8); - + liblte_align_up_zero(ptr, 8); + // MBSFN Area Id - err = liblte_m2ap_pack_mbsfnareaid(&ie->mbsfnArea,ptr); - if(err != LIBLTE_SUCCESS) + err = liblte_m2ap_pack_mbsfnareaid(&ie->mbsfnArea, ptr); + if (err != LIBLTE_SUCCESS) return err; - + // PDCCH Length - if(liblte_m2ap_pack_pdcchlength(&ie->pdcchLength, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_pdcchlength(&ie->pdcchLength, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } // Repetition Period - if(liblte_m2ap_pack_repetitionperiod(&ie->repetitionPeriod, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_repetitionperiod(&ie->repetitionPeriod, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - + // Offset - if(liblte_m2ap_pack_offset(&ie->offset, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_offset(&ie->offset, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - + // Modification Period - if(liblte_m2ap_pack_modificationperiod(&ie->modificationPeriod, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_modificationperiod(&ie->modificationPeriod, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - + // Subframe Allocation Info - if(liblte_m2ap_pack_subframeallocationinfo(&ie->subframeAllocationInfo, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_subframeallocationinfo(&ie->subframeAllocationInfo, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - - // Modulation and Conding Scheme - if(liblte_m2ap_pack_modulationandcodingscheme(&ie->modulationAndCodingScheme, ptr) != LIBLTE_SUCCESS) { + + // Modulation and Conding Scheme + if (liblte_m2ap_pack_modulationandcodingscheme(&ie->modulationAndCodingScheme, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - - // Cell Information List - if(liblte_m2ap_pack_cellinformationlist(&ie->cellInformationList, ptr) != LIBLTE_SUCCESS) { + + // Cell Information List + if (liblte_m2ap_pack_cellinformationlist(&ie->cellInformationList, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2339,64 +2018,61 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem( } LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT *ie) + uint8_t** ptr, LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("MCCHRelatedBCCH-ConfigPerMBSFNArea Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools + // Bools ie->cellInformationList_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - liblte_align_up_zero(ptr,8); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + liblte_align_up_zero(ptr, 8); - //MBSFN Area Id - if(liblte_m2ap_unpack_mbsfnareaid(ptr, &ie->mbsfnArea) != LIBLTE_SUCCESS) { + // MBSFN Area Id + if (liblte_m2ap_unpack_mbsfnareaid(ptr, &ie->mbsfnArea) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - //PDCCH Length - if(liblte_m2ap_unpack_pdcchlength(ptr, &ie->pdcchLength) != LIBLTE_SUCCESS) { + // PDCCH Length + if (liblte_m2ap_unpack_pdcchlength(ptr, &ie->pdcchLength) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - //Repetition Period - if(liblte_m2ap_unpack_repetitionperiod(ptr, &ie->repetitionPeriod) != LIBLTE_SUCCESS) { + // Repetition Period + if (liblte_m2ap_unpack_repetitionperiod(ptr, &ie->repetitionPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - //Offset - if(liblte_m2ap_unpack_offset(ptr, &ie->offset) != LIBLTE_SUCCESS) { + // Offset + if (liblte_m2ap_unpack_offset(ptr, &ie->offset) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } ////Modification Period - if(liblte_m2ap_unpack_modificationperiod(ptr, &ie->modificationPeriod) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_modificationperiod(ptr, &ie->modificationPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - //Subframe Allocation Info - if(liblte_m2ap_unpack_subframeallocationinfo(ptr, &ie->subframeAllocationInfo) != LIBLTE_SUCCESS) { + // Subframe Allocation Info + if (liblte_m2ap_unpack_subframeallocationinfo(ptr, &ie->subframeAllocationInfo) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - - //Modulation Coding Scheme - if(liblte_m2ap_unpack_modulationandcodingscheme(ptr, &ie->modulationAndCodingScheme) != LIBLTE_SUCCESS) { + + // Modulation Coding Scheme + if (liblte_m2ap_unpack_modulationandcodingscheme(ptr, &ie->modulationAndCodingScheme) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - //Cell Information List - if(ie->cellInformationList_present) { - if(liblte_m2ap_unpack_cellinformationlist(ptr, &ie->cellInformationList) != LIBLTE_SUCCESS) { + // Cell Information List + if (ie->cellInformationList_present) { + if (liblte_m2ap_unpack_cellinformationlist(ptr, &ie->cellInformationList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2405,23 +2081,19 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem( return err; } - /*************************************************************************************** * ProtocolIE ENB-MBMS-Configuration-data-List SEQUENCE OF ProtocolIE-Single-Container ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist( - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist(LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT* ie, + uint8_t** ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; proto_container.id.ProtocolIE_ID = LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_ITEM; - proto_container.criticality = LIBLTE_M2AP_CRITICALITY_REJECT; - - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + proto_container.criticality = LIBLTE_M2AP_CRITICALITY_REJECT; + + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print( "ProtocolIE_ENB-MBMS-Configuration-data-List pack error - max supported dynamic sequence length = 32, " "ie->len = %d\n", @@ -2430,24 +2102,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist( } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); - for(uint16_t i =0; i < ie->len; i++){ + for (uint16_t i = 0; i < ie->len; i++) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - ENB-MBMS-Configuration-Data-Item tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_enbmbmsconfigurationdataitem(&ie->buffer[i],&tmp_ptr); - if(err != LIBLTE_SUCCESS){ + err = liblte_m2ap_pack_enbmbmsconfigurationdataitem(&ie->buffer[i], &tmp_ptr); + if (err != LIBLTE_SUCCESS) { return err; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_ITEM, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_ITEM, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -2458,19 +2130,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_enbmbmsconfigurationdatalist( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdatalist( - uint8_t **ptr, - LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_enbmbmsconfigurationdatalist(uint8_t** ptr, LIBLTE_M2AP_ENB_MBMS_CONFIGURATION_DATA_LIST_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_M2AP_CRITICALITY_ENUM crit; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_M2AP_CRITICALITY_ENUM crit; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length FIXME!!! ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); @@ -2481,12 +2150,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdatalist( return LIBLTE_ERROR_DECODE_FAIL; } - for(uint16_t i =0; i < ie->len; i++){ - if(liblte_m2ap_unpack_protocolie_singlecontainer(ptr, &proto_container) != LIBLTE_SUCCESS) { + for (uint16_t i = 0; i < ie->len; i++) { + if (liblte_m2ap_unpack_protocolie_singlecontainer(ptr, &proto_container) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = liblte_m2ap_unpack_enbmbmsconfigurationdataitem(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -2497,16 +2166,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_enbmbmsconfigurationdatalist( /*************************************************************************************** * ProtocolIE MCCHrelatedBCCH-ConfigPerMBSFNArea SEQUENCE OF ProtocolIE-Single-Container ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea( - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea(LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print( "ProtocolIE_MCCHrelatedBCCH-ConfigPerMBSFNArea pack error - max supported dynamic sequence length = 32, " "ie->len = %d\n", @@ -2515,24 +2182,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea( } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); - for(uint16_t i =0; i < ie->len; i++){ + for (uint16_t i = 0; i < ie->len; i++) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MCCHrelatedBCCH-ConfigPerMBSFNArea tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem(&ie->buffer[i],&tmp_ptr); - if(err != LIBLTE_SUCCESS){ + err = liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnareaitem(&ie->buffer[i], &tmp_ptr); + if (err != LIBLTE_SUCCESS) { return err; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA_ITEM, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA_ITEM, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -2543,19 +2210,17 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea( - uint8_t **ptr, - LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea(uint8_t** ptr, + LIBLTE_M2AP_MCCH_RELATED_BCCH_CONFIG_PER_MBSFN_AREA_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_M2AP_CRITICALITY_ENUM crit; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_M2AP_CRITICALITY_ENUM crit; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length FIXME!!! ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); @@ -2566,12 +2231,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea( return LIBLTE_ERROR_DECODE_FAIL; } - for(uint16_t i =0; i < ie->len; i++){ - if(liblte_m2ap_unpack_protocolie_singlecontainer(ptr, &proto_container) != LIBLTE_SUCCESS) { + for (uint16_t i = 0; i < ie->len; i++) { + if (liblte_m2ap_unpack_protocolie_singlecontainer(ptr, &proto_container) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnareaitem(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -2582,62 +2247,55 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea( /******************************************************************************* * ProtocolIE MBMSSessionListPerPMCH-Item SEQUENCE (SIZE(1..maxnoofSessionsPerPMCH)) OF SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionlistperpmchitem( - LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionlistperpmchitem(LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length - liblte_value_2_bits(ie->len-1, ptr, 5); - - for (int i =0; ilen; i++) { - liblte_value_2_bits(ie->buffer[i].ext, ptr,1); - liblte_value_2_bits(ie->buffer[i].iE_Extensions_present, ptr,1); - - //TMGI - if(liblte_m2ap_pack_tmgi(&ie->buffer[i].Tmgi, ptr) != LIBLTE_SUCCESS) { + liblte_value_2_bits(ie->len - 1, ptr, 5); + + for (int i = 0; i < ie->len; i++) { + liblte_value_2_bits(ie->buffer[i].ext, ptr, 1); + liblte_value_2_bits(ie->buffer[i].iE_Extensions_present, ptr, 1); + + // TMGI + if (liblte_m2ap_pack_tmgi(&ie->buffer[i].Tmgi, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } // LCID - if(liblte_m2ap_pack_lcid(&ie->buffer[i].Lcid, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_lcid(&ie->buffer[i].Lcid, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } + } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionlistperpmchitem( - uint8_t **ptr, - LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionlistperpmchitem(uint8_t** ptr, + LIBLTE_M2AP_MBMS_SESSION_LIST_PER_PMCH_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length - ie->len = liblte_bits_2_value(ptr, 5)+1; + ie->len = liblte_bits_2_value(ptr, 5) + 1; - for (int i =0; ilen; i++){ - ie->buffer[i].ext = liblte_bits_2_value(ptr,1); - ie->buffer[i].iE_Extensions_present = liblte_bits_2_value(ptr,1); - //TMGI - if(liblte_m2ap_unpack_tmgi(ptr, &ie->buffer[i].Tmgi) != LIBLTE_SUCCESS) { + for (int i = 0; i < ie->len; i++) { + ie->buffer[i].ext = liblte_bits_2_value(ptr, 1); + ie->buffer[i].iE_Extensions_present = liblte_bits_2_value(ptr, 1); + // TMGI + if (liblte_m2ap_unpack_tmgi(ptr, &ie->buffer[i].Tmgi) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } // LCID - if(liblte_m2ap_unpack_lcid(ptr, &ie->buffer[i].Lcid) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_lcid(ptr, &ie->buffer[i].Lcid) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } - - + } + err = LIBLTE_SUCCESS; } return err; @@ -2646,45 +2304,42 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionlistperpmchitem( /******************************************************************************* * ProtocolIE MBSFN-Subframe-Configuration SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfiguration( - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfiguration(LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MBSFN-Subframe-Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("MBSFN Subframe Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - + // Radio Frame Allocation Period - if(liblte_m2ap_pack_radioframeallocationperiod(&ie->radioFrameAllocationPeriod, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_radioframeallocationperiod(&ie->radioFrameAllocationPeriod, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - + // Radio Frame Allocation Offset - if(liblte_m2ap_pack_radioframeallocationoffset(&ie->radioFrameAllocationOffset, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_radioframeallocationoffset(&ie->radioFrameAllocationOffset, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - // Subframe Allocation - if(liblte_m2ap_pack_subframeallocation(&ie->subframeAllocation, ptr) != LIBLTE_SUCCESS) { + // Subframe Allocation + if (liblte_m2ap_pack_subframeallocation(&ie->subframeAllocation, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - - if(ie->iE_Extensions_present) { - if(liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + + if (ie->iE_Extensions_present) { + if (liblte_m2ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2693,42 +2348,39 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfiguration( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfiguration( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfiguration(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("PMCH Configuration error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools + // Bools ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - + // Radio Frame Allocation Period - if(liblte_m2ap_unpack_radioframeallocationperiod(ptr, &ie->radioFrameAllocationPeriod) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_radioframeallocationperiod(ptr, &ie->radioFrameAllocationPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - + // Radio Frame Allocation Offset - if(liblte_m2ap_unpack_radioframeallocationoffset(ptr, &ie->radioFrameAllocationOffset) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_radioframeallocationoffset(ptr, &ie->radioFrameAllocationOffset) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - // Subframe Allocation - if(liblte_m2ap_unpack_subframeallocation(ptr, &ie->subframeAllocation) != LIBLTE_SUCCESS) { + // Subframe Allocation + if (liblte_m2ap_unpack_subframeallocation(ptr, &ie->subframeAllocation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2739,69 +2391,63 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfiguration( /*************************************************************************************** * ProtocolIE MBSFN-Subframe-Configuration-List SEQUENCE OF ProtocolIE-Single-Container ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnsubframeconfigurationlist( - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_mbsfnsubframeconfigurationlist(LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print( - "ProtocolIE_PMCH-Configuration-List pack error - max supported dynamic sequence length = 32, " - "ie->len = %d\n", - ie->len); + + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ProtocolIE_PMCH-Configuration-List pack error - max supported dynamic sequence length = 32, " + "ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 3); + liblte_value_2_bits(ie->len - 1, ptr, 3); liblte_align_up_zero(ptr, 8); - - for(uint16_t i =0; i < ie->len; i++){ + + for (uint16_t i = 0; i < ie->len; i++) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MBSFN-Subframe-Configuration tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_mbsfnsubframeconfiguration(&ie->buffer[i],&tmp_ptr); - if(err != LIBLTE_SUCCESS){ + err = liblte_m2ap_pack_mbsfnsubframeconfiguration(&ie->buffer[i], &tmp_ptr); + if (err != LIBLTE_SUCCESS) { return err; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_ITEM, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_ITEM, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; } - + err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbsfnsubframeconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_SUBFRAME_CONFIGURATION_LIST_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_M2AP_CRITICALITY_ENUM crit; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_M2AP_CRITICALITY_ENUM crit; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length FIXME!!! - ie->len = liblte_bits_2_value(ptr, 3)+1; + ie->len = liblte_bits_2_value(ptr, 3) + 1; liblte_align_up(ptr, 8); if (ie->len > 32) { liblte_log_print( @@ -2809,13 +2455,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfigurationlist( ie->len); return LIBLTE_ERROR_DECODE_FAIL; } - - for(uint16_t i =0; i < ie->len; i++){ - if(liblte_m2ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + + for (uint16_t i = 0; i < ie->len; i++) { + if (liblte_m2ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = liblte_m2ap_unpack_mbsfnsubframeconfiguration(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -2825,47 +2471,43 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnsubframeconfigurationlist( /******************************************************************************* * ProtocolIE PMCH-Configiguration SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfiguration( - LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfiguration(LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PMCH-Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("PMCH Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_align_up_zero(ptr,8); - + liblte_align_up_zero(ptr, 8); + // Allocated Subframes End - if(liblte_m2ap_pack_allocatedsubframesend(&ie->allocatedSubframesEnd, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_allocatedsubframesend(&ie->allocatedSubframesEnd, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - + // Data MCS - if(liblte_m2ap_pack_datamcs(&ie->dataMCS, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_datamcs(&ie->dataMCS, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } // Scheduling Period - if(liblte_m2ap_pack_mchschedulingperiod(&ie->mchSchedulingPeriod, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mchschedulingperiod(&ie->mchSchedulingPeriod, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2874,44 +2516,40 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfiguration( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfiguration( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfiguration(uint8_t** ptr, LIBLTE_M2AP_PMCH_CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("PMCH Configuration error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools - //ie->cellInformationList_present = liblte_bits_2_value(ptr, 1); + // Bools + // ie->cellInformationList_present = liblte_bits_2_value(ptr, 1); ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - liblte_align_up_zero(ptr,8); + liblte_align_up_zero(ptr, 8); // Allocated Subframes End - if(liblte_m2ap_unpack_allocatedsubframesend(ptr, &ie->allocatedSubframesEnd) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_allocatedsubframesend(ptr, &ie->allocatedSubframesEnd) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - + // Data MCS - if(liblte_m2ap_unpack_datamcs(ptr, &ie->dataMCS) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_datamcs(ptr, &ie->dataMCS) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } // Scheduling Period - if(liblte_m2ap_unpack_mchschedulingperiod(ptr, &ie->mchSchedulingPeriod) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mchschedulingperiod(ptr, &ie->mchSchedulingPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2922,42 +2560,38 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfiguration( /******************************************************************************* * ProtocolIE PMCH-Configiguration-Item SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationitem( - LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationitem(LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - //Extension present - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + if (ie != NULL && ptr != NULL) { + // Extension present + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PMCH-Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - //IE Extension present - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); - if(ie->iE_Extensions_present) { + // IE Extension present + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); + if (ie->iE_Extensions_present) { liblte_log_print("PMCH Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - + // PMCH-Configuration err = liblte_m2ap_pack_pmchconfiguration(&ie->PMCHConfiguration, ptr); - if(err != LIBLTE_SUCCESS){ + if (err != LIBLTE_SUCCESS) { return err; } // MBMS Session List per PMCH Item - if(liblte_m2ap_pack_mbmssessionlistperpmchitem(&ie->MBMSSessionListPerPMCHItem, ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mbmssessionlistperpmchitem(&ie->MBMSSessionListPerPMCHItem, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -2966,37 +2600,34 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationitem( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationitem( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationitem(uint8_t** ptr, + LIBLTE_M2AP_PMCH_CONFIGURATION_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + if (ie->ext) { liblte_log_print("PMCH Configuration Item error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - //Bools + // Bools ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - //PMCH Configuration - if(liblte_m2ap_unpack_pmchconfiguration(ptr, &ie->PMCHConfiguration) != LIBLTE_SUCCESS) { + // PMCH Configuration + if (liblte_m2ap_unpack_pmchconfiguration(ptr, &ie->PMCHConfiguration) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - + // MBMS Session List per PMCH Item - if(liblte_m2ap_unpack_mbmssessionlistperpmchitem(ptr, &ie->MBMSSessionListPerPMCHItem) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mbmssessionlistperpmchitem(ptr, &ie->MBMSSessionListPerPMCHItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - - if(ie->iE_Extensions_present) { - if(liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + + if (ie->iE_Extensions_present) { + if (liblte_m2ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -3007,43 +2638,37 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationitem( /*************************************************************************************** * ProtocolIE PMCH-Configuration-List SEQUENCE OF ProtocolIE-Single-Container ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationlist( - LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationlist(LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print( - "ProtocolIE_PMCH-Configuration-List pack error - max supported dynamic sequence length = 32, " - "ie->len = %d\n", - ie->len); + + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ProtocolIE_PMCH-Configuration-List pack error - max supported dynamic sequence length = 32, " + "ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length liblte_value_2_bits(ie->len, ptr, 4); liblte_align_up_zero(ptr, 8); - - for(uint16_t i =0; i < ie->len; i++){ + + for (uint16_t i = 0; i < ie->len; i++) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - PMCH-Configuration-Item tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_pmchconfigurationitem(&ie->buffer[i],&tmp_ptr); - if(err != LIBLTE_SUCCESS){ + err = liblte_m2ap_pack_pmchconfigurationitem(&ie->buffer[i], &tmp_ptr); + if (err != LIBLTE_SUCCESS) { return err; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_ITEM, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_ITEM, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3054,19 +2679,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_pmchconfigurationlist( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_PMCH_CONFIGURATION_LIST_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_M2AP_CRITICALITY_ENUM crit; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_M2AP_CRITICALITY_ENUM crit; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length FIXME!!! ie->len = liblte_bits_2_value(ptr, 4); liblte_align_up(ptr, 8); @@ -3076,13 +2698,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist( ie->len); return LIBLTE_ERROR_DECODE_FAIL; } - - for(uint16_t i =0; i < ie->len; i++){ - if(liblte_m2ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + + for (uint16_t i = 0; i < ie->len; i++) { + if (liblte_m2ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = liblte_m2ap_unpack_pmchconfigurationitem(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -3093,122 +2715,114 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_pmchconfigurationlist( /******************************************************************************* * ProtocolIE MBSFN-Area-Configuration-Item SEQUENCE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationitem( - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationitem(LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - int n_ies = 4; + if (ie != NULL && ptr != NULL) { + int n_ies = 4; LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; + + liblte_value_2_bits(n_ies, ptr, 16); - liblte_value_2_bits(n_ies,ptr,16); - // PMCH Configuration List tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_pmchconfigurationlist(&ie->PMCHConfigurationList, &tmp_ptr); + err = liblte_m2ap_pack_pmchconfigurationlist(&ie->PMCHConfigurationList, &tmp_ptr); if (err != LIBLTE_SUCCESS) return err; liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_LIST, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_PMCH_CONFIGURATION_LIST, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; - - + // MBSFN Subframe Configuration List tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_mbsfnsubframeconfigurationlist(&ie->MBSFNSubframeConfigurationList, &tmp_ptr); + err = liblte_m2ap_pack_mbsfnsubframeconfigurationlist(&ie->MBSFNSubframeConfigurationList, &tmp_ptr); if (err != LIBLTE_SUCCESS) return err; liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; - + // Common Subframe Allocation Period tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_commonsubframeallocationperiod(&ie->CommonSubframeAllocationPeriod, &tmp_ptr); + err = liblte_m2ap_pack_commonsubframeallocationperiod(&ie->CommonSubframeAllocationPeriod, &tmp_ptr); if (err != LIBLTE_SUCCESS) return err; liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_COMMON_SUBFRAME_ALLOCATION_PERIOD, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_COMMON_SUBFRAME_ALLOCATION_PERIOD, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; - - //MBSFN Area Id + + // MBSFN Area Id tmp_ptr = tmp_msg.msg; - err = liblte_m2ap_pack_mbsfnareaid(&ie->MBSFNAreaId, &tmp_ptr); + err = liblte_m2ap_pack_mbsfnareaid(&ie->MBSFNAreaId, &tmp_ptr); if (err != LIBLTE_SUCCESS) return err; liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MBSFN_AREA_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_MBSFN_AREA_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; - + err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationitem( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationitem(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_ITEM_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; - - if(ie != NULL && - ptr != NULL) - { + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; + + if (ie != NULL && ptr != NULL) { // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - + // Unpack ProtocolIE Fields - for(i=0;iPMCHConfigurationList) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_pmchconfigurationlist(ptr, &ie->PMCHConfigurationList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST == ie_id) { - if(liblte_m2ap_unpack_mbsfnsubframeconfigurationlist(ptr, &ie->MBSFNSubframeConfigurationList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_MBSFN_SUBFRAME_CONFIGURATION_LIST == ie_id) { + if (liblte_m2ap_unpack_mbsfnsubframeconfigurationlist(ptr, &ie->MBSFNSubframeConfigurationList) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); @@ -3231,16 +2845,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationitem( /*************************************************************************************** * ProtocolIE MBSFN-Area-Configuration-List SEQUENCE OF ProtocolIE-Single-Container ***************************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist( - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist(LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print( "ProtocolIE_MBSFN-Area-Configuration-List pack error - max supported dynamic sequence length = 32, " "ie->len = %d\n", @@ -3249,12 +2860,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist( } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); - for(uint16_t i =0; i < ie->len; i++){ + for (uint16_t i = 0; i < ie->len; i++) { // ProtocolIE - MBSFN-Area-Configuration-Item - err = liblte_m2ap_pack_mbsfnareaconfigurationitem(&ie->buffer[i],ptr); - if(err != LIBLTE_SUCCESS){ + err = liblte_m2ap_pack_mbsfnareaconfigurationitem(&ie->buffer[i], ptr); + if (err != LIBLTE_SUCCESS) { return err; } liblte_align_up_zero(ptr, 8); @@ -3264,19 +2875,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbsfnareaconfigurationlist( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist( - uint8_t **ptr, - LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist(uint8_t** ptr, + LIBLTE_M2AP_MBSFN_AREA_CONFIGURATION_LIST_STRUCT* ie) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_M2AP_CRITICALITY_ENUM crit; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_M2AP_CRITICALITY_ENUM crit; LIBLTE_M2AP_PROTOCOLIE_SINGLECONTAINER_STRUCT proto_container; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length FIXME!!! ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); @@ -3286,10 +2894,10 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist( ie->len); return LIBLTE_ERROR_DECODE_FAIL; } - - for(uint16_t i =0; i < ie->len; i++){ + + for (uint16_t i = 0; i < ie->len; i++) { err = liblte_m2ap_unpack_mbsfnareaconfigurationitem(ptr, &ie->buffer[i]); - if(err != LIBLTE_SUCCESS) + if (err != LIBLTE_SUCCESS) return err; } err = LIBLTE_SUCCESS; @@ -3299,79 +2907,72 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbsfnareaconfigurationlist( /******************************************************************************* * Protocol Message M2SetupRequest STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setuprequest( - LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setuprequest(LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupRequestIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->eNBname_present) + if (!msg->eNBname_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg = {}; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Global_ENB_ID tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_globalenbid(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_globalenbid(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_GLOBALENB_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_GLOBALENB_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNBname - if(msg->eNBname_present) { + if (msg->eNBname_present) { tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_M2AP_IE_ID_ENBNAME, - LIBLTE_M2AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_M2AP_IE_ID_ENBNAME, LIBLTE_M2AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; } - //Protocol IE - eNB-MBMS-Configuration-Data-List + // Protocol IE - eNB-MBMS-Configuration-Data-List tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_enbmbmsconfigurationdatalist(&msg->configurationDataList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_enbmbmsconfigurationdatalist(&msg->configurationDataList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3382,28 +2983,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setuprequest( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_M2SETUPREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->eNBname_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupRequestIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3412,26 +3009,26 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iGlobal_ENB_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_IE_ID_GLOBALENB_ID == ie_id) { + if (liblte_m2ap_unpack_globalenbid(ptr, &msg->Global_ENB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_ENBNAME == ie_id) { - if(liblte_m2ap_unpack_enbname(ptr, &msg->eNBname) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_ENBNAME == ie_id) { + if (liblte_m2ap_unpack_enbname(ptr, &msg->eNBname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->eNBname_present = true; - } else if(LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST == ie_id){ - if(liblte_m2ap_unpack_enbmbmsconfigurationdatalist(ptr, &msg->configurationDataList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_ENB_MBMS_CONFIGURATION_DATA_LIST == ie_id) { + if (liblte_m2ap_unpack_enbmbmsconfigurationdatalist(ptr, &msg->configurationDataList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } + } } err = LIBLTE_SUCCESS; @@ -3442,19 +3039,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setuprequest( /******************************************************************************* * Protocol Message M2SetupResponse STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse( - LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse(LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3465,19 +3058,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Global_MCE_ID tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_globalmceid(&msg->Global_MCE_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_globalmceid(&msg->Global_MCE_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_GLOBALMCE_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_GLOBALMCE_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3487,15 +3079,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse( // ProtocolIE - MCCHrelatedBCCH-ConfigPerMBSFNArea tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea(&msg->MCCHrelatedBCCHConfigPerMBSFNArea, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mcchrelatedbcchconfigpermbsfnarea(&msg->MCCHrelatedBCCHConfigPerMBSFNArea, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, + LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA, + LIBLTE_M2AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3505,28 +3098,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2setupresponse( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_M2SETUPRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; - //Set bools + // Set bools msg->MCEname_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3534,23 +3123,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iGlobal_MCE_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_IE_ID_GLOBALMCE_ID == ie_id) { + if (liblte_m2ap_unpack_globalmceid(ptr, &msg->Global_MCE_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_MCENAME == ie_id) { - if(liblte_m2ap_unpack_mcename(ptr, &msg->MCEname) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_MCENAME == ie_id) { + if (liblte_m2ap_unpack_mcename(ptr, &msg->MCEname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MCEname_present = true; - } else if(LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA == ie_id) { - if(liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea(ptr, &msg->MCCHrelatedBCCHConfigPerMBSFNArea) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_MCCHRELATEDBCCH_CONFIGPERMBSFNAREA == ie_id) { + if (liblte_m2ap_unpack_mcchrelatedbcchconfigpermbsfnarea(ptr, &msg->MCCHrelatedBCCHConfigPerMBSFNArea) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); @@ -3564,19 +3154,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2setupresponse( /******************************************************************************* * Protocol Message MBMSSessionStartRequest STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest(LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3587,19 +3174,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MCE MBMS M2AP Id tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mcembmsm2apid(&msg->MceMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mcembmsm2apid(&msg->MceMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3607,15 +3193,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( // ProtocolIE - TMGI tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_tmgi(&msg->Tmgi, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_tmgi(&msg->Tmgi, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_TMGI, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_TMGI, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3643,15 +3227,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( // ProtocolIE - MBMS Service Area tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mbmsservicearea(&msg->MbmsServiceArea, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mbmsservicearea(&msg->MbmsServiceArea, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3659,15 +3242,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( // ProtocolIE - TNL Information tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_tnlinformation(&msg->TnlInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_tnlinformation(&msg->TnlInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_TNL_INFORMATION, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_TNL_INFORMATION, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3678,28 +3260,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartrequest( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest(uint8_t** ptr, + LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; - //Set bools + // Set bools msg->MbmsSessionId_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3707,34 +3286,34 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMceMbmsM2apId) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID == ie_id) { + if (liblte_m2ap_unpack_mcembmsm2apid(ptr, &msg->MceMbmsM2apId) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_TMGI == ie_id) { - if(liblte_m2ap_unpack_tmgi(ptr, &msg->Tmgi) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_TMGI == ie_id) { + if (liblte_m2ap_unpack_tmgi(ptr, &msg->Tmgi) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_MBMS_SESSION_ID == ie_id) { + } else if (LIBLTE_M2AP_IE_ID_MBMS_SESSION_ID == ie_id) { msg->MbmsSessionId_present = true; - //if(liblte_m2ap_unpack_mbmssessionid(ptr, &msg->MbmsSessionId) != LIBLTE_SUCCESS) { + // if(liblte_m2ap_unpack_mbmssessionid(ptr, &msg->MbmsSessionId) != LIBLTE_SUCCESS) { // return LIBLTE_ERROR_DECODE_FAIL; //} liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA == ie_id) { - if(liblte_m2ap_unpack_mbmsservicearea(ptr, &msg->MbmsServiceArea) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_MBMS_SERVICE_AREA == ie_id) { + if (liblte_m2ap_unpack_mbmsservicearea(ptr, &msg->MbmsServiceArea) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_TNL_INFORMATION == ie_id) { - if(liblte_m2ap_unpack_tnlinformation(ptr, &msg->TnlInformation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_TNL_INFORMATION == ie_id) { + if (liblte_m2ap_unpack_tnlinformation(ptr, &msg->TnlInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); @@ -3748,19 +3327,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartrequest( /******************************************************************************* * Protocol Message MBMSSessionStartResponse STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse( - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse(LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3771,19 +3347,18 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MCE MBMS M2AP Id tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mcembmsm2apid(&msg->MceMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mcembmsm2apid(&msg->MceMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3791,15 +3366,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse( // ProtocolIE - ENB MBMS M2AP Id tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_enbmbmsm2apid(&msg->EnbMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_enbmbmsm2apid(&msg->EnbMbmsM2apId, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3828,28 +3402,25 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmssessionstartresponse( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse(uint8_t** ptr, + LIBLTE_M2AP_MESSAGE_MBMSSESSIONSTARTRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; - //Set bools + // Set bools msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupResponseIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3857,29 +3428,28 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMceMbmsM2apId) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_IE_ID_MCE_MBMS_M2AP_ID == ie_id) { + if (liblte_m2ap_unpack_mcembmsm2apid(ptr, &msg->MceMbmsM2apId) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID == ie_id) { - if(liblte_m2ap_unpack_enbmbmsm2apid(ptr, &msg->EnbMbmsM2apId) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_ENB_MBMS_M2AP_ID == ie_id) { + if (liblte_m2ap_unpack_enbmbmsm2apid(ptr, &msg->EnbMbmsM2apId) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + } else if (LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { /*msg->CriticalityDiagnostics_present = true; if(liblte_m2ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8);*/ } - } err = LIBLTE_SUCCESS; } @@ -3889,43 +3459,39 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmssessionstartresponse( /******************************************************************************* * Protocol Message MBMS Scheduling Information STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation( - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation(LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MBMSSchedulingInformation IEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - + // No. of ProtocolIE uint32_t n_ie = 2; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MCCH-Update-Time tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mcchupdatetime(&msg->MCCHUpdateTime, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mcchupdatetime(&msg->MCCHUpdateTime, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_MCCH_UPDATE_TIME, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_MCCH_UPDATE_TIME, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3933,15 +3499,14 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation( // ProtocolIE - MBSFN-Area-Configuration-List tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_mbsfnareaconfigurationlist(&msg->MbsfnAreaConfigurationList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_mbsfnareaconfigurationlist(&msg->MbsfnAreaConfigurationList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -3952,25 +3517,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformation( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformation( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbmsschedulinginformation(uint8_t** ptr, LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupRequestIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3979,22 +3541,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformation( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMCCHUpdateTime) != LIBLTE_SUCCESS) { + + if (LIBLTE_M2AP_IE_ID_MCCH_UPDATE_TIME == ie_id) { + if (liblte_m2ap_unpack_mcchupdatetime(ptr, &msg->MCCHUpdateTime) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST == ie_id) { - if(liblte_m2ap_unpack_mbsfnareaconfigurationlist(ptr, &msg->MbsfnAreaConfigurationList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_IE_ID_MBSFN_AREA_CONFIGURATION_LIST == ie_id) { + if (liblte_m2ap_unpack_mbsfnareaconfigurationlist(ptr, &msg->MbsfnAreaConfigurationList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -4005,47 +3567,44 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformation( /******************************************************************************* * Protocol Message MBMS Scheduling Information Response STRUCT *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformationresponse( - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_m2ap_pack_mbmsschedulinginformationresponse(LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MBMSSchedulingInformation IEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - + // No. of ProtocolIE uint32_t n_ie = 1; - if(msg->CriticalityDiagnostics_present == false){ + if (msg->CriticalityDiagnostics_present == false) { --n_ie; } liblte_value_2_bits(n_ie, ptr, 16); - if(msg->CriticalityDiagnostics_present){ + if (msg->CriticalityDiagnostics_present) { // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Criticality Diagnostics tmp_ptr = tmp_msg.msg; - if(liblte_m2ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_m2ap_pack_protocolie_header((tmp_msg.N_bits) / 8, - LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_M2AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_m2ap_pack_protocolie_header( + (tmp_msg.N_bits) / 8, LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_M2AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -4056,44 +3615,42 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_mbmsschedulinginformationresponse( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformationresponse( - uint8_t **ptr, - LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_m2ap_unpack_mbmsschedulinginformationresponse(uint8_t** ptr, + LIBLTE_M2AP_MESSAGE_MBMSSCHEDULINGINFORMATIONRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_M2AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M2SetupRequestIEs error: M2AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - if (n_ie == 0){ + if (n_ie == 0) { msg->CriticalityDiagnostics_present = false; } else { msg->CriticalityDiagnostics_present = true; } // Unpack ProtocolIE Fields - for(i=0;iCriticalityDiagnostics) != LIBLTE_SUCCESS) { + + if (LIBLTE_M2AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_m2ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); @@ -4109,29 +3666,26 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_mbmsschedulinginformationresponse( /******************************************************************************* * InitiatingMessage CHOICE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage( - LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage(LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr = tmp_msg.msg; + uint8_t* tmp_ptr = tmp_msg.msg; // Message - if(msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_M2SETUPREQUEST) { - if(liblte_m2ap_pack_m2setuprequest(&msg->choice.M2SetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + if (msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_M2SETUPREQUEST) { + if (liblte_m2ap_pack_m2setuprequest(&msg->choice.M2SetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSIONSTARTREQUEST) { - if(liblte_m2ap_pack_mbmssessionstartrequest(&msg->choice.MbmsSessionStartRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSIONSTARTREQUEST) { + if (liblte_m2ap_pack_mbmssessionstartrequest(&msg->choice.MbmsSessionStartRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSCHEDULINGINFORMATION) { - if(liblte_m2ap_pack_mbmsschedulinginformation(&msg->choice.MbmsSchedulingInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSCHEDULINGINFORMATION) { + if (liblte_m2ap_pack_mbmsschedulinginformation(&msg->choice.MbmsSchedulingInformation, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -4147,12 +3701,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage( // Length uint32_t len = (tmp_msg.N_bits + 7) / 8; - if(len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4166,27 +3720,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_initiatingmessage( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage( - uint8_t **ptr, - LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT *msg) -{ LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage(uint8_t** ptr, LIBLTE_M2AP_INITIATINGMESSAGE_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Procedure code - msg->procedureCode = liblte_bits_2_value(ptr, 8); + msg->procedureCode = liblte_bits_2_value(ptr, 8); // Criticality - msg->criticality = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + msg->criticality = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); // Length uint32_t len = 0; - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4194,15 +3745,15 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage( } // Message - if(msg->procedureCode == LIBLTE_M2AP_PROC_ID_M2SETUP) { + if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_M2SETUP) { msg->choice_type = LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_M2SETUPREQUEST; - err = liblte_m2ap_unpack_m2setuprequest(ptr, &msg->choice.M2SetupRequest); - } else if(msg->procedureCode == LIBLTE_M2AP_PROC_ID_SESSIONSTART) { + err = liblte_m2ap_unpack_m2setuprequest(ptr, &msg->choice.M2SetupRequest); + } else if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_SESSIONSTART) { msg->choice_type = LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSESSIONSTARTREQUEST; - err = liblte_m2ap_unpack_mbmssessionstartrequest(ptr, &msg->choice.MbmsSessionStartRequest); - } else if(msg->procedureCode == LIBLTE_M2AP_PROC_ID_MBMSSCHEDULINGINFORMATION) { + err = liblte_m2ap_unpack_mbmssessionstartrequest(ptr, &msg->choice.MbmsSessionStartRequest); + } else if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_MBMSSCHEDULINGINFORMATION) { msg->choice_type = LIBLTE_M2AP_INITIATINGMESSAGE_CHOICE_MBMSSCHEDULINGINFORMATION; - err = liblte_m2ap_unpack_mbmsschedulinginformation(ptr, &msg->choice.MbmsSchedulingInformation); + err = liblte_m2ap_unpack_mbmsschedulinginformation(ptr, &msg->choice.MbmsSchedulingInformation); } else { err = LIBLTE_ERROR_DECODE_FAIL; } @@ -4213,17 +3764,13 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_initiatingmessage( /******************************************************************************* * SuccessfulOutcome CHOICE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome( - LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome(LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr = tmp_msg.msg; + uint8_t* tmp_ptr = tmp_msg.msg; // Message if (msg->choice_type == LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_M2SETUPRESPONSE) { @@ -4255,12 +3802,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome( // Length uint32_t len = (tmp_msg.N_bits + 7) / 8; - if(len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4274,27 +3821,24 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_successfuloutcome( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome( - uint8_t **ptr, - LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT *msg) -{ LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome(uint8_t** ptr, LIBLTE_M2AP_SUCCESSFULOUTCOME_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Procedure code - msg->procedureCode = liblte_bits_2_value(ptr, 8); + msg->procedureCode = liblte_bits_2_value(ptr, 8); // Criticality - msg->criticality = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + msg->criticality = (LIBLTE_M2AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); // Length uint32_t len = 0; - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4302,21 +3846,22 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome( } // Message - if(msg->procedureCode == LIBLTE_M2AP_PROC_ID_M2SETUP) { + if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_M2SETUP) { msg->choice_type = LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_M2SETUPRESPONSE; - if(liblte_m2ap_unpack_m2setupresponse(ptr, &msg->choice.M2SetupResponse) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_m2setupresponse(ptr, &msg->choice.M2SetupResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; } else if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_SESSIONSTART) { msg->choice_type = LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSESSIONSTARTRESPONSE; - if(liblte_m2ap_unpack_mbmssessionstartresponse(ptr, &msg->choice.MbmsSessionStartResponse) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mbmssessionstartresponse(ptr, &msg->choice.MbmsSessionStartResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; } else if (msg->procedureCode == LIBLTE_M2AP_PROC_ID_MBMSSCHEDULINGINFORMATION) { msg->choice_type = LIBLTE_M2AP_SUCCESSFULOUTCOME_CHOICE_MBMSSCHEDULINGINFORMATIONRESPONSE; - if(liblte_m2ap_unpack_mbmsschedulinginformationresponse(ptr, &msg->choice.MbmsSchedulingInformationResponse) != LIBLTE_SUCCESS) { + if (liblte_m2ap_unpack_mbmsschedulinginformationresponse(ptr, &msg->choice.MbmsSchedulingInformationResponse) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -4330,33 +3875,29 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_successfuloutcome( /******************************************************************************* * M2AP_PDU CHOICE *******************************************************************************/ -LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2ap_pdu( - LIBLTE_M2AP_M2AP_PDU_STRUCT *m2ap_pdu, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2ap_pdu(LIBLTE_M2AP_M2AP_PDU_STRUCT* m2ap_pdu, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_BIT_MSG_STRUCT bit_msg; - if(m2ap_pdu != NULL && - msg != NULL) - { - uint8_t *p = bit_msg.msg; - uint8_t **ptr = &p; + if (m2ap_pdu != NULL && msg != NULL) { + uint8_t* p = bit_msg.msg; + uint8_t** ptr = &p; // Extension - liblte_value_2_bits(m2ap_pdu->ext?1:0, ptr, 1); + liblte_value_2_bits(m2ap_pdu->ext ? 1 : 0, ptr, 1); // Message choice liblte_value_2_bits(m2ap_pdu->choice_type, ptr, 2); liblte_align_up_zero(ptr, 8); // Message - if(LIBLTE_M2AP_M2AP_PDU_CHOICE_INITIATINGMESSAGE == m2ap_pdu->choice_type) { - if(liblte_m2ap_pack_initiatingmessage(&m2ap_pdu->choice.initiatingMessage, ptr) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_M2AP_PDU_CHOICE_INITIATINGMESSAGE == m2ap_pdu->choice_type) { + if (liblte_m2ap_pack_initiatingmessage(&m2ap_pdu->choice.initiatingMessage, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(LIBLTE_M2AP_M2AP_PDU_CHOICE_SUCCESSFULOUTCOME == m2ap_pdu->choice_type) { - if(liblte_m2ap_pack_successfuloutcome(&m2ap_pdu->choice.successfulOutcome, ptr) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_M2AP_PDU_CHOICE_SUCCESSFULOUTCOME == m2ap_pdu->choice_type) { + if (liblte_m2ap_pack_successfuloutcome(&m2ap_pdu->choice.successfulOutcome, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } /*else if(LIBLTE_M2AP_M2AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == m2ap_pdu->choice_type) { @@ -4374,20 +3915,16 @@ LIBLTE_ERROR_ENUM liblte_m2ap_pack_m2ap_pdu( return err; } -LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2ap_pdu( - LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_M2AP_M2AP_PDU_STRUCT *m2ap_pdu) +LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2ap_pdu(LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_M2AP_M2AP_PDU_STRUCT* m2ap_pdu) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_BIT_MSG_STRUCT bit_msg; - if(m2ap_pdu != NULL && - msg != NULL) - { + if (m2ap_pdu != NULL && msg != NULL) { liblte_unpack(msg, &bit_msg); - uint8_t *p = bit_msg.msg; - uint8_t **ptr = &p; + uint8_t* p = bit_msg.msg; + uint8_t** ptr = &p; // Extension m2ap_pdu->ext = liblte_bits_2_value(ptr, 1); @@ -4397,12 +3934,12 @@ LIBLTE_ERROR_ENUM liblte_m2ap_unpack_m2ap_pdu( liblte_align_up(ptr, 8); // Message - if(LIBLTE_M2AP_M2AP_PDU_CHOICE_INITIATINGMESSAGE == m2ap_pdu->choice_type) { - if(liblte_m2ap_unpack_initiatingmessage(ptr, &m2ap_pdu->choice.initiatingMessage) != LIBLTE_SUCCESS) { + if (LIBLTE_M2AP_M2AP_PDU_CHOICE_INITIATINGMESSAGE == m2ap_pdu->choice_type) { + if (liblte_m2ap_unpack_initiatingmessage(ptr, &m2ap_pdu->choice.initiatingMessage) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - }else if(LIBLTE_M2AP_M2AP_PDU_CHOICE_SUCCESSFULOUTCOME == m2ap_pdu->choice_type) { - if(liblte_m2ap_unpack_successfuloutcome(ptr, &m2ap_pdu->choice.successfulOutcome) != LIBLTE_SUCCESS) { + } else if (LIBLTE_M2AP_M2AP_PDU_CHOICE_SUCCESSFULOUTCOME == m2ap_pdu->choice_type) { + if (liblte_m2ap_unpack_successfuloutcome(ptr, &m2ap_pdu->choice.successfulOutcome) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } /*else if(LIBLTE_M2AP_M2AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == m2ap_pdu->choice_type) { diff --git a/lib/src/asn1/liblte_mme.cc b/lib/src/asn1/liblte_mme.cc index 7fbd55ae5..24dfe48bf 100644 --- a/lib/src/asn1/liblte_mme.cc +++ b/lib/src/asn1/liblte_mme.cc @@ -47,17 +47,14 @@ DEFINES *******************************************************************************/ - /******************************************************************************* TYPEDEFS *******************************************************************************/ - /******************************************************************************* GLOBAL VARIABLES *******************************************************************************/ - /******************************************************************************* INFORMATION ELEMENT FUNCTIONS *******************************************************************************/ @@ -71,47 +68,41 @@ Document Reference: 24.301 v10.2.0 Section 9.9.2.0 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_information_ie(LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT *add_info, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_additional_information_ie(LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT* add_info, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(add_info != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = add_info->N_octets; - for(i=0; iN_octets; i++) - { - (*ie_ptr)[1+i] = add_info->info[i]; - } - *ie_ptr += add_info->N_octets + 1; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (add_info != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = add_info->N_octets; + for (i = 0; i < add_info->N_octets; i++) { + (*ie_ptr)[1 + i] = add_info->info[i]; } + *ie_ptr += add_info->N_octets + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8 **ie_ptr, - LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT *add_info) +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8** ie_ptr, + LIBLTE_MME_ADDITIONAL_INFORMATION_STRUCT* add_info) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - add_info != NULL) - { - add_info->N_octets = (*ie_ptr)[0]; - for(i=0; iN_octets; i++) - { - add_info->info[i] = (*ie_ptr)[1+i]; - } - *ie_ptr += add_info->N_octets + 1; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && add_info != NULL) { + add_info->N_octets = (*ie_ptr)[0]; + for (i = 0; i < add_info->N_octets; i++) { + add_info->info[i] = (*ie_ptr)[1 + i]; } + *ie_ptr += add_info->N_octets + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -123,36 +114,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_information_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.0A 24.008 v10.2.0 Section 10.5.7.8 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_device_properties_ie(LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_device_properties_ie(LIBLTE_MME_DEVICE_PROPERTIES_ENUM device_props, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= device_props << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= device_props << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_DEVICE_PROPERTIES_ENUM *device_props) +LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_DEVICE_PROPERTIES_ENUM* device_props) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - device_props != NULL) - { - *device_props = (LIBLTE_MME_DEVICE_PROPERTIES_ENUM)((**ie_ptr >> bit_offset) & 0x01); + if (ie_ptr != NULL && device_props != NULL) { + *device_props = (LIBLTE_MME_DEVICE_PROPERTIES_ENUM)((**ie_ptr >> bit_offset) & 0x01); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -163,58 +150,54 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_device_properties_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_bearer_context_status_ie(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT *ebcs, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_bearer_context_status_ie(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT* ebcs, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ebcs != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 2; + (*ie_ptr)[1] = (ebcs->ebi[7] << 7); + (*ie_ptr)[1] |= (ebcs->ebi[6] << 6); + (*ie_ptr)[1] |= (ebcs->ebi[5] << 5); + (*ie_ptr)[2] = (ebcs->ebi[15] << 7); + (*ie_ptr)[2] |= (ebcs->ebi[14] << 6); + (*ie_ptr)[2] |= (ebcs->ebi[13] << 5); + (*ie_ptr)[2] |= (ebcs->ebi[12] << 4); + (*ie_ptr)[2] |= (ebcs->ebi[11] << 3); + (*ie_ptr)[2] |= (ebcs->ebi[10] << 2); + (*ie_ptr)[2] |= (ebcs->ebi[9] << 1); + (*ie_ptr)[2] |= ebcs->ebi[8]; + *ie_ptr += 3; - if(ebcs != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 2; - (*ie_ptr)[1] = (ebcs->ebi[7] << 7); - (*ie_ptr)[1] |= (ebcs->ebi[6] << 6); - (*ie_ptr)[1] |= (ebcs->ebi[5] << 5); - (*ie_ptr)[2] = (ebcs->ebi[15] << 7); - (*ie_ptr)[2] |= (ebcs->ebi[14] << 6); - (*ie_ptr)[2] |= (ebcs->ebi[13] << 5); - (*ie_ptr)[2] |= (ebcs->ebi[12] << 4); - (*ie_ptr)[2] |= (ebcs->ebi[11] << 3); - (*ie_ptr)[2] |= (ebcs->ebi[10] << 2); - (*ie_ptr)[2] |= (ebcs->ebi[9] << 1); - (*ie_ptr)[2] |= ebcs->ebi[8]; - *ie_ptr += 3; - - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT *ebcs) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8** ie_ptr, + LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_STRUCT* ebcs) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && ebcs != NULL) { + ebcs->ebi[5] = ((*ie_ptr)[1] >> 5) & 0x01; + ebcs->ebi[6] = ((*ie_ptr)[1] >> 6) & 0x01; + ebcs->ebi[7] = ((*ie_ptr)[1] >> 7) & 0x01; + ebcs->ebi[8] = (*ie_ptr)[2] & 0x01; + ebcs->ebi[9] = ((*ie_ptr)[2] >> 1) & 0x01; + ebcs->ebi[10] = ((*ie_ptr)[2] >> 2) & 0x01; + ebcs->ebi[11] = ((*ie_ptr)[2] >> 3) & 0x01; + ebcs->ebi[12] = ((*ie_ptr)[2] >> 4) & 0x01; + ebcs->ebi[13] = ((*ie_ptr)[2] >> 5) & 0x01; + ebcs->ebi[14] = ((*ie_ptr)[2] >> 6) & 0x01; + ebcs->ebi[15] = ((*ie_ptr)[2] >> 7) & 0x01; + *ie_ptr += 3; - if(ie_ptr != NULL && - ebcs != NULL) - { - ebcs->ebi[5] = ((*ie_ptr)[1] >> 5) & 0x01; - ebcs->ebi[6] = ((*ie_ptr)[1] >> 6) & 0x01; - ebcs->ebi[7] = ((*ie_ptr)[1] >> 7) & 0x01; - ebcs->ebi[8] = (*ie_ptr)[2] & 0x01; - ebcs->ebi[9] = ((*ie_ptr)[2] >> 1) & 0x01; - ebcs->ebi[10] = ((*ie_ptr)[2] >> 2) & 0x01; - ebcs->ebi[11] = ((*ie_ptr)[2] >> 3) & 0x01; - ebcs->ebi[12] = ((*ie_ptr)[2] >> 4) & 0x01; - ebcs->ebi[13] = ((*ie_ptr)[2] >> 5) & 0x01; - ebcs->ebi[14] = ((*ie_ptr)[2] >> 6) & 0x01; - ebcs->ebi[15] = ((*ie_ptr)[2] >> 7) & 0x01; - *ie_ptr += 3; - - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -226,60 +209,52 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_bearer_context_status_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.2 24.008 v10.2.0 Section 10.5.1.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_location_area_id_ie(LIBLTE_MME_LOCATION_AREA_ID_STRUCT *lai, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(lai != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = (((lai->mcc/10) % 10) << 4) | ((lai->mcc/100) % 10); - if(lai->mnc < 100) - { - (*ie_ptr)[1] = 0xF0 | (lai->mcc % 10); - (*ie_ptr)[2] = ((lai->mnc % 10) << 4) | ((lai->mnc/10) % 10); - }else{ - (*ie_ptr)[1] = ((lai->mnc % 10) << 4) | (lai->mcc % 10); - (*ie_ptr)[2] = (((lai->mnc/10) % 10) << 4) | ((lai->mnc/100) % 10); - } - (*ie_ptr)[3] = (lai->lac >> 8) & 0xFF; - (*ie_ptr)[4] = lai->lac & 0xFF; - *ie_ptr += 5; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8 **ie_ptr, - LIBLTE_MME_LOCATION_AREA_ID_STRUCT *lai) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - lai != NULL) - { - lai->mcc = ((*ie_ptr)[0] & 0x0F)*100; - lai->mcc += (((*ie_ptr)[0] >> 4) & 0x0F)*10; - lai->mcc += (*ie_ptr)[1] & 0x0F; - if((((*ie_ptr)[1] >> 4) & 0x0F) == 0x0F) - { - lai->mnc = ((*ie_ptr)[2] & 0x0F)*10; - lai->mnc += ((*ie_ptr)[2] >> 4) & 0x0F; - }else{ - lai->mnc = ((*ie_ptr)[1] >> 4) & 0x0F; - lai->mnc += ((*ie_ptr)[2] & 0x0F)*100; - lai->mnc += (((*ie_ptr)[2] >> 4) & 0x0F)*10; - } - lai->lac = (*ie_ptr)[3] << 8; - lai->lac |= (*ie_ptr)[4]; - *ie_ptr += 5; +LIBLTE_ERROR_ENUM liblte_mme_pack_location_area_id_ie(LIBLTE_MME_LOCATION_AREA_ID_STRUCT* lai, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (lai != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = (((lai->mcc / 10) % 10) << 4) | ((lai->mcc / 100) % 10); + if (lai->mnc < 100) { + (*ie_ptr)[1] = 0xF0 | (lai->mcc % 10); + (*ie_ptr)[2] = ((lai->mnc % 10) << 4) | ((lai->mnc / 10) % 10); + } else { + (*ie_ptr)[1] = ((lai->mnc % 10) << 4) | (lai->mcc % 10); + (*ie_ptr)[2] = (((lai->mnc / 10) % 10) << 4) | ((lai->mnc / 100) % 10); + } + (*ie_ptr)[3] = (lai->lac >> 8) & 0xFF; + (*ie_ptr)[4] = lai->lac & 0xFF; + *ie_ptr += 5; - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8** ie_ptr, LIBLTE_MME_LOCATION_AREA_ID_STRUCT* lai) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && lai != NULL) { + lai->mcc = ((*ie_ptr)[0] & 0x0F) * 100; + lai->mcc += (((*ie_ptr)[0] >> 4) & 0x0F) * 10; + lai->mcc += (*ie_ptr)[1] & 0x0F; + if ((((*ie_ptr)[1] >> 4) & 0x0F) == 0x0F) { + lai->mnc = ((*ie_ptr)[2] & 0x0F) * 10; + lai->mnc += ((*ie_ptr)[2] >> 4) & 0x0F; + } else { + lai->mnc = ((*ie_ptr)[1] >> 4) & 0x0F; + lai->mnc += ((*ie_ptr)[2] & 0x0F) * 100; + lai->mnc += (((*ie_ptr)[2] >> 4) & 0x0F) * 10; } + lai->lac = (*ie_ptr)[3] << 8; + lai->lac |= (*ie_ptr)[4]; + *ie_ptr += 5; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -292,141 +267,125 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_location_area_id_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.3 24.008 v10.2.0 Section 10.5.1.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_id_ie(LIBLTE_MME_MOBILE_ID_STRUCT *mobile_id, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *id = NULL; - uint32 id32 = 0; - uint32 i; - uint8 length = 0; - bool odd = false; - - if(mobile_id != NULL && - ie_ptr != NULL) - { - if(LIBLTE_MME_MOBILE_ID_TYPE_IMSI == mobile_id->type_of_id) - { - id = mobile_id->imsi; - length = 8; - odd = true; - }else if(LIBLTE_MME_MOBILE_ID_TYPE_IMEI == mobile_id->type_of_id){ - id = mobile_id->imei; - length = 8; - odd = true; - }else if(LIBLTE_MME_MOBILE_ID_TYPE_IMEISV == mobile_id->type_of_id){ - id = mobile_id->imeisv; - length = 9; - odd = false; - }else if(LIBLTE_MME_MOBILE_ID_TYPE_TMSI == mobile_id->type_of_id){ - id32 = mobile_id->tmsi; - length = 5; - odd = false; - } - }else{ - // FIXME: Not handling these IDs - return(err); - } +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_id_ie(LIBLTE_MME_MOBILE_ID_STRUCT* mobile_id, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* id = NULL; + uint32 id32 = 0; + uint32 i; + uint8 length = 0; + bool odd = false; + + if (mobile_id != NULL && ie_ptr != NULL) { + if (LIBLTE_MME_MOBILE_ID_TYPE_IMSI == mobile_id->type_of_id) { + id = mobile_id->imsi; + length = 8; + odd = true; + } else if (LIBLTE_MME_MOBILE_ID_TYPE_IMEI == mobile_id->type_of_id) { + id = mobile_id->imei; + length = 8; + odd = true; + } else if (LIBLTE_MME_MOBILE_ID_TYPE_IMEISV == mobile_id->type_of_id) { + id = mobile_id->imeisv; + length = 9; + odd = false; + } else if (LIBLTE_MME_MOBILE_ID_TYPE_TMSI == mobile_id->type_of_id) { + id32 = mobile_id->tmsi; + length = 5; + odd = false; + } + } else { + // FIXME: Not handling these IDs + return (err); + } - // Length - **ie_ptr = length; - *ie_ptr += 1; - if(LIBLTE_MME_MOBILE_ID_TYPE_TMSI != mobile_id->type_of_id) - { - // | Identity digit 1 | odd/even | Id type | - if(odd) - { - **ie_ptr = (id[0] << 4) | (1 << 3) | mobile_id->type_of_id; - }else{ - **ie_ptr = (id[0] << 4) | (0 << 3) | mobile_id->type_of_id; - } - *ie_ptr += 1; - - - // | Identity digit p+1 | Identity digit p | - for(i=0; i<7; i++) - { - (*ie_ptr)[i] = (id[i*2+2] << 4) | id[i*2+1]; - } - *ie_ptr += 7; - if(!odd) - { - **ie_ptr = 0xF0 | id[15]; - *ie_ptr += 1; - } - - err = LIBLTE_SUCCESS; - } - else{ - - **ie_ptr = (0xFF << 4) | (0 << 3) | mobile_id->type_of_id; - *ie_ptr += 1; - //4-Byte based ids - **ie_ptr = (id32 >> 24) & 0xFF; - *ie_ptr += 1; - **ie_ptr = (id32 >> 16) & 0xFF; - *ie_ptr += 1; - **ie_ptr = (id32 >> 8) & 0xFF; - *ie_ptr += 1; - **ie_ptr = id32 & 0xFF; - *ie_ptr += 1; - - err = LIBLTE_SUCCESS; - } + // Length + **ie_ptr = length; + *ie_ptr += 1; + if (LIBLTE_MME_MOBILE_ID_TYPE_TMSI != mobile_id->type_of_id) { + // | Identity digit 1 | odd/even | Id type | + if (odd) { + **ie_ptr = (id[0] << 4) | (1 << 3) | mobile_id->type_of_id; + } else { + **ie_ptr = (id[0] << 4) | (0 << 3) | mobile_id->type_of_id; + } + *ie_ptr += 1; + + // | Identity digit p+1 | Identity digit p | + for (i = 0; i < 7; i++) { + (*ie_ptr)[i] = (id[i * 2 + 2] << 4) | id[i * 2 + 1]; + } + *ie_ptr += 7; + if (!odd) { + **ie_ptr = 0xF0 | id[15]; + *ie_ptr += 1; + } + + err = LIBLTE_SUCCESS; + } else { + + **ie_ptr = (0xFF << 4) | (0 << 3) | mobile_id->type_of_id; + *ie_ptr += 1; + // 4-Byte based ids + **ie_ptr = (id32 >> 24) & 0xFF; + *ie_ptr += 1; + **ie_ptr = (id32 >> 16) & 0xFF; + *ie_ptr += 1; + **ie_ptr = (id32 >> 8) & 0xFF; + *ie_ptr += 1; + **ie_ptr = id32 & 0xFF; + *ie_ptr += 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_ID_STRUCT *mobile_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8** ie_ptr, LIBLTE_MME_MOBILE_ID_STRUCT* mobile_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *id; - uint32 length; - uint32 i; - bool odd = false; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* id; + uint32 length; + uint32 i; + bool odd = false; - if(ie_ptr != NULL && - mobile_id != NULL) - { - length = **ie_ptr; - *ie_ptr += 1; + if (ie_ptr != NULL && mobile_id != NULL) { + length = **ie_ptr; + *ie_ptr += 1; - mobile_id->type_of_id = **ie_ptr & 0x07; - - if(LIBLTE_MME_MOBILE_ID_TYPE_IMSI == mobile_id->type_of_id) - { - id = mobile_id->imsi; - odd = true; - }else if(LIBLTE_MME_MOBILE_ID_TYPE_IMEI == mobile_id->type_of_id){ - id = mobile_id->imei; - odd = true; - }else if(LIBLTE_MME_MOBILE_ID_TYPE_IMEISV == mobile_id->type_of_id){ - id = mobile_id->imeisv; - odd = false; - }else{ - // FIXME: Not handling these IDs - return(err); - } + mobile_id->type_of_id = **ie_ptr & 0x07; - id[0] = **ie_ptr >> 4; - *ie_ptr += 1; - for(i=0; i<7; i++) - { - id[i*2+1] = (*ie_ptr)[i] & 0x0F; - id[i*2+2] = (*ie_ptr)[i] >> 4; - } - if(odd) - { - *ie_ptr += 7; - }else{ - id[i*2+1] = (*ie_ptr)[i] & 0xF; - *ie_ptr += 8; - } + if (LIBLTE_MME_MOBILE_ID_TYPE_IMSI == mobile_id->type_of_id) { + id = mobile_id->imsi; + odd = true; + } else if (LIBLTE_MME_MOBILE_ID_TYPE_IMEI == mobile_id->type_of_id) { + id = mobile_id->imei; + odd = true; + } else if (LIBLTE_MME_MOBILE_ID_TYPE_IMEISV == mobile_id->type_of_id) { + id = mobile_id->imeisv; + odd = false; + } else { + // FIXME: Not handling these IDs + return (err); + } - err = LIBLTE_SUCCESS; + id[0] = **ie_ptr >> 4; + *ie_ptr += 1; + for (i = 0; i < 7; i++) { + id[i * 2 + 1] = (*ie_ptr)[i] & 0x0F; + id[i * 2 + 2] = (*ie_ptr)[i] >> 4; + } + if (odd) { + *ie_ptr += 7; + } else { + id[i * 2 + 1] = (*ie_ptr)[i] & 0xF; + *ie_ptr += 8; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -438,70 +397,66 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_id_ie(uint8 **i Document Reference: 24.301 v10.2.0 Section 9.9.2.4 24.008 v10.2.0 Section 10.5.1.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_2_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT *ms_cm2, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ms_cm2 != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 3; - (*ie_ptr)[1] = (ms_cm2->rev_lev & 0x03) << 5; - (*ie_ptr)[1] |= ms_cm2->es_ind << 4; - (*ie_ptr)[1] |= ms_cm2->a5_1 << 3; - (*ie_ptr)[1] |= ms_cm2->rf_power_cap & 0x07; - (*ie_ptr)[2] = ms_cm2->ps_cap << 6; - (*ie_ptr)[2] |= (ms_cm2->ss_screen_ind & 0x03) << 4; - (*ie_ptr)[2] |= ms_cm2->sm_cap << 3; - (*ie_ptr)[2] |= ms_cm2->vbs << 2; - (*ie_ptr)[2] |= ms_cm2->vgcs << 1; - (*ie_ptr)[2] |= ms_cm2->fc; - (*ie_ptr)[3] = ms_cm2->cm3 << 7; - (*ie_ptr)[3] |= ms_cm2->lcsva_cap << 5; - (*ie_ptr)[3] |= ms_cm2->ucs2 << 4; - (*ie_ptr)[3] |= ms_cm2->solsa << 3; - (*ie_ptr)[3] |= ms_cm2->cmsp << 2; - (*ie_ptr)[3] |= ms_cm2->a5_3 << 1; - (*ie_ptr)[3] |= ms_cm2->a5_2; - *ie_ptr += 4; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT *ms_cm2) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - ms_cm2 != NULL) - { - ms_cm2->rev_lev = (LIBLTE_MME_REVISION_LEVEL_ENUM)(((*ie_ptr)[1] >> 5) & 0x03); - ms_cm2->es_ind = ((*ie_ptr)[1] >> 4) & 0x01; - ms_cm2->a5_1 = ((*ie_ptr)[1] >> 3) & 0x01; - ms_cm2->rf_power_cap = (LIBLTE_MME_RF_POWER_CAPABILITY_ENUM)((*ie_ptr)[1] & 0x07); - ms_cm2->ps_cap = ((*ie_ptr)[2] >> 6) & 0x01; - ms_cm2->ss_screen_ind = (LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM)(((*ie_ptr)[2] >> 4) & 0x03); - ms_cm2->sm_cap = ((*ie_ptr)[2] >> 3) & 0x01; - ms_cm2->vbs = ((*ie_ptr)[2] >> 2) & 0x01; - ms_cm2->vgcs = ((*ie_ptr)[2] >> 1) & 0x01; - ms_cm2->fc = (*ie_ptr)[2] & 0x01; - ms_cm2->cm3 = ((*ie_ptr)[3] >> 7) & 0x01; - ms_cm2->lcsva_cap = ((*ie_ptr)[3] >> 5) & 0x01; - ms_cm2->ucs2 = ((*ie_ptr)[3] >> 4) & 0x01; - ms_cm2->solsa = ((*ie_ptr)[3] >> 3) & 0x01; - ms_cm2->cmsp = ((*ie_ptr)[3] >> 2) & 0x01; - ms_cm2->a5_3 = ((*ie_ptr)[3] >> 1) & 0x01; - ms_cm2->a5_2 = (*ie_ptr)[3] & 0x01; - *ie_ptr += 4; - - err = LIBLTE_SUCCESS; - } - - return(err); +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_2_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT* ms_cm2, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ms_cm2 != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 3; + (*ie_ptr)[1] = (ms_cm2->rev_lev & 0x03) << 5; + (*ie_ptr)[1] |= ms_cm2->es_ind << 4; + (*ie_ptr)[1] |= ms_cm2->a5_1 << 3; + (*ie_ptr)[1] |= ms_cm2->rf_power_cap & 0x07; + (*ie_ptr)[2] = ms_cm2->ps_cap << 6; + (*ie_ptr)[2] |= (ms_cm2->ss_screen_ind & 0x03) << 4; + (*ie_ptr)[2] |= ms_cm2->sm_cap << 3; + (*ie_ptr)[2] |= ms_cm2->vbs << 2; + (*ie_ptr)[2] |= ms_cm2->vgcs << 1; + (*ie_ptr)[2] |= ms_cm2->fc; + (*ie_ptr)[3] = ms_cm2->cm3 << 7; + (*ie_ptr)[3] |= ms_cm2->lcsva_cap << 5; + (*ie_ptr)[3] |= ms_cm2->ucs2 << 4; + (*ie_ptr)[3] |= ms_cm2->solsa << 3; + (*ie_ptr)[3] |= ms_cm2->cmsp << 2; + (*ie_ptr)[3] |= ms_cm2->a5_3 << 1; + (*ie_ptr)[3] |= ms_cm2->a5_2; + *ie_ptr += 4; + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8** ie_ptr, + LIBLTE_MME_MOBILE_STATION_CLASSMARK_2_STRUCT* ms_cm2) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && ms_cm2 != NULL) { + ms_cm2->rev_lev = (LIBLTE_MME_REVISION_LEVEL_ENUM)(((*ie_ptr)[1] >> 5) & 0x03); + ms_cm2->es_ind = ((*ie_ptr)[1] >> 4) & 0x01; + ms_cm2->a5_1 = ((*ie_ptr)[1] >> 3) & 0x01; + ms_cm2->rf_power_cap = (LIBLTE_MME_RF_POWER_CAPABILITY_ENUM)((*ie_ptr)[1] & 0x07); + ms_cm2->ps_cap = ((*ie_ptr)[2] >> 6) & 0x01; + ms_cm2->ss_screen_ind = (LIBLTE_MME_SS_SCREEN_INDICATOR_ENUM)(((*ie_ptr)[2] >> 4) & 0x03); + ms_cm2->sm_cap = ((*ie_ptr)[2] >> 3) & 0x01; + ms_cm2->vbs = ((*ie_ptr)[2] >> 2) & 0x01; + ms_cm2->vgcs = ((*ie_ptr)[2] >> 1) & 0x01; + ms_cm2->fc = (*ie_ptr)[2] & 0x01; + ms_cm2->cm3 = ((*ie_ptr)[3] >> 7) & 0x01; + ms_cm2->lcsva_cap = ((*ie_ptr)[3] >> 5) & 0x01; + ms_cm2->ucs2 = ((*ie_ptr)[3] >> 4) & 0x01; + ms_cm2->solsa = ((*ie_ptr)[3] >> 3) & 0x01; + ms_cm2->cmsp = ((*ie_ptr)[3] >> 2) & 0x01; + ms_cm2->a5_3 = ((*ie_ptr)[3] >> 1) & 0x01; + ms_cm2->a5_2 = (*ie_ptr)[3] & 0x01; + *ie_ptr += 4; + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -513,35 +468,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_2_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.5 24.008 v10.2.0 Section 10.5.1.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_3_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT *ms_cm3, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_mobile_station_classmark_3_ie(LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT* ms_cm3, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ms_cm3 != NULL && - ie_ptr != NULL) - { - // FIXME + if (ms_cm3 != NULL && ie_ptr != NULL) { + // FIXME - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8 **ie_ptr, - LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT *ms_cm3) +LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8** ie_ptr, + LIBLTE_MME_MOBILE_STATION_CLASSMARK_3_STRUCT* ms_cm3) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - ms_cm3 != NULL) - { - // FIXME + if (ie_ptr != NULL && ms_cm3 != NULL) { + // FIXME - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -552,36 +503,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_mobile_station_classmark_3_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_from_eutra_ie(uint8 dl_nas_count, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_from_eutra_ie(uint8 dl_nas_count, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = dl_nas_count & 0x0F; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = dl_nas_count & 0x0F; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8 **ie_ptr, - uint8 *dl_nas_count) +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8** ie_ptr, uint8* dl_nas_count) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - dl_nas_count != NULL) - { - *dl_nas_count = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && dl_nas_count != NULL) { + *dl_nas_count = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -594,51 +540,49 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_from_eutra_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_parameters_to_eutra_ie(LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT *sec_params, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_nas_security_parameters_to_eutra_ie(LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT* sec_params, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(sec_params != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = (sec_params->nonce_mme >> 24) & 0xFF; - (*ie_ptr)[1] = (sec_params->nonce_mme >> 16) & 0xFF; - (*ie_ptr)[2] = (sec_params->nonce_mme >> 8) & 0xFF; - (*ie_ptr)[3] = sec_params->nonce_mme & 0xFF; - (*ie_ptr)[4] = (sec_params->eea & 0x07) << 4; - (*ie_ptr)[4] |= sec_params->eia & 0x07; - (*ie_ptr)[5] = (sec_params->tsc_flag & 0x01) << 3; - (*ie_ptr)[5] |= sec_params->nas_ksi & 0x07; - *ie_ptr += 6; + if (sec_params != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = (sec_params->nonce_mme >> 24) & 0xFF; + (*ie_ptr)[1] = (sec_params->nonce_mme >> 16) & 0xFF; + (*ie_ptr)[2] = (sec_params->nonce_mme >> 8) & 0xFF; + (*ie_ptr)[3] = sec_params->nonce_mme & 0xFF; + (*ie_ptr)[4] = (sec_params->eea & 0x07) << 4; + (*ie_ptr)[4] |= sec_params->eia & 0x07; + (*ie_ptr)[5] = (sec_params->tsc_flag & 0x01) << 3; + (*ie_ptr)[5] |= sec_params->nas_ksi & 0x07; + *ie_ptr += 6; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8 **ie_ptr, - LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT *sec_params) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8** ie_ptr, + LIBLTE_MME_NAS_SECURITY_PARAMETERS_TO_EUTRA_STRUCT* sec_params) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - sec_params != NULL) - { - sec_params->nonce_mme = (*ie_ptr)[0] << 24; - sec_params->nonce_mme |= (*ie_ptr)[1] << 16; - sec_params->nonce_mme |= (*ie_ptr)[2] << 8; - sec_params->nonce_mme |= (*ie_ptr)[3]; - sec_params->eea = (LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM)(((*ie_ptr)[4] >> 4) & 0x07); - sec_params->eia = (LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM)((*ie_ptr)[4] & 0x07); - sec_params->tsc_flag = (LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM)(((*ie_ptr)[5] >> 3) & 0x01); - sec_params->nas_ksi = (*ie_ptr)[5] & 0x07; - *ie_ptr += 6; + if (ie_ptr != NULL && sec_params != NULL) { + sec_params->nonce_mme = (*ie_ptr)[0] << 24; + sec_params->nonce_mme |= (*ie_ptr)[1] << 16; + sec_params->nonce_mme |= (*ie_ptr)[2] << 8; + sec_params->nonce_mme |= (*ie_ptr)[3]; + sec_params->eea = (LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM)(((*ie_ptr)[4] >> 4) & 0x07); + sec_params->eia = (LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM)((*ie_ptr)[4] & 0x07); + sec_params->tsc_flag = (LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM)(((*ie_ptr)[5] >> 3) & 0x01); + sec_params->nas_ksi = (*ie_ptr)[5] & 0x07; + *ie_ptr += 6; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -649,66 +593,56 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_parameters_to_eutra_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.2.8 24.008 v10.2.0 Section 10.5.1.13 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_plmn_list_ie(LIBLTE_MME_PLMN_LIST_STRUCT *plmn_list, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(plmn_list != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = plmn_list->N_plmns * 3; - for(i=0; iN_plmns; i++) - { - (*ie_ptr)[i*3+0] = (((plmn_list->mcc[i]/10) % 10) << 4) | ((plmn_list->mcc[i]/100) % 10); - if(plmn_list->mnc[i] < 100) - { - (*ie_ptr)[i*3+1] = 0xF0 | (plmn_list->mcc[i] % 10); - (*ie_ptr)[i*3+2] = ((plmn_list->mnc[i] % 10) << 4) | ((plmn_list->mnc[i]/10) % 10); - }else{ - (*ie_ptr)[i*3+1] = ((plmn_list->mnc[i] % 10) << 4) | (plmn_list->mcc[i] % 10); - (*ie_ptr)[i*3+2] = (((plmn_list->mnc[i]/10) % 10) << 4) | ((plmn_list->mnc[i]/100) % 10); - } - } - *ie_ptr += (plmn_list->N_plmns * 3) + 1; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8 **ie_ptr, - LIBLTE_MME_PLMN_LIST_STRUCT *plmn_list) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - plmn_list != NULL) - { - plmn_list->N_plmns = (*ie_ptr)[0] / 3; - for(i=0; iN_plmns; i++) - { - plmn_list->mcc[i] = ((*ie_ptr)[i*3+0] & 0x0F)*100; - plmn_list->mcc[i] += (((*ie_ptr)[i*3+0] >> 4) & 0x0F)*10; - plmn_list->mcc[i] += (*ie_ptr)[i*3+1] & 0x0F; - if((((*ie_ptr)[i*3+1] >> 4) & 0x0F) == 0x0F) - { - plmn_list->mnc[i] = ((*ie_ptr)[i*3+2] & 0x0F)*10; - plmn_list->mnc[i] += ((*ie_ptr)[i*3+2] >> 4) & 0x0F; - }else{ - plmn_list->mnc[i] = ((*ie_ptr)[i*3+1] >> 4) & 0x0F; - plmn_list->mnc[i] += ((*ie_ptr)[i*3+2] & 0x0F)*100; - plmn_list->mnc[i] += (((*ie_ptr)[i*3+2] >> 4) & 0x0F)*10; - } - } - *ie_ptr += (*ie_ptr)[0] + 1; +LIBLTE_ERROR_ENUM liblte_mme_pack_plmn_list_ie(LIBLTE_MME_PLMN_LIST_STRUCT* plmn_list, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + + if (plmn_list != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = plmn_list->N_plmns * 3; + for (i = 0; i < plmn_list->N_plmns; i++) { + (*ie_ptr)[i * 3 + 0] = (((plmn_list->mcc[i] / 10) % 10) << 4) | ((plmn_list->mcc[i] / 100) % 10); + if (plmn_list->mnc[i] < 100) { + (*ie_ptr)[i * 3 + 1] = 0xF0 | (plmn_list->mcc[i] % 10); + (*ie_ptr)[i * 3 + 2] = ((plmn_list->mnc[i] % 10) << 4) | ((plmn_list->mnc[i] / 10) % 10); + } else { + (*ie_ptr)[i * 3 + 1] = ((plmn_list->mnc[i] % 10) << 4) | (plmn_list->mcc[i] % 10); + (*ie_ptr)[i * 3 + 2] = (((plmn_list->mnc[i] / 10) % 10) << 4) | ((plmn_list->mnc[i] / 100) % 10); + } + } + *ie_ptr += (plmn_list->N_plmns * 3) + 1; + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8** ie_ptr, LIBLTE_MME_PLMN_LIST_STRUCT* plmn_list) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && plmn_list != NULL) { + plmn_list->N_plmns = (*ie_ptr)[0] / 3; + for (i = 0; i < plmn_list->N_plmns; i++) { + plmn_list->mcc[i] = ((*ie_ptr)[i * 3 + 0] & 0x0F) * 100; + plmn_list->mcc[i] += (((*ie_ptr)[i * 3 + 0] >> 4) & 0x0F) * 10; + plmn_list->mcc[i] += (*ie_ptr)[i * 3 + 1] & 0x0F; + if ((((*ie_ptr)[i * 3 + 1] >> 4) & 0x0F) == 0x0F) { + plmn_list->mnc[i] = ((*ie_ptr)[i * 3 + 2] & 0x0F) * 10; + plmn_list->mnc[i] += ((*ie_ptr)[i * 3 + 2] >> 4) & 0x0F; + } else { + plmn_list->mnc[i] = ((*ie_ptr)[i * 3 + 1] >> 4) & 0x0F; + plmn_list->mnc[i] += ((*ie_ptr)[i * 3 + 2] & 0x0F) * 100; + plmn_list->mnc[i] += (((*ie_ptr)[i * 3 + 2] >> 4) & 0x0F) * 10; + } } + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -730,52 +664,46 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_plmn_list_ie(uint8 **i Document Reference: 24.301 v10.2.0 Section 9.9.2.10 24.008 v10.2.0 Section 10.5.4.32 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_supported_codec_list_ie(LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT *supported_codec_list, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(supported_codec_list != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = supported_codec_list->N_supported_codecs*4; - for(i=0; iN_supported_codecs; i++) - { - (*ie_ptr)[1+i*4+0] = supported_codec_list->supported_codec[i].sys_id; - (*ie_ptr)[1+i*4+1] = 2; - (*ie_ptr)[1+i*4+2] = (supported_codec_list->supported_codec[i].codec_bitmap >> 8) & 0xFF; - (*ie_ptr)[1+i*4+3] = supported_codec_list->supported_codec[i].codec_bitmap & 0xFF; - } - *ie_ptr += (supported_codec_list->N_supported_codecs*4) + 1; +LIBLTE_ERROR_ENUM liblte_mme_pack_supported_codec_list_ie(LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT* supported_codec_list, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (supported_codec_list != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = supported_codec_list->N_supported_codecs * 4; + for (i = 0; i < supported_codec_list->N_supported_codecs; i++) { + (*ie_ptr)[1 + i * 4 + 0] = supported_codec_list->supported_codec[i].sys_id; + (*ie_ptr)[1 + i * 4 + 1] = 2; + (*ie_ptr)[1 + i * 4 + 2] = (supported_codec_list->supported_codec[i].codec_bitmap >> 8) & 0xFF; + (*ie_ptr)[1 + i * 4 + 3] = supported_codec_list->supported_codec[i].codec_bitmap & 0xFF; } + *ie_ptr += (supported_codec_list->N_supported_codecs * 4) + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_supported_codec_list_ie(uint8 **ie_ptr, - LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT *supported_codec_list) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_supported_codec_list_ie(uint8** ie_ptr, LIBLTE_MME_SUPPORTED_CODEC_LIST_STRUCT* supported_codec_list) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - supported_codec_list != NULL) - { - supported_codec_list->N_supported_codecs = ((*ie_ptr)[0]/4); - for(i=0; iN_supported_codecs; i++) - { - supported_codec_list->supported_codec[i].sys_id = (*ie_ptr)[1+i*4+0]; - supported_codec_list->supported_codec[i].codec_bitmap = (*ie_ptr)[1+i*4+2] << 8; - supported_codec_list->supported_codec[i].codec_bitmap |= (*ie_ptr)[1+i*4+3]; - } - *ie_ptr += (supported_codec_list->N_supported_codecs*4) + 1; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && supported_codec_list != NULL) { + supported_codec_list->N_supported_codecs = ((*ie_ptr)[0] / 4); + for (i = 0; i < supported_codec_list->N_supported_codecs; i++) { + supported_codec_list->supported_codec[i].sys_id = (*ie_ptr)[1 + i * 4 + 0]; + supported_codec_list->supported_codec[i].codec_bitmap = (*ie_ptr)[1 + i * 4 + 2] << 8; + supported_codec_list->supported_codec[i].codec_bitmap |= (*ie_ptr)[1 + i * 4 + 3]; } + *ie_ptr += (supported_codec_list->N_supported_codecs * 4) + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -787,36 +715,33 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_supported_codec_list_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.0A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_result_ie(LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM result, + uint8 bit_offset, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= result << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= result << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM *result) +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM* result) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(result != NULL && - ie_ptr != NULL) - { - *result = (LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM)((**ie_ptr >> bit_offset) & 0x03); + if (result != NULL && ie_ptr != NULL) { + *result = (LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_ENUM)((**ie_ptr >> bit_offset) & 0x03); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -828,36 +753,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_result_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.0B *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_additional_update_type_ie(LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM aut, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_additional_update_type_ie(LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM aut, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= aut << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= aut << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM *aut) +LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM* aut) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - aut != NULL) - { - *aut = (LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM)((**ie_ptr >> bit_offset) & 0x01); + if (ie_ptr != NULL && aut != NULL) { + *aut = (LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_ENUM)((**ie_ptr >> bit_offset) & 0x01); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -871,46 +792,38 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_additional_update_type_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.1 24.008 v10.2.0 Section 10.5.3.2.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_parameter_ie(uint8 *auth_fail_param, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_parameter_ie(uint8* auth_fail_param, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(auth_fail_param != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 14; - for(i=0; i<14; i++) - { - (*ie_ptr)[i+1] = auth_fail_param[i]; - } - *ie_ptr += 15; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (auth_fail_param != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 14; + for (i = 0; i < 14; i++) { + (*ie_ptr)[i + 1] = auth_fail_param[i]; } + *ie_ptr += 15; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8 **ie_ptr, - uint8 *auth_fail_param) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8** ie_ptr, uint8* auth_fail_param) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - auth_fail_param != NULL) - { - for(i=0; i<14; i++) - { - auth_fail_param[i] = (*ie_ptr)[i+1]; - } - *ie_ptr += 15; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && auth_fail_param != NULL) { + for (i = 0; i < 14; i++) { + auth_fail_param[i] = (*ie_ptr)[i + 1]; } + *ie_ptr += 15; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -922,46 +835,38 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_parameter_ie(uint8 ** Document Reference: 24.301 v10.2.0 Section 9.9.3.2 24.008 v10.2.0 Section 10.5.3.1.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_autn_ie(uint8 *autn, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_autn_ie(uint8* autn, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(autn != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 16; - for(i=0; i<16; i++) - { - (*ie_ptr)[i+1] = autn[i]; - } - *ie_ptr += 17; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (autn != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 16; + for (i = 0; i < 16; i++) { + (*ie_ptr)[i + 1] = autn[i]; } + *ie_ptr += 17; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8 **ie_ptr, - uint8 *autn) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8** ie_ptr, uint8* autn) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - autn != NULL) - { - for(i=0; i<16; i++) - { - autn[i] = (*ie_ptr)[i+1]; - } - *ie_ptr += 17; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && autn != NULL) { + for (i = 0; i < 16; i++) { + autn[i] = (*ie_ptr)[i + 1]; } + *ie_ptr += 17; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -977,45 +882,37 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_autn_ie(uint8 **ie_ Document Reference: 24.301 v10.2.0 Section 9.9.3.3 24.008 v10.2.0 Section 10.5.3.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_rand_ie(uint8 *rand_val, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_parameter_rand_ie(uint8* rand_val, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(rand_val != NULL && - ie_ptr != NULL) - { - for(i=0; i<16; i++) - { - (*ie_ptr)[i] = rand_val[i]; - } - *ie_ptr += 16; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (rand_val != NULL && ie_ptr != NULL) { + for (i = 0; i < 16; i++) { + (*ie_ptr)[i] = rand_val[i]; } + *ie_ptr += 16; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8 **ie_ptr, - uint8 *rand_val) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8** ie_ptr, uint8* rand_val) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - rand_val != NULL) - { - for(i=0; i<16; i++) - { - rand_val[i] = (*ie_ptr)[i]; - } - *ie_ptr += 16; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && rand_val != NULL) { + for (i = 0; i < 16; i++) { + rand_val[i] = (*ie_ptr)[i]; } + *ie_ptr += 16; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1026,48 +923,39 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8 **ie_ Document Reference: 24.301 v10.2.0 Section 9.9.3.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8 *res, - int res_len, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(res != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = res_len; - *ie_ptr += 1; - for(i=0; i> bit_offset) & 0x07; + if (ie_ptr != NULL && key_seq != NULL) { + *key_seq = ((*ie_ptr)[0] >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1120,36 +1001,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ciphering_key_sequence_number_ie(uint8 **ie_ Document Reference: 24.301 v10.2.0 Section 9.9.3.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_csfb_response_ie(uint8 csfb_resp, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_csfb_response_ie(uint8 csfb_resp, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= (csfb_resp & 0x07) << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= (csfb_resp & 0x07) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *csfb_resp) +LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8** ie_ptr, uint8 bit_offset, uint8* csfb_resp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - csfb_resp != NULL) - { - *csfb_resp = ((*ie_ptr)[0] & 0x07) >> bit_offset; + if (ie_ptr != NULL && csfb_resp != NULL) { + *csfb_resp = ((*ie_ptr)[0] & 0x07) >> bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1160,37 +1034,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_csfb_response_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.6 24.008 v10.2.0 Section 10.5.3.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_daylight_saving_time_ie(LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM dst, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = 1; - (*ie_ptr)[1] = dst & 0x03; - *ie_ptr += 2; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = 1; + (*ie_ptr)[1] = dst & 0x03; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8 **ie_ptr, - LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM *dst) +LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8** ie_ptr, LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM* dst) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - dst != NULL) - { - *dst = (LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM)((*ie_ptr)[1] & 0x03); - *ie_ptr += 2; + if (ie_ptr != NULL && dst != NULL) { + *dst = (LIBLTE_MME_DAYLIGHT_SAVING_TIME_ENUM)((*ie_ptr)[1] & 0x03); + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1200,39 +1069,33 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_daylight_saving_time_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_type_ie(LIBLTE_MME_DETACH_TYPE_STRUCT *detach_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_detach_type_ie(LIBLTE_MME_DETACH_TYPE_STRUCT* detach_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(detach_type != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] |= (detach_type->switch_off & 0x01) << (3 + bit_offset); - (*ie_ptr)[0] |= (detach_type->type_of_detach & 0x07) << bit_offset; + if (detach_type != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] |= (detach_type->switch_off & 0x01) << (3 + bit_offset); + (*ie_ptr)[0] |= (detach_type->type_of_detach & 0x07) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_DETACH_TYPE_STRUCT *detach_type) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_detach_type_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_DETACH_TYPE_STRUCT* detach_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - detach_type != NULL) - { - detach_type->switch_off = ((*ie_ptr)[0] >> (3 + bit_offset)) & 0x01; - detach_type->type_of_detach = ((*ie_ptr)[0] >> bit_offset) & 0x07; + if (ie_ptr != NULL && detach_type != NULL) { + detach_type->switch_off = ((*ie_ptr)[0] >> (3 + bit_offset)) & 0x01; + detach_type->type_of_detach = ((*ie_ptr)[0] >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1243,43 +1106,37 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_type_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.8 24.008 v10.2.0 Section 10.5.5.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_drx_parameter_ie(LIBLTE_MME_DRX_PARAMETER_STRUCT *drx_param, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_drx_parameter_ie(LIBLTE_MME_DRX_PARAMETER_STRUCT* drx_param, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(drx_param != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = drx_param->split_pg_cycle_code; - (*ie_ptr)[1] = (drx_param->drx_cycle_len_coeff_and_value & 0x0F) << 4; - (*ie_ptr)[1] |= (drx_param->split_on_ccch & 0x01) << 3; - (*ie_ptr)[1] |= drx_param->non_drx_timer & 0x07; - *ie_ptr += 2; + if (drx_param != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = drx_param->split_pg_cycle_code; + (*ie_ptr)[1] = (drx_param->drx_cycle_len_coeff_and_value & 0x0F) << 4; + (*ie_ptr)[1] |= (drx_param->split_on_ccch & 0x01) << 3; + (*ie_ptr)[1] |= drx_param->non_drx_timer & 0x07; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8 **ie_ptr, - LIBLTE_MME_DRX_PARAMETER_STRUCT *drx_param) +LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8** ie_ptr, LIBLTE_MME_DRX_PARAMETER_STRUCT* drx_param) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - drx_param != NULL) - { - drx_param->split_pg_cycle_code = (*ie_ptr)[0]; - drx_param->drx_cycle_len_coeff_and_value = ((*ie_ptr)[1] >> 4) & 0x0F; - drx_param->split_on_ccch = ((*ie_ptr)[1] >> 3) & 0x01; - drx_param->non_drx_timer = (LIBLTE_MME_NON_DRX_TIMER_ENUM)((*ie_ptr)[1] & 0x07); - *ie_ptr += 2; + if (ie_ptr != NULL && drx_param != NULL) { + drx_param->split_pg_cycle_code = (*ie_ptr)[0]; + drx_param->drx_cycle_len_coeff_and_value = ((*ie_ptr)[1] >> 4) & 0x0F; + drx_param->split_on_ccch = ((*ie_ptr)[1] >> 3) & 0x01; + drx_param->non_drx_timer = (LIBLTE_MME_NON_DRX_TIMER_ENUM)((*ie_ptr)[1] & 0x07); + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1290,36 +1147,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_drx_parameter_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_cause_ie(uint8 emm_cause, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_cause_ie(uint8 emm_cause, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr = emm_cause; - *ie_ptr += 1; + if (ie_ptr != NULL) { + **ie_ptr = emm_cause; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8 **ie_ptr, - uint8 *emm_cause) +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8** ie_ptr, uint8* emm_cause) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - emm_cause != NULL) - { - *emm_cause = **ie_ptr; - *ie_ptr += 1; + if (ie_ptr != NULL && emm_cause != NULL) { + *emm_cause = **ie_ptr; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1329,36 +1181,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_cause_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.10 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_result_ie(uint8 result, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_result_ie(uint8 result, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= result << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= result << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *result) +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8** ie_ptr, uint8 bit_offset, uint8* result) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - result != NULL) - { - *result = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && result != NULL) { + *result = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1368,36 +1213,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_result_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.11 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_type_ie(uint8 attach_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_attach_type_ie(uint8 attach_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= attach_type << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= attach_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *attach_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* attach_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - attach_type != NULL) - { - *attach_type = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && attach_type != NULL) { + *attach_type = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1407,146 +1245,132 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_attach_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_mobile_id_ie(LIBLTE_MME_EPS_MOBILE_ID_STRUCT *eps_mobile_id, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *id; - uint32 i; - - if(eps_mobile_id != NULL && - ie_ptr != NULL) - { - if(LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI == eps_mobile_id->type_of_id) - { - **ie_ptr = 11; - *ie_ptr += 1; - **ie_ptr = 0xF0 | eps_mobile_id->type_of_id; - *ie_ptr += 1; - **ie_ptr = (((eps_mobile_id->guti.mcc/10) % 10) << 4) | ((eps_mobile_id->guti.mcc/100) % 10); - *ie_ptr += 1; - if(eps_mobile_id->guti.mnc < 100) - { - **ie_ptr = 0xF0 | (eps_mobile_id->guti.mcc % 10); - *ie_ptr += 1; - **ie_ptr = ((eps_mobile_id->guti.mnc % 10) << 4) | ((eps_mobile_id->guti.mnc/10) % 10); - *ie_ptr += 1; - }else{ - **ie_ptr = ((eps_mobile_id->guti.mnc % 10) << 4) | (eps_mobile_id->guti.mcc % 10); - *ie_ptr += 1; - **ie_ptr = (((eps_mobile_id->guti.mnc/10) % 10) << 4) | ((eps_mobile_id->guti.mnc/100) % 10); - *ie_ptr += 1; - } - **ie_ptr = (eps_mobile_id->guti.mme_group_id >> 8) & 0xFF; - *ie_ptr += 1; - **ie_ptr = eps_mobile_id->guti.mme_group_id & 0xFF; - *ie_ptr += 1; - **ie_ptr = eps_mobile_id->guti.mme_code; - *ie_ptr += 1; - **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 24) & 0xFF; - *ie_ptr += 1; - **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 16) & 0xFF; - *ie_ptr += 1; - **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 8) & 0xFF; - *ie_ptr += 1; - **ie_ptr = eps_mobile_id->guti.m_tmsi & 0xFF; - *ie_ptr += 1; - }else{ - if(LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI == eps_mobile_id->type_of_id) - { - id = eps_mobile_id->imsi; - }else{ - id = eps_mobile_id->imei; - } - - **ie_ptr = 8; - *ie_ptr += 1; - **ie_ptr = (id[0] << 4) | (1 << 3) | eps_mobile_id->type_of_id; - *ie_ptr += 1; - for(i=0; i<7; i++) - { - **ie_ptr = (id[i*2+2] << 4) | id[i*2+1]; - *ie_ptr += 1; - } - } - - err = LIBLTE_SUCCESS; +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_mobile_id_ie(LIBLTE_MME_EPS_MOBILE_ID_STRUCT* eps_mobile_id, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* id; + uint32 i; + + if (eps_mobile_id != NULL && ie_ptr != NULL) { + if (LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI == eps_mobile_id->type_of_id) { + **ie_ptr = 11; + *ie_ptr += 1; + **ie_ptr = 0xF0 | eps_mobile_id->type_of_id; + *ie_ptr += 1; + **ie_ptr = (((eps_mobile_id->guti.mcc / 10) % 10) << 4) | ((eps_mobile_id->guti.mcc / 100) % 10); + *ie_ptr += 1; + if (eps_mobile_id->guti.mnc < 100) { + **ie_ptr = 0xF0 | (eps_mobile_id->guti.mcc % 10); + *ie_ptr += 1; + **ie_ptr = ((eps_mobile_id->guti.mnc % 10) << 4) | ((eps_mobile_id->guti.mnc / 10) % 10); + *ie_ptr += 1; + } else { + **ie_ptr = ((eps_mobile_id->guti.mnc % 10) << 4) | (eps_mobile_id->guti.mcc % 10); + *ie_ptr += 1; + **ie_ptr = (((eps_mobile_id->guti.mnc / 10) % 10) << 4) | ((eps_mobile_id->guti.mnc / 100) % 10); + *ie_ptr += 1; + } + **ie_ptr = (eps_mobile_id->guti.mme_group_id >> 8) & 0xFF; + *ie_ptr += 1; + **ie_ptr = eps_mobile_id->guti.mme_group_id & 0xFF; + *ie_ptr += 1; + **ie_ptr = eps_mobile_id->guti.mme_code; + *ie_ptr += 1; + **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 24) & 0xFF; + *ie_ptr += 1; + **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 16) & 0xFF; + *ie_ptr += 1; + **ie_ptr = (eps_mobile_id->guti.m_tmsi >> 8) & 0xFF; + *ie_ptr += 1; + **ie_ptr = eps_mobile_id->guti.m_tmsi & 0xFF; + *ie_ptr += 1; + } else { + if (LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI == eps_mobile_id->type_of_id) { + id = eps_mobile_id->imsi; + } else { + id = eps_mobile_id->imei; + } + + **ie_ptr = 8; + *ie_ptr += 1; + **ie_ptr = (id[0] << 4) | (1 << 3) | eps_mobile_id->type_of_id; + *ie_ptr += 1; + for (i = 0; i < 7; i++) { + **ie_ptr = (id[i * 2 + 2] << 4) | id[i * 2 + 1]; + *ie_ptr += 1; + } } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_MOBILE_ID_STRUCT *eps_mobile_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8** ie_ptr, LIBLTE_MME_EPS_MOBILE_ID_STRUCT* eps_mobile_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *id; - uint32 length; - uint32 i; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* id; + uint32 length; + uint32 i; - if(ie_ptr != NULL && - eps_mobile_id != NULL) - { - length = **ie_ptr; - *ie_ptr += 1; + if (ie_ptr != NULL && eps_mobile_id != NULL) { + length = **ie_ptr; + *ie_ptr += 1; - eps_mobile_id->type_of_id = **ie_ptr & 0x07; - - if(LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI == eps_mobile_id->type_of_id) - { - *ie_ptr += 1; - eps_mobile_id->guti.mcc = (**ie_ptr & 0x0F)*100; - eps_mobile_id->guti.mcc += ((**ie_ptr >> 4) & 0x0F)*10; - *ie_ptr += 1; - eps_mobile_id->guti.mcc += **ie_ptr & 0x0F; - if(((**ie_ptr >> 4) & 0x0F) == 0x0F) - { - *ie_ptr += 1; - eps_mobile_id->guti.mnc = (**ie_ptr & 0x0F)*10; - eps_mobile_id->guti.mnc += (**ie_ptr >> 4) & 0x0F; - *ie_ptr += 1; - }else{ - eps_mobile_id->guti.mnc = (**ie_ptr >> 4) & 0x0F; - *ie_ptr += 1; - eps_mobile_id->guti.mnc += (**ie_ptr & 0x0F)*100; - eps_mobile_id->guti.mnc += ((**ie_ptr >> 4) & 0x0F)*10; - *ie_ptr += 1; - } - eps_mobile_id->guti.mme_group_id = **ie_ptr << 8; - *ie_ptr += 1; - eps_mobile_id->guti.mme_group_id |= **ie_ptr; - *ie_ptr += 1; - eps_mobile_id->guti.mme_code = **ie_ptr; - *ie_ptr += 1; - eps_mobile_id->guti.m_tmsi = **ie_ptr << 24; - *ie_ptr += 1; - eps_mobile_id->guti.m_tmsi |= **ie_ptr << 16; - *ie_ptr += 1; - eps_mobile_id->guti.m_tmsi |= **ie_ptr << 8; - *ie_ptr += 1; - eps_mobile_id->guti.m_tmsi |= **ie_ptr; - *ie_ptr += 1; - }else{ - if(LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI == eps_mobile_id->type_of_id) - { - id = eps_mobile_id->imsi; - }else{ - id = eps_mobile_id->imei; - } - - id[0] = **ie_ptr >> 4; - *ie_ptr += 1; - for(i=0; i<7; i++) - { - id[i*2+1] = **ie_ptr & 0x0F; - id[i*2+2] = **ie_ptr >> 4; - *ie_ptr += 1; - } - } + eps_mobile_id->type_of_id = **ie_ptr & 0x07; - err = LIBLTE_SUCCESS; + if (LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI == eps_mobile_id->type_of_id) { + *ie_ptr += 1; + eps_mobile_id->guti.mcc = (**ie_ptr & 0x0F) * 100; + eps_mobile_id->guti.mcc += ((**ie_ptr >> 4) & 0x0F) * 10; + *ie_ptr += 1; + eps_mobile_id->guti.mcc += **ie_ptr & 0x0F; + if (((**ie_ptr >> 4) & 0x0F) == 0x0F) { + *ie_ptr += 1; + eps_mobile_id->guti.mnc = (**ie_ptr & 0x0F) * 10; + eps_mobile_id->guti.mnc += (**ie_ptr >> 4) & 0x0F; + *ie_ptr += 1; + } else { + eps_mobile_id->guti.mnc = (**ie_ptr >> 4) & 0x0F; + *ie_ptr += 1; + eps_mobile_id->guti.mnc += (**ie_ptr & 0x0F) * 100; + eps_mobile_id->guti.mnc += ((**ie_ptr >> 4) & 0x0F) * 10; + *ie_ptr += 1; + } + eps_mobile_id->guti.mme_group_id = **ie_ptr << 8; + *ie_ptr += 1; + eps_mobile_id->guti.mme_group_id |= **ie_ptr; + *ie_ptr += 1; + eps_mobile_id->guti.mme_code = **ie_ptr; + *ie_ptr += 1; + eps_mobile_id->guti.m_tmsi = **ie_ptr << 24; + *ie_ptr += 1; + eps_mobile_id->guti.m_tmsi |= **ie_ptr << 16; + *ie_ptr += 1; + eps_mobile_id->guti.m_tmsi |= **ie_ptr << 8; + *ie_ptr += 1; + eps_mobile_id->guti.m_tmsi |= **ie_ptr; + *ie_ptr += 1; + } else { + if (LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI == eps_mobile_id->type_of_id) { + id = eps_mobile_id->imsi; + } else { + id = eps_mobile_id->imei; + } + + id[0] = **ie_ptr >> 4; + *ie_ptr += 1; + for (i = 0; i < 7; i++) { + id[i * 2 + 1] = **ie_ptr & 0x0F; + id[i * 2 + 2] = **ie_ptr >> 4; + *ie_ptr += 1; + } } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -1557,46 +1381,42 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_mobile_id_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.12A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_network_feature_support_ie(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT *eps_nfs, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_network_feature_support_ie(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT* eps_nfs, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(eps_nfs != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 1; - (*ie_ptr)[1] = eps_nfs->esrps << 5; - (*ie_ptr)[1] |= (eps_nfs->cs_lcs & 0x03) << 3; - (*ie_ptr)[1] |= eps_nfs->epc_lcs << 2; - (*ie_ptr)[1] |= eps_nfs->emc_bs << 1; - (*ie_ptr)[1] |= eps_nfs->ims_vops; - *ie_ptr += 2; + if (eps_nfs != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 1; + (*ie_ptr)[1] = eps_nfs->esrps << 5; + (*ie_ptr)[1] |= (eps_nfs->cs_lcs & 0x03) << 3; + (*ie_ptr)[1] |= eps_nfs->epc_lcs << 2; + (*ie_ptr)[1] |= eps_nfs->emc_bs << 1; + (*ie_ptr)[1] |= eps_nfs->ims_vops; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_network_feature_support_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT *eps_nfs) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_eps_network_feature_support_ie(uint8** ie_ptr, LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_STRUCT* eps_nfs) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - eps_nfs != NULL) - { - eps_nfs->esrps = ((*ie_ptr)[1] >> 5) & 0x01; - eps_nfs->cs_lcs = (LIBLTE_MME_CS_LCS_ENUM)(((*ie_ptr)[1] >> 3) & 0x03); - eps_nfs->epc_lcs = ((*ie_ptr)[1] >> 2) & 0x01; - eps_nfs->emc_bs = ((*ie_ptr)[1] >> 1) & 0x01; - eps_nfs->ims_vops = (*ie_ptr)[1] & 0x01; - *ie_ptr += 2; + if (ie_ptr != NULL && eps_nfs != NULL) { + eps_nfs->esrps = ((*ie_ptr)[1] >> 5) & 0x01; + eps_nfs->cs_lcs = (LIBLTE_MME_CS_LCS_ENUM)(((*ie_ptr)[1] >> 3) & 0x03); + eps_nfs->epc_lcs = ((*ie_ptr)[1] >> 2) & 0x01; + eps_nfs->emc_bs = ((*ie_ptr)[1] >> 1) & 0x01; + eps_nfs->ims_vops = (*ie_ptr)[1] & 0x01; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1607,36 +1427,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_network_feature_support_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.13 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_result_ie(uint8 eps_update_res, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_result_ie(uint8 eps_update_res, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= (eps_update_res & 0x07) << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= (eps_update_res & 0x07) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *eps_update_res) +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8** ie_ptr, uint8 bit_offset, uint8* eps_update_res) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - eps_update_res != NULL) - { - *eps_update_res = ((*ie_ptr)[0] >> bit_offset) & 0x07; + if (ie_ptr != NULL && eps_update_res != NULL) { + *eps_update_res = ((*ie_ptr)[0] >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1647,39 +1460,34 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_result_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.14 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_update_type_ie(LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT *eps_update_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_eps_update_type_ie(LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT* eps_update_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(eps_update_type != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] |= (eps_update_type->active_flag & 0x01) << (bit_offset + 3); - (*ie_ptr)[0] |= (eps_update_type->type & 0x07) << bit_offset; + if (eps_update_type != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] |= (eps_update_type->active_flag & 0x01) << (bit_offset + 3); + (*ie_ptr)[0] |= (eps_update_type->type & 0x07) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT *eps_update_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8** ie_ptr, + uint8 bit_offset, + LIBLTE_MME_EPS_UPDATE_TYPE_STRUCT* eps_update_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - eps_update_type != NULL) - { - eps_update_type->active_flag = ((*ie_ptr)[0] >> (bit_offset + 3)) & 0x01; - eps_update_type->type = (LIBLTE_MME_EPS_UPDATE_TYPE_ENUM)(((*ie_ptr)[0] >> bit_offset) & 0x07); + if (ie_ptr != NULL && eps_update_type != NULL) { + eps_update_type->active_flag = ((*ie_ptr)[0] >> (bit_offset + 3)) & 0x01; + eps_update_type->type = (LIBLTE_MME_EPS_UPDATE_TYPE_ENUM)(((*ie_ptr)[0] >> bit_offset) & 0x07); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1690,55 +1498,46 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_update_type_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.15 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *esm_msg, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(esm_msg != NULL && - ie_ptr != NULL && - esm_msg->N_bytes <= LIBLTE_MAX_MSG_SIZE_BYTES) - { - (*ie_ptr)[0] = esm_msg->N_bytes >> 8; - (*ie_ptr)[1] = esm_msg->N_bytes & 0xFF; - for(i=0; iN_bytes; i++) - { - (*ie_ptr)[2+i] = esm_msg->msg[i]; - } - *ie_ptr += esm_msg->N_bytes + 2; +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* esm_msg, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (esm_msg != NULL && ie_ptr != NULL && esm_msg->N_bytes <= LIBLTE_MAX_MSG_SIZE_BYTES) { + (*ie_ptr)[0] = esm_msg->N_bytes >> 8; + (*ie_ptr)[1] = esm_msg->N_bytes & 0xFF; + for (i = 0; i < esm_msg->N_bytes; i++) { + (*ie_ptr)[2 + i] = esm_msg->msg[i]; } + *ie_ptr += esm_msg->N_bytes + 2; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *esm_msg) +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* esm_msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - esm_msg != NULL) - { - esm_msg->N_bytes = (*ie_ptr)[0] << 8; - esm_msg->N_bytes |= (*ie_ptr)[1]; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - if(esm_msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES ) { - return err; - } + if (ie_ptr != NULL && esm_msg != NULL) { + esm_msg->N_bytes = (*ie_ptr)[0] << 8; + esm_msg->N_bytes |= (*ie_ptr)[1]; - for(i=0; iN_bytes; i++) - { - esm_msg->msg[i] = (*ie_ptr)[2+i]; - } - *ie_ptr += esm_msg->N_bytes + 2; + if (esm_msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES) { + return err; + } - err = LIBLTE_SUCCESS; + for (i = 0; i < esm_msg->N_bytes; i++) { + esm_msg->msg[i] = (*ie_ptr)[2 + i]; } + *ie_ptr += esm_msg->N_bytes + 2; - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -1749,38 +1548,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_message_container_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.16 24.008 v10.2.0 Section 10.5.7.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_ie(LIBLTE_MME_GPRS_TIMER_STRUCT *timer, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_ie(LIBLTE_MME_GPRS_TIMER_STRUCT* timer, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(timer != NULL && - ie_ptr != NULL) - { - **ie_ptr = ((timer->unit & 0x07) << 5) | (timer->value & 0x1F); - *ie_ptr += 1; + if (timer != NULL && ie_ptr != NULL) { + **ie_ptr = ((timer->unit & 0x07) << 5) | (timer->value & 0x1F); + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8 **ie_ptr, - LIBLTE_MME_GPRS_TIMER_STRUCT *timer) +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8** ie_ptr, LIBLTE_MME_GPRS_TIMER_STRUCT* timer) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - timer != NULL) - { - timer->unit = **ie_ptr >> 5; - timer->value = **ie_ptr & 0x1F; - *ie_ptr += 1; + if (ie_ptr != NULL && timer != NULL) { + timer->unit = **ie_ptr >> 5; + timer->value = **ie_ptr & 0x1F; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1791,39 +1584,34 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_ie(uint8 * Document Reference: 24.301 v10.2.0 Section 9.9.3.16A 24.008 v10.2.0 Section 10.5.7.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_2_ie(uint8 value, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_2_ie(uint8 value, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr = 1; - *ie_ptr += 1; - **ie_ptr = value; - *ie_ptr += 1; + if (ie_ptr != NULL) { + **ie_ptr = 1; + *ie_ptr += 1; + **ie_ptr = value; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8 **ie_ptr, - uint8 *value) +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8** ie_ptr, uint8* value) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - value != NULL) - { - *ie_ptr += 1; - *value = **ie_ptr; - *ie_ptr += 1; + if (ie_ptr != NULL && value != NULL) { + *ie_ptr += 1; + *value = **ie_ptr; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1834,39 +1622,33 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_2_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.16B 24.008 v10.2.0 Section 10.5.7.4A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_3_ie(LIBLTE_MME_GPRS_TIMER_3_STRUCT *timer, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_gprs_timer_3_ie(LIBLTE_MME_GPRS_TIMER_3_STRUCT* timer, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(timer != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 1; - (*ie_ptr)[1] = ((timer->unit & 0x07) << 5) | (timer->value & 0x1F); - *ie_ptr += 2; + if (timer != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 1; + (*ie_ptr)[1] = ((timer->unit & 0x07) << 5) | (timer->value & 0x1F); + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8 **ie_ptr, - LIBLTE_MME_GPRS_TIMER_3_STRUCT *timer) +LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8** ie_ptr, LIBLTE_MME_GPRS_TIMER_3_STRUCT* timer) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - timer != NULL) - { - timer->unit = (*ie_ptr)[1] >> 5; - timer->value = (*ie_ptr)[1] & 0x1F; - *ie_ptr += 2; + if (ie_ptr != NULL && timer != NULL) { + timer->unit = (*ie_ptr)[1] >> 5; + timer->value = (*ie_ptr)[1] & 0x1F; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1877,36 +1659,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_gprs_timer_3_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.17 24.008 v10.2.0 Section 10.5.5.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_type_2_ie(uint8 id_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_type_2_ie(uint8 id_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= id_type << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= id_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *id_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8** ie_ptr, uint8 bit_offset, uint8* id_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - id_type != NULL) - { - *id_type = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && id_type != NULL) { + *id_type = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1919,36 +1694,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_type_2_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.18 24.008 v10.2.0 Section 10.5.5.10 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_imeisv_request_ie(LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_imeisv_request_ie(LIBLTE_MME_IMEISV_REQUEST_ENUM imeisv_req, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= imeisv_req << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= imeisv_req << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_imeisv_request_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_IMEISV_REQUEST_ENUM *imeisv_req) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_imeisv_request_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_IMEISV_REQUEST_ENUM* imeisv_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - imeisv_req != NULL) - { - *imeisv_req = (LIBLTE_MME_IMEISV_REQUEST_ENUM)((**ie_ptr >> bit_offset) & 0x07); + if (ie_ptr != NULL && imeisv_req != NULL) { + *imeisv_req = (LIBLTE_MME_IMEISV_REQUEST_ENUM)((**ie_ptr >> bit_offset) & 0x07); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1962,39 +1732,35 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_imeisv_request_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.19 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ksi_and_sequence_number_ie(LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT *ksi_and_seq_num, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_ksi_and_sequence_number_ie(LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT* ksi_and_seq_num, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ksi_and_seq_num != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = (ksi_and_seq_num->ksi & 0x07) << 5; - (*ie_ptr)[0] |= ksi_and_seq_num->seq_num & 0x1F; - *ie_ptr += 1; + if (ksi_and_seq_num != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = (ksi_and_seq_num->ksi & 0x07) << 5; + (*ie_ptr)[0] |= ksi_and_seq_num->seq_num & 0x1F; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_ksi_and_sequence_number_ie(uint8 **ie_ptr, - LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT *ksi_and_seq_num) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_ksi_and_sequence_number_ie(uint8** ie_ptr, LIBLTE_MME_KSI_AND_SEQUENCE_NUMBER_STRUCT* ksi_and_seq_num) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - ksi_and_seq_num != NULL) - { - ksi_and_seq_num->ksi = ((*ie_ptr)[0] >> 5) & 0x07; - ksi_and_seq_num->seq_num = (*ie_ptr)[0] & 0x1F; - *ie_ptr += 1; + if (ie_ptr != NULL && ksi_and_seq_num != NULL) { + ksi_and_seq_num->ksi = ((*ie_ptr)[0] >> 5) & 0x07; + ksi_and_seq_num->seq_num = (*ie_ptr)[0] & 0x1F; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2006,80 +1772,76 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ksi_and_sequence_number_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.20 24.008 v10.2.0 Section 10.5.5.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ms_network_capability_ie(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT *ms_network_cap, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ms_network_cap != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = 3; - (*ie_ptr)[1] = ms_network_cap->gea[1] << 7; - (*ie_ptr)[1] |= ms_network_cap->sm_cap_ded << 6; - (*ie_ptr)[1] |= ms_network_cap->sm_cap_gprs << 5; - (*ie_ptr)[1] |= ms_network_cap->ucs2 << 4; - (*ie_ptr)[1] |= (ms_network_cap->ss_screening & 0x03) << 2; - (*ie_ptr)[1] |= ms_network_cap->solsa << 1; - (*ie_ptr)[1] |= ms_network_cap->revision; - (*ie_ptr)[2] = ms_network_cap->pfc << 7; - (*ie_ptr)[2] |= ms_network_cap->gea[2] << 6; - (*ie_ptr)[2] |= ms_network_cap->gea[3] << 5; - (*ie_ptr)[2] |= ms_network_cap->gea[4] << 4; - (*ie_ptr)[2] |= ms_network_cap->gea[5] << 3; - (*ie_ptr)[2] |= ms_network_cap->gea[6] << 2; - (*ie_ptr)[2] |= ms_network_cap->gea[7] << 1; - (*ie_ptr)[2] |= ms_network_cap->lcsva; - (*ie_ptr)[3] = ms_network_cap->ho_g2u_via_iu << 7; - (*ie_ptr)[3] |= ms_network_cap->ho_g2e_via_s1 << 6; - (*ie_ptr)[3] |= ms_network_cap->emm_comb << 5; - (*ie_ptr)[3] |= ms_network_cap->isr << 4; - (*ie_ptr)[3] |= ms_network_cap->srvcc << 3; - (*ie_ptr)[3] |= ms_network_cap->epc << 2; - (*ie_ptr)[3] |= ms_network_cap->nf << 1; - *ie_ptr += 4; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8 **ie_ptr, - LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT *ms_network_cap) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - ms_network_cap != NULL) - { - ms_network_cap->gea[1] = ((*ie_ptr)[1] >> 7) & 0x01; - ms_network_cap->sm_cap_ded = ((*ie_ptr)[1] >> 6) & 0x01; - ms_network_cap->sm_cap_gprs = ((*ie_ptr)[1] >> 5) & 0x01; - ms_network_cap->ucs2 = ((*ie_ptr)[1] >> 4) & 0x01; - ms_network_cap->ss_screening = (LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM)(((*ie_ptr)[1] >> 2) & 0x03); - ms_network_cap->solsa = ((*ie_ptr)[1] >> 1) & 0x01; - ms_network_cap->revision = (*ie_ptr)[1] & 0x01; - ms_network_cap->pfc = ((*ie_ptr)[2] >> 7) & 0x01; - ms_network_cap->gea[2] = ((*ie_ptr)[2] >> 6) & 0x01; - ms_network_cap->gea[3] = ((*ie_ptr)[2] >> 5) & 0x01; - ms_network_cap->gea[4] = ((*ie_ptr)[2] >> 4) & 0x01; - ms_network_cap->gea[5] = ((*ie_ptr)[2] >> 3) & 0x01; - ms_network_cap->gea[6] = ((*ie_ptr)[2] >> 2) & 0x01; - ms_network_cap->gea[7] = ((*ie_ptr)[2] >> 1) & 0x01; - ms_network_cap->lcsva = (*ie_ptr)[2] & 0x01; - ms_network_cap->ho_g2u_via_iu = ((*ie_ptr)[3] >> 7) & 0x01; - ms_network_cap->ho_g2e_via_s1 = ((*ie_ptr)[3] >> 6) & 0x01; - ms_network_cap->emm_comb = ((*ie_ptr)[3] >> 5) & 0x01; - ms_network_cap->isr = ((*ie_ptr)[3] >> 4) & 0x01; - ms_network_cap->srvcc = ((*ie_ptr)[3] >> 3) & 0x01; - ms_network_cap->epc = ((*ie_ptr)[3] >> 2) & 0x01; - ms_network_cap->nf = ((*ie_ptr)[3] >> 1) & 0x01; - *ie_ptr += (*ie_ptr)[0] + 1; - - err = LIBLTE_SUCCESS; - } - - return(err); +LIBLTE_ERROR_ENUM liblte_mme_pack_ms_network_capability_ie(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT* ms_network_cap, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ms_network_cap != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = 3; + (*ie_ptr)[1] = ms_network_cap->gea[1] << 7; + (*ie_ptr)[1] |= ms_network_cap->sm_cap_ded << 6; + (*ie_ptr)[1] |= ms_network_cap->sm_cap_gprs << 5; + (*ie_ptr)[1] |= ms_network_cap->ucs2 << 4; + (*ie_ptr)[1] |= (ms_network_cap->ss_screening & 0x03) << 2; + (*ie_ptr)[1] |= ms_network_cap->solsa << 1; + (*ie_ptr)[1] |= ms_network_cap->revision; + (*ie_ptr)[2] = ms_network_cap->pfc << 7; + (*ie_ptr)[2] |= ms_network_cap->gea[2] << 6; + (*ie_ptr)[2] |= ms_network_cap->gea[3] << 5; + (*ie_ptr)[2] |= ms_network_cap->gea[4] << 4; + (*ie_ptr)[2] |= ms_network_cap->gea[5] << 3; + (*ie_ptr)[2] |= ms_network_cap->gea[6] << 2; + (*ie_ptr)[2] |= ms_network_cap->gea[7] << 1; + (*ie_ptr)[2] |= ms_network_cap->lcsva; + (*ie_ptr)[3] = ms_network_cap->ho_g2u_via_iu << 7; + (*ie_ptr)[3] |= ms_network_cap->ho_g2e_via_s1 << 6; + (*ie_ptr)[3] |= ms_network_cap->emm_comb << 5; + (*ie_ptr)[3] |= ms_network_cap->isr << 4; + (*ie_ptr)[3] |= ms_network_cap->srvcc << 3; + (*ie_ptr)[3] |= ms_network_cap->epc << 2; + (*ie_ptr)[3] |= ms_network_cap->nf << 1; + *ie_ptr += 4; + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8** ie_ptr, + LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT* ms_network_cap) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && ms_network_cap != NULL) { + ms_network_cap->gea[1] = ((*ie_ptr)[1] >> 7) & 0x01; + ms_network_cap->sm_cap_ded = ((*ie_ptr)[1] >> 6) & 0x01; + ms_network_cap->sm_cap_gprs = ((*ie_ptr)[1] >> 5) & 0x01; + ms_network_cap->ucs2 = ((*ie_ptr)[1] >> 4) & 0x01; + ms_network_cap->ss_screening = (LIBLTE_MME_SS_SCREENING_INDICATOR_ENUM)(((*ie_ptr)[1] >> 2) & 0x03); + ms_network_cap->solsa = ((*ie_ptr)[1] >> 1) & 0x01; + ms_network_cap->revision = (*ie_ptr)[1] & 0x01; + ms_network_cap->pfc = ((*ie_ptr)[2] >> 7) & 0x01; + ms_network_cap->gea[2] = ((*ie_ptr)[2] >> 6) & 0x01; + ms_network_cap->gea[3] = ((*ie_ptr)[2] >> 5) & 0x01; + ms_network_cap->gea[4] = ((*ie_ptr)[2] >> 4) & 0x01; + ms_network_cap->gea[5] = ((*ie_ptr)[2] >> 3) & 0x01; + ms_network_cap->gea[6] = ((*ie_ptr)[2] >> 2) & 0x01; + ms_network_cap->gea[7] = ((*ie_ptr)[2] >> 1) & 0x01; + ms_network_cap->lcsva = (*ie_ptr)[2] & 0x01; + ms_network_cap->ho_g2u_via_iu = ((*ie_ptr)[3] >> 7) & 0x01; + ms_network_cap->ho_g2e_via_s1 = ((*ie_ptr)[3] >> 6) & 0x01; + ms_network_cap->emm_comb = ((*ie_ptr)[3] >> 5) & 0x01; + ms_network_cap->isr = ((*ie_ptr)[3] >> 4) & 0x01; + ms_network_cap->srvcc = ((*ie_ptr)[3] >> 3) & 0x01; + ms_network_cap->epc = ((*ie_ptr)[3] >> 2) & 0x01; + ms_network_cap->nf = ((*ie_ptr)[3] >> 1) & 0x01; + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -2090,39 +1852,33 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ms_network_capability_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.21 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_key_set_id_ie(LIBLTE_MME_NAS_KEY_SET_ID_STRUCT *nas_ksi, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_nas_key_set_id_ie(LIBLTE_MME_NAS_KEY_SET_ID_STRUCT* nas_ksi, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(nas_ksi != NULL && - ie_ptr != NULL) - { - **ie_ptr |= nas_ksi->tsc_flag << (bit_offset + 3); - **ie_ptr |= nas_ksi->nas_ksi << bit_offset; + if (nas_ksi != NULL && ie_ptr != NULL) { + **ie_ptr |= nas_ksi->tsc_flag << (bit_offset + 3); + **ie_ptr |= nas_ksi->nas_ksi << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_key_set_id_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_NAS_KEY_SET_ID_STRUCT *nas_ksi) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_nas_key_set_id_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_NAS_KEY_SET_ID_STRUCT* nas_ksi) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - nas_ksi != NULL) - { - nas_ksi->tsc_flag = (LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM)((**ie_ptr >> (bit_offset + 3)) & 0x01); - nas_ksi->nas_ksi = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && nas_ksi != NULL) { + nas_ksi->tsc_flag = (LIBLTE_MME_TYPE_OF_SECURITY_CONTEXT_FLAG_ENUM)((**ie_ptr >> (bit_offset + 3)) & 0x01); + nas_ksi->nas_ksi = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2133,47 +1889,39 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_key_set_id_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.22 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *nas_msg, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* nas_msg, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(nas_msg != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = nas_msg->N_bytes & 0xFF; - for(i=0; iN_bytes; i++) - { - (*ie_ptr)[1+i] = nas_msg->msg[i]; - } - *ie_ptr += nas_msg->N_bytes + 1; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (nas_msg != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = nas_msg->N_bytes & 0xFF; + for (i = 0; i < nas_msg->N_bytes; i++) { + (*ie_ptr)[1 + i] = nas_msg->msg[i]; } + *ie_ptr += nas_msg->N_bytes + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *nas_msg) +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* nas_msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - nas_msg != NULL) - { - nas_msg->N_bytes = (*ie_ptr)[0]; - for(i=0; iN_bytes; i++) - { - nas_msg->msg[i] = (*ie_ptr)[1+i]; - } - *ie_ptr += nas_msg->N_bytes + 1; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && nas_msg != NULL) { + nas_msg->N_bytes = (*ie_ptr)[0]; + for (i = 0; i < nas_msg->N_bytes; i++) { + nas_msg->msg[i] = (*ie_ptr)[1 + i]; } + *ie_ptr += nas_msg->N_bytes + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2184,38 +1932,34 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_message_container_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.23 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_algorithms_ie(LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT *nas_sec_algs, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_nas_security_algorithms_ie(LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT* nas_sec_algs, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(nas_sec_algs != NULL && - ie_ptr != NULL) - { - **ie_ptr = (nas_sec_algs->type_of_eea << 4) | (nas_sec_algs->type_of_eia); - *ie_ptr += 1; + if (nas_sec_algs != NULL && ie_ptr != NULL) { + **ie_ptr = (nas_sec_algs->type_of_eea << 4) | (nas_sec_algs->type_of_eia); + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8 **ie_ptr, - LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT *nas_sec_algs) +LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8** ie_ptr, + LIBLTE_MME_NAS_SECURITY_ALGORITHMS_STRUCT* nas_sec_algs) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - nas_sec_algs != NULL) - { - nas_sec_algs->type_of_eea = (LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM)((**ie_ptr >> 4) & 0x07); - nas_sec_algs->type_of_eia = (LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM)(**ie_ptr & 0x07); - *ie_ptr += 1; + if (ie_ptr != NULL && nas_sec_algs != NULL) { + nas_sec_algs->type_of_eea = (LIBLTE_MME_TYPE_OF_CIPHERING_ALGORITHM_ENUM)((**ie_ptr >> 4) & 0x07); + nas_sec_algs->type_of_eia = (LIBLTE_MME_TYPE_OF_INTEGRITY_ALGORITHM_ENUM)(**ie_ptr & 0x07); + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2226,223 +1970,187 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nas_security_algorithms_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.24 24.008 v10.2.0 Section 10.5.3.5A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_network_name_ie(LIBLTE_MME_NETWORK_NAME_STRUCT *net_name, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - uint32 bit_offset; - uint32 byte_offset; - const char *char_str = net_name->name; - - if(net_name != NULL && - ie_ptr != NULL) - { - bit_offset = 0; - byte_offset = 2; - for(i=0; i= 0x20 && - char_str[i] <= 0x3F) || - (char_str[i] >= 0x41 && - char_str[i] <= 0x5A) || - (char_str[i] >= 0x61 && - char_str[i] <= 0x7A)) - { - switch(bit_offset) - { - case 0: - (*ie_ptr)[byte_offset] = char_str[i]; - bit_offset = 7; - break; - case 1: - (*ie_ptr)[byte_offset] |= (char_str[i] << 1); - bit_offset = 0; - byte_offset++; - break; - case 2: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 2) & 0xFC); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 6) & 0x01); - bit_offset = 1; - break; - case 3: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 3) & 0xF8); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 5) & 0x03); - bit_offset = 2; - break; - case 4: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 4) & 0xF0); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 4) & 0x07); - bit_offset = 3; - break; - case 5: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 5) & 0xE0); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 3) & 0x0F); - bit_offset = 4; - break; - case 6: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 6) & 0xC0); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 2) & 0x1F); - bit_offset = 5; - break; - case 7: - (*ie_ptr)[byte_offset] |= ((char_str[i] << 7) & 0x80); - byte_offset++; - (*ie_ptr)[byte_offset] = ((char_str[i] >> 1) & 0x3F); - bit_offset = 6; - break; - } - } - } - if(0 == bit_offset) - { - (*ie_ptr)[0] = byte_offset - 1; - (*ie_ptr)[1] = 0x80 | ((net_name->add_ci & 0x01) << 3); - *ie_ptr += byte_offset; - }else{ - (*ie_ptr)[0] = byte_offset; - (*ie_ptr)[1] = 0x80 | ((net_name->add_ci & 0x01) << 3) | ((8 - bit_offset) & 0x07); - *ie_ptr += byte_offset + 1; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_network_name_ie(LIBLTE_MME_NETWORK_NAME_STRUCT* net_name, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + uint32 bit_offset; + uint32 byte_offset; + const char* char_str = net_name->name; + + if (net_name != NULL && ie_ptr != NULL) { + bit_offset = 0; + byte_offset = 2; + for (i = 0; i < strnlen(char_str, LIBLTE_STRING_LEN); i++) { + if (char_str[i] == 0x0A || char_str[i] == 0x0D || (char_str[i] >= 0x20 && char_str[i] <= 0x3F) || + (char_str[i] >= 0x41 && char_str[i] <= 0x5A) || (char_str[i] >= 0x61 && char_str[i] <= 0x7A)) { + switch (bit_offset) { + case 0: + (*ie_ptr)[byte_offset] = char_str[i]; + bit_offset = 7; + break; + case 1: + (*ie_ptr)[byte_offset] |= (char_str[i] << 1); + bit_offset = 0; + byte_offset++; + break; + case 2: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 2) & 0xFC); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 6) & 0x01); + bit_offset = 1; + break; + case 3: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 3) & 0xF8); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 5) & 0x03); + bit_offset = 2; + break; + case 4: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 4) & 0xF0); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 4) & 0x07); + bit_offset = 3; + break; + case 5: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 5) & 0xE0); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 3) & 0x0F); + bit_offset = 4; + break; + case 6: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 6) & 0xC0); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 2) & 0x1F); + bit_offset = 5; + break; + case 7: + (*ie_ptr)[byte_offset] |= ((char_str[i] << 7) & 0x80); + byte_offset++; + (*ie_ptr)[byte_offset] = ((char_str[i] >> 1) & 0x3F); + bit_offset = 6; + break; + } + } + } + if (0 == bit_offset) { + (*ie_ptr)[0] = byte_offset - 1; + (*ie_ptr)[1] = 0x80 | ((net_name->add_ci & 0x01) << 3); + *ie_ptr += byte_offset; + } else { + (*ie_ptr)[0] = byte_offset; + (*ie_ptr)[1] = 0x80 | ((net_name->add_ci & 0x01) << 3) | ((8 - bit_offset) & 0x07); + *ie_ptr += byte_offset + 1; + } - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8 **ie_ptr, - LIBLTE_MME_NETWORK_NAME_STRUCT *net_name) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - uint32 bit_offset; - uint32 byte_offset; - uint32 N_bytes; - uint8 spare_field; - char tmp_char; - uint32 str_cnt; - - if(ie_ptr != NULL && - net_name != NULL) - { - net_name->add_ci = (LIBLTE_MME_ADD_CI_ENUM)(((*ie_ptr)[1] >> 3) & 0x01); - spare_field = (*ie_ptr)[1] & 0x07; - N_bytes = (*ie_ptr)[0]; - bit_offset = 0; - byte_offset = 2; - str_cnt = 0; - - while(byte_offset < N_bytes && str_cnt < LIBLTE_STRING_LEN) - { - switch(bit_offset) - { - case 0: - tmp_char = (*ie_ptr)[byte_offset] & 0x7F; - bit_offset = 7; - break; - case 1: - tmp_char = ((*ie_ptr)[byte_offset] >> 1) & 0x7F; - bit_offset = 0; - byte_offset++; - break; - case 2: - tmp_char = ((*ie_ptr)[byte_offset] >> 2) & 0x3F; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 6) & 0x40; - bit_offset = 1; - break; - case 3: - tmp_char = ((*ie_ptr)[byte_offset] >> 3) & 0x1F; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 5) & 0x60; - bit_offset = 2; - break; - case 4: - tmp_char = ((*ie_ptr)[byte_offset] >> 4) & 0x0F; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 4) & 0x70; - bit_offset = 3; - break; - case 5: - tmp_char = ((*ie_ptr)[byte_offset] >> 5) & 0x07; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 3) & 0x78; - bit_offset = 4; - break; - case 6: - tmp_char = ((*ie_ptr)[byte_offset] >> 6) & 0x03; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 2) & 0x7C; - bit_offset = 5; - break; - case 7: - tmp_char = ((*ie_ptr)[byte_offset] >> 7) & 0x01; - byte_offset++; - tmp_char |= ((*ie_ptr)[byte_offset] << 1) & 0x7E; - bit_offset = 6; - break; - } - - if(tmp_char == 0x0A || - tmp_char == 0x0D || - (tmp_char >= 0x20 && - tmp_char <= 0x3F) || - (tmp_char >= 0x41 && - tmp_char <= 0x5A) || - (tmp_char >= 0x61 && - tmp_char <= 0x7A)) - { - if (str_cnt < LIBLTE_STRING_LEN) { - net_name->name[str_cnt] = tmp_char; - str_cnt++; - } - } - } + err = LIBLTE_SUCCESS; + } - if(0 == bit_offset || - (1 == bit_offset && - 0 == spare_field)) - { - if(0 == bit_offset) - { - tmp_char = (*ie_ptr)[byte_offset] & 0x7F; - }else{ - tmp_char = ((*ie_ptr)[byte_offset] >> 1) & 0x7F; - } - if(tmp_char == 0x0A || - tmp_char == 0x0D || - (tmp_char >= 0x20 && - tmp_char <= 0x3F) || - (tmp_char >= 0x41 && - tmp_char <= 0x5A) || - (tmp_char >= 0x61 && - tmp_char <= 0x7A)) - { - if (str_cnt < LIBLTE_STRING_LEN) { - net_name->name[str_cnt] = tmp_char; - str_cnt++; - } - } + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8** ie_ptr, LIBLTE_MME_NETWORK_NAME_STRUCT* net_name) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + uint32 bit_offset; + uint32 byte_offset; + uint32 N_bytes; + uint8 spare_field; + char tmp_char; + uint32 str_cnt; + + if (ie_ptr != NULL && net_name != NULL) { + net_name->add_ci = (LIBLTE_MME_ADD_CI_ENUM)(((*ie_ptr)[1] >> 3) & 0x01); + spare_field = (*ie_ptr)[1] & 0x07; + N_bytes = (*ie_ptr)[0]; + bit_offset = 0; + byte_offset = 2; + str_cnt = 0; + + while (byte_offset < N_bytes && str_cnt < LIBLTE_STRING_LEN) { + switch (bit_offset) { + case 0: + tmp_char = (*ie_ptr)[byte_offset] & 0x7F; + bit_offset = 7; + break; + case 1: + tmp_char = ((*ie_ptr)[byte_offset] >> 1) & 0x7F; + bit_offset = 0; + byte_offset++; + break; + case 2: + tmp_char = ((*ie_ptr)[byte_offset] >> 2) & 0x3F; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 6) & 0x40; + bit_offset = 1; + break; + case 3: + tmp_char = ((*ie_ptr)[byte_offset] >> 3) & 0x1F; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 5) & 0x60; + bit_offset = 2; + break; + case 4: + tmp_char = ((*ie_ptr)[byte_offset] >> 4) & 0x0F; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 4) & 0x70; + bit_offset = 3; + break; + case 5: + tmp_char = ((*ie_ptr)[byte_offset] >> 5) & 0x07; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 3) & 0x78; + bit_offset = 4; + break; + case 6: + tmp_char = ((*ie_ptr)[byte_offset] >> 6) & 0x03; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 2) & 0x7C; + bit_offset = 5; + break; + case 7: + tmp_char = ((*ie_ptr)[byte_offset] >> 7) & 0x01; + byte_offset++; + tmp_char |= ((*ie_ptr)[byte_offset] << 1) & 0x7E; + bit_offset = 6; + break; + } + + if (tmp_char == 0x0A || tmp_char == 0x0D || (tmp_char >= 0x20 && tmp_char <= 0x3F) || + (tmp_char >= 0x41 && tmp_char <= 0x5A) || (tmp_char >= 0x61 && tmp_char <= 0x7A)) { + if (str_cnt < LIBLTE_STRING_LEN) { + net_name->name[str_cnt] = tmp_char; + str_cnt++; } + } + } + if (0 == bit_offset || (1 == bit_offset && 0 == spare_field)) { + if (0 == bit_offset) { + tmp_char = (*ie_ptr)[byte_offset] & 0x7F; + } else { + tmp_char = ((*ie_ptr)[byte_offset] >> 1) & 0x7F; + } + if (tmp_char == 0x0A || tmp_char == 0x0D || (tmp_char >= 0x20 && tmp_char <= 0x3F) || + (tmp_char >= 0x41 && tmp_char <= 0x5A) || (tmp_char >= 0x61 && tmp_char <= 0x7A)) { if (str_cnt < LIBLTE_STRING_LEN) { - net_name->name[str_cnt] = '\0'; - str_cnt++; + net_name->name[str_cnt] = tmp_char; + str_cnt++; } + } + } - *ie_ptr += byte_offset + 1; - - err = LIBLTE_SUCCESS; + if (str_cnt < LIBLTE_STRING_LEN) { + net_name->name[str_cnt] = '\0'; + str_cnt++; } - return(err); + *ie_ptr += byte_offset + 1; + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -2453,42 +2161,37 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_network_name_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.25 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_nonce_ie(uint32 nonce, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_nonce_ie(uint32 nonce, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = (nonce >> 24) & 0xFF; - (*ie_ptr)[1] = (nonce >> 16) & 0xFF; - (*ie_ptr)[2] = (nonce >> 8) & 0xFF; - (*ie_ptr)[3] = nonce & 0xFF; - *ie_ptr += 4; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = (nonce >> 24) & 0xFF; + (*ie_ptr)[1] = (nonce >> 16) & 0xFF; + (*ie_ptr)[2] = (nonce >> 8) & 0xFF; + (*ie_ptr)[3] = nonce & 0xFF; + *ie_ptr += 4; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8 **ie_ptr, - uint32 *nonce) +LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8** ie_ptr, uint32* nonce) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - nonce != NULL) - { - *nonce = (*ie_ptr)[0] << 24; - *nonce |= (*ie_ptr)[1] << 16; - *nonce |= (*ie_ptr)[2] << 8; - *nonce |= (*ie_ptr)[3]; - *ie_ptr += 4; + if (ie_ptr != NULL && nonce != NULL) { + *nonce = (*ie_ptr)[0] << 24; + *nonce |= (*ie_ptr)[1] << 16; + *nonce |= (*ie_ptr)[2] << 8; + *nonce |= (*ie_ptr)[3]; + *ie_ptr += 4; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2499,36 +2202,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_nonce_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.25A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_paging_identity_ie(uint8 paging_id, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_paging_identity_ie(uint8 paging_id, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = paging_id & 0x01; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = paging_id & 0x01; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8 **ie_ptr, - uint8 *paging_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8** ie_ptr, uint8* paging_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - paging_id != NULL) - { - *paging_id = (*ie_ptr)[0] & 0x01; - *ie_ptr += 1; + if (ie_ptr != NULL && paging_id != NULL) { + *paging_id = (*ie_ptr)[0] & 0x01; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2539,42 +2237,37 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_paging_identity_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.26 24.008 v10.2.0 Section 10.5.5.8 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_p_tmsi_signature_ie(uint32 p_tmsi_signature, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_p_tmsi_signature_ie(uint32 p_tmsi_signature, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = (p_tmsi_signature >> 24) & 0xFF; - (*ie_ptr)[1] = (p_tmsi_signature >> 16) & 0xFF; - (*ie_ptr)[2] = (p_tmsi_signature >> 8) & 0xFF; - (*ie_ptr)[3] = p_tmsi_signature & 0xFF; - *ie_ptr += 4; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = (p_tmsi_signature >> 24) & 0xFF; + (*ie_ptr)[1] = (p_tmsi_signature >> 16) & 0xFF; + (*ie_ptr)[2] = (p_tmsi_signature >> 8) & 0xFF; + (*ie_ptr)[3] = p_tmsi_signature & 0xFF; + *ie_ptr += 4; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8 **ie_ptr, - uint32 *p_tmsi_signature) +LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8** ie_ptr, uint32* p_tmsi_signature) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - p_tmsi_signature != NULL) - { - *p_tmsi_signature = (*ie_ptr)[0] << 24; - *p_tmsi_signature |= (*ie_ptr)[1] << 16; - *p_tmsi_signature |= (*ie_ptr)[2] << 8; - *p_tmsi_signature |= (*ie_ptr)[3]; - *ie_ptr += 4; + if (ie_ptr != NULL && p_tmsi_signature != NULL) { + *p_tmsi_signature = (*ie_ptr)[0] << 24; + *p_tmsi_signature |= (*ie_ptr)[1] << 16; + *p_tmsi_signature |= (*ie_ptr)[2] << 8; + *p_tmsi_signature |= (*ie_ptr)[3]; + *ie_ptr += 4; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2585,36 +2278,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_p_tmsi_signature_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.27 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_service_type_ie(uint8 value, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_service_type_ie(uint8 value, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= (value & 0x0F) << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= (value & 0x0F) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *value) +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* value) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - value != NULL) - { - *value = ((*ie_ptr)[0] >> bit_offset) & 0x0F; + if (ie_ptr != NULL && value != NULL) { + *value = ((*ie_ptr)[0] >> bit_offset) & 0x0F; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2624,38 +2310,33 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.28 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_short_mac_ie(uint16 short_mac, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_short_mac_ie(uint16 short_mac, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = (short_mac >> 8) & 0xFF; - (*ie_ptr)[1] = short_mac & 0xFF; - *ie_ptr += 2; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = (short_mac >> 8) & 0xFF; + (*ie_ptr)[1] = short_mac & 0xFF; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8 **ie_ptr, - uint16 *short_mac) +LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8** ie_ptr, uint16* short_mac) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - short_mac != NULL) - { - *short_mac = (*ie_ptr)[0] << 8; - *short_mac |= (*ie_ptr)[1]; - *ie_ptr += 2; + if (ie_ptr != NULL && short_mac != NULL) { + *short_mac = (*ie_ptr)[0] << 8; + *short_mac |= (*ie_ptr)[1]; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2667,36 +2348,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_short_mac_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.29 24.008 v10.2.0 Section 10.5.3.8 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_ie(uint8 tz, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_ie(uint8 tz, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = tz; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = tz; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8 **ie_ptr, - uint8 *tz) +LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8** ie_ptr, uint8* tz) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - tz != NULL) - { - *tz = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && tz != NULL) { + *tz = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2710,49 +2386,43 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.30 24.008 v10.2.0 Section 10.5.3.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT *ttz, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_time_zone_and_time_ie(LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT* ttz, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ttz != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = ((ttz->year % 10) << 4) | ((ttz->year % 100) / 10); - (*ie_ptr)[1] = ((ttz->month % 10) << 4) | (ttz->month / 10); - (*ie_ptr)[2] = ((ttz->day % 10) << 4) | (ttz->day / 10); - (*ie_ptr)[3] = ((ttz->hour % 10) << 4) | (ttz->hour / 10); - (*ie_ptr)[4] = ((ttz->minute % 10) << 4) | (ttz->minute / 10); - (*ie_ptr)[5] = ((ttz->second % 10) << 4) | (ttz->second / 10); - (*ie_ptr)[6] = ttz->tz; - *ie_ptr += 7; + if (ttz != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = ((ttz->year % 10) << 4) | ((ttz->year % 100) / 10); + (*ie_ptr)[1] = ((ttz->month % 10) << 4) | (ttz->month / 10); + (*ie_ptr)[2] = ((ttz->day % 10) << 4) | (ttz->day / 10); + (*ie_ptr)[3] = ((ttz->hour % 10) << 4) | (ttz->hour / 10); + (*ie_ptr)[4] = ((ttz->minute % 10) << 4) | (ttz->minute / 10); + (*ie_ptr)[5] = ((ttz->second % 10) << 4) | (ttz->second / 10); + (*ie_ptr)[6] = ttz->tz; + *ie_ptr += 7; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8 **ie_ptr, - LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT *ttz) +LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8** ie_ptr, LIBLTE_MME_TIME_ZONE_AND_TIME_STRUCT* ttz) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - ttz != NULL) - { - ttz->year = 2000 + (((*ie_ptr)[0] & 0x0F) * 10) + (((*ie_ptr)[0] >> 4) & 0x0F); - ttz->month = (((*ie_ptr)[1] & 0x0F) * 10) + (((*ie_ptr)[1] >> 4) & 0x0F); - ttz->day = (((*ie_ptr)[2] & 0x0F) * 10) + (((*ie_ptr)[2] >> 4) & 0x0F); - ttz->hour = (((*ie_ptr)[3] & 0x0F) * 10) + (((*ie_ptr)[3] >> 4) & 0x0F); - ttz->minute = (((*ie_ptr)[4] & 0x0F) * 10) + (((*ie_ptr)[4] >> 4) & 0x0F); - ttz->second = (((*ie_ptr)[5] & 0x0F) * 10) + (((*ie_ptr)[5] >> 4) & 0x0F); - ttz->tz = (*ie_ptr)[6]; - *ie_ptr += 7; + if (ie_ptr != NULL && ttz != NULL) { + ttz->year = 2000 + (((*ie_ptr)[0] & 0x0F) * 10) + (((*ie_ptr)[0] >> 4) & 0x0F); + ttz->month = (((*ie_ptr)[1] & 0x0F) * 10) + (((*ie_ptr)[1] >> 4) & 0x0F); + ttz->day = (((*ie_ptr)[2] & 0x0F) * 10) + (((*ie_ptr)[2] >> 4) & 0x0F); + ttz->hour = (((*ie_ptr)[3] & 0x0F) * 10) + (((*ie_ptr)[3] >> 4) & 0x0F); + ttz->minute = (((*ie_ptr)[4] & 0x0F) * 10) + (((*ie_ptr)[4] >> 4) & 0x0F); + ttz->second = (((*ie_ptr)[5] & 0x0F) * 10) + (((*ie_ptr)[5] >> 4) & 0x0F); + ttz->tz = (*ie_ptr)[6]; + *ie_ptr += 7; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2764,36 +2434,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_time_zone_and_time_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.31 24.008 v10.2.0 Section 10.5.5.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tmsi_status_ie(LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_tmsi_status_ie(LIBLTE_MME_TMSI_STATUS_ENUM tmsi_status, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= tmsi_status << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= tmsi_status << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_tmsi_status_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_TMSI_STATUS_ENUM *tmsi_status) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tmsi_status_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_TMSI_STATUS_ENUM* tmsi_status) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - tmsi_status != NULL) - { - *tmsi_status = (LIBLTE_MME_TMSI_STATUS_ENUM)((**ie_ptr >> bit_offset) & 0x01); + if (ie_ptr != NULL && tmsi_status != NULL) { + *tmsi_status = (LIBLTE_MME_TMSI_STATUS_ENUM)((**ie_ptr >> bit_offset) & 0x01); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -2804,63 +2469,55 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tmsi_status_ie(uint8 * Document Reference: 24.301 v10.2.0 Section 9.9.3.32 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_id_ie(LIBLTE_MME_TRACKING_AREA_ID_STRUCT *tai, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(tai != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = (((tai->mcc/10) % 10) << 4) | ((tai->mcc/100) % 10); - if(tai->mnc < 100) - { - (*ie_ptr)[1] = 0xF0 | (tai->mcc % 10); - (*ie_ptr)[2] = ((tai->mnc % 10) << 4) | ((tai->mnc/10) % 10); - }else{ - (*ie_ptr)[1] = ((tai->mnc % 10) << 4) | (tai->mcc % 10); - (*ie_ptr)[2] = (((tai->mnc/10) % 10) << 4) | ((tai->mnc/100) % 10); - } - (*ie_ptr)[3] = (tai->tac >> 8) & 0xFF; - (*ie_ptr)[4] = tai->tac & 0xFF; - *ie_ptr += 5; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8 **ie_ptr, - LIBLTE_MME_TRACKING_AREA_ID_STRUCT *tai) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - tai != NULL) - { - tai->mcc = ((*ie_ptr)[0] & 0x0F)*100; - tai->mcc += (((*ie_ptr)[0] >> 4) & 0x0F)*10; - tai->mcc += (*ie_ptr)[1] & 0x0F; - if((((*ie_ptr)[1] >> 4) & 0x0F) == 0x0F) - { - tai->mnc = ((*ie_ptr)[2] & 0x0F)*10; - tai->mnc += ((*ie_ptr)[2] >> 4) & 0x0F; - }else{ - tai->mnc = ((*ie_ptr)[1] >> 4) & 0x0F; - tai->mnc += ((*ie_ptr)[2] & 0x0F)*100; - tai->mnc += (((*ie_ptr)[2] >> 4) & 0x0F)*10; - } - tai->tac = (*ie_ptr)[3] << 8; - tai->tac |= (*ie_ptr)[4]; - *ie_ptr += 5; +LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_id_ie(LIBLTE_MME_TRACKING_AREA_ID_STRUCT* tai, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - err = LIBLTE_SUCCESS; + if (tai != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = (((tai->mcc / 10) % 10) << 4) | ((tai->mcc / 100) % 10); + if (tai->mnc < 100) { + (*ie_ptr)[1] = 0xF0 | (tai->mcc % 10); + (*ie_ptr)[2] = ((tai->mnc % 10) << 4) | ((tai->mnc / 10) % 10); + } else { + (*ie_ptr)[1] = ((tai->mnc % 10) << 4) | (tai->mcc % 10); + (*ie_ptr)[2] = (((tai->mnc / 10) % 10) << 4) | ((tai->mnc / 100) % 10); } + (*ie_ptr)[3] = (tai->tac >> 8) & 0xFF; + (*ie_ptr)[4] = tai->tac & 0xFF; + *ie_ptr += 5; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } +LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8** ie_ptr, LIBLTE_MME_TRACKING_AREA_ID_STRUCT* tai) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; -/********************************************************************* + if (ie_ptr != NULL && tai != NULL) { + tai->mcc = ((*ie_ptr)[0] & 0x0F) * 100; + tai->mcc += (((*ie_ptr)[0] >> 4) & 0x0F) * 10; + tai->mcc += (*ie_ptr)[1] & 0x0F; + if ((((*ie_ptr)[1] >> 4) & 0x0F) == 0x0F) { + tai->mnc = ((*ie_ptr)[2] & 0x0F) * 10; + tai->mnc += ((*ie_ptr)[2] >> 4) & 0x0F; + } else { + tai->mnc = ((*ie_ptr)[1] >> 4) & 0x0F; + tai->mnc += ((*ie_ptr)[2] & 0x0F) * 100; + tai->mnc += (((*ie_ptr)[2] >> 4) & 0x0F) * 10; + } + tai->tac = (*ie_ptr)[3] << 8; + tai->tac |= (*ie_ptr)[4]; + *ie_ptr += 5; + + err = LIBLTE_SUCCESS; + } + + return (err); +} + +/********************************************************************* IE Name: Tracking Area Identity List Description: Transfers a list of tracking areas from the network @@ -2868,131 +2525,120 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_id_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.33 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_identity_list_ie(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT *tai_list, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(tai_list != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[0] = (tai_list->N_tais*5) + 1; - // FIXME: Support all types - if(1 == tai_list->N_tais) - { - (*ie_ptr)[1] = (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS << 5) | ((tai_list->N_tais - 1) & 0x1F); - }else{ - (*ie_ptr)[1] = (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS << 5) | ((tai_list->N_tais - 1) & 0x1F); - } - *ie_ptr += 2; - for(i=0; iN_tais; i++) - { - liblte_mme_pack_tracking_area_id_ie(&tai_list->tai[i], ie_ptr); - } - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_identity_list_ie(uint8 **ie_ptr, - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT *tai_list) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM type; - uint32 sent_length; - uint32 length; - uint32 i; - uint32 N_elems; - uint16 mcc; - uint16 mnc; - uint16 tac; - - if(ie_ptr != NULL && - tai_list != NULL) - { - sent_length = (*ie_ptr)[0] + 1; - length = 1; - tai_list->N_tais = 0; - while(length < sent_length) - { - type = (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM)(((*ie_ptr)[length] >> 5) & 0x03); - N_elems = (*ie_ptr)[length++] & 0x1F; - if(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS == type) - { - mcc = ((*ie_ptr)[length] & 0x0F)*100; - mcc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - mcc += (*ie_ptr)[length] & 0x0F; - if((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) - { - length++; - mnc = ((*ie_ptr)[length] & 0x0F)*10; - mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; - }else{ - mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; - mnc += ((*ie_ptr)[length] & 0x0F)*100; - mnc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - } - for(i=0; itai[tai_list->N_tais].mcc = mcc; - tai_list->tai[tai_list->N_tais].mnc = mnc; - tai_list->tai[tai_list->N_tais].tac = (*ie_ptr)[length++] << 8; - tai_list->tai[tai_list->N_tais].tac |= (*ie_ptr)[length++]; - tai_list->N_tais++; - } - }else if(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_CONSECUTIVE_TACS == type){ - mcc = ((*ie_ptr)[length] & 0x0F)*100; - mcc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - mcc += (*ie_ptr)[length] & 0x0F; - if((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) - { - length++; - mnc = ((*ie_ptr)[length] & 0x0F)*10; - mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; - }else{ - mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; - mnc += ((*ie_ptr)[length] & 0x0F)*100; - mnc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - } - tac = (*ie_ptr)[length++] << 8; - tac |= (*ie_ptr)[length++]; - for(i=0; itai[tai_list->N_tais].mcc = mcc; - tai_list->tai[tai_list->N_tais].mnc = mnc; - tai_list->tai[tai_list->N_tais].tac = tac + i; - tai_list->N_tais++; - } - }else{ - for(i=0; itai[tai_list->N_tais].mcc = ((*ie_ptr)[length] & 0x0F)*100; - tai_list->tai[tai_list->N_tais].mcc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - tai_list->tai[tai_list->N_tais].mcc += (*ie_ptr)[length] & 0x0F; - if((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) - { - length++; - tai_list->tai[tai_list->N_tais].mnc = ((*ie_ptr)[length] & 0x0F)*10; - tai_list->tai[tai_list->N_tais].mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; - }else{ - tai_list->tai[tai_list->N_tais].mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; - tai_list->tai[tai_list->N_tais].mnc += ((*ie_ptr)[length] & 0x0F)*100; - tai_list->tai[tai_list->N_tais].mnc += (((*ie_ptr)[length++] >> 4) & 0x0F)*10; - } - tai_list->tai[tai_list->N_tais].tac = (*ie_ptr)[length++] << 8; - tai_list->tai[tai_list->N_tais].tac |= (*ie_ptr)[length++]; - tai_list->N_tais++; - } - } - } - *ie_ptr += (*ie_ptr)[0] + 1; +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_identity_list_ie(LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT* tai_list, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (tai_list != NULL && ie_ptr != NULL) { + (*ie_ptr)[0] = (tai_list->N_tais * 5) + 1; + // FIXME: Support all types + if (1 == tai_list->N_tais) { + (*ie_ptr)[1] = (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS << 5) | + ((tai_list->N_tais - 1) & 0x1F); + } else { + (*ie_ptr)[1] = + (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_DIFFERENT_PLMNS << 5) | ((tai_list->N_tais - 1) & 0x1F); } + *ie_ptr += 2; + for (i = 0; i < tai_list->N_tais; i++) { + liblte_mme_pack_tracking_area_id_ie(&tai_list->tai[i], ie_ptr); + } + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_identity_list_ie(uint8** ie_ptr, + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_STRUCT* tai_list) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM type; + uint32 sent_length; + uint32 length; + uint32 i; + uint32 N_elems; + uint16 mcc; + uint16 mnc; + uint16 tac; + + if (ie_ptr != NULL && tai_list != NULL) { + sent_length = (*ie_ptr)[0] + 1; + length = 1; + tai_list->N_tais = 0; + while (length < sent_length) { + type = (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ENUM)(((*ie_ptr)[length] >> 5) & 0x03); + N_elems = (*ie_ptr)[length++] & 0x1F; + if (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_NON_CONSECUTIVE_TACS == type) { + mcc = ((*ie_ptr)[length] & 0x0F) * 100; + mcc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + mcc += (*ie_ptr)[length] & 0x0F; + if ((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) { + length++; + mnc = ((*ie_ptr)[length] & 0x0F) * 10; + mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; + } else { + mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; + mnc += ((*ie_ptr)[length] & 0x0F) * 100; + mnc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + } + for (i = 0; i < N_elems; i++) { + tai_list->tai[tai_list->N_tais].mcc = mcc; + tai_list->tai[tai_list->N_tais].mnc = mnc; + tai_list->tai[tai_list->N_tais].tac = (*ie_ptr)[length++] << 8; + tai_list->tai[tai_list->N_tais].tac |= (*ie_ptr)[length++]; + tai_list->N_tais++; + } + } else if (LIBLTE_MME_TRACKING_AREA_IDENTITY_LIST_TYPE_ONE_PLMN_CONSECUTIVE_TACS == type) { + mcc = ((*ie_ptr)[length] & 0x0F) * 100; + mcc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + mcc += (*ie_ptr)[length] & 0x0F; + if ((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) { + length++; + mnc = ((*ie_ptr)[length] & 0x0F) * 10; + mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; + } else { + mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; + mnc += ((*ie_ptr)[length] & 0x0F) * 100; + mnc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + } + tac = (*ie_ptr)[length++] << 8; + tac |= (*ie_ptr)[length++]; + for (i = 0; i < N_elems; i++) { + tai_list->tai[tai_list->N_tais].mcc = mcc; + tai_list->tai[tai_list->N_tais].mnc = mnc; + tai_list->tai[tai_list->N_tais].tac = tac + i; + tai_list->N_tais++; + } + } else { + for (i = 0; i < N_elems; i++) { + tai_list->tai[tai_list->N_tais].mcc = ((*ie_ptr)[length] & 0x0F) * 100; + tai_list->tai[tai_list->N_tais].mcc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + tai_list->tai[tai_list->N_tais].mcc += (*ie_ptr)[length] & 0x0F; + if ((((*ie_ptr)[length] >> 4) & 0x0F) == 0x0F) { + length++; + tai_list->tai[tai_list->N_tais].mnc = ((*ie_ptr)[length] & 0x0F) * 10; + tai_list->tai[tai_list->N_tais].mnc += ((*ie_ptr)[length++] >> 4) & 0x0F; + } else { + tai_list->tai[tai_list->N_tais].mnc = ((*ie_ptr)[length++] >> 4) & 0x0F; + tai_list->tai[tai_list->N_tais].mnc += ((*ie_ptr)[length] & 0x0F) * 100; + tai_list->tai[tai_list->N_tais].mnc += (((*ie_ptr)[length++] >> 4) & 0x0F) * 10; + } + tai_list->tai[tai_list->N_tais].tac = (*ie_ptr)[length++] << 8; + tai_list->tai[tai_list->N_tais].tac |= (*ie_ptr)[length++]; + tai_list->N_tais++; + } + } + } + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3004,180 +2650,159 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_identity_list_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.34 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT *ue_network_cap, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ue_network_cap != NULL && - ie_ptr != NULL) - { - if(ue_network_cap->uea_present && - (ue_network_cap->ucs2_present || - ue_network_cap->uia_present) && - (ue_network_cap->lpp_present || - ue_network_cap->lcs_present || - ue_network_cap->onexsrvcc_present || - ue_network_cap->nf_present)) - { - **ie_ptr = 5; - }else if(ue_network_cap->uea_present && - (ue_network_cap->ucs2_present || - ue_network_cap->uia_present)){ - **ie_ptr = 4; - }else if(ue_network_cap->uea_present){ - **ie_ptr = 3; - }else{ - **ie_ptr = 2; - } - *ie_ptr += 1; - **ie_ptr = ue_network_cap->eea[0] << 7; - **ie_ptr |= ue_network_cap->eea[1] << 6; - **ie_ptr |= ue_network_cap->eea[2] << 5; - **ie_ptr |= ue_network_cap->eea[3] << 4; - **ie_ptr |= ue_network_cap->eea[4] << 3; - **ie_ptr |= ue_network_cap->eea[5] << 2; - **ie_ptr |= ue_network_cap->eea[6] << 1; - **ie_ptr |= ue_network_cap->eea[7]; - *ie_ptr += 1; - **ie_ptr = ue_network_cap->eia[0] << 7; - **ie_ptr |= ue_network_cap->eia[1] << 6; - **ie_ptr |= ue_network_cap->eia[2] << 5; - **ie_ptr |= ue_network_cap->eia[3] << 4; - **ie_ptr |= ue_network_cap->eia[4] << 3; - **ie_ptr |= ue_network_cap->eia[5] << 2; - **ie_ptr |= ue_network_cap->eia[6] << 1; - **ie_ptr |= ue_network_cap->eia[7]; - *ie_ptr += 1; - if(ue_network_cap->uea_present) - { - **ie_ptr = ue_network_cap->uea[0] << 7; - **ie_ptr |= ue_network_cap->uea[1] << 6; - **ie_ptr |= ue_network_cap->uea[2] << 5; - **ie_ptr |= ue_network_cap->uea[3] << 4; - **ie_ptr |= ue_network_cap->uea[4] << 3; - **ie_ptr |= ue_network_cap->uea[5] << 2; - **ie_ptr |= ue_network_cap->uea[6] << 1; - **ie_ptr |= ue_network_cap->uea[7]; - *ie_ptr += 1; - } - if(ue_network_cap->ucs2_present || - ue_network_cap->uia_present) - { - **ie_ptr = ue_network_cap->ucs2 << 7; - **ie_ptr |= ue_network_cap->uia[1] << 6; - **ie_ptr |= ue_network_cap->uia[2] << 5; - **ie_ptr |= ue_network_cap->uia[3] << 4; - **ie_ptr |= ue_network_cap->uia[4] << 3; - **ie_ptr |= ue_network_cap->uia[5] << 2; - **ie_ptr |= ue_network_cap->uia[6] << 1; - **ie_ptr |= ue_network_cap->uia[7]; - *ie_ptr += 1; - } - if(ue_network_cap->lpp_present || - ue_network_cap->lcs_present || - ue_network_cap->onexsrvcc_present || - ue_network_cap->nf_present) - { - **ie_ptr = ue_network_cap->lpp << 3; - **ie_ptr |= ue_network_cap->lcs << 2; - **ie_ptr |= ue_network_cap->onexsrvcc << 1; - **ie_ptr |= ue_network_cap->nf; - *ie_ptr += 1; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_ue_network_capability_ie(LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT* ue_network_cap, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ue_network_cap != NULL && ie_ptr != NULL) { + if (ue_network_cap->uea_present && (ue_network_cap->ucs2_present || ue_network_cap->uia_present) && + (ue_network_cap->lpp_present || ue_network_cap->lcs_present || ue_network_cap->onexsrvcc_present || + ue_network_cap->nf_present)) { + **ie_ptr = 5; + } else if (ue_network_cap->uea_present && (ue_network_cap->ucs2_present || ue_network_cap->uia_present)) { + **ie_ptr = 4; + } else if (ue_network_cap->uea_present) { + **ie_ptr = 3; + } else { + **ie_ptr = 2; + } + *ie_ptr += 1; + **ie_ptr = ue_network_cap->eea[0] << 7; + **ie_ptr |= ue_network_cap->eea[1] << 6; + **ie_ptr |= ue_network_cap->eea[2] << 5; + **ie_ptr |= ue_network_cap->eea[3] << 4; + **ie_ptr |= ue_network_cap->eea[4] << 3; + **ie_ptr |= ue_network_cap->eea[5] << 2; + **ie_ptr |= ue_network_cap->eea[6] << 1; + **ie_ptr |= ue_network_cap->eea[7]; + *ie_ptr += 1; + **ie_ptr = ue_network_cap->eia[0] << 7; + **ie_ptr |= ue_network_cap->eia[1] << 6; + **ie_ptr |= ue_network_cap->eia[2] << 5; + **ie_ptr |= ue_network_cap->eia[3] << 4; + **ie_ptr |= ue_network_cap->eia[4] << 3; + **ie_ptr |= ue_network_cap->eia[5] << 2; + **ie_ptr |= ue_network_cap->eia[6] << 1; + **ie_ptr |= ue_network_cap->eia[7]; + *ie_ptr += 1; + if (ue_network_cap->uea_present) { + **ie_ptr = ue_network_cap->uea[0] << 7; + **ie_ptr |= ue_network_cap->uea[1] << 6; + **ie_ptr |= ue_network_cap->uea[2] << 5; + **ie_ptr |= ue_network_cap->uea[3] << 4; + **ie_ptr |= ue_network_cap->uea[4] << 3; + **ie_ptr |= ue_network_cap->uea[5] << 2; + **ie_ptr |= ue_network_cap->uea[6] << 1; + **ie_ptr |= ue_network_cap->uea[7]; + *ie_ptr += 1; + } + if (ue_network_cap->ucs2_present || ue_network_cap->uia_present) { + **ie_ptr = ue_network_cap->ucs2 << 7; + **ie_ptr |= ue_network_cap->uia[1] << 6; + **ie_ptr |= ue_network_cap->uia[2] << 5; + **ie_ptr |= ue_network_cap->uia[3] << 4; + **ie_ptr |= ue_network_cap->uia[4] << 3; + **ie_ptr |= ue_network_cap->uia[5] << 2; + **ie_ptr |= ue_network_cap->uia[6] << 1; + **ie_ptr |= ue_network_cap->uia[7]; + *ie_ptr += 1; + } + if (ue_network_cap->lpp_present || ue_network_cap->lcs_present || ue_network_cap->onexsrvcc_present || + ue_network_cap->nf_present) { + **ie_ptr = ue_network_cap->lpp << 3; + **ie_ptr |= ue_network_cap->lcs << 2; + **ie_ptr |= ue_network_cap->onexsrvcc << 1; + **ie_ptr |= ue_network_cap->nf; + *ie_ptr += 1; + } - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8 **ie_ptr, - LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT *ue_network_cap) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 length; - - if(ie_ptr != NULL && - ue_network_cap != NULL) - { - length = **ie_ptr; - *ie_ptr += 1; - ue_network_cap->eea[0] = (**ie_ptr >> 7) & 0x01; - ue_network_cap->eea[1] = (**ie_ptr >> 6) & 0x01; - ue_network_cap->eea[2] = (**ie_ptr >> 5) & 0x01; - ue_network_cap->eea[3] = (**ie_ptr >> 4) & 0x01; - ue_network_cap->eea[4] = (**ie_ptr >> 3) & 0x01; - ue_network_cap->eea[5] = (**ie_ptr >> 2) & 0x01; - ue_network_cap->eea[6] = (**ie_ptr >> 1) & 0x01; - ue_network_cap->eea[7] = **ie_ptr & 0x01; - *ie_ptr += 1; - ue_network_cap->eia[0] = (**ie_ptr >> 7) & 0x01; - ue_network_cap->eia[1] = (**ie_ptr >> 6) & 0x01; - ue_network_cap->eia[2] = (**ie_ptr >> 5) & 0x01; - ue_network_cap->eia[3] = (**ie_ptr >> 4) & 0x01; - ue_network_cap->eia[4] = (**ie_ptr >> 3) & 0x01; - ue_network_cap->eia[5] = (**ie_ptr >> 2) & 0x01; - ue_network_cap->eia[6] = (**ie_ptr >> 1) & 0x01; - ue_network_cap->eia[7] = **ie_ptr & 0x01; - *ie_ptr += 1; - if(length > 2) - { - ue_network_cap->uea[0] = (**ie_ptr >> 7) & 0x01; - ue_network_cap->uea[1] = (**ie_ptr >> 6) & 0x01; - ue_network_cap->uea[2] = (**ie_ptr >> 5) & 0x01; - ue_network_cap->uea[3] = (**ie_ptr >> 4) & 0x01; - ue_network_cap->uea[4] = (**ie_ptr >> 3) & 0x01; - ue_network_cap->uea[5] = (**ie_ptr >> 2) & 0x01; - ue_network_cap->uea[6] = (**ie_ptr >> 1) & 0x01; - ue_network_cap->uea[7] = **ie_ptr & 0x01; - ue_network_cap->uea_present = true; - *ie_ptr += 1; - }else{ - ue_network_cap->uea_present = false; - } - if(length > 3) - { - ue_network_cap->ucs2 = (**ie_ptr >> 7) & 0x01; - ue_network_cap->ucs2_present = true; - ue_network_cap->uia[1] = (**ie_ptr >> 6) & 0x01; - ue_network_cap->uia[2] = (**ie_ptr >> 5) & 0x01; - ue_network_cap->uia[3] = (**ie_ptr >> 4) & 0x01; - ue_network_cap->uia[4] = (**ie_ptr >> 3) & 0x01; - ue_network_cap->uia[5] = (**ie_ptr >> 2) & 0x01; - ue_network_cap->uia[6] = (**ie_ptr >> 1) & 0x01; - ue_network_cap->uia[7] = **ie_ptr & 0x01; - ue_network_cap->uia_present = true; - *ie_ptr += 1; - }else{ - ue_network_cap->ucs2_present = false; - ue_network_cap->uia_present = false; - } - if(length > 4) - { - ue_network_cap->lpp = (**ie_ptr >> 3) & 0x01; - ue_network_cap->lpp_present = true; - ue_network_cap->lcs = (**ie_ptr >> 2) & 0x01; - ue_network_cap->lcs_present = true; - ue_network_cap->onexsrvcc = (**ie_ptr >> 1) & 0x01; - ue_network_cap->onexsrvcc_present = true; - ue_network_cap->nf = **ie_ptr >> 1; - ue_network_cap->nf_present = true; - *ie_ptr += 1; - }else{ - ue_network_cap->lpp_present = false; - ue_network_cap->lcs_present = false; - ue_network_cap->onexsrvcc_present = false; - ue_network_cap->nf_present = false; - } - if(length > 5) - { - *ie_ptr += length-5; - } + err = LIBLTE_SUCCESS; + } - err = LIBLTE_SUCCESS; + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8** ie_ptr, + LIBLTE_MME_UE_NETWORK_CAPABILITY_STRUCT* ue_network_cap) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 length; + + if (ie_ptr != NULL && ue_network_cap != NULL) { + length = **ie_ptr; + *ie_ptr += 1; + ue_network_cap->eea[0] = (**ie_ptr >> 7) & 0x01; + ue_network_cap->eea[1] = (**ie_ptr >> 6) & 0x01; + ue_network_cap->eea[2] = (**ie_ptr >> 5) & 0x01; + ue_network_cap->eea[3] = (**ie_ptr >> 4) & 0x01; + ue_network_cap->eea[4] = (**ie_ptr >> 3) & 0x01; + ue_network_cap->eea[5] = (**ie_ptr >> 2) & 0x01; + ue_network_cap->eea[6] = (**ie_ptr >> 1) & 0x01; + ue_network_cap->eea[7] = **ie_ptr & 0x01; + *ie_ptr += 1; + ue_network_cap->eia[0] = (**ie_ptr >> 7) & 0x01; + ue_network_cap->eia[1] = (**ie_ptr >> 6) & 0x01; + ue_network_cap->eia[2] = (**ie_ptr >> 5) & 0x01; + ue_network_cap->eia[3] = (**ie_ptr >> 4) & 0x01; + ue_network_cap->eia[4] = (**ie_ptr >> 3) & 0x01; + ue_network_cap->eia[5] = (**ie_ptr >> 2) & 0x01; + ue_network_cap->eia[6] = (**ie_ptr >> 1) & 0x01; + ue_network_cap->eia[7] = **ie_ptr & 0x01; + *ie_ptr += 1; + if (length > 2) { + ue_network_cap->uea[0] = (**ie_ptr >> 7) & 0x01; + ue_network_cap->uea[1] = (**ie_ptr >> 6) & 0x01; + ue_network_cap->uea[2] = (**ie_ptr >> 5) & 0x01; + ue_network_cap->uea[3] = (**ie_ptr >> 4) & 0x01; + ue_network_cap->uea[4] = (**ie_ptr >> 3) & 0x01; + ue_network_cap->uea[5] = (**ie_ptr >> 2) & 0x01; + ue_network_cap->uea[6] = (**ie_ptr >> 1) & 0x01; + ue_network_cap->uea[7] = **ie_ptr & 0x01; + ue_network_cap->uea_present = true; + *ie_ptr += 1; + } else { + ue_network_cap->uea_present = false; + } + if (length > 3) { + ue_network_cap->ucs2 = (**ie_ptr >> 7) & 0x01; + ue_network_cap->ucs2_present = true; + ue_network_cap->uia[1] = (**ie_ptr >> 6) & 0x01; + ue_network_cap->uia[2] = (**ie_ptr >> 5) & 0x01; + ue_network_cap->uia[3] = (**ie_ptr >> 4) & 0x01; + ue_network_cap->uia[4] = (**ie_ptr >> 3) & 0x01; + ue_network_cap->uia[5] = (**ie_ptr >> 2) & 0x01; + ue_network_cap->uia[6] = (**ie_ptr >> 1) & 0x01; + ue_network_cap->uia[7] = **ie_ptr & 0x01; + ue_network_cap->uia_present = true; + *ie_ptr += 1; + } else { + ue_network_cap->ucs2_present = false; + ue_network_cap->uia_present = false; + } + if (length > 4) { + ue_network_cap->lpp = (**ie_ptr >> 3) & 0x01; + ue_network_cap->lpp_present = true; + ue_network_cap->lcs = (**ie_ptr >> 2) & 0x01; + ue_network_cap->lcs_present = true; + ue_network_cap->onexsrvcc = (**ie_ptr >> 1) & 0x01; + ue_network_cap->onexsrvcc_present = true; + ue_network_cap->nf = **ie_ptr >> 1; + ue_network_cap->nf_present = true; + *ie_ptr += 1; + } else { + ue_network_cap->lpp_present = false; + ue_network_cap->lcs_present = false; + ue_network_cap->onexsrvcc_present = false; + ue_network_cap->nf_present = false; + } + if (length > 5) { + *ie_ptr += length - 5; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -3188,36 +2813,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_network_capability_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.35 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_radio_capability_update_needed_ie(uint8 urc_update, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_ue_radio_capability_update_needed_ie(uint8 urc_update, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= (urc_update & 0x01) << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= (urc_update & 0x01) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *urc_update) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8** ie_ptr, uint8 bit_offset, uint8* urc_update) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - urc_update != NULL) - { - *urc_update = ((*ie_ptr)[0] >> bit_offset) & 0x01; + if (ie_ptr != NULL && urc_update != NULL) { + *urc_update = ((*ie_ptr)[0] >> bit_offset) & 0x01; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3228,160 +2848,146 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_radio_capability_update_needed_ie(uint8 * Document Reference: 24.301 v10.2.0 Section 9.9.3.36 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ue_security_capabilities_ie(LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT *ue_sec_cap, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 idx; - - if(ue_sec_cap != NULL && - ie_ptr != NULL) - { - if(ue_sec_cap->uea_present && - ue_sec_cap->uia_present && - ue_sec_cap->gea_present) - { - (*ie_ptr)[0] = 5; - }else if(ue_sec_cap->uea_present && - ue_sec_cap->uia_present){ - (*ie_ptr)[0] = 4; - }else if(ue_sec_cap->uea_present){ - (*ie_ptr)[0] = 3; - }else{ - (*ie_ptr)[0] = 2; - } - idx = 1; - (*ie_ptr)[idx] = ue_sec_cap->eea[0] << 7; - (*ie_ptr)[idx] |= ue_sec_cap->eea[1] << 6; - (*ie_ptr)[idx] |= ue_sec_cap->eea[2] << 5; - (*ie_ptr)[idx] |= ue_sec_cap->eea[3] << 4; - (*ie_ptr)[idx] |= ue_sec_cap->eea[4] << 3; - (*ie_ptr)[idx] |= ue_sec_cap->eea[5] << 2; - (*ie_ptr)[idx] |= ue_sec_cap->eea[6] << 1; - (*ie_ptr)[idx] |= ue_sec_cap->eea[7]; - idx++; - (*ie_ptr)[idx] = ue_sec_cap->eia[0] << 7; - (*ie_ptr)[idx] |= ue_sec_cap->eia[1] << 6; - (*ie_ptr)[idx] |= ue_sec_cap->eia[2] << 5; - (*ie_ptr)[idx] |= ue_sec_cap->eia[3] << 4; - (*ie_ptr)[idx] |= ue_sec_cap->eia[4] << 3; - (*ie_ptr)[idx] |= ue_sec_cap->eia[5] << 2; - (*ie_ptr)[idx] |= ue_sec_cap->eia[6] << 1; - (*ie_ptr)[idx] |= ue_sec_cap->eia[7]; - idx++; - if(ue_sec_cap->uea_present) - { - (*ie_ptr)[idx] = ue_sec_cap->uea[0] << 7; - (*ie_ptr)[idx] |= ue_sec_cap->uea[1] << 6; - (*ie_ptr)[idx] |= ue_sec_cap->uea[2] << 5; - (*ie_ptr)[idx] |= ue_sec_cap->uea[3] << 4; - (*ie_ptr)[idx] |= ue_sec_cap->uea[4] << 3; - (*ie_ptr)[idx] |= ue_sec_cap->uea[5] << 2; - (*ie_ptr)[idx] |= ue_sec_cap->uea[6] << 1; - (*ie_ptr)[idx] |= ue_sec_cap->uea[7]; - idx++; - } - if(ue_sec_cap->uia_present) - { - (*ie_ptr)[idx] = ue_sec_cap->uia[1] << 6; - (*ie_ptr)[idx] |= ue_sec_cap->uia[2] << 5; - (*ie_ptr)[idx] |= ue_sec_cap->uia[3] << 4; - (*ie_ptr)[idx] |= ue_sec_cap->uia[4] << 3; - (*ie_ptr)[idx] |= ue_sec_cap->uia[5] << 2; - (*ie_ptr)[idx] |= ue_sec_cap->uia[6] << 1; - (*ie_ptr)[idx] |= ue_sec_cap->uia[7]; - idx++; - } - if(ue_sec_cap->gea_present) - { - (*ie_ptr)[idx] = ue_sec_cap->gea[1] << 6; - (*ie_ptr)[idx] |= ue_sec_cap->gea[2] << 5; - (*ie_ptr)[idx] |= ue_sec_cap->gea[3] << 4; - (*ie_ptr)[idx] |= ue_sec_cap->gea[4] << 3; - (*ie_ptr)[idx] |= ue_sec_cap->gea[5] << 2; - (*ie_ptr)[idx] |= ue_sec_cap->gea[6] << 1; - (*ie_ptr)[idx] |= ue_sec_cap->gea[7]; - idx++; - } - *ie_ptr += idx; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8 **ie_ptr, - LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT *ue_sec_cap) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 length; - - if(ie_ptr != NULL && - ue_sec_cap != NULL) - { - length = (*ie_ptr)[0]; - ue_sec_cap->eea[0] = ((*ie_ptr)[1] >> 7) & 0x01; - ue_sec_cap->eea[1] = ((*ie_ptr)[1] >> 6) & 0x01; - ue_sec_cap->eea[2] = ((*ie_ptr)[1] >> 5) & 0x01; - ue_sec_cap->eea[3] = ((*ie_ptr)[1] >> 4) & 0x01; - ue_sec_cap->eea[4] = ((*ie_ptr)[1] >> 3) & 0x01; - ue_sec_cap->eea[5] = ((*ie_ptr)[1] >> 2) & 0x01; - ue_sec_cap->eea[6] = ((*ie_ptr)[1] >> 1) & 0x01; - ue_sec_cap->eea[7] = (*ie_ptr)[1] & 0x01; - ue_sec_cap->eia[0] = ((*ie_ptr)[2] >> 7) & 0x01; - ue_sec_cap->eia[1] = ((*ie_ptr)[2] >> 6) & 0x01; - ue_sec_cap->eia[2] = ((*ie_ptr)[2] >> 5) & 0x01; - ue_sec_cap->eia[3] = ((*ie_ptr)[2] >> 4) & 0x01; - ue_sec_cap->eia[4] = ((*ie_ptr)[2] >> 3) & 0x01; - ue_sec_cap->eia[5] = ((*ie_ptr)[2] >> 2) & 0x01; - ue_sec_cap->eia[6] = ((*ie_ptr)[2] >> 1) & 0x01; - ue_sec_cap->eia[7] = (*ie_ptr)[2] & 0x01; - if(length > 2) - { - ue_sec_cap->uea[0] = ((*ie_ptr)[3] >> 7) & 0x01; - ue_sec_cap->uea[1] = ((*ie_ptr)[3] >> 6) & 0x01; - ue_sec_cap->uea[2] = ((*ie_ptr)[3] >> 5) & 0x01; - ue_sec_cap->uea[3] = ((*ie_ptr)[3] >> 4) & 0x01; - ue_sec_cap->uea[4] = ((*ie_ptr)[3] >> 3) & 0x01; - ue_sec_cap->uea[5] = ((*ie_ptr)[3] >> 2) & 0x01; - ue_sec_cap->uea[6] = ((*ie_ptr)[3] >> 1) & 0x01; - ue_sec_cap->uea[7] = (*ie_ptr)[3] & 0x01; - ue_sec_cap->uea_present = true; - }else{ - ue_sec_cap->uea_present = false; - } - if(length > 3) - { - ue_sec_cap->uia[1] = ((*ie_ptr)[4] >> 6) & 0x01; - ue_sec_cap->uia[2] = ((*ie_ptr)[4] >> 5) & 0x01; - ue_sec_cap->uia[3] = ((*ie_ptr)[4] >> 4) & 0x01; - ue_sec_cap->uia[4] = ((*ie_ptr)[4] >> 3) & 0x01; - ue_sec_cap->uia[5] = ((*ie_ptr)[4] >> 2) & 0x01; - ue_sec_cap->uia[6] = ((*ie_ptr)[4] >> 1) & 0x01; - ue_sec_cap->uia[7] = (*ie_ptr)[4] & 0x01; - ue_sec_cap->uia_present = true; - }else{ - ue_sec_cap->uia_present = false; - } - if(length > 4) - { - ue_sec_cap->gea[1] = ((*ie_ptr)[5] >> 6) & 0x01; - ue_sec_cap->gea[2] = ((*ie_ptr)[5] >> 5) & 0x01; - ue_sec_cap->gea[3] = ((*ie_ptr)[5] >> 4) & 0x01; - ue_sec_cap->gea[4] = ((*ie_ptr)[5] >> 3) & 0x01; - ue_sec_cap->gea[5] = ((*ie_ptr)[5] >> 2) & 0x01; - ue_sec_cap->gea[6] = ((*ie_ptr)[5] >> 1) & 0x01; - ue_sec_cap->gea[7] = (*ie_ptr)[5] & 0x01; - ue_sec_cap->gea_present = true; - }else{ - ue_sec_cap->gea_present = false; - } - *ie_ptr += length + 1; +LIBLTE_ERROR_ENUM liblte_mme_pack_ue_security_capabilities_ie(LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT* ue_sec_cap, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 idx; + + if (ue_sec_cap != NULL && ie_ptr != NULL) { + if (ue_sec_cap->uea_present && ue_sec_cap->uia_present && ue_sec_cap->gea_present) { + (*ie_ptr)[0] = 5; + } else if (ue_sec_cap->uea_present && ue_sec_cap->uia_present) { + (*ie_ptr)[0] = 4; + } else if (ue_sec_cap->uea_present) { + (*ie_ptr)[0] = 3; + } else { + (*ie_ptr)[0] = 2; + } + idx = 1; + (*ie_ptr)[idx] = ue_sec_cap->eea[0] << 7; + (*ie_ptr)[idx] |= ue_sec_cap->eea[1] << 6; + (*ie_ptr)[idx] |= ue_sec_cap->eea[2] << 5; + (*ie_ptr)[idx] |= ue_sec_cap->eea[3] << 4; + (*ie_ptr)[idx] |= ue_sec_cap->eea[4] << 3; + (*ie_ptr)[idx] |= ue_sec_cap->eea[5] << 2; + (*ie_ptr)[idx] |= ue_sec_cap->eea[6] << 1; + (*ie_ptr)[idx] |= ue_sec_cap->eea[7]; + idx++; + (*ie_ptr)[idx] = ue_sec_cap->eia[0] << 7; + (*ie_ptr)[idx] |= ue_sec_cap->eia[1] << 6; + (*ie_ptr)[idx] |= ue_sec_cap->eia[2] << 5; + (*ie_ptr)[idx] |= ue_sec_cap->eia[3] << 4; + (*ie_ptr)[idx] |= ue_sec_cap->eia[4] << 3; + (*ie_ptr)[idx] |= ue_sec_cap->eia[5] << 2; + (*ie_ptr)[idx] |= ue_sec_cap->eia[6] << 1; + (*ie_ptr)[idx] |= ue_sec_cap->eia[7]; + idx++; + if (ue_sec_cap->uea_present) { + (*ie_ptr)[idx] = ue_sec_cap->uea[0] << 7; + (*ie_ptr)[idx] |= ue_sec_cap->uea[1] << 6; + (*ie_ptr)[idx] |= ue_sec_cap->uea[2] << 5; + (*ie_ptr)[idx] |= ue_sec_cap->uea[3] << 4; + (*ie_ptr)[idx] |= ue_sec_cap->uea[4] << 3; + (*ie_ptr)[idx] |= ue_sec_cap->uea[5] << 2; + (*ie_ptr)[idx] |= ue_sec_cap->uea[6] << 1; + (*ie_ptr)[idx] |= ue_sec_cap->uea[7]; + idx++; + } + if (ue_sec_cap->uia_present) { + (*ie_ptr)[idx] = ue_sec_cap->uia[1] << 6; + (*ie_ptr)[idx] |= ue_sec_cap->uia[2] << 5; + (*ie_ptr)[idx] |= ue_sec_cap->uia[3] << 4; + (*ie_ptr)[idx] |= ue_sec_cap->uia[4] << 3; + (*ie_ptr)[idx] |= ue_sec_cap->uia[5] << 2; + (*ie_ptr)[idx] |= ue_sec_cap->uia[6] << 1; + (*ie_ptr)[idx] |= ue_sec_cap->uia[7]; + idx++; + } + if (ue_sec_cap->gea_present) { + (*ie_ptr)[idx] = ue_sec_cap->gea[1] << 6; + (*ie_ptr)[idx] |= ue_sec_cap->gea[2] << 5; + (*ie_ptr)[idx] |= ue_sec_cap->gea[3] << 4; + (*ie_ptr)[idx] |= ue_sec_cap->gea[4] << 3; + (*ie_ptr)[idx] |= ue_sec_cap->gea[5] << 2; + (*ie_ptr)[idx] |= ue_sec_cap->gea[6] << 1; + (*ie_ptr)[idx] |= ue_sec_cap->gea[7]; + idx++; + } + *ie_ptr += idx; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8** ie_ptr, + LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT* ue_sec_cap) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 length; + + if (ie_ptr != NULL && ue_sec_cap != NULL) { + length = (*ie_ptr)[0]; + ue_sec_cap->eea[0] = ((*ie_ptr)[1] >> 7) & 0x01; + ue_sec_cap->eea[1] = ((*ie_ptr)[1] >> 6) & 0x01; + ue_sec_cap->eea[2] = ((*ie_ptr)[1] >> 5) & 0x01; + ue_sec_cap->eea[3] = ((*ie_ptr)[1] >> 4) & 0x01; + ue_sec_cap->eea[4] = ((*ie_ptr)[1] >> 3) & 0x01; + ue_sec_cap->eea[5] = ((*ie_ptr)[1] >> 2) & 0x01; + ue_sec_cap->eea[6] = ((*ie_ptr)[1] >> 1) & 0x01; + ue_sec_cap->eea[7] = (*ie_ptr)[1] & 0x01; + ue_sec_cap->eia[0] = ((*ie_ptr)[2] >> 7) & 0x01; + ue_sec_cap->eia[1] = ((*ie_ptr)[2] >> 6) & 0x01; + ue_sec_cap->eia[2] = ((*ie_ptr)[2] >> 5) & 0x01; + ue_sec_cap->eia[3] = ((*ie_ptr)[2] >> 4) & 0x01; + ue_sec_cap->eia[4] = ((*ie_ptr)[2] >> 3) & 0x01; + ue_sec_cap->eia[5] = ((*ie_ptr)[2] >> 2) & 0x01; + ue_sec_cap->eia[6] = ((*ie_ptr)[2] >> 1) & 0x01; + ue_sec_cap->eia[7] = (*ie_ptr)[2] & 0x01; + if (length > 2) { + ue_sec_cap->uea[0] = ((*ie_ptr)[3] >> 7) & 0x01; + ue_sec_cap->uea[1] = ((*ie_ptr)[3] >> 6) & 0x01; + ue_sec_cap->uea[2] = ((*ie_ptr)[3] >> 5) & 0x01; + ue_sec_cap->uea[3] = ((*ie_ptr)[3] >> 4) & 0x01; + ue_sec_cap->uea[4] = ((*ie_ptr)[3] >> 3) & 0x01; + ue_sec_cap->uea[5] = ((*ie_ptr)[3] >> 2) & 0x01; + ue_sec_cap->uea[6] = ((*ie_ptr)[3] >> 1) & 0x01; + ue_sec_cap->uea[7] = (*ie_ptr)[3] & 0x01; + ue_sec_cap->uea_present = true; + } else { + ue_sec_cap->uea_present = false; + } + if (length > 3) { + ue_sec_cap->uia[1] = ((*ie_ptr)[4] >> 6) & 0x01; + ue_sec_cap->uia[2] = ((*ie_ptr)[4] >> 5) & 0x01; + ue_sec_cap->uia[3] = ((*ie_ptr)[4] >> 4) & 0x01; + ue_sec_cap->uia[4] = ((*ie_ptr)[4] >> 3) & 0x01; + ue_sec_cap->uia[5] = ((*ie_ptr)[4] >> 2) & 0x01; + ue_sec_cap->uia[6] = ((*ie_ptr)[4] >> 1) & 0x01; + ue_sec_cap->uia[7] = (*ie_ptr)[4] & 0x01; + ue_sec_cap->uia_present = true; + } else { + ue_sec_cap->uia_present = false; + } + if (length > 4) { + ue_sec_cap->gea[1] = ((*ie_ptr)[5] >> 6) & 0x01; + ue_sec_cap->gea[2] = ((*ie_ptr)[5] >> 5) & 0x01; + ue_sec_cap->gea[3] = ((*ie_ptr)[5] >> 4) & 0x01; + ue_sec_cap->gea[4] = ((*ie_ptr)[5] >> 3) & 0x01; + ue_sec_cap->gea[5] = ((*ie_ptr)[5] >> 2) & 0x01; + ue_sec_cap->gea[6] = ((*ie_ptr)[5] >> 1) & 0x01; + ue_sec_cap->gea[7] = (*ie_ptr)[5] & 0x01; + ue_sec_cap->gea_present = true; + } else { + ue_sec_cap->gea_present = false; + } + *ie_ptr += length + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3394,98 +3000,87 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ue_security_capabilities_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.37 24.008 v10.2.0 Section 10.5.3.13 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_emergency_number_list_ie(LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT *emerg_num_list, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - uint32 j; - uint32 length; - - if(emerg_num_list != NULL && - ie_ptr != NULL) - { - length = 1; - for(i=0; iN_emerg_nums; i++) - { - if((emerg_num_list->emerg_num[i].N_emerg_num_digits % 2) == 0) - { - (*ie_ptr)[length++] = (emerg_num_list->emerg_num[i].N_emerg_num_digits/2) + 1; - (*ie_ptr)[length++] = emerg_num_list->emerg_num[i].emerg_service_cat; - - if (emerg_num_list->emerg_num[i].N_emerg_num_digits / 2 > LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS) { - return err; - } - - for(j=0; jemerg_num[i].N_emerg_num_digits/2; j++) - { - (*ie_ptr)[length] = emerg_num_list->emerg_num[i].emerg_num[j*2+0]; - (*ie_ptr)[length++] |= emerg_num_list->emerg_num[i].emerg_num[j*2+1] << 4; - } - }else{ - (*ie_ptr)[length++] = (emerg_num_list->emerg_num[i].N_emerg_num_digits/2) + 2; - (*ie_ptr)[length++] = emerg_num_list->emerg_num[i].emerg_service_cat; - for(j=0; jemerg_num[i].N_emerg_num_digits/2; j++) - { - (*ie_ptr)[length] = emerg_num_list->emerg_num[i].emerg_num[j*2+0]; - (*ie_ptr)[length++] |= emerg_num_list->emerg_num[i].emerg_num[j*2+1] << 4; - } - (*ie_ptr)[length++] = 0xF0 | emerg_num_list->emerg_num[i].emerg_num[j*2]; - } - } - (*ie_ptr)[0] = length - 2; - *ie_ptr += length - 1; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8 **ie_ptr, - LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT *emerg_num_list) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 sent_length; - uint32 length; - uint32 idx; - uint32 i; - - if(ie_ptr != NULL && - emerg_num_list != NULL) - { - sent_length = (*ie_ptr)[0] + 1; - length = 1; - emerg_num_list->N_emerg_nums = 0; - while(length < sent_length) - { - idx = emerg_num_list->N_emerg_nums; - emerg_num_list->emerg_num[idx].N_emerg_num_digits = ((*ie_ptr)[length++] - 1) * 2; - if (emerg_num_list->emerg_num[idx].N_emerg_num_digits > - LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS) { - return err; - } - - emerg_num_list->emerg_num[idx].emerg_service_cat = (LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM)((*ie_ptr)[length++] & 0x1F); - for(i=0; iemerg_num[idx].N_emerg_num_digits/2; i++) - { - emerg_num_list->emerg_num[idx].emerg_num[i*2+0] = (*ie_ptr)[length] & 0x0F; - emerg_num_list->emerg_num[idx].emerg_num[i*2+1] = (*ie_ptr)[length++] >> 4; - } - // Added by Ismael: if i==0 this is negative - if (i > 0) { - if(emerg_num_list->emerg_num[idx].emerg_num[i*2-1] == 0x0F) - { - emerg_num_list->emerg_num[idx].N_emerg_num_digits--; - } - } - emerg_num_list->N_emerg_nums++; +LIBLTE_ERROR_ENUM liblte_mme_pack_emergency_number_list_ie(LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT* emerg_num_list, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + uint32 j; + uint32 length; + + if (emerg_num_list != NULL && ie_ptr != NULL) { + length = 1; + for (i = 0; i < emerg_num_list->N_emerg_nums; i++) { + if ((emerg_num_list->emerg_num[i].N_emerg_num_digits % 2) == 0) { + (*ie_ptr)[length++] = (emerg_num_list->emerg_num[i].N_emerg_num_digits / 2) + 1; + (*ie_ptr)[length++] = emerg_num_list->emerg_num[i].emerg_service_cat; + + if (emerg_num_list->emerg_num[i].N_emerg_num_digits / 2 > LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS) { + return err; } - *ie_ptr += (*ie_ptr)[0] + 1; - err = LIBLTE_SUCCESS; + for (j = 0; j < emerg_num_list->emerg_num[i].N_emerg_num_digits / 2; j++) { + (*ie_ptr)[length] = emerg_num_list->emerg_num[i].emerg_num[j * 2 + 0]; + (*ie_ptr)[length++] |= emerg_num_list->emerg_num[i].emerg_num[j * 2 + 1] << 4; + } + } else { + (*ie_ptr)[length++] = (emerg_num_list->emerg_num[i].N_emerg_num_digits / 2) + 2; + (*ie_ptr)[length++] = emerg_num_list->emerg_num[i].emerg_service_cat; + for (j = 0; j < emerg_num_list->emerg_num[i].N_emerg_num_digits / 2; j++) { + (*ie_ptr)[length] = emerg_num_list->emerg_num[i].emerg_num[j * 2 + 0]; + (*ie_ptr)[length++] |= emerg_num_list->emerg_num[i].emerg_num[j * 2 + 1] << 4; + } + (*ie_ptr)[length++] = 0xF0 | emerg_num_list->emerg_num[i].emerg_num[j * 2]; + } } + (*ie_ptr)[0] = length - 2; + *ie_ptr += length - 1; + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8** ie_ptr, + LIBLTE_MME_EMERGENCY_NUMBER_LIST_STRUCT* emerg_num_list) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 sent_length; + uint32 length; + uint32 idx; + uint32 i; + + if (ie_ptr != NULL && emerg_num_list != NULL) { + sent_length = (*ie_ptr)[0] + 1; + length = 1; + emerg_num_list->N_emerg_nums = 0; + while (length < sent_length) { + idx = emerg_num_list->N_emerg_nums; + emerg_num_list->emerg_num[idx].N_emerg_num_digits = ((*ie_ptr)[length++] - 1) * 2; + if (emerg_num_list->emerg_num[idx].N_emerg_num_digits > LIBLTE_MME_EMERGENCY_NUMBER_MAX_NUM_DIGITS) { + return err; + } + + emerg_num_list->emerg_num[idx].emerg_service_cat = + (LIBLTE_MME_EMERGENCY_SERVICE_CATEGORY_ENUM)((*ie_ptr)[length++] & 0x1F); + for (i = 0; i < emerg_num_list->emerg_num[idx].N_emerg_num_digits / 2; i++) { + emerg_num_list->emerg_num[idx].emerg_num[i * 2 + 0] = (*ie_ptr)[length] & 0x0F; + emerg_num_list->emerg_num[idx].emerg_num[i * 2 + 1] = (*ie_ptr)[length++] >> 4; + } + // Added by Ismael: if i==0 this is negative + if (i > 0) { + if (emerg_num_list->emerg_num[idx].emerg_num[i * 2 - 1] == 0x0F) { + emerg_num_list->emerg_num[idx].N_emerg_num_digits--; + } + } + emerg_num_list->N_emerg_nums++; + } + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3507,36 +3102,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emergency_number_list_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.39 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_ss_code_ie(uint8 code, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_ss_code_ie(uint8 code, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = code; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = code; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8 **ie_ptr, - uint8 *code) +LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8** ie_ptr, uint8* code) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - code != NULL) - { - *code = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && code != NULL) { + *code = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3548,36 +3138,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_ss_code_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.40 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_lcs_indicator_ie(uint8 lcs_ind, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_lcs_indicator_ie(uint8 lcs_ind, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = lcs_ind; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = lcs_ind; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8 **ie_ptr, - uint8 *lcs_ind) +LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8** ie_ptr, uint8* lcs_ind) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - lcs_ind != NULL) - { - *lcs_ind = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && lcs_ind != NULL) { + *lcs_ind = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3598,36 +3183,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_lcs_indicator_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.3.42 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_type_ie(uint8 msg_cont_type, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_type_ie(uint8 msg_cont_type, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = msg_cont_type; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = msg_cont_type; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8 **ie_ptr, - uint8 *msg_cont_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8** ie_ptr, uint8* msg_cont_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - msg_cont_type != NULL) - { - *msg_cont_type = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && msg_cont_type != NULL) { + *msg_cont_type = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3638,55 +3218,46 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_type_ie(uint8 **ie Document Reference: 24.301 v10.2.0 Section 9.9.3.43 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_ie(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(msg != NULL && - ie_ptr != NULL && - msg->N_bytes <= LIBLTE_MAX_MSG_SIZE_BYTES) - { - (*ie_ptr)[0] = msg->N_bytes >> 8; - (*ie_ptr)[1] = msg->N_bytes & 0xFF; - for(i=0; iN_bytes; i++) - { - (*ie_ptr)[2+i] = msg->msg[i]; - } - *ie_ptr += msg->N_bytes + 2; +LIBLTE_ERROR_ENUM liblte_mme_pack_generic_message_container_ie(LIBLTE_BYTE_MSG_STRUCT* msg, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (msg != NULL && ie_ptr != NULL && msg->N_bytes <= LIBLTE_MAX_MSG_SIZE_BYTES) { + (*ie_ptr)[0] = msg->N_bytes >> 8; + (*ie_ptr)[1] = msg->N_bytes & 0xFF; + for (i = 0; i < msg->N_bytes; i++) { + (*ie_ptr)[2 + i] = msg->msg[i]; } + *ie_ptr += msg->N_bytes + 2; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8 **ie_ptr, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8** ie_ptr, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - msg != NULL) - { - msg->N_bytes = (*ie_ptr)[0] << 8; - msg->N_bytes |= (*ie_ptr)[1]; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - if(msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES){ - return err; - } + if (ie_ptr != NULL && msg != NULL) { + msg->N_bytes = (*ie_ptr)[0] << 8; + msg->N_bytes |= (*ie_ptr)[1]; - for(i=0; iN_bytes; i++) - { - msg->msg[i] = (*ie_ptr)[2+i]; - } - *ie_ptr += msg->N_bytes + 2; + if (msg->N_bytes > LIBLTE_MAX_MSG_SIZE_BYTES) { + return err; + } - err = LIBLTE_SUCCESS; + for (i = 0; i < msg->N_bytes; i++) { + msg->msg[i] = (*ie_ptr)[2 + i]; } + *ie_ptr += msg->N_bytes + 2; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3698,42 +3269,39 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_generic_message_container_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.3.44 24.008 v10.2.0 Section 10.5.5.28 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie(LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT *voice_domain_pref_and_ue_usage_setting, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie( + LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(voice_domain_pref_and_ue_usage_setting != NULL && - ie_ptr != NULL) - { - **ie_ptr = 1; - *ie_ptr += 1; - **ie_ptr = voice_domain_pref_and_ue_usage_setting->ue_usage_setting << 2; - **ie_ptr |= voice_domain_pref_and_ue_usage_setting->voice_domain_pref; - *ie_ptr += 1; + if (voice_domain_pref_and_ue_usage_setting != NULL && ie_ptr != NULL) { + **ie_ptr = 1; + *ie_ptr += 1; + **ie_ptr = voice_domain_pref_and_ue_usage_setting->ue_usage_setting << 2; + **ie_ptr |= voice_domain_pref_and_ue_usage_setting->voice_domain_pref; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(uint8 **ie_ptr, - LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT *voice_domain_pref_and_ue_usage_setting) +LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie( + uint8** ie_ptr, LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_STRUCT* voice_domain_pref_and_ue_usage_setting) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - voice_domain_pref_and_ue_usage_setting != NULL) - { - *ie_ptr += 1; - voice_domain_pref_and_ue_usage_setting->ue_usage_setting = (LIBLTE_MME_UE_USAGE_SETTING_ENUM)((**ie_ptr >> 2) & 0x01); - voice_domain_pref_and_ue_usage_setting->voice_domain_pref = (LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM)(**ie_ptr & 0x03); - *ie_ptr += 1; + if (ie_ptr != NULL && voice_domain_pref_and_ue_usage_setting != NULL) { + *ie_ptr += 1; + voice_domain_pref_and_ue_usage_setting->ue_usage_setting = + (LIBLTE_MME_UE_USAGE_SETTING_ENUM)((**ie_ptr >> 2) & 0x01); + voice_domain_pref_and_ue_usage_setting->voice_domain_pref = (LIBLTE_MME_VOICE_DOMAIN_PREF_ENUM)(**ie_ptr & 0x03); + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3746,36 +3314,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(ui Document Reference: 24.301 v10.2.0 Section 9.9.3.45 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_type_ie(LIBLTE_MME_GUTI_TYPE_ENUM guti_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_guti_type_ie(LIBLTE_MME_GUTI_TYPE_ENUM guti_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= guti_type << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= guti_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_GUTI_TYPE_ENUM *guti_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_type_ie(uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_GUTI_TYPE_ENUM* guti_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - guti_type != NULL) - { - *guti_type = (LIBLTE_MME_GUTI_TYPE_ENUM)((**ie_ptr >> bit_offset) & 0x01); + if (ie_ptr != NULL && guti_type != NULL) { + *guti_type = (LIBLTE_MME_GUTI_TYPE_ENUM)((**ie_ptr >> bit_offset) & 0x01); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -3789,84 +3350,73 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_type_ie(uint8 **ie_ Document Reference: 24.301 v10.2.0 Section 9.9.4.1 24.008 v10.2.0 Section 10.5.6.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_access_point_name_ie(LIBLTE_MME_ACCESS_POINT_NAME_STRUCT *apn, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - const char *apn_str; - uint32 i; - uint32 len_idx; - uint32 apn_idx; - uint32 label_len; - - if(apn != NULL && - ie_ptr != NULL) - { - apn_str = apn->apn; - (*ie_ptr)[0] = strnlen(apn->apn, LIBLTE_STRING_LEN)+1; - len_idx = 0; - apn_idx = 0; - label_len = 0; - while(strnlen(apn->apn, LIBLTE_STRING_LEN) > apn_idx) - { - (*ie_ptr)[1+apn_idx+1] = (uint8)apn_str[apn_idx]; - apn_idx++; - label_len++; - - if(apn_str[apn_idx] == '.') - { - (*ie_ptr)[1+len_idx] = label_len; - label_len = 0; - len_idx = apn_idx+1; - apn_idx++; - } - } - (*ie_ptr)[1+len_idx] = label_len; - *ie_ptr += strnlen(apn->apn, LIBLTE_STRING_LEN) + 2; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8 **ie_ptr, - LIBLTE_MME_ACCESS_POINT_NAME_STRUCT *apn) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - uint32 ie_idx; - uint32 label_len; - uint32 str_cnt; - - if(ie_ptr != NULL && - apn != NULL) - { - ie_idx = 0; - str_cnt = 0; - while(ie_idx < (*ie_ptr)[0] && str_cnt < LIBLTE_STRING_LEN) - { - label_len = (*ie_ptr)[1+ie_idx]; - for(i=0; iapn[str_cnt] = (char)((*ie_ptr)[1+ie_idx+i+1]); - str_cnt++; - } - ie_idx += label_len + 1; - if(ie_idx < (*ie_ptr)[0] && str_cnt < LIBLTE_STRING_LEN) - { - apn->apn[str_cnt] = '.'; - str_cnt++; - } - } - if (str_cnt < LIBLTE_STRING_LEN) { - apn->apn[str_cnt] = '\0'; - } - *ie_ptr += (*ie_ptr)[0] + 1; +LIBLTE_ERROR_ENUM liblte_mme_pack_access_point_name_ie(LIBLTE_MME_ACCESS_POINT_NAME_STRUCT* apn, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + const char* apn_str; + uint32 i; + uint32 len_idx; + uint32 apn_idx; + uint32 label_len; + + if (apn != NULL && ie_ptr != NULL) { + apn_str = apn->apn; + (*ie_ptr)[0] = strnlen(apn->apn, LIBLTE_STRING_LEN) + 1; + len_idx = 0; + apn_idx = 0; + label_len = 0; + while (strnlen(apn->apn, LIBLTE_STRING_LEN) > apn_idx) { + (*ie_ptr)[1 + apn_idx + 1] = (uint8)apn_str[apn_idx]; + apn_idx++; + label_len++; + + if (apn_str[apn_idx] == '.') { + (*ie_ptr)[1 + len_idx] = label_len; + label_len = 0; + len_idx = apn_idx + 1; + apn_idx++; + } + } + (*ie_ptr)[1 + len_idx] = label_len; + *ie_ptr += strnlen(apn->apn, LIBLTE_STRING_LEN) + 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8** ie_ptr, LIBLTE_MME_ACCESS_POINT_NAME_STRUCT* apn) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + uint32 ie_idx; + uint32 label_len; + uint32 str_cnt; + + if (ie_ptr != NULL && apn != NULL) { + ie_idx = 0; + str_cnt = 0; + while (ie_idx < (*ie_ptr)[0] && str_cnt < LIBLTE_STRING_LEN) { + label_len = (*ie_ptr)[1 + ie_idx]; + for (i = 0; i < label_len && str_cnt < LIBLTE_STRING_LEN; i++) { + apn->apn[str_cnt] = (char)((*ie_ptr)[1 + ie_idx + i + 1]); + str_cnt++; + } + ie_idx += label_len + 1; + if (ie_idx < (*ie_ptr)[0] && str_cnt < LIBLTE_STRING_LEN) { + apn->apn[str_cnt] = '.'; + str_cnt++; + } + } + if (str_cnt < LIBLTE_STRING_LEN) { + apn->apn[str_cnt] = '\0'; + } + *ie_ptr += (*ie_ptr)[0] + 1; - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -3878,95 +3428,82 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_access_point_name_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT *apn_ambr, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(apn_ambr != NULL && - ie_ptr != NULL) - { - if(apn_ambr->ext_present && - apn_ambr->ext2_present) - { - (*ie_ptr)[0] = 6; - }else if(apn_ambr->ext_present){ - (*ie_ptr)[0] = 4; - }else{ - (*ie_ptr)[0] = 2; - } - (*ie_ptr)[1] = apn_ambr->apn_ambr_dl; - (*ie_ptr)[2] = apn_ambr->apn_ambr_ul; - if(apn_ambr->ext_present) - { - (*ie_ptr)[3] = apn_ambr->apn_ambr_dl_ext; - (*ie_ptr)[4] = apn_ambr->apn_ambr_ul_ext; - } - if(apn_ambr->ext2_present) - { - (*ie_ptr)[5] = apn_ambr->apn_ambr_dl_ext2; - (*ie_ptr)[6] = apn_ambr->apn_ambr_ul_ext2; - } - if(apn_ambr->ext_present && - apn_ambr->ext2_present) - { - *ie_ptr += 7; - }else if(apn_ambr->ext_present){ - *ie_ptr += 5; - }else{ - *ie_ptr += 3; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT* apn_ambr, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - err = LIBLTE_SUCCESS; + if (apn_ambr != NULL && ie_ptr != NULL) { + if (apn_ambr->ext_present && apn_ambr->ext2_present) { + (*ie_ptr)[0] = 6; + } else if (apn_ambr->ext_present) { + (*ie_ptr)[0] = 4; + } else { + (*ie_ptr)[0] = 2; + } + (*ie_ptr)[1] = apn_ambr->apn_ambr_dl; + (*ie_ptr)[2] = apn_ambr->apn_ambr_ul; + if (apn_ambr->ext_present) { + (*ie_ptr)[3] = apn_ambr->apn_ambr_dl_ext; + (*ie_ptr)[4] = apn_ambr->apn_ambr_ul_ext; + } + if (apn_ambr->ext2_present) { + (*ie_ptr)[5] = apn_ambr->apn_ambr_dl_ext2; + (*ie_ptr)[6] = apn_ambr->apn_ambr_ul_ext2; + } + if (apn_ambr->ext_present && apn_ambr->ext2_present) { + *ie_ptr += 7; + } else if (apn_ambr->ext_present) { + *ie_ptr += 5; + } else { + *ie_ptr += 3; } - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8 **ie_ptr, - LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT *apn_ambr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - apn_ambr != NULL) - { - if(6 == (*ie_ptr)[0]) - { - apn_ambr->ext_present = true; - apn_ambr->ext2_present = true; - }else if(4 == (*ie_ptr)[0]){ - apn_ambr->ext_present = true; - apn_ambr->ext2_present = false; - }else{ - apn_ambr->ext_present = false; - apn_ambr->ext2_present = false; - } - apn_ambr->apn_ambr_dl = (*ie_ptr)[1]; - apn_ambr->apn_ambr_ul = (*ie_ptr)[2]; - if(apn_ambr->ext_present) - { - apn_ambr->apn_ambr_dl_ext = (*ie_ptr)[3]; - apn_ambr->apn_ambr_ul_ext = (*ie_ptr)[4]; - } - if(apn_ambr->ext2_present) - { - apn_ambr->apn_ambr_dl_ext2 = (*ie_ptr)[5]; - apn_ambr->apn_ambr_ul_ext2 = (*ie_ptr)[6]; - } - if(apn_ambr->ext_present && - apn_ambr->ext2_present) - { - *ie_ptr += 7; - }else if(apn_ambr->ext_present){ - *ie_ptr += 5; - }else{ - *ie_ptr += 3; - } + err = LIBLTE_SUCCESS; + } - err = LIBLTE_SUCCESS; + return (err); +} +LIBLTE_ERROR_ENUM +liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8** ie_ptr, + LIBLTE_MME_APN_AGGREGATE_MAXIMUM_BIT_RATE_STRUCT* apn_ambr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && apn_ambr != NULL) { + if (6 == (*ie_ptr)[0]) { + apn_ambr->ext_present = true; + apn_ambr->ext2_present = true; + } else if (4 == (*ie_ptr)[0]) { + apn_ambr->ext_present = true; + apn_ambr->ext2_present = false; + } else { + apn_ambr->ext_present = false; + apn_ambr->ext2_present = false; + } + apn_ambr->apn_ambr_dl = (*ie_ptr)[1]; + apn_ambr->apn_ambr_ul = (*ie_ptr)[2]; + if (apn_ambr->ext_present) { + apn_ambr->apn_ambr_dl_ext = (*ie_ptr)[3]; + apn_ambr->apn_ambr_ul_ext = (*ie_ptr)[4]; + } + if (apn_ambr->ext2_present) { + apn_ambr->apn_ambr_dl_ext2 = (*ie_ptr)[5]; + apn_ambr->apn_ambr_ul_ext2 = (*ie_ptr)[6]; + } + if (apn_ambr->ext_present && apn_ambr->ext2_present) { + *ie_ptr += 7; + } else if (apn_ambr->ext_present) { + *ie_ptr += 5; + } else { + *ie_ptr += 3; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -3978,36 +3515,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.2A 24.008 v10.2.0 Section 10.5.6.19 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_connectivity_type_ie(uint8 con_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_connectivity_type_ie(uint8 con_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= con_type << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= con_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *con_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* con_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - con_type != NULL) - { - *con_type = ((*ie_ptr)[0] >> bit_offset) & 0x0F; + if (ie_ptr != NULL && con_type != NULL) { + *con_type = ((*ie_ptr)[0] >> bit_offset) & 0x0F; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4018,101 +3548,86 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_connectivity_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_eps_quality_of_service_ie(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT *qos, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(qos != NULL && - ie_ptr != NULL) - { - if(qos->br_present && - qos->br_ext_present) - { - (*ie_ptr)[0] = 9; - }else if(qos->br_present){ - (*ie_ptr)[0] = 5; - }else{ - (*ie_ptr)[0] = 1; - } - (*ie_ptr)[1] = qos->qci; - if(qos->br_present) - { - (*ie_ptr)[2] = qos->mbr_ul; - (*ie_ptr)[3] = qos->mbr_dl; - (*ie_ptr)[4] = qos->gbr_ul; - (*ie_ptr)[5] = qos->gbr_dl; - } - if(qos->br_ext_present) - { - (*ie_ptr)[6] = qos->mbr_ul_ext; - (*ie_ptr)[7] = qos->mbr_dl_ext; - (*ie_ptr)[8] = qos->gbr_ul_ext; - (*ie_ptr)[9] = qos->gbr_dl_ext; - } - if(qos->br_present && - qos->br_ext_present) - { - *ie_ptr += 10; - }else if(qos->br_present){ - *ie_ptr += 6; - }else{ - *ie_ptr += 2; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_eps_quality_of_service_ie(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT* qos, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - err = LIBLTE_SUCCESS; + if (qos != NULL && ie_ptr != NULL) { + if (qos->br_present && qos->br_ext_present) { + (*ie_ptr)[0] = 9; + } else if (qos->br_present) { + (*ie_ptr)[0] = 5; + } else { + (*ie_ptr)[0] = 1; + } + (*ie_ptr)[1] = qos->qci; + if (qos->br_present) { + (*ie_ptr)[2] = qos->mbr_ul; + (*ie_ptr)[3] = qos->mbr_dl; + (*ie_ptr)[4] = qos->gbr_ul; + (*ie_ptr)[5] = qos->gbr_dl; + } + if (qos->br_ext_present) { + (*ie_ptr)[6] = qos->mbr_ul_ext; + (*ie_ptr)[7] = qos->mbr_dl_ext; + (*ie_ptr)[8] = qos->gbr_ul_ext; + (*ie_ptr)[9] = qos->gbr_dl_ext; + } + if (qos->br_present && qos->br_ext_present) { + *ie_ptr += 10; + } else if (qos->br_present) { + *ie_ptr += 6; + } else { + *ie_ptr += 2; } - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8 **ie_ptr, - LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT *qos) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - qos != NULL) - { - if((*ie_ptr)[0] == 1) - { - qos->br_present = false; - qos->br_ext_present = false; - }else if((*ie_ptr)[0] == 5){ - qos->br_present = true; - qos->br_ext_present = false; - }else{ - qos->br_present = true; - qos->br_ext_present = true; - } - qos->qci = (*ie_ptr)[1]; - if(qos->br_present) - { - qos->mbr_ul = (*ie_ptr)[2]; - qos->mbr_dl = (*ie_ptr)[3]; - qos->gbr_ul = (*ie_ptr)[4]; - qos->gbr_dl = (*ie_ptr)[5]; - } - if(qos->br_ext_present) - { - qos->mbr_ul_ext = (*ie_ptr)[6]; - qos->mbr_dl_ext = (*ie_ptr)[7]; - qos->gbr_ul_ext = (*ie_ptr)[8]; - qos->gbr_dl_ext = (*ie_ptr)[9]; - } - if(qos->br_present && - qos->br_ext_present) - { - *ie_ptr += 10; - }else if(qos->br_present){ - *ie_ptr += 6; - }else{ - *ie_ptr += 2; - } + err = LIBLTE_SUCCESS; + } - err = LIBLTE_SUCCESS; + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8** ie_ptr, + LIBLTE_MME_EPS_QUALITY_OF_SERVICE_STRUCT* qos) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && qos != NULL) { + if ((*ie_ptr)[0] == 1) { + qos->br_present = false; + qos->br_ext_present = false; + } else if ((*ie_ptr)[0] == 5) { + qos->br_present = true; + qos->br_ext_present = false; + } else { + qos->br_present = true; + qos->br_ext_present = true; + } + qos->qci = (*ie_ptr)[1]; + if (qos->br_present) { + qos->mbr_ul = (*ie_ptr)[2]; + qos->mbr_dl = (*ie_ptr)[3]; + qos->gbr_ul = (*ie_ptr)[4]; + qos->gbr_dl = (*ie_ptr)[5]; + } + if (qos->br_ext_present) { + qos->mbr_ul_ext = (*ie_ptr)[6]; + qos->mbr_dl_ext = (*ie_ptr)[7]; + qos->gbr_ul_ext = (*ie_ptr)[8]; + qos->gbr_dl_ext = (*ie_ptr)[9]; + } + if (qos->br_present && qos->br_ext_present) { + *ie_ptr += 10; + } else if (qos->br_present) { + *ie_ptr += 6; + } else { + *ie_ptr += 2; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -4123,36 +3638,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_eps_quality_of_service_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_cause_ie(uint8 cause, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_cause_ie(uint8 cause, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = cause; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = cause; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8 **ie_ptr, - uint8 *cause) +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8** ie_ptr, uint8* cause) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - cause != NULL) - { - *cause = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && cause != NULL) { + *cause = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4164,36 +3674,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_cause_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_info_transfer_flag_ie(LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_info_transfer_flag_ie( + LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM esm_info_transfer_flag, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= esm_info_transfer_flag << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= esm_info_transfer_flag << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie(uint8 **ie_ptr, - uint8 bit_offset, - LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM *esm_info_transfer_flag) +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie( + uint8** ie_ptr, uint8 bit_offset, LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM* esm_info_transfer_flag) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - esm_info_transfer_flag != NULL) - { - *esm_info_transfer_flag = (LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM)((**ie_ptr >> bit_offset) & 0x01); + if (ie_ptr != NULL && esm_info_transfer_flag != NULL) { + *esm_info_transfer_flag = (LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_ENUM)((**ie_ptr >> bit_offset) & 0x01); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4207,36 +3712,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_info_transfer_flag_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_linked_eps_bearer_identity_ie(uint8 bearer_id, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_linked_eps_bearer_identity_ie(uint8 bearer_id, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] |= (bearer_id & 0x0F) << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] |= (bearer_id & 0x0F) << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *bearer_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8** ie_ptr, uint8 bit_offset, uint8* bearer_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - bearer_id != NULL) - { - *bearer_id = ((*ie_ptr)[0] >> bit_offset) & 0x0F; + if (ie_ptr != NULL && bearer_id != NULL) { + *bearer_id = ((*ie_ptr)[0] >> bit_offset) & 0x0F; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4248,36 +3746,31 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_linked_eps_bearer_identity_ie(uint8 **ie_ptr Document Reference: 24.301 v10.2.0 Section 9.9.4.7 24.008 v10.2.0 Section 10.5.6.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_llc_service_access_point_identifier_ie(uint8 llc_sapi, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_llc_service_access_point_identifier_ie(uint8 llc_sapi, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = llc_sapi; - *ie_ptr += 1; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = llc_sapi; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8 **ie_ptr, - uint8 *llc_sapi) +LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8** ie_ptr, uint8* llc_sapi) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - llc_sapi != NULL) - { - *llc_sapi = (*ie_ptr)[0]; - *ie_ptr += 1; + if (ie_ptr != NULL && llc_sapi != NULL) { + *llc_sapi = (*ie_ptr)[0]; + *ie_ptr += 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4289,37 +3782,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_llc_service_access_point_identifier_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.7A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_notification_indicator_ie(uint8 notification_ind, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_notification_indicator_ie(uint8 notification_ind, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = 1; - (*ie_ptr)[1] = notification_ind; - *ie_ptr += 2; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = 1; + (*ie_ptr)[1] = notification_ind; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8 **ie_ptr, - uint8 *notification_ind) +LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8** ie_ptr, uint8* notification_ind) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - notification_ind != NULL) - { - *notification_ind = (*ie_ptr)[1]; - *ie_ptr += 2; + if (ie_ptr != NULL && notification_ind != NULL) { + *notification_ind = (*ie_ptr)[1]; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4331,37 +3819,32 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_indicator_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.8 24.008 v10.2.0 Section 10.5.6.11 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_packet_flow_identifier_ie(uint8 packet_flow_id, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_packet_flow_identifier_ie(uint8 packet_flow_id, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = 1; - (*ie_ptr)[1] = packet_flow_id; - *ie_ptr += 2; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = 1; + (*ie_ptr)[1] = packet_flow_id; + *ie_ptr += 2; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8 **ie_ptr, - uint8 *packet_flow_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8** ie_ptr, uint8* packet_flow_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - packet_flow_id != NULL) - { - *packet_flow_id = (*ie_ptr)[1]; - *ie_ptr += (*ie_ptr)[0]; + if (ie_ptr != NULL && packet_flow_id != NULL) { + *packet_flow_id = (*ie_ptr)[1]; + *ie_ptr += (*ie_ptr)[0]; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4374,78 +3857,64 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_packet_flow_identifier_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_address_ie(LIBLTE_MME_PDN_ADDRESS_STRUCT *pdn_addr, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(pdn_addr != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[1] = 0x00 | (pdn_addr->pdn_type & 0x07); - if(LIBLTE_MME_PDN_TYPE_IPV4 == pdn_addr->pdn_type) - { - for(i=0; i<4; i++) - { - (*ie_ptr)[2+i] = pdn_addr->addr[i]; - } - (*ie_ptr)[0] = 5; - *ie_ptr += 6; - }else if(LIBLTE_MME_PDN_TYPE_IPV6 == pdn_addr->pdn_type){ - for(i=0; i<8; i++) - { - (*ie_ptr)[2+i] = pdn_addr->addr[i]; - } - (*ie_ptr)[0] = 9; - *ie_ptr += 10; - }else{ - for(i=0; i<12; i++) - { - (*ie_ptr)[2+i] = pdn_addr->addr[i]; - } - (*ie_ptr)[0] = 13; - *ie_ptr += 14; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_address_ie(LIBLTE_MME_PDN_ADDRESS_STRUCT* pdn_addr, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + + if (pdn_addr != NULL && ie_ptr != NULL) { + (*ie_ptr)[1] = 0x00 | (pdn_addr->pdn_type & 0x07); + if (LIBLTE_MME_PDN_TYPE_IPV4 == pdn_addr->pdn_type) { + for (i = 0; i < 4; i++) { + (*ie_ptr)[2 + i] = pdn_addr->addr[i]; + } + (*ie_ptr)[0] = 5; + *ie_ptr += 6; + } else if (LIBLTE_MME_PDN_TYPE_IPV6 == pdn_addr->pdn_type) { + for (i = 0; i < 8; i++) { + (*ie_ptr)[2 + i] = pdn_addr->addr[i]; + } + (*ie_ptr)[0] = 9; + *ie_ptr += 10; + } else { + for (i = 0; i < 12; i++) { + (*ie_ptr)[2 + i] = pdn_addr->addr[i]; + } + (*ie_ptr)[0] = 13; + *ie_ptr += 14; + } - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8 **ie_ptr, - LIBLTE_MME_PDN_ADDRESS_STRUCT *pdn_addr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - - if(ie_ptr != NULL && - pdn_addr != NULL) - { - pdn_addr->pdn_type = (*ie_ptr)[1] & 0x07; - if(LIBLTE_MME_PDN_TYPE_IPV4 == pdn_addr->pdn_type) - { - for(i=0; i<4; i++) - { - pdn_addr->addr[i] = (*ie_ptr)[2+i]; - } - }else if(LIBLTE_MME_PDN_TYPE_IPV6 == pdn_addr->pdn_type){ - for(i=0; i<8; i++) - { - pdn_addr->addr[i] = (*ie_ptr)[2+i]; - } - }else{ - for(i=0; i<12; i++) - { - pdn_addr->addr[i] = (*ie_ptr)[2+i]; - } - } - *ie_ptr += (*ie_ptr)[0] + 1; + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8** ie_ptr, LIBLTE_MME_PDN_ADDRESS_STRUCT* pdn_addr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && pdn_addr != NULL) { + pdn_addr->pdn_type = (*ie_ptr)[1] & 0x07; + if (LIBLTE_MME_PDN_TYPE_IPV4 == pdn_addr->pdn_type) { + for (i = 0; i < 4; i++) { + pdn_addr->addr[i] = (*ie_ptr)[2 + i]; + } + } else if (LIBLTE_MME_PDN_TYPE_IPV6 == pdn_addr->pdn_type) { + for (i = 0; i < 8; i++) { + pdn_addr->addr[i] = (*ie_ptr)[2 + i]; + } + } else { + for (i = 0; i < 12; i++) { + pdn_addr->addr[i] = (*ie_ptr)[2 + i]; + } } + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4456,36 +3925,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_address_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.10 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_type_ie(uint8 pdn_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_type_ie(uint8 pdn_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= pdn_type << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= pdn_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *pdn_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* pdn_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - pdn_type != NULL) - { - *pdn_type = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && pdn_type != NULL) { + *pdn_type = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4501,66 +3963,60 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.11 24.008 v10.2.0 Section 10.5.6.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_protocol_config_options_ie(LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT *protocol_cnfg_opts, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 idx; - uint32 i; - uint32 j; - - if(protocol_cnfg_opts != NULL && - ie_ptr != NULL) - { - (*ie_ptr)[1] = 0x80; - idx = 2; - for(i=0; iN_opts; i++) - { - (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].id >> 8; - (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].id & 0x00FF; - (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].len; - for(j=0; jopt[i].len; j++) - { - (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].contents[j]; - } - } - (*ie_ptr)[0] = idx - 1; - *ie_ptr += idx; - - err = LIBLTE_SUCCESS; - } - - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_protocol_config_options_ie(uint8 **ie_ptr, - LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT *protocol_cnfg_opts) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 idx; - uint32 i; - - if(ie_ptr != NULL && - protocol_cnfg_opts != NULL) - { - idx = 2; - protocol_cnfg_opts->N_opts = 0; - while(idx < (*ie_ptr)[0]) - { - protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].id = (*ie_ptr)[idx++] << 8; - protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].id |= (*ie_ptr)[idx++]; - protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].len = (*ie_ptr)[idx++]; - for(i=0; iopt[protocol_cnfg_opts->N_opts].len; i++) - { - protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].contents[i] = (*ie_ptr)[idx++]; - } - protocol_cnfg_opts->N_opts++; - } - *ie_ptr += (*ie_ptr)[0] + 1; +LIBLTE_ERROR_ENUM +liblte_mme_pack_protocol_config_options_ie(LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT* protocol_cnfg_opts, + uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 idx; + uint32 i; + uint32 j; + + if (protocol_cnfg_opts != NULL && ie_ptr != NULL) { + (*ie_ptr)[1] = 0x80; + idx = 2; + for (i = 0; i < protocol_cnfg_opts->N_opts; i++) { + (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].id >> 8; + (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].id & 0x00FF; + (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].len; + for (j = 0; j < protocol_cnfg_opts->opt[i].len; j++) { + (*ie_ptr)[idx++] = protocol_cnfg_opts->opt[i].contents[j]; + } + } + (*ie_ptr)[0] = idx - 1; + *ie_ptr += idx; + + err = LIBLTE_SUCCESS; + } + + return (err); +} +LIBLTE_ERROR_ENUM +liblte_mme_unpack_protocol_config_options_ie(uint8** ie_ptr, + LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT* protocol_cnfg_opts) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 idx; + uint32 i; - err = LIBLTE_SUCCESS; + if (ie_ptr != NULL && protocol_cnfg_opts != NULL) { + idx = 2; + protocol_cnfg_opts->N_opts = 0; + while (idx < (*ie_ptr)[0]) { + protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].id = (*ie_ptr)[idx++] << 8; + protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].id |= (*ie_ptr)[idx++]; + protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].len = (*ie_ptr)[idx++]; + for (i = 0; i < protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].len; i++) { + protocol_cnfg_opts->opt[protocol_cnfg_opts->N_opts].contents[i] = (*ie_ptr)[idx++]; + } + protocol_cnfg_opts->N_opts++; } + *ie_ptr += (*ie_ptr)[0] + 1; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4571,122 +4027,106 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_protocol_config_options_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.12 24.008 v10.2.0 Section 10.5.6.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_quality_of_service_ie(LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT *qos, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(qos != NULL && - ie_ptr != NULL) - { - if(qos->dl_ext_present && - qos->ul_ext_present) - { - (*ie_ptr)[0] = 16; - }else if(qos->dl_ext_present){ - (*ie_ptr)[0] = 14; - }else{ - (*ie_ptr)[0] = 12; - } - (*ie_ptr)[1] = ((qos->delay_class & 0x07) << 3) | (qos->reliability_class & 0x07); - (*ie_ptr)[2] = ((qos->peak_throughput & 0x0F) << 4) | (qos->precedence_class & 0x07); - (*ie_ptr)[3] = qos->mean_throughput & 0x1F; - (*ie_ptr)[4] = ((qos->traffic_class & 0x07) << 5) | ((qos->delivery_order & 0x03) << 3) | (qos->delivery_of_erroneous_sdu & 0x03); - (*ie_ptr)[5] = qos->max_sdu_size; - (*ie_ptr)[6] = qos->mbr_ul; - (*ie_ptr)[7] = qos->mbr_dl; - (*ie_ptr)[8] = ((qos->residual_ber & 0x0F) << 4) | (qos->sdu_error_ratio & 0x0F); - (*ie_ptr)[9] = ((qos->transfer_delay & 0x3F) << 2) | (qos->traffic_handling_prio & 0x03); - (*ie_ptr)[10] = qos->gbr_ul; - (*ie_ptr)[11] = qos->gbr_dl; - (*ie_ptr)[12] = ((qos->signalling_ind & 0x01) << 4) | (qos->source_stats_descriptor & 0x0F); - if(qos->dl_ext_present) - { - (*ie_ptr)[13] = qos->mbr_dl_ext; - (*ie_ptr)[14] = qos->gbr_dl_ext; - } - if(qos->ul_ext_present) - { - (*ie_ptr)[15] = qos->mbr_ul_ext; - (*ie_ptr)[16] = qos->gbr_ul_ext; - } - if(qos->dl_ext_present && - qos->ul_ext_present) - { - *ie_ptr += 17; - }else if(qos->dl_ext_present){ - *ie_ptr += 15; - }else{ - *ie_ptr += 13; - } - - err = LIBLTE_SUCCESS; +LIBLTE_ERROR_ENUM liblte_mme_pack_quality_of_service_ie(LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT* qos, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (qos != NULL && ie_ptr != NULL) { + if (qos->dl_ext_present && qos->ul_ext_present) { + (*ie_ptr)[0] = 16; + } else if (qos->dl_ext_present) { + (*ie_ptr)[0] = 14; + } else { + (*ie_ptr)[0] = 12; + } + (*ie_ptr)[1] = ((qos->delay_class & 0x07) << 3) | (qos->reliability_class & 0x07); + (*ie_ptr)[2] = ((qos->peak_throughput & 0x0F) << 4) | (qos->precedence_class & 0x07); + (*ie_ptr)[3] = qos->mean_throughput & 0x1F; + (*ie_ptr)[4] = ((qos->traffic_class & 0x07) << 5) | ((qos->delivery_order & 0x03) << 3) | + (qos->delivery_of_erroneous_sdu & 0x03); + (*ie_ptr)[5] = qos->max_sdu_size; + (*ie_ptr)[6] = qos->mbr_ul; + (*ie_ptr)[7] = qos->mbr_dl; + (*ie_ptr)[8] = ((qos->residual_ber & 0x0F) << 4) | (qos->sdu_error_ratio & 0x0F); + (*ie_ptr)[9] = ((qos->transfer_delay & 0x3F) << 2) | (qos->traffic_handling_prio & 0x03); + (*ie_ptr)[10] = qos->gbr_ul; + (*ie_ptr)[11] = qos->gbr_dl; + (*ie_ptr)[12] = ((qos->signalling_ind & 0x01) << 4) | (qos->source_stats_descriptor & 0x0F); + if (qos->dl_ext_present) { + (*ie_ptr)[13] = qos->mbr_dl_ext; + (*ie_ptr)[14] = qos->gbr_dl_ext; + } + if (qos->ul_ext_present) { + (*ie_ptr)[15] = qos->mbr_ul_ext; + (*ie_ptr)[16] = qos->gbr_ul_ext; + } + if (qos->dl_ext_present && qos->ul_ext_present) { + *ie_ptr += 17; + } else if (qos->dl_ext_present) { + *ie_ptr += 15; + } else { + *ie_ptr += 13; } - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8 **ie_ptr, - LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT *qos) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(ie_ptr != NULL && - qos != NULL) - { - if(16 == (*ie_ptr)[0]) - { - qos->dl_ext_present = true; - qos->ul_ext_present = true; - }else if(14 == (*ie_ptr)[0]){ - qos->dl_ext_present = true; - qos->ul_ext_present = false; - }else{ - qos->dl_ext_present = false; - qos->ul_ext_present = false; - } - qos->delay_class = ((*ie_ptr)[1] >> 3) & 0x07; - qos->reliability_class = (*ie_ptr)[1] & 0x07; - qos->peak_throughput = (*ie_ptr)[2] >> 4; - qos->precedence_class = (*ie_ptr)[2] & 0x07; - qos->mean_throughput = (*ie_ptr)[3] & 0x1F; - qos->traffic_class = ((*ie_ptr)[4] >> 5) & 0x07; - qos->delivery_order = ((*ie_ptr)[4] >> 3) & 0x03; - qos->delivery_of_erroneous_sdu = (*ie_ptr)[4] & 0x07; - qos->max_sdu_size = (*ie_ptr)[5]; - qos->mbr_ul = (*ie_ptr)[6]; - qos->mbr_dl = (*ie_ptr)[7]; - qos->residual_ber = ((*ie_ptr)[8] >> 4) & 0x0F; - qos->sdu_error_ratio = (*ie_ptr)[8] & 0x0F; - qos->transfer_delay = ((*ie_ptr)[9] >> 2) & 0x3F; - qos->traffic_handling_prio = (*ie_ptr)[9] & 0x03; - qos->gbr_ul = (*ie_ptr)[10]; - qos->gbr_dl = (*ie_ptr)[11]; - qos->signalling_ind = ((*ie_ptr)[12] >> 4) & 0x01; - qos->source_stats_descriptor = (*ie_ptr)[12] & 0x0F; - if(qos->dl_ext_present) - { - qos->mbr_dl_ext = (*ie_ptr)[13]; - qos->gbr_dl_ext = (*ie_ptr)[14]; - } - if(qos->ul_ext_present) - { - qos->mbr_ul_ext = (*ie_ptr)[15]; - qos->gbr_ul_ext = (*ie_ptr)[16]; - } - if(qos->dl_ext_present && - qos->ul_ext_present) - { - *ie_ptr += 17; - }else if(qos->dl_ext_present){ - *ie_ptr += 15; - }else{ - *ie_ptr += 13; - } + err = LIBLTE_SUCCESS; + } - err = LIBLTE_SUCCESS; + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8** ie_ptr, LIBLTE_MME_QUALITY_OF_SERVICE_STRUCT* qos) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + + if (ie_ptr != NULL && qos != NULL) { + if (16 == (*ie_ptr)[0]) { + qos->dl_ext_present = true; + qos->ul_ext_present = true; + } else if (14 == (*ie_ptr)[0]) { + qos->dl_ext_present = true; + qos->ul_ext_present = false; + } else { + qos->dl_ext_present = false; + qos->ul_ext_present = false; + } + qos->delay_class = ((*ie_ptr)[1] >> 3) & 0x07; + qos->reliability_class = (*ie_ptr)[1] & 0x07; + qos->peak_throughput = (*ie_ptr)[2] >> 4; + qos->precedence_class = (*ie_ptr)[2] & 0x07; + qos->mean_throughput = (*ie_ptr)[3] & 0x1F; + qos->traffic_class = ((*ie_ptr)[4] >> 5) & 0x07; + qos->delivery_order = ((*ie_ptr)[4] >> 3) & 0x03; + qos->delivery_of_erroneous_sdu = (*ie_ptr)[4] & 0x07; + qos->max_sdu_size = (*ie_ptr)[5]; + qos->mbr_ul = (*ie_ptr)[6]; + qos->mbr_dl = (*ie_ptr)[7]; + qos->residual_ber = ((*ie_ptr)[8] >> 4) & 0x0F; + qos->sdu_error_ratio = (*ie_ptr)[8] & 0x0F; + qos->transfer_delay = ((*ie_ptr)[9] >> 2) & 0x3F; + qos->traffic_handling_prio = (*ie_ptr)[9] & 0x03; + qos->gbr_ul = (*ie_ptr)[10]; + qos->gbr_dl = (*ie_ptr)[11]; + qos->signalling_ind = ((*ie_ptr)[12] >> 4) & 0x01; + qos->source_stats_descriptor = (*ie_ptr)[12] & 0x0F; + if (qos->dl_ext_present) { + qos->mbr_dl_ext = (*ie_ptr)[13]; + qos->gbr_dl_ext = (*ie_ptr)[14]; + } + if (qos->ul_ext_present) { + qos->mbr_ul_ext = (*ie_ptr)[15]; + qos->gbr_ul_ext = (*ie_ptr)[16]; + } + if (qos->dl_ext_present && qos->ul_ext_present) { + *ie_ptr += 17; + } else if (qos->dl_ext_present) { + *ie_ptr += 15; + } else { + *ie_ptr += 13; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -4700,35 +4140,28 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_quality_of_service_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.13 24.008 v10.2.0 Section 10.5.7.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_radio_priority_ie(uint8 radio_prio, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_radio_priority_ie(uint8 radio_prio, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - (*ie_ptr)[0] = radio_prio << bit_offset; + if (ie_ptr != NULL) { + (*ie_ptr)[0] = radio_prio << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *radio_prio) +LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8** ie_ptr, uint8 bit_offset, uint8* radio_prio) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - radio_prio != NULL) - { - *radio_prio = ((*ie_ptr)[0] >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + if (ie_ptr != NULL && radio_prio != NULL) { + *radio_prio = ((*ie_ptr)[0] >> bit_offset) & 0x07; + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4741,36 +4174,29 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_radio_priority_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.14 24.008 v10.2.0 Section 10.5.6.17 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_request_type_ie(uint8 req_type, - uint8 bit_offset, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_request_type_ie(uint8 req_type, uint8 bit_offset, uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL) - { - **ie_ptr |= req_type << bit_offset; + if (ie_ptr != NULL) { + **ie_ptr |= req_type << bit_offset; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8 **ie_ptr, - uint8 bit_offset, - uint8 *req_type) +LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8** ie_ptr, uint8 bit_offset, uint8* req_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - req_type != NULL) - { - *req_type = (**ie_ptr >> bit_offset) & 0x07; + if (ie_ptr != NULL && req_type != NULL) { + *req_type = (**ie_ptr >> bit_offset) & 0x07; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4781,15 +4207,17 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_request_type_ie(uint8 **ie_ptr, Document Reference: 24.301 v10.2.0 Section 9.9.4.15 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_aggregate_description_ie(LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT *tfad, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM +liblte_mme_pack_traffic_flow_aggregate_description_ie(LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT* tfad, + uint8** ie_ptr) { - return(liblte_mme_pack_traffic_flow_template_ie((LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *)tfad, ie_ptr)); + return (liblte_mme_pack_traffic_flow_template_ie((LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT*)tfad, ie_ptr)); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8 **ie_ptr, - LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT *tfad) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8** ie_ptr, + LIBLTE_MME_TRAFFIC_FLOW_AGGREGATE_DESCRIPTION_STRUCT* tfad) { - return(liblte_mme_unpack_traffic_flow_template_ie(ie_ptr, (LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *)tfad)); + return (liblte_mme_unpack_traffic_flow_template_ie(ie_ptr, (LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT*)tfad)); } /********************************************************************* @@ -4801,126 +4229,109 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_aggregate_description_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.16 24.008 v10.2.0 Section 10.5.6.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_template_ie(LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *tft, - uint8 **ie_ptr) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 idx; - uint32 i; - uint32 j; - - if(tft != NULL && - ie_ptr != NULL) - { - idx = 1; - (*ie_ptr)[idx] = (tft->tft_op_code & 0x07) << 5; - if(0 != tft->parameter_list_size) - { - (*ie_ptr)[idx] |= 0x10; - } - (*ie_ptr)[idx] |= tft->packet_filter_list_size & 0x0F; - idx++; +LIBLTE_ERROR_ENUM liblte_mme_pack_traffic_flow_template_ie(LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft, uint8** ie_ptr) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 idx; + uint32 i; + uint32 j; - for(i=0; ipacket_filter_list_size; i++) - { - (*ie_ptr)[idx] = (tft->packet_filter_list[i].dir & 0x0F) << 4; - (*ie_ptr)[idx] |= tft->packet_filter_list[i].id & 0x0F; - idx++; - if(LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT != tft->tft_op_code) - { - (*ie_ptr)[idx] = tft->packet_filter_list[i].eval_precedence; - idx++; - (*ie_ptr)[idx] = tft->packet_filter_list[i].filter_size; - idx++; - for(j=0; jpacket_filter_list[i].filter_size; j++) - { - (*ie_ptr)[idx] = tft->packet_filter_list[i].filter[j]; - idx++; - } - } - } + if (tft != NULL && ie_ptr != NULL) { + idx = 1; + (*ie_ptr)[idx] = (tft->tft_op_code & 0x07) << 5; + if (0 != tft->parameter_list_size) { + (*ie_ptr)[idx] |= 0x10; + } + (*ie_ptr)[idx] |= tft->packet_filter_list_size & 0x0F; + idx++; - for(i=0; iparameter_list_size; i++) - { - (*ie_ptr)[idx] = tft->parameter_list[i].id; - idx++; - (*ie_ptr)[idx] = tft->parameter_list[i].parameter_size; - idx++; - for(j=0; jparameter_list[i].parameter_size; j++) - { - (*ie_ptr)[idx] = tft->parameter_list[i].parameter[j]; - idx++; - } + for (i = 0; i < tft->packet_filter_list_size; i++) { + (*ie_ptr)[idx] = (tft->packet_filter_list[i].dir & 0x0F) << 4; + (*ie_ptr)[idx] |= tft->packet_filter_list[i].id & 0x0F; + idx++; + if (LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT != tft->tft_op_code) { + (*ie_ptr)[idx] = tft->packet_filter_list[i].eval_precedence; + idx++; + (*ie_ptr)[idx] = tft->packet_filter_list[i].filter_size; + idx++; + for (j = 0; j < tft->packet_filter_list[i].filter_size; j++) { + (*ie_ptr)[idx] = tft->packet_filter_list[i].filter[j]; + idx++; } - (*ie_ptr)[0] = idx - 1; - *ie_ptr += idx; + } + } - err = LIBLTE_SUCCESS; + for (i = 0; i < tft->parameter_list_size; i++) { + (*ie_ptr)[idx] = tft->parameter_list[i].id; + idx++; + (*ie_ptr)[idx] = tft->parameter_list[i].parameter_size; + idx++; + for (j = 0; j < tft->parameter_list[i].parameter_size; j++) { + (*ie_ptr)[idx] = tft->parameter_list[i].parameter[j]; + idx++; + } } + (*ie_ptr)[0] = idx - 1; + *ie_ptr += idx; - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8 **ie_ptr, - LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT *tft) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 idx; - uint32 i; - uint32 j; - bool param_list_present; + err = LIBLTE_SUCCESS; + } - if(ie_ptr != NULL && - tft != NULL) - { - idx = 1; - tft->tft_op_code = (LIBLTE_MME_TFT_OPERATION_CODE_ENUM)(((*ie_ptr)[idx] >> 5) & 0x07); - param_list_present = ((*ie_ptr)[idx] >> 4) & 0x01; - tft->packet_filter_list_size = (*ie_ptr)[idx] & 0x0F; + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8** ie_ptr, + LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_STRUCT* tft) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 idx; + uint32 i; + uint32 j; + bool param_list_present; + + if (ie_ptr != NULL && tft != NULL) { + idx = 1; + tft->tft_op_code = (LIBLTE_MME_TFT_OPERATION_CODE_ENUM)(((*ie_ptr)[idx] >> 5) & 0x07); + param_list_present = ((*ie_ptr)[idx] >> 4) & 0x01; + tft->packet_filter_list_size = (*ie_ptr)[idx] & 0x0F; + idx++; + + for (i = 0; i < tft->packet_filter_list_size; i++) { + tft->packet_filter_list[i].dir = (LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM)(((*ie_ptr)[idx] >> 4) & 0x0F); + tft->packet_filter_list[i].id = (*ie_ptr)[idx] & 0x0F; + idx++; + if (LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT != tft->tft_op_code) { + tft->packet_filter_list[i].eval_precedence = (*ie_ptr)[idx]; idx++; - - for(i=0; ipacket_filter_list_size; i++) - { - tft->packet_filter_list[i].dir = (LIBLTE_MME_TFT_PACKET_FILTER_DIRECTION_ENUM)(((*ie_ptr)[idx] >> 4) & 0x0F); - tft->packet_filter_list[i].id = (*ie_ptr)[idx] & 0x0F; - idx++; - if(LIBLTE_MME_TFT_OPERATION_CODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT != tft->tft_op_code) - { - tft->packet_filter_list[i].eval_precedence = (*ie_ptr)[idx]; - idx++; - tft->packet_filter_list[i].filter_size = (*ie_ptr)[idx]; - idx++; - for(j=0; jpacket_filter_list[i].filter_size; j++) - { - tft->packet_filter_list[i].filter[j] = (*ie_ptr)[idx]; - idx++; - } - } + tft->packet_filter_list[i].filter_size = (*ie_ptr)[idx]; + idx++; + for (j = 0; j < tft->packet_filter_list[i].filter_size; j++) { + tft->packet_filter_list[i].filter[j] = (*ie_ptr)[idx]; + idx++; } + } + } - tft->parameter_list_size = 0; - if(param_list_present) - { - while(idx < (*ie_ptr)[0]) - { - tft->parameter_list[tft->parameter_list_size].id = (*ie_ptr)[idx]; - idx++; - tft->parameter_list[tft->parameter_list_size].parameter_size = (*ie_ptr)[idx]; - idx++; - for(i=0; iparameter_list[tft->parameter_list_size].parameter_size; i++) - { - tft->parameter_list[tft->parameter_list_size].parameter[i] = (*ie_ptr)[idx]; - idx++; - } - tft->parameter_list_size++; - } + tft->parameter_list_size = 0; + if (param_list_present) { + while (idx < (*ie_ptr)[0]) { + tft->parameter_list[tft->parameter_list_size].id = (*ie_ptr)[idx]; + idx++; + tft->parameter_list[tft->parameter_list_size].parameter_size = (*ie_ptr)[idx]; + idx++; + for (i = 0; i < tft->parameter_list[tft->parameter_list_size].parameter_size; i++) { + tft->parameter_list[tft->parameter_list_size].parameter[i] = (*ie_ptr)[idx]; + idx++; } + tft->parameter_list_size++; + } + } - *ie_ptr += (*ie_ptr)[0] + 1; + *ie_ptr += (*ie_ptr)[0] + 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -4933,59 +4344,53 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_traffic_flow_template_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.9.4.17 24.008 v10.2.0 Section 10.5.6.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_transaction_identifier_ie(LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT *trans_id, - uint8 **ie_ptr) +LIBLTE_ERROR_ENUM liblte_mme_pack_transaction_identifier_ie(LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT* trans_id, + uint8** ie_ptr) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - - if(trans_id != NULL && - ie_ptr != NULL) - { - if(LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE == trans_id->tio) - { - (*ie_ptr)[0] = 2; - }else{ - (*ie_ptr)[0] = 1; - } - (*ie_ptr)[1] = ((trans_id->ti_flag & 0x01) << 7) | ((trans_id->tio & 0x07) << 4); - if(LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE == trans_id->tio) - { - (*ie_ptr)[2] = 0x80 | (trans_id->tie & 0x7F); - *ie_ptr += 3; - }else{ - *ie_ptr += 2; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - err = LIBLTE_SUCCESS; + if (trans_id != NULL && ie_ptr != NULL) { + if (LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE == trans_id->tio) { + (*ie_ptr)[0] = 2; + } else { + (*ie_ptr)[0] = 1; + } + (*ie_ptr)[1] = ((trans_id->ti_flag & 0x01) << 7) | ((trans_id->tio & 0x07) << 4); + if (LIBLTE_MME_TI_VALUE_IS_GIVEN_BY_TIE == trans_id->tio) { + (*ie_ptr)[2] = 0x80 | (trans_id->tie & 0x7F); + *ie_ptr += 3; + } else { + *ie_ptr += 2; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8 **ie_ptr, - LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT *trans_id) +LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8** ie_ptr, + LIBLTE_MME_TRANSACTION_IDENTIFIER_STRUCT* trans_id) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie_ptr != NULL && - trans_id != NULL) - { - uint8_t len = (*ie_ptr)[0]; - trans_id->ti_flag = (*ie_ptr)[1] >> 7; - trans_id->tio = ((*ie_ptr)[1] >> 4) & 0x07; - if (len > 2 || len == 0){ - return err; - } + if (ie_ptr != NULL && trans_id != NULL) { + uint8_t len = (*ie_ptr)[0]; + trans_id->ti_flag = (*ie_ptr)[1] >> 7; + trans_id->tio = ((*ie_ptr)[1] >> 4) & 0x07; + if (len > 2 || len == 0) { + return err; + } - if (2 == len) { - trans_id->tie = (*ie_ptr)[2] & 0x7F; - } + if (2 == len) { + trans_id->tie = (*ie_ptr)[2] & 0x7F; + } - *ie_ptr += (*ie_ptr)[0] + 1; + *ie_ptr += (*ie_ptr)[0] + 1; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /******************************************************************************* @@ -5000,24 +4405,18 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_transaction_identifier_ie(uint8 Document Reference: 24.301 v10.2.0 Section 9.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_parse_msg_sec_header(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 *pd, - uint8 *sec_hdr_type) +LIBLTE_ERROR_ENUM liblte_mme_parse_msg_sec_header(LIBLTE_BYTE_MSG_STRUCT* msg, uint8* pd, uint8* sec_hdr_type) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if (msg != NULL && - pd != NULL && - sec_hdr_type != NULL) - { - *sec_hdr_type = (uint8) ((msg->msg[0] & 0xF0) >> 4); - err = LIBLTE_SUCCESS; - } - return(err); + if (msg != NULL && pd != NULL && sec_hdr_type != NULL) { + *sec_hdr_type = (uint8)((msg->msg[0] & 0xF0) >> 4); + err = LIBLTE_SUCCESS; + } + return (err); } - /********************************************************************* Message Name: Message Header (Plain NAS Message) @@ -5025,95 +4424,82 @@ LIBLTE_ERROR_ENUM liblte_mme_parse_msg_sec_header(LIBLTE_BYTE_MSG_STRUCT *msg, Document Reference: 24.301 v10.2.0 Section 9.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_parse_msg_header(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 *pd, - uint8 *msg_type) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 sec_hdr_type; - - if(msg != NULL && - pd != NULL && - msg_type != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - - // Protocol Discriminator - *pd = msg->msg[0] & 0x0F; - - if(LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST == sec_hdr_type) - { - *msg_type = LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST; - }else{ - if(LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT == *pd) - { - // Message Type - *msg_type = msg->msg[2]; - }else{ - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - // Message Type - *msg_type = msg->msg[1]; - }else{ - // Protocol Discriminator - *pd = msg->msg[6] & 0x0F; - - if(LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT == *pd) - { - *msg_type = msg->msg[8]; - }else{ - *msg_type = msg->msg[7]; - } - } - } - } +LIBLTE_ERROR_ENUM liblte_mme_parse_msg_header(LIBLTE_BYTE_MSG_STRUCT* msg, uint8* pd, uint8* msg_type) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 sec_hdr_type; + + if (msg != NULL && pd != NULL && msg_type != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + + // Protocol Discriminator + *pd = msg->msg[0] & 0x0F; + + if (LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST == sec_hdr_type) { + *msg_type = LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST; + } else { + if (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT == *pd) { + // Message Type + *msg_type = msg->msg[2]; + } else { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + // Message Type + *msg_type = msg->msg[1]; + } else { + // Protocol Discriminator + *pd = msg->msg[6] & 0x0F; - err = LIBLTE_SUCCESS; + if (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT == *pd) { + *msg_type = msg->msg[8]; + } else { + *msg_type = msg->msg[7]; + } + } + } } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STRUCT *msg, +LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STRUCT* msg, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *sec_msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = sec_msg->msg; - uint32 i; - - if(msg != NULL && - sec_msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* sec_msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = sec_msg->msg; + uint32 i; - // NAS Message - for(i=0; iN_bytes; i++) - { - *msg_ptr = msg->msg[i]; - msg_ptr++; - } + if (msg != NULL && sec_msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // MAC will be filled in later + msg_ptr += 4; - // Fill in the number of bytes used - sec_msg->N_bytes = msg_ptr - sec_msg->msg; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - err = LIBLTE_SUCCESS; + // NAS Message + for (i = 0; i < msg->N_bytes; i++) { + *msg_ptr = msg->msg[i]; + msg_ptr++; } - return(err); + // Fill in the number of bytes used + sec_msg->N_bytes = msg_ptr - sec_msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -5124,298 +4510,270 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_security_protected_nas_msg(LIBLTE_BYTE_MSG_STR Document Reference: 24.301 v10.2.0 Section 8.2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_accept_msg(LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT *attach_accept, +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_accept_msg(LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT* attach_accept, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(attach_accept != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (attach_accept != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_ACCEPT; - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // EPS Attach Result & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_eps_attach_result_ie(attach_accept->eps_attach_result, 0, &msg_ptr); - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // T3412 Value - liblte_mme_pack_gprs_timer_ie(&attach_accept->t3412, &msg_ptr); + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // TAI List - liblte_mme_pack_tracking_area_identity_list_ie(&attach_accept->tai_list, &msg_ptr); + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_ACCEPT; + msg_ptr++; - // ESM Message Container - liblte_mme_pack_esm_message_container_ie(&attach_accept->esm_msg, &msg_ptr); + // EPS Attach Result & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_eps_attach_result_ie(attach_accept->eps_attach_result, 0, &msg_ptr); + msg_ptr++; - // GUTI - if(attach_accept->guti_present) - { - *msg_ptr = LIBLTE_MME_GUTI_IEI; - msg_ptr++; - liblte_mme_pack_eps_mobile_id_ie(&attach_accept->guti, &msg_ptr); - } + // T3412 Value + liblte_mme_pack_gprs_timer_ie(&attach_accept->t3412, &msg_ptr); - // Location Area Identification - if(attach_accept->lai_present) - { - *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; - msg_ptr++; - liblte_mme_pack_location_area_id_ie(&attach_accept->lai, &msg_ptr); - } + // TAI List + liblte_mme_pack_tracking_area_identity_list_ie(&attach_accept->tai_list, &msg_ptr); - // MS Identity - if(attach_accept->ms_id_present) - { - *msg_ptr = LIBLTE_MME_MS_IDENTITY_IEI; - msg_ptr++; - liblte_mme_pack_mobile_id_ie(&attach_accept->ms_id, &msg_ptr); - } + // ESM Message Container + liblte_mme_pack_esm_message_container_ie(&attach_accept->esm_msg, &msg_ptr); - // EMM Cause - if(attach_accept->emm_cause_present) - { - *msg_ptr = LIBLTE_MME_EMM_CAUSE_IEI; - msg_ptr++; - liblte_mme_pack_emm_cause_ie(attach_accept->emm_cause, &msg_ptr); - } + // GUTI + if (attach_accept->guti_present) { + *msg_ptr = LIBLTE_MME_GUTI_IEI; + msg_ptr++; + liblte_mme_pack_eps_mobile_id_ie(&attach_accept->guti, &msg_ptr); + } - // T3402 Value - if(attach_accept->t3402_present) - { - *msg_ptr = LIBLTE_MME_T3402_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&attach_accept->t3402, &msg_ptr); - } + // Location Area Identification + if (attach_accept->lai_present) { + *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; + msg_ptr++; + liblte_mme_pack_location_area_id_ie(&attach_accept->lai, &msg_ptr); + } - // T3423 Value - if(attach_accept->t3423_present) - { - *msg_ptr = LIBLTE_MME_T3423_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&attach_accept->t3423, &msg_ptr); - } + // MS Identity + if (attach_accept->ms_id_present) { + *msg_ptr = LIBLTE_MME_MS_IDENTITY_IEI; + msg_ptr++; + liblte_mme_pack_mobile_id_ie(&attach_accept->ms_id, &msg_ptr); + } - // Equivalent PLMNs - if(attach_accept->equivalent_plmns_present) - { - *msg_ptr = LIBLTE_MME_EQUIVALENT_PLMNS_IEI; - msg_ptr++; - liblte_mme_pack_plmn_list_ie(&attach_accept->equivalent_plmns, &msg_ptr); - } + // EMM Cause + if (attach_accept->emm_cause_present) { + *msg_ptr = LIBLTE_MME_EMM_CAUSE_IEI; + msg_ptr++; + liblte_mme_pack_emm_cause_ie(attach_accept->emm_cause, &msg_ptr); + } - // Emergency Number List - if(attach_accept->emerg_num_list_present) - { - *msg_ptr = LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI; - msg_ptr++; - liblte_mme_pack_emergency_number_list_ie(&attach_accept->emerg_num_list, &msg_ptr); - } + // T3402 Value + if (attach_accept->t3402_present) { + *msg_ptr = LIBLTE_MME_T3402_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&attach_accept->t3402, &msg_ptr); + } - // EPS Network Feature Support - if(attach_accept->eps_network_feature_support_present) - { - *msg_ptr = LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI; - msg_ptr++; - liblte_mme_pack_eps_network_feature_support_ie(&attach_accept->eps_network_feature_support, &msg_ptr); - } + // T3423 Value + if (attach_accept->t3423_present) { + *msg_ptr = LIBLTE_MME_T3423_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&attach_accept->t3423, &msg_ptr); + } - // Additional Update Result - if(attach_accept->additional_update_result_present) - { - *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4; - liblte_mme_pack_additional_update_result_ie(attach_accept->additional_update_result, 0, &msg_ptr); - msg_ptr++; - } + // Equivalent PLMNs + if (attach_accept->equivalent_plmns_present) { + *msg_ptr = LIBLTE_MME_EQUIVALENT_PLMNS_IEI; + msg_ptr++; + liblte_mme_pack_plmn_list_ie(&attach_accept->equivalent_plmns, &msg_ptr); + } - // T3412 Extended Value - if(attach_accept->t3412_ext_present) - { - *msg_ptr = LIBLTE_MME_T3412_EXTENDED_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_3_ie(&attach_accept->t3412_ext, &msg_ptr); - } + // Emergency Number List + if (attach_accept->emerg_num_list_present) { + *msg_ptr = LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI; + msg_ptr++; + liblte_mme_pack_emergency_number_list_ie(&attach_accept->emerg_num_list, &msg_ptr); + } + + // EPS Network Feature Support + if (attach_accept->eps_network_feature_support_present) { + *msg_ptr = LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI; + msg_ptr++; + liblte_mme_pack_eps_network_feature_support_ie(&attach_accept->eps_network_feature_support, &msg_ptr); + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Additional Update Result + if (attach_accept->additional_update_result_present) { + *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4; + liblte_mme_pack_additional_update_result_ie(attach_accept->additional_update_result, 0, &msg_ptr); + msg_ptr++; + } - err = LIBLTE_SUCCESS; + // T3412 Extended Value + if (attach_accept->t3412_ext_present) { + *msg_ptr = LIBLTE_MME_T3412_EXTENDED_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_3_ie(&attach_accept->t3412_ext, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT *attach_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_ACCEPT_MSG_STRUCT* attach_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - attach_accept != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && attach_accept != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EPS Attach Result & Spare Half Octet - liblte_mme_unpack_eps_attach_result_ie(&msg_ptr, 0, &attach_accept->eps_attach_result); - msg_ptr++; + // Skip Message Type + msg_ptr++; - // T3412 Value - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3412); + // EPS Attach Result & Spare Half Octet + liblte_mme_unpack_eps_attach_result_ie(&msg_ptr, 0, &attach_accept->eps_attach_result); + msg_ptr++; - // TAI List - liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &attach_accept->tai_list); + // T3412 Value + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3412); - // ESM Message Container - liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_accept->esm_msg); + // TAI List + liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &attach_accept->tai_list); - // GUTI - if(LIBLTE_MME_GUTI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_accept->guti); - attach_accept->guti_present = true; - }else{ - attach_accept->guti_present = false; - } + // ESM Message Container + liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_accept->esm_msg); - // Location Area Identification - if(LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_location_area_id_ie(&msg_ptr, &attach_accept->lai); - attach_accept->lai_present = true; - }else{ - attach_accept->lai_present = false; - } + // GUTI + if (LIBLTE_MME_GUTI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_accept->guti); + attach_accept->guti_present = true; + } else { + attach_accept->guti_present = false; + } - // MS Identity - if(LIBLTE_MME_MS_IDENTITY_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_mobile_id_ie(&msg_ptr, &attach_accept->ms_id); - attach_accept->ms_id_present = true; - }else{ - attach_accept->ms_id_present = false; - } + // Location Area Identification + if (LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_location_area_id_ie(&msg_ptr, &attach_accept->lai); + attach_accept->lai_present = true; + } else { + attach_accept->lai_present = false; + } - // EMM Cause - if(LIBLTE_MME_EMM_CAUSE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &attach_accept->emm_cause); - attach_accept->emm_cause_present = true; - }else{ - attach_accept->emm_cause_present = false; - } + // MS Identity + if (LIBLTE_MME_MS_IDENTITY_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_mobile_id_ie(&msg_ptr, &attach_accept->ms_id); + attach_accept->ms_id_present = true; + } else { + attach_accept->ms_id_present = false; + } - // T3402 Value - if(LIBLTE_MME_T3402_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3402); - attach_accept->t3402_present = true; - }else{ - attach_accept->t3402_present = false; - } + // EMM Cause + if (LIBLTE_MME_EMM_CAUSE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &attach_accept->emm_cause); + attach_accept->emm_cause_present = true; + } else { + attach_accept->emm_cause_present = false; + } - // T3423 Value - if(LIBLTE_MME_T3423_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3423); - attach_accept->t3423_present = true; - }else{ - attach_accept->t3423_present = false; - } + // T3402 Value + if (LIBLTE_MME_T3402_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3402); + attach_accept->t3402_present = true; + } else { + attach_accept->t3402_present = false; + } - // Equivalent PLMNs - if(LIBLTE_MME_EQUIVALENT_PLMNS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_plmn_list_ie(&msg_ptr, &attach_accept->equivalent_plmns); - attach_accept->equivalent_plmns_present = true; - }else{ - attach_accept->equivalent_plmns_present = false; - } + // T3423 Value + if (LIBLTE_MME_T3423_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &attach_accept->t3423); + attach_accept->t3423_present = true; + } else { + attach_accept->t3423_present = false; + } - // Emergency Number List - if(LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_emergency_number_list_ie(&msg_ptr, &attach_accept->emerg_num_list); - attach_accept->emerg_num_list_present = true; - }else{ - attach_accept->emerg_num_list_present = false; - } + // Equivalent PLMNs + if (LIBLTE_MME_EQUIVALENT_PLMNS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_plmn_list_ie(&msg_ptr, &attach_accept->equivalent_plmns); + attach_accept->equivalent_plmns_present = true; + } else { + attach_accept->equivalent_plmns_present = false; + } - // EPS Network Feature Support - if(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_network_feature_support_ie(&msg_ptr, &attach_accept->eps_network_feature_support); - attach_accept->eps_network_feature_support_present = true; - }else{ - attach_accept->eps_network_feature_support_present = false; - } + // Emergency Number List + if (LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_emergency_number_list_ie(&msg_ptr, &attach_accept->emerg_num_list); + attach_accept->emerg_num_list_present = true; + } else { + attach_accept->emerg_num_list_present = false; + } - // Additional Update Result - if((LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_additional_update_result_ie(&msg_ptr, 0, &attach_accept->additional_update_result); - msg_ptr++; - attach_accept->additional_update_result_present = true; - }else{ - attach_accept->additional_update_result_present = false; - } + // EPS Network Feature Support + if (LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_network_feature_support_ie(&msg_ptr, &attach_accept->eps_network_feature_support); + attach_accept->eps_network_feature_support_present = true; + } else { + attach_accept->eps_network_feature_support_present = false; + } - // T3412 Extended Value - if(LIBLTE_MME_T3412_EXTENDED_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &attach_accept->t3412_ext); - attach_accept->t3412_ext_present = true; - }else{ - attach_accept->t3412_ext_present = false; - } + // Additional Update Result + if ((LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_additional_update_result_ie(&msg_ptr, 0, &attach_accept->additional_update_result); + msg_ptr++; + attach_accept->additional_update_result_present = true; + } else { + attach_accept->additional_update_result_present = false; + } - err = LIBLTE_SUCCESS; + // T3412 Extended Value + if (LIBLTE_MME_T3412_EXTENDED_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &attach_accept->t3412_ext); + attach_accept->t3412_ext_present = true; + } else { + attach_accept->t3412_ext_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -5426,79 +4784,73 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_accept_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_complete_msg(LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT *attach_comp, +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_complete_msg(LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT* attach_comp, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(attach_comp != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (attach_comp != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_COMPLETE; - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // ESM Message Container - liblte_mme_pack_esm_message_container_ie(&attach_comp->esm_msg, &msg_ptr); + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - err = LIBLTE_SUCCESS; - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_COMPLETE; + msg_ptr++; + + // ESM Message Container + liblte_mme_pack_esm_message_container_ie(&attach_comp->esm_msg, &msg_ptr); + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT *attach_comp) +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_COMPLETE_MSG_STRUCT* attach_comp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - attach_comp != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && attach_comp != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // ESM Message Container - liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_comp->esm_msg); + // ESM Message Container + liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_comp->esm_msg); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -5509,99 +4861,90 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_complete_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_reject_msg(LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT *attach_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_reject_msg(LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT* attach_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(attach_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (attach_rej != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_REJECT; - msg_ptr++; - - // EMM Cause - liblte_mme_pack_emm_cause_ie(attach_rej->emm_cause, &msg_ptr); - - // ESM Message Container - if(attach_rej->esm_msg_present) - { - *msg_ptr = LIBLTE_MME_ESM_MSG_CONTAINER_IEI; - msg_ptr++; - liblte_mme_pack_esm_message_container_ie(&attach_rej->esm_msg, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_REJECT; + msg_ptr++; - // T3446 Value - if(attach_rej->t3446_value_present) - { - *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_2_ie(attach_rej->t3446_value, &msg_ptr); - } + // EMM Cause + liblte_mme_pack_emm_cause_ie(attach_rej->emm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Message Container + if (attach_rej->esm_msg_present) { + *msg_ptr = LIBLTE_MME_ESM_MSG_CONTAINER_IEI; + msg_ptr++; + liblte_mme_pack_esm_message_container_ie(&attach_rej->esm_msg, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // T3446 Value + if (attach_rej->t3446_value_present) { + *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_2_ie(attach_rej->t3446_value, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT *attach_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT* attach_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - attach_rej != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && attach_rej != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &attach_rej->emm_cause); + // Skip Message Type + msg_ptr++; - // ESM Message Container - if(LIBLTE_MME_ESM_MSG_CONTAINER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_rej->esm_msg); - attach_rej->esm_msg_present = true; - }else{ - attach_rej->esm_msg_present = false; - } + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &attach_rej->emm_cause); - // T3446 Value - if(LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &attach_rej->t3446_value); - attach_rej->t3446_value_present = true; - }else{ - attach_rej->t3446_value_present = false; - } + // ESM Message Container + if (LIBLTE_MME_ESM_MSG_CONTAINER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_rej->esm_msg); + attach_rej->esm_msg_present = true; + } else { + attach_rej->esm_msg_present = false; + } - err = LIBLTE_SUCCESS; + // T3446 Value + if (LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &attach_rej->t3446_value); + attach_rej->t3446_value_present = true; + } else { + attach_rej->t3446_value_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -5612,360 +4955,328 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_reject_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - return liblte_mme_pack_attach_request_msg(attach_req, LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS, 0, msg); + return liblte_mme_pack_attach_request_msg(attach_req, LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS, 0, msg); } -LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req, +LIBLTE_ERROR_ENUM liblte_mme_pack_attach_request_msg(LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(attach_req != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (attach_req != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST; - msg_ptr++; - - // EPS Attach Type & NAS Key Set Identifier - *msg_ptr = 0; - liblte_mme_pack_eps_attach_type_ie(attach_req->eps_attach_type, 0, &msg_ptr); - liblte_mme_pack_nas_key_set_id_ie(&attach_req->nas_ksi, 4, &msg_ptr); - msg_ptr++; - - // EPS Mobile ID - liblte_mme_pack_eps_mobile_id_ie(&attach_req->eps_mobile_id, &msg_ptr); - - // UE Network Capability - liblte_mme_pack_ue_network_capability_ie(&attach_req->ue_network_cap, &msg_ptr); - - // ESM Message Container - liblte_mme_pack_esm_message_container_ie(&attach_req->esm_msg, &msg_ptr); - - // Old P-TMSI Signature - if(attach_req->old_p_tmsi_signature_present) - { - *msg_ptr = LIBLTE_MME_P_TMSI_SIGNATURE_IEI; - msg_ptr++; - liblte_mme_pack_p_tmsi_signature_ie(attach_req->old_p_tmsi_signature, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; - // Additional GUTI - if(attach_req->additional_guti_present) - { - *msg_ptr = LIBLTE_MME_ADDITIONAL_GUTI_IEI; - msg_ptr++; - liblte_mme_pack_eps_mobile_id_ie(&attach_req->additional_guti, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Last Visited Registered TAI - if(attach_req->last_visited_registered_tai_present) - { - *msg_ptr = LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI; - msg_ptr++; - liblte_mme_pack_tracking_area_id_ie(&attach_req->last_visited_registered_tai, &msg_ptr); - } + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // DRX Parameter - if(attach_req->drx_param_present) - { - *msg_ptr = LIBLTE_MME_DRX_PARAMETER_IEI; - msg_ptr++; - liblte_mme_pack_drx_parameter_ie(&attach_req->drx_param, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST; + msg_ptr++; - // MS Network Capability - if(attach_req->ms_network_cap_present) - { - *msg_ptr = LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI; - msg_ptr++; - liblte_mme_pack_ms_network_capability_ie(&attach_req->ms_network_cap, &msg_ptr); - } + // EPS Attach Type & NAS Key Set Identifier + *msg_ptr = 0; + liblte_mme_pack_eps_attach_type_ie(attach_req->eps_attach_type, 0, &msg_ptr); + liblte_mme_pack_nas_key_set_id_ie(&attach_req->nas_ksi, 4, &msg_ptr); + msg_ptr++; - // Old Location Area ID - if(attach_req->old_lai_present) - { - *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; - msg_ptr++; - liblte_mme_pack_location_area_id_ie(&attach_req->old_lai, &msg_ptr); - } + // EPS Mobile ID + liblte_mme_pack_eps_mobile_id_ie(&attach_req->eps_mobile_id, &msg_ptr); - // TMSI Status - if(attach_req->tmsi_status_present) - { - *msg_ptr = LIBLTE_MME_TMSI_STATUS_IEI << 4; - liblte_mme_pack_tmsi_status_ie(attach_req->tmsi_status, 0, &msg_ptr); - msg_ptr++; - } + // UE Network Capability + liblte_mme_pack_ue_network_capability_ie(&attach_req->ue_network_cap, &msg_ptr); - // Mobile Station Classmark 2 - if(attach_req->ms_cm2_present) - { - *msg_ptr = LIBLTE_MME_MS_CLASSMARK_2_IEI; - msg_ptr++; - liblte_mme_pack_mobile_station_classmark_2_ie(&attach_req->ms_cm2, &msg_ptr); - } + // ESM Message Container + liblte_mme_pack_esm_message_container_ie(&attach_req->esm_msg, &msg_ptr); - // Mobile Station Classmark 3 - if(attach_req->ms_cm3_present) - { - *msg_ptr = LIBLTE_MME_MS_CLASSMARK_3_IEI; - msg_ptr++; - liblte_mme_pack_mobile_station_classmark_3_ie(&attach_req->ms_cm3, &msg_ptr); - } + // Old P-TMSI Signature + if (attach_req->old_p_tmsi_signature_present) { + *msg_ptr = LIBLTE_MME_P_TMSI_SIGNATURE_IEI; + msg_ptr++; + liblte_mme_pack_p_tmsi_signature_ie(attach_req->old_p_tmsi_signature, &msg_ptr); + } - // Supported Codecs - if(attach_req->supported_codecs_present) - { - *msg_ptr = LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI; - msg_ptr++; - liblte_mme_pack_supported_codec_list_ie(&attach_req->supported_codecs, &msg_ptr); - } + // Additional GUTI + if (attach_req->additional_guti_present) { + *msg_ptr = LIBLTE_MME_ADDITIONAL_GUTI_IEI; + msg_ptr++; + liblte_mme_pack_eps_mobile_id_ie(&attach_req->additional_guti, &msg_ptr); + } - // Additional Update Type - if(attach_req->additional_update_type_present) - { - *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI << 4; - liblte_mme_pack_additional_update_type_ie(attach_req->additional_update_type, 0, &msg_ptr); - msg_ptr++; - } + // Last Visited Registered TAI + if (attach_req->last_visited_registered_tai_present) { + *msg_ptr = LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI; + msg_ptr++; + liblte_mme_pack_tracking_area_id_ie(&attach_req->last_visited_registered_tai, &msg_ptr); + } - // Voice Domain Preference and UE's Usage Setting - if(attach_req->voice_domain_pref_and_ue_usage_setting_present) - { - *msg_ptr = LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI; - msg_ptr++; - liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie(&attach_req->voice_domain_pref_and_ue_usage_setting, &msg_ptr); - } + // DRX Parameter + if (attach_req->drx_param_present) { + *msg_ptr = LIBLTE_MME_DRX_PARAMETER_IEI; + msg_ptr++; + liblte_mme_pack_drx_parameter_ie(&attach_req->drx_param, &msg_ptr); + } - // Device Properties - if(attach_req->device_properties_present) - { - *msg_ptr = LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI << 4; - liblte_mme_pack_device_properties_ie(attach_req->device_properties, 0, &msg_ptr); - msg_ptr++; - } + // MS Network Capability + if (attach_req->ms_network_cap_present) { + *msg_ptr = LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI; + msg_ptr++; + liblte_mme_pack_ms_network_capability_ie(&attach_req->ms_network_cap, &msg_ptr); + } - // Old GUTI Type - if(attach_req->old_guti_type_present) - { - *msg_ptr = LIBLTE_MME_GUTI_TYPE_IEI << 4; - liblte_mme_pack_guti_type_ie(attach_req->old_guti_type, 0, &msg_ptr); - msg_ptr++; - } + // Old Location Area ID + if (attach_req->old_lai_present) { + *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; + msg_ptr++; + liblte_mme_pack_location_area_id_ie(&attach_req->old_lai, &msg_ptr); + } + + // TMSI Status + if (attach_req->tmsi_status_present) { + *msg_ptr = LIBLTE_MME_TMSI_STATUS_IEI << 4; + liblte_mme_pack_tmsi_status_ie(attach_req->tmsi_status, 0, &msg_ptr); + msg_ptr++; + } + + // Mobile Station Classmark 2 + if (attach_req->ms_cm2_present) { + *msg_ptr = LIBLTE_MME_MS_CLASSMARK_2_IEI; + msg_ptr++; + liblte_mme_pack_mobile_station_classmark_2_ie(&attach_req->ms_cm2, &msg_ptr); + } + + // Mobile Station Classmark 3 + if (attach_req->ms_cm3_present) { + *msg_ptr = LIBLTE_MME_MS_CLASSMARK_3_IEI; + msg_ptr++; + liblte_mme_pack_mobile_station_classmark_3_ie(&attach_req->ms_cm3, &msg_ptr); + } + + // Supported Codecs + if (attach_req->supported_codecs_present) { + *msg_ptr = LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI; + msg_ptr++; + liblte_mme_pack_supported_codec_list_ie(&attach_req->supported_codecs, &msg_ptr); + } + + // Additional Update Type + if (attach_req->additional_update_type_present) { + *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI << 4; + liblte_mme_pack_additional_update_type_ie(attach_req->additional_update_type, 0, &msg_ptr); + msg_ptr++; + } + + // Voice Domain Preference and UE's Usage Setting + if (attach_req->voice_domain_pref_and_ue_usage_setting_present) { + *msg_ptr = LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI; + msg_ptr++; + liblte_mme_pack_voice_domain_pref_and_ue_usage_setting_ie(&attach_req->voice_domain_pref_and_ue_usage_setting, + &msg_ptr); + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Device Properties + if (attach_req->device_properties_present) { + *msg_ptr = LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI << 4; + liblte_mme_pack_device_properties_ie(attach_req->device_properties, 0, &msg_ptr); + msg_ptr++; + } - err = LIBLTE_SUCCESS; + // Old GUTI Type + if (attach_req->old_guti_type_present) { + *msg_ptr = LIBLTE_MME_GUTI_TYPE_IEI << 4; + liblte_mme_pack_guti_type_ie(attach_req->old_guti_type, 0, &msg_ptr); + msg_ptr++; } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT* attach_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - attach_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && attach_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EPS Attach Type & NAS Key Set Identifier - liblte_mme_unpack_eps_attach_type_ie(&msg_ptr, 0, &attach_req->eps_attach_type); - liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &attach_req->nas_ksi); - msg_ptr++; + // Skip Message Type + msg_ptr++; - // EPS Mobile ID - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_req->eps_mobile_id); + // EPS Attach Type & NAS Key Set Identifier + liblte_mme_unpack_eps_attach_type_ie(&msg_ptr, 0, &attach_req->eps_attach_type); + liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &attach_req->nas_ksi); + msg_ptr++; - // UE Network Capability - liblte_mme_unpack_ue_network_capability_ie(&msg_ptr, &attach_req->ue_network_cap); + // EPS Mobile ID + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_req->eps_mobile_id); - // ESM Message Container - liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_req->esm_msg); + // UE Network Capability + liblte_mme_unpack_ue_network_capability_ie(&msg_ptr, &attach_req->ue_network_cap); - // Old P-TMSI Signature - if(LIBLTE_MME_P_TMSI_SIGNATURE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_p_tmsi_signature_ie(&msg_ptr, &attach_req->old_p_tmsi_signature); - attach_req->old_p_tmsi_signature_present = true; - }else{ - attach_req->old_p_tmsi_signature_present = false; - } + // ESM Message Container + liblte_mme_unpack_esm_message_container_ie(&msg_ptr, &attach_req->esm_msg); - // Additional GUTI - if(LIBLTE_MME_ADDITIONAL_GUTI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_req->additional_guti); - attach_req->additional_guti_present = true; - }else{ - attach_req->additional_guti_present = false; - } + // Old P-TMSI Signature + if (LIBLTE_MME_P_TMSI_SIGNATURE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_p_tmsi_signature_ie(&msg_ptr, &attach_req->old_p_tmsi_signature); + attach_req->old_p_tmsi_signature_present = true; + } else { + attach_req->old_p_tmsi_signature_present = false; + } - // Last Visited Registered TAI - if(LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_tracking_area_id_ie(&msg_ptr, &attach_req->last_visited_registered_tai); - attach_req->last_visited_registered_tai_present = true; - }else{ - attach_req->last_visited_registered_tai_present = false; - } + // Additional GUTI + if (LIBLTE_MME_ADDITIONAL_GUTI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &attach_req->additional_guti); + attach_req->additional_guti_present = true; + } else { + attach_req->additional_guti_present = false; + } - // DRX Parameter - if(LIBLTE_MME_DRX_PARAMETER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_drx_parameter_ie(&msg_ptr, &attach_req->drx_param); - attach_req->drx_param_present = true; - }else{ - attach_req->drx_param_present = false; - } + // Last Visited Registered TAI + if (LIBLTE_MME_LAST_VISITED_REGISTERED_TAI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_tracking_area_id_ie(&msg_ptr, &attach_req->last_visited_registered_tai); + attach_req->last_visited_registered_tai_present = true; + } else { + attach_req->last_visited_registered_tai_present = false; + } - // MS Network Capability - if(LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_ms_network_capability_ie(&msg_ptr, &attach_req->ms_network_cap); - attach_req->ms_network_cap_present = true; - }else{ - attach_req->ms_network_cap_present = false; - } + // DRX Parameter + if (LIBLTE_MME_DRX_PARAMETER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_drx_parameter_ie(&msg_ptr, &attach_req->drx_param); + attach_req->drx_param_present = true; + } else { + attach_req->drx_param_present = false; + } - // Old Location Area ID - if(LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_location_area_id_ie(&msg_ptr, &attach_req->old_lai); - attach_req->old_lai_present = true; - }else{ - attach_req->old_lai_present = false; - } + // MS Network Capability + if (LIBLTE_MME_MS_NETWORK_CAPABILITY_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_ms_network_capability_ie(&msg_ptr, &attach_req->ms_network_cap); + attach_req->ms_network_cap_present = true; + } else { + attach_req->ms_network_cap_present = false; + } - // TMSI Status - if((LIBLTE_MME_TMSI_STATUS_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_tmsi_status_ie(&msg_ptr, 0, &attach_req->tmsi_status); - msg_ptr++; - attach_req->tmsi_status_present = true; - }else{ - attach_req->tmsi_status_present = false; - } + // Old Location Area ID + if (LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_location_area_id_ie(&msg_ptr, &attach_req->old_lai); + attach_req->old_lai_present = true; + } else { + attach_req->old_lai_present = false; + } - // Mobile Station Classmark 2 - if(LIBLTE_MME_MS_CLASSMARK_2_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_mobile_station_classmark_2_ie(&msg_ptr, &attach_req->ms_cm2); - attach_req->ms_cm2_present = true; - }else{ - attach_req->ms_cm2_present = false; - } + // TMSI Status + if ((LIBLTE_MME_TMSI_STATUS_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_tmsi_status_ie(&msg_ptr, 0, &attach_req->tmsi_status); + msg_ptr++; + attach_req->tmsi_status_present = true; + } else { + attach_req->tmsi_status_present = false; + } - // Mobile Station Classmark 3 - if(LIBLTE_MME_MS_CLASSMARK_3_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_mobile_station_classmark_3_ie(&msg_ptr, &attach_req->ms_cm3); - attach_req->ms_cm3_present = true; - }else{ - attach_req->ms_cm3_present = false; - } + // Mobile Station Classmark 2 + if (LIBLTE_MME_MS_CLASSMARK_2_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_mobile_station_classmark_2_ie(&msg_ptr, &attach_req->ms_cm2); + attach_req->ms_cm2_present = true; + } else { + attach_req->ms_cm2_present = false; + } - // Supported Codecs - if(LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_supported_codec_list_ie(&msg_ptr, &attach_req->supported_codecs); - attach_req->supported_codecs_present = true; - }else{ - attach_req->supported_codecs_present = false; - } + // Mobile Station Classmark 3 + if (LIBLTE_MME_MS_CLASSMARK_3_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_mobile_station_classmark_3_ie(&msg_ptr, &attach_req->ms_cm3); + attach_req->ms_cm3_present = true; + } else { + attach_req->ms_cm3_present = false; + } - // Additional Update Type - if((LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_additional_update_type_ie(&msg_ptr, 0, &attach_req->additional_update_type); - msg_ptr++; - attach_req->additional_update_type_present = true; - }else{ - attach_req->additional_update_type_present = false; - } + // Supported Codecs + if (LIBLTE_MME_SUPPORTED_CODEC_LIST_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_supported_codec_list_ie(&msg_ptr, &attach_req->supported_codecs); + attach_req->supported_codecs_present = true; + } else { + attach_req->supported_codecs_present = false; + } - // Voice Domain Preference and UE's Usage Setting - if(LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(&msg_ptr, &attach_req->voice_domain_pref_and_ue_usage_setting); - attach_req->voice_domain_pref_and_ue_usage_setting_present = true; - }else{ - attach_req->voice_domain_pref_and_ue_usage_setting_present = false; - } + // Additional Update Type + if ((LIBLTE_MME_ADDITIONAL_UPDATE_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_additional_update_type_ie(&msg_ptr, 0, &attach_req->additional_update_type); + msg_ptr++; + attach_req->additional_update_type_present = true; + } else { + attach_req->additional_update_type_present = false; + } - // Device Properties - if((LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &attach_req->device_properties); - msg_ptr++; - attach_req->device_properties_present = true; - }else{ - attach_req->device_properties_present = false; - } + // Voice Domain Preference and UE's Usage Setting + if (LIBLTE_MME_VOICE_DOMAIN_PREF_AND_UE_USAGE_SETTING_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_voice_domain_pref_and_ue_usage_setting_ie(&msg_ptr, + &attach_req->voice_domain_pref_and_ue_usage_setting); + attach_req->voice_domain_pref_and_ue_usage_setting_present = true; + } else { + attach_req->voice_domain_pref_and_ue_usage_setting_present = false; + } - // Old GUTI Type - if((LIBLTE_MME_GUTI_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_guti_type_ie(&msg_ptr, 0, &attach_req->old_guti_type); - msg_ptr++; - attach_req->old_guti_type_present = true; - }else{ - attach_req->old_guti_type_present = false; - } + // Device Properties + if ((LIBLTE_MME_ATTACH_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &attach_req->device_properties); + msg_ptr++; + attach_req->device_properties_present = true; + } else { + attach_req->device_properties_present = false; + } - err = LIBLTE_SUCCESS; + // Old GUTI Type + if ((LIBLTE_MME_GUTI_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_guti_type_ie(&msg_ptr, 0, &attach_req->old_guti_type); + msg_ptr++; + attach_req->old_guti_type_present = true; + } else { + attach_req->old_guti_type_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -5976,81 +5287,74 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_attach_request_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_msg(LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT *auth_fail, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_failure_msg(LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT* auth_fail, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(auth_fail != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (auth_fail != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_FAILURE; - msg_ptr++; - - // EMM Cause - liblte_mme_pack_emm_cause_ie(auth_fail->emm_cause, &msg_ptr); - - // Authentication Failure Parameter - if(auth_fail->auth_fail_param_present) - { - *msg_ptr = LIBLTE_MME_AUTHENTICATION_FAILURE_PARAMETER_IEI; - msg_ptr++; - liblte_mme_pack_authentication_failure_parameter_ie(auth_fail->auth_fail_param, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_FAILURE; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // EMM Cause + liblte_mme_pack_emm_cause_ie(auth_fail->emm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Authentication Failure Parameter + if (auth_fail->auth_fail_param_present) { + *msg_ptr = LIBLTE_MME_AUTHENTICATION_FAILURE_PARAMETER_IEI; + msg_ptr++; + liblte_mme_pack_authentication_failure_parameter_ie(auth_fail->auth_fail_param, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT *auth_fail) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_FAILURE_MSG_STRUCT* auth_fail) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - auth_fail != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && auth_fail != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &auth_fail->emm_cause); + // Skip Message Type + msg_ptr++; - // Authentication Failure Parameter - if(LIBLTE_MME_AUTHENTICATION_FAILURE_PARAMETER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_authentication_failure_parameter_ie(&msg_ptr, auth_fail->auth_fail_param); - auth_fail->auth_fail_param_present = true; - }else{ - auth_fail->auth_fail_param_present = false; - } + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &auth_fail->emm_cause); - err = LIBLTE_SUCCESS; + // Authentication Failure Parameter + if (LIBLTE_MME_AUTHENTICATION_FAILURE_PARAMETER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_authentication_failure_parameter_ie(&msg_ptr, auth_fail->auth_fail_param); + auth_fail->auth_fail_param_present = true; + } else { + auth_fail->auth_fail_param_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -6062,57 +5366,52 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_failure_msg(LIBLTE_BYTE_MSG_S Document Reference: 24.301 v10.2.0 Section 8.2.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_reject_msg(LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT *auth_reject, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_reject_msg(LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT* auth_reject, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(auth_reject != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (auth_reject != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REJECT; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT *auth_reject) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_REJECT_MSG_STRUCT* auth_reject) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - auth_reject != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && auth_reject != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6123,78 +5422,73 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_reject_msg(LIBLTE_BYTE_MSG_ST Document Reference: 24.301 v10.2.0 Section 8.2.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_request_msg(LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT *auth_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_request_msg(LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT* auth_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(auth_req != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (auth_req != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_REQUEST; + msg_ptr++; - // NAS Key Set Identifier & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_nas_key_set_id_ie(&auth_req->nas_ksi, 0, &msg_ptr); - msg_ptr++; + // NAS Key Set Identifier & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_nas_key_set_id_ie(&auth_req->nas_ksi, 0, &msg_ptr); + msg_ptr++; - // Authentication Parameter RAND - liblte_mme_pack_authentication_parameter_rand_ie(auth_req->rand, &msg_ptr); + // Authentication Parameter RAND + liblte_mme_pack_authentication_parameter_rand_ie(auth_req->rand, &msg_ptr); - // Authentication Parameter AUTN - liblte_mme_pack_authentication_parameter_autn_ie(auth_req->autn, &msg_ptr); + // Authentication Parameter AUTN + liblte_mme_pack_authentication_parameter_autn_ie(auth_req->autn, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT *auth_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT* auth_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - auth_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && auth_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // NAS Key Set Identifier & Spare Half Octet - liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 0, &auth_req->nas_ksi); - msg_ptr++; + // NAS Key Set Identifier & Spare Half Octet + liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 0, &auth_req->nas_ksi); + msg_ptr++; - // Authentication Parameter RAND - liblte_mme_unpack_authentication_parameter_rand_ie(&msg_ptr, auth_req->rand); + // Authentication Parameter RAND + liblte_mme_unpack_authentication_parameter_rand_ie(&msg_ptr, auth_req->rand); - // Authentication Parameter AUTN - liblte_mme_unpack_authentication_parameter_autn_ie(&msg_ptr, auth_req->autn); + // Authentication Parameter AUTN + liblte_mme_unpack_authentication_parameter_autn_ie(&msg_ptr, auth_req->autn); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6205,80 +5499,75 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_request_msg(LIBLTE_BYTE_MSG_S Document Reference: 24.301 v10.2.0 Section 8.2.8 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_msg(LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT *auth_resp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_msg(LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT* auth_resp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(auth_resp != NULL && - msg != NULL) - { + if (auth_resp != NULL && msg != NULL) { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // MAC will be filled in later - msg_ptr += 4; + // MAC will be filled in later + msg_ptr += 4; - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_RESPONSE; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_AUTHENTICATION_RESPONSE; + msg_ptr++; - // Authentication Response Parameter (RES) - liblte_mme_pack_authentication_response_parameter_ie(auth_resp->res, auth_resp->res_len, &msg_ptr); + // Authentication Response Parameter (RES) + liblte_mme_pack_authentication_response_parameter_ie(auth_resp->res, auth_resp->res_len, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT *auth_resp) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_AUTHENTICATION_RESPONSE_MSG_STRUCT* auth_resp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - auth_resp != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && auth_resp != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Authentication Response Parameter (RES) - liblte_mme_unpack_authentication_response_parameter_ie(&msg_ptr, auth_resp->res); + // Authentication Response Parameter (RES) + liblte_mme_unpack_authentication_response_parameter_ie(&msg_ptr, auth_resp->res); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6301,73 +5590,67 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_response_msg(LIBLTE_BYTE_MSG_ Document Reference: 24.301 v10.2.0 Section 8.2.10 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_accept_msg(LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT *detach_accept, +LIBLTE_ERROR_ENUM liblte_mme_pack_detach_accept_msg(LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT* detach_accept, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(detach_accept != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } - - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_DETACH_ACCEPT; - msg_ptr++; + if (detach_accept != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // MAC will be filled in later + msg_ptr += 4; - err = LIBLTE_SUCCESS; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; } - return(err); + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_DETACH_ACCEPT; + msg_ptr++; + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT *detach_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DETACH_ACCEPT_MSG_STRUCT* detach_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - detach_accept != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && detach_accept != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6378,90 +5661,84 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_accept_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.11 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_detach_request_msg(LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT *detach_req, +LIBLTE_ERROR_ENUM liblte_mme_pack_detach_request_msg(LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT* detach_req, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(detach_req != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (detach_req != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_DETACH_REQUEST; - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; + + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_DETACH_REQUEST; + msg_ptr++; - // Detach Type & NAS Key Set Identifier - *msg_ptr = 0; - liblte_mme_pack_detach_type_ie(&detach_req->detach_type, 0, &msg_ptr); - liblte_mme_pack_nas_key_set_id_ie(&detach_req->nas_ksi, 4, &msg_ptr); - msg_ptr++; + // Detach Type & NAS Key Set Identifier + *msg_ptr = 0; + liblte_mme_pack_detach_type_ie(&detach_req->detach_type, 0, &msg_ptr); + liblte_mme_pack_nas_key_set_id_ie(&detach_req->nas_ksi, 4, &msg_ptr); + msg_ptr++; - // EPS Mobile ID - liblte_mme_pack_eps_mobile_id_ie(&detach_req->eps_mobile_id, &msg_ptr); + // EPS Mobile ID + liblte_mme_pack_eps_mobile_id_ie(&detach_req->eps_mobile_id, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT *detach_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT* detach_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - detach_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && detach_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Detach Type & NAS Key Set Identifier - liblte_mme_unpack_detach_type_ie(&msg_ptr, 0, &detach_req->detach_type); - liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &detach_req->nas_ksi); - msg_ptr++; + // Detach Type & NAS Key Set Identifier + liblte_mme_unpack_detach_type_ie(&msg_ptr, 0, &detach_req->detach_type); + liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &detach_req->nas_ksi); + msg_ptr++; - // EPS Mobile ID - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &detach_req->eps_mobile_id); + // EPS Mobile ID + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &detach_req->eps_mobile_id); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6472,79 +5749,75 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_detach_request_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_nas_transport_msg(LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT *dl_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(dl_nas_transport != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_downlink_nas_transport_msg(LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT* dl_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + + if (dl_nas_transport != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_DOWNLINK_NAS_TRANSPORT; - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // NAS Message Container - liblte_mme_pack_nas_message_container_ie(&dl_nas_transport->nas_msg, &msg_ptr); + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_DOWNLINK_NAS_TRANSPORT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // NAS Message Container + liblte_mme_pack_nas_message_container_ie(&dl_nas_transport->nas_msg, &msg_ptr); - err = LIBLTE_SUCCESS; - } + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT *dl_nas_transport) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DOWNLINK_NAS_TRANSPORT_MSG_STRUCT* dl_nas_transport) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - dl_nas_transport != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && dl_nas_transport != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // NAS Message Container - liblte_mme_unpack_nas_message_container_ie(&msg_ptr, &dl_nas_transport->nas_msg); + // NAS Message Container + liblte_mme_unpack_nas_message_container_ie(&msg_ptr, &dl_nas_transport->nas_msg); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -6555,163 +5828,147 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_nas_transport_msg(LIBLTE_BYTE_MSG_S Document Reference: 24.301 v10.2.0 Section 8.2.13 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_information_msg(LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT *emm_info, +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_information_msg(LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT* emm_info, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(emm_info != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (emm_info != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_EMM_INFORMATION; - msg_ptr++; - - // Full Name For Network - if(emm_info->full_net_name_present) - { - *msg_ptr = LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI; - msg_ptr++; - liblte_mme_pack_network_name_ie(&emm_info->full_net_name, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; - // Short Name For Network - if(emm_info->short_net_name_present) - { - *msg_ptr = LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI; - msg_ptr++; - liblte_mme_pack_network_name_ie(&emm_info->short_net_name, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Local Time Zone - if(emm_info->local_time_zone_present) - { - *msg_ptr = LIBLTE_MME_LOCAL_TIME_ZONE_IEI; - msg_ptr++; - liblte_mme_pack_time_zone_ie(emm_info->local_time_zone, &msg_ptr); - } + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Universal Time And Local Time Zone - if(emm_info->utc_and_local_time_zone_present) - { - *msg_ptr = LIBLTE_MME_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_IEI; - msg_ptr++; - liblte_mme_pack_time_zone_and_time_ie(&emm_info->utc_and_local_time_zone, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_EMM_INFORMATION; + msg_ptr++; - // Network Daylight Saving Time - if(emm_info->net_dst_present) - { - *msg_ptr = LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI; - msg_ptr++; - liblte_mme_pack_daylight_saving_time_ie(emm_info->net_dst, &msg_ptr); - } + // Full Name For Network + if (emm_info->full_net_name_present) { + *msg_ptr = LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI; + msg_ptr++; + liblte_mme_pack_network_name_ie(&emm_info->full_net_name, &msg_ptr); + } + + // Short Name For Network + if (emm_info->short_net_name_present) { + *msg_ptr = LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI; + msg_ptr++; + liblte_mme_pack_network_name_ie(&emm_info->short_net_name, &msg_ptr); + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Local Time Zone + if (emm_info->local_time_zone_present) { + *msg_ptr = LIBLTE_MME_LOCAL_TIME_ZONE_IEI; + msg_ptr++; + liblte_mme_pack_time_zone_ie(emm_info->local_time_zone, &msg_ptr); + } + + // Universal Time And Local Time Zone + if (emm_info->utc_and_local_time_zone_present) { + *msg_ptr = LIBLTE_MME_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_IEI; + msg_ptr++; + liblte_mme_pack_time_zone_and_time_ie(&emm_info->utc_and_local_time_zone, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // Network Daylight Saving Time + if (emm_info->net_dst_present) { + *msg_ptr = LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI; + msg_ptr++; + liblte_mme_pack_daylight_saving_time_ie(emm_info->net_dst, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT *emm_info) +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EMM_INFORMATION_MSG_STRUCT* emm_info) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - emm_info != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && emm_info != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; - - // Full Name For Network - if(LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_network_name_ie(&msg_ptr, &emm_info->full_net_name); - emm_info->full_net_name_present = true; - }else{ - emm_info->full_net_name_present = false; - } + // Skip Message Type + msg_ptr++; - // Short Name For Network - if(LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_network_name_ie(&msg_ptr, &emm_info->short_net_name); - emm_info->short_net_name_present = true; - }else{ - emm_info->short_net_name_present = false; - } + // Full Name For Network + if (LIBLTE_MME_FULL_NAME_FOR_NETWORK_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_network_name_ie(&msg_ptr, &emm_info->full_net_name); + emm_info->full_net_name_present = true; + } else { + emm_info->full_net_name_present = false; + } - // Local Time Zone - if(LIBLTE_MME_LOCAL_TIME_ZONE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_time_zone_ie(&msg_ptr, &emm_info->local_time_zone); - emm_info->local_time_zone_present = true; - }else{ - emm_info->local_time_zone_present = false; - } + // Short Name For Network + if (LIBLTE_MME_SHORT_NAME_FOR_NETWORK_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_network_name_ie(&msg_ptr, &emm_info->short_net_name); + emm_info->short_net_name_present = true; + } else { + emm_info->short_net_name_present = false; + } - // Universal Time And Local Time Zone - if(LIBLTE_MME_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_time_zone_and_time_ie(&msg_ptr, &emm_info->utc_and_local_time_zone); - emm_info->utc_and_local_time_zone_present = true; - }else{ - emm_info->utc_and_local_time_zone_present = false; - } + // Local Time Zone + if (LIBLTE_MME_LOCAL_TIME_ZONE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_time_zone_ie(&msg_ptr, &emm_info->local_time_zone); + emm_info->local_time_zone_present = true; + } else { + emm_info->local_time_zone_present = false; + } - // Network Daylight Saving Time - if(LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_daylight_saving_time_ie(&msg_ptr, &emm_info->net_dst); - emm_info->net_dst_present = true; - }else{ - emm_info->net_dst_present = false; - } + // Universal Time And Local Time Zone + if (LIBLTE_MME_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_time_zone_and_time_ie(&msg_ptr, &emm_info->utc_and_local_time_zone); + emm_info->utc_and_local_time_zone_present = true; + } else { + emm_info->utc_and_local_time_zone_present = false; + } - err = LIBLTE_SUCCESS; + // Network Daylight Saving Time + if (LIBLTE_MME_NETWORK_DAYLIGHT_SAVING_TIME_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_daylight_saving_time_ie(&msg_ptr, &emm_info->net_dst); + emm_info->net_dst_present = true; + } else { + emm_info->net_dst_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -6722,79 +5979,73 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_information_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.14 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_emm_status_msg(LIBLTE_MME_EMM_STATUS_MSG_STRUCT *emm_status, +LIBLTE_ERROR_ENUM liblte_mme_pack_emm_status_msg(LIBLTE_MME_EMM_STATUS_MSG_STRUCT* emm_status, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(emm_status != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } - - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_EMM_STATUS; - msg_ptr++; + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // EMM Cause - liblte_mme_pack_emm_cause_ie(emm_status->emm_cause, &msg_ptr); + if (emm_status != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // MAC will be filled in later + msg_ptr += 4; - err = LIBLTE_SUCCESS; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; } - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EMM_STATUS_MSG_STRUCT *emm_status) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - if(msg != NULL && - emm_status != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_EMM_STATUS; + msg_ptr++; - // Skip Message Type - msg_ptr++; + // EMM Cause + liblte_mme_pack_emm_cause_ie(emm_status->emm_cause, &msg_ptr); - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &emm_status->emm_cause); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EMM_STATUS_MSG_STRUCT* emm_status) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; + + if (msg != NULL && emm_status != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } + + // Skip Message Type + msg_ptr++; + + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &emm_status->emm_cause); + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -6811,144 +6062,134 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_emm_status_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.15 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_extended_service_request_msg(LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT *ext_service_req, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ext_service_req != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_extended_service_request_msg(LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT* ext_service_req, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (ext_service_req != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_EXTENDED_SERVICE_REQUEST; - msg_ptr++; - - // Service Type & NAS Key Set Identifier - *msg_ptr = 0; - liblte_mme_pack_service_type_ie(ext_service_req->service_type, 0, &msg_ptr); - liblte_mme_pack_nas_key_set_id_ie(&ext_service_req->nas_ksi, 4, &msg_ptr); - msg_ptr++; - - // M-TMSI - liblte_mme_pack_mobile_id_ie(&ext_service_req->m_tmsi, &msg_ptr); - - // CSFB Response - if(ext_service_req->csfb_resp_present) - { - *msg_ptr = LIBLTE_MME_CSFB_RESPONSE_IEI << 4; - liblte_mme_pack_csfb_response_ie(ext_service_req->csfb_resp, 0, &msg_ptr); - msg_ptr++; - } + // MAC will be filled in later + msg_ptr += 4; - // EPS Bearer Context Status - if(ext_service_req->eps_bearer_context_status_present) - { - *msg_ptr = LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI; - msg_ptr++; - liblte_mme_pack_eps_bearer_context_status_ie(&ext_service_req->eps_bearer_context_status, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Device Properties - if(ext_service_req->device_props_present) - { - *msg_ptr = LIBLTE_MME_EXTENDED_SERVICE_REQUEST_DEVICE_PROPERTIES_IEI << 4; - liblte_mme_pack_device_properties_ie(ext_service_req->device_props, 0, &msg_ptr); - msg_ptr++; - } + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_EXTENDED_SERVICE_REQUEST; + msg_ptr++; + + // Service Type & NAS Key Set Identifier + *msg_ptr = 0; + liblte_mme_pack_service_type_ie(ext_service_req->service_type, 0, &msg_ptr); + liblte_mme_pack_nas_key_set_id_ie(&ext_service_req->nas_ksi, 4, &msg_ptr); + msg_ptr++; - err = LIBLTE_SUCCESS; + // M-TMSI + liblte_mme_pack_mobile_id_ie(&ext_service_req->m_tmsi, &msg_ptr); + + // CSFB Response + if (ext_service_req->csfb_resp_present) { + *msg_ptr = LIBLTE_MME_CSFB_RESPONSE_IEI << 4; + liblte_mme_pack_csfb_response_ie(ext_service_req->csfb_resp, 0, &msg_ptr); + msg_ptr++; } - return(err); + // EPS Bearer Context Status + if (ext_service_req->eps_bearer_context_status_present) { + *msg_ptr = LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI; + msg_ptr++; + liblte_mme_pack_eps_bearer_context_status_ie(&ext_service_req->eps_bearer_context_status, &msg_ptr); + } + + // Device Properties + if (ext_service_req->device_props_present) { + *msg_ptr = LIBLTE_MME_EXTENDED_SERVICE_REQUEST_DEVICE_PROPERTIES_IEI << 4; + liblte_mme_pack_device_properties_ie(ext_service_req->device_props, 0, &msg_ptr); + msg_ptr++; + } + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT *ext_service_req) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_EXTENDED_SERVICE_REQUEST_MSG_STRUCT* ext_service_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - ext_service_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && ext_service_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; - - // Service Type & NAS Key Set Identifier - liblte_mme_unpack_service_type_ie(&msg_ptr, 0, &ext_service_req->service_type); - liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &ext_service_req->nas_ksi); - msg_ptr++; - - // M-TMSI - liblte_mme_unpack_mobile_id_ie(&msg_ptr, &ext_service_req->m_tmsi); - - // CSFB Response - if((LIBLTE_MME_CSFB_RESPONSE_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_csfb_response_ie(&msg_ptr, 0, &ext_service_req->csfb_resp); - msg_ptr++; - ext_service_req->csfb_resp_present = true; - }else{ - ext_service_req->csfb_resp_present = false; - } + // Skip Message Type + msg_ptr++; - // EPS Bearer Context Status - if(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_bearer_context_status_ie(&msg_ptr, &ext_service_req->eps_bearer_context_status); - ext_service_req->eps_bearer_context_status_present = true; - }else{ - ext_service_req->eps_bearer_context_status_present = false; - } + // Service Type & NAS Key Set Identifier + liblte_mme_unpack_service_type_ie(&msg_ptr, 0, &ext_service_req->service_type); + liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 4, &ext_service_req->nas_ksi); + msg_ptr++; - // Device Properties - if((LIBLTE_MME_EXTENDED_SERVICE_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &ext_service_req->device_props); - msg_ptr++; - ext_service_req->device_props_present = true; - }else{ - ext_service_req->device_props_present = false; - } + // M-TMSI + liblte_mme_unpack_mobile_id_ie(&msg_ptr, &ext_service_req->m_tmsi); - err = LIBLTE_SUCCESS; + // CSFB Response + if ((LIBLTE_MME_CSFB_RESPONSE_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_csfb_response_ie(&msg_ptr, 0, &ext_service_req->csfb_resp); + msg_ptr++; + ext_service_req->csfb_resp_present = true; + } else { + ext_service_req->csfb_resp_present = false; } - return(err); + // EPS Bearer Context Status + if (LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_bearer_context_status_ie(&msg_ptr, &ext_service_req->eps_bearer_context_status); + ext_service_req->eps_bearer_context_status_present = true; + } else { + ext_service_req->eps_bearer_context_status_present = false; + } + + // Device Properties + if ((LIBLTE_MME_EXTENDED_SERVICE_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &ext_service_req->device_props); + msg_ptr++; + ext_service_req->device_props_present = true; + } else { + ext_service_req->device_props_present = false; + } + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -6959,97 +6200,91 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_extended_service_request_msg(LIBLTE_BYTE_MSG Document Reference: 24.301 v10.2.0 Section 8.2.16 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_reallocation_command_msg(LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT *guti_realloc_cmd, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(guti_realloc_cmd != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_guti_reallocation_command_msg(LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT* guti_realloc_cmd, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + + if (guti_realloc_cmd != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMMAND; - msg_ptr++; - - // GUTI - liblte_mme_pack_eps_mobile_id_ie(&guti_realloc_cmd->guti, &msg_ptr); - - // TAI List - if(guti_realloc_cmd->tai_list_present) - { - *msg_ptr = LIBLTE_MME_TAI_LIST_IEI; - msg_ptr++; - liblte_mme_pack_tracking_area_identity_list_ie(&guti_realloc_cmd->tai_list, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMMAND; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // GUTI + liblte_mme_pack_eps_mobile_id_ie(&guti_realloc_cmd->guti, &msg_ptr); - err = LIBLTE_SUCCESS; + // TAI List + if (guti_realloc_cmd->tai_list_present) { + *msg_ptr = LIBLTE_MME_TAI_LIST_IEI; + msg_ptr++; + liblte_mme_pack_tracking_area_identity_list_ie(&guti_realloc_cmd->tai_list, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT *guti_realloc_cmd) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_GUTI_REALLOCATION_COMMAND_MSG_STRUCT* guti_realloc_cmd) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - guti_realloc_cmd != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && guti_realloc_cmd != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // GUTI - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &guti_realloc_cmd->guti); + // Skip Message Type + msg_ptr++; - // TAI List - if(LIBLTE_MME_TAI_LIST_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &guti_realloc_cmd->tai_list); - guti_realloc_cmd->tai_list_present = true; - }else{ - guti_realloc_cmd->tai_list_present = false; - } + // GUTI + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &guti_realloc_cmd->guti); - err = LIBLTE_SUCCESS; + // TAI List + if (LIBLTE_MME_TAI_LIST_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &guti_realloc_cmd->tai_list); + guti_realloc_cmd->tai_list_present = true; + } else { + guti_realloc_cmd->tai_list_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -7060,73 +6295,68 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_command_msg(LIBLTE_BYTE_MS Document Reference: 24.301 v10.2.0 Section 8.2.17 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_guti_reallocation_complete_msg(LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT *guti_realloc_complete, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(guti_realloc_complete != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } - - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; +LIBLTE_ERROR_ENUM +liblte_mme_pack_guti_reallocation_complete_msg(LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMPLETE; - msg_ptr++; + if (guti_realloc_complete != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // MAC will be filled in later + msg_ptr += 4; - err = LIBLTE_SUCCESS; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; } - return(err); + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_GUTI_REALLOCATION_COMPLETE; + msg_ptr++; + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT *guti_realloc_complete) +LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_GUTI_REALLOCATION_COMPLETE_MSG_STRUCT* guti_realloc_complete) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - guti_realloc_complete != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && guti_realloc_complete != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -7137,66 +6367,61 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_guti_reallocation_complete_msg(LIBLTE_BYTE_M Document Reference: 24.301 v10.2.0 Section 8.2.18 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_request_msg(LIBLTE_MME_ID_REQUEST_MSG_STRUCT *id_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_request_msg(LIBLTE_MME_ID_REQUEST_MSG_STRUCT* id_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(id_req != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (id_req != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_IDENTITY_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_IDENTITY_REQUEST; + msg_ptr++; - // ID Type & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_identity_type_2_ie(id_req->id_type, 0, &msg_ptr); - msg_ptr++; + // ID Type & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_identity_type_2_ie(id_req->id_type, 0, &msg_ptr); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ID_REQUEST_MSG_STRUCT *id_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ID_REQUEST_MSG_STRUCT* id_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - id_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && id_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // ID Type & Spare Half Offset - liblte_mme_unpack_identity_type_2_ie(&msg_ptr, 0, &id_req->id_type); - msg_ptr++; + // ID Type & Spare Half Offset + liblte_mme_unpack_identity_type_2_ie(&msg_ptr, 0, &id_req->id_type); + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* Message Name: Identity Response @@ -7207,64 +6432,59 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_request_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.19 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_identity_response_msg(LIBLTE_MME_ID_RESPONSE_MSG_STRUCT *id_resp, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_identity_response_msg(LIBLTE_MME_ID_RESPONSE_MSG_STRUCT* id_resp, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(id_resp != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (id_resp != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE; + msg_ptr++; - // Mobile Identity - liblte_mme_pack_mobile_id_ie(&id_resp->mobile_id, &msg_ptr); + // Mobile Identity + liblte_mme_pack_mobile_id_ie(&id_resp->mobile_id, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ID_RESPONSE_MSG_STRUCT *id_resp) +LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ID_RESPONSE_MSG_STRUCT* id_resp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - id_resp != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && id_resp != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Mobile Identity - liblte_mme_unpack_mobile_id_ie(&msg_ptr, &id_resp->mobile_id); + // Mobile Identity + liblte_mme_unpack_mobile_id_ie(&msg_ptr, &id_resp->mobile_id); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -7275,148 +6495,136 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_identity_response_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.20 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_command_msg(LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT *sec_mode_cmd, +LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_command_msg(LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT* sec_mode_cmd, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(sec_mode_cmd != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (sec_mode_cmd != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMMAND; - msg_ptr++; - - // Selected NAS Security Algorithms - liblte_mme_pack_nas_security_algorithms_ie(&sec_mode_cmd->selected_nas_sec_algs, &msg_ptr); - - // NAS Key Set Identifier & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_nas_key_set_id_ie(&sec_mode_cmd->nas_ksi, 0, &msg_ptr); - msg_ptr++; - - // Replayed UE Security Capabilities - liblte_mme_pack_ue_security_capabilities_ie(&sec_mode_cmd->ue_security_cap, &msg_ptr); - - // IMEISV Request - if(sec_mode_cmd->imeisv_req_present) - { - *msg_ptr = LIBLTE_MME_IMEISV_REQUEST_IEI << 4; - liblte_mme_pack_imeisv_request_ie(sec_mode_cmd->imeisv_req, 0, &msg_ptr); - msg_ptr++; - } + // MAC will be filled in later + msg_ptr += 4; - // Replayed NONCE_ue - if(sec_mode_cmd->nonce_ue_present) - { - *msg_ptr = LIBLTE_MME_REPLAYED_NONCE_UE_IEI; - msg_ptr++; - liblte_mme_pack_nonce_ie(sec_mode_cmd->nonce_ue, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // NONCE_mme - if(sec_mode_cmd->nonce_mme_present) - { - *msg_ptr = LIBLTE_MME_NONCE_MME_IEI; - msg_ptr++; - liblte_mme_pack_nonce_ie(sec_mode_cmd->nonce_mme, &msg_ptr); - } + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMMAND; + msg_ptr++; + + // Selected NAS Security Algorithms + liblte_mme_pack_nas_security_algorithms_ie(&sec_mode_cmd->selected_nas_sec_algs, &msg_ptr); + + // NAS Key Set Identifier & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_nas_key_set_id_ie(&sec_mode_cmd->nas_ksi, 0, &msg_ptr); + msg_ptr++; + + // Replayed UE Security Capabilities + liblte_mme_pack_ue_security_capabilities_ie(&sec_mode_cmd->ue_security_cap, &msg_ptr); + + // IMEISV Request + if (sec_mode_cmd->imeisv_req_present) { + *msg_ptr = LIBLTE_MME_IMEISV_REQUEST_IEI << 4; + liblte_mme_pack_imeisv_request_ie(sec_mode_cmd->imeisv_req, 0, &msg_ptr); + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Replayed NONCE_ue + if (sec_mode_cmd->nonce_ue_present) { + *msg_ptr = LIBLTE_MME_REPLAYED_NONCE_UE_IEI; + msg_ptr++; + liblte_mme_pack_nonce_ie(sec_mode_cmd->nonce_ue, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // NONCE_mme + if (sec_mode_cmd->nonce_mme_present) { + *msg_ptr = LIBLTE_MME_NONCE_MME_IEI; + msg_ptr++; + liblte_mme_pack_nonce_ie(sec_mode_cmd->nonce_mme, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT *sec_mode_cmd) +LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_COMMAND_MSG_STRUCT* sec_mode_cmd) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - sec_mode_cmd != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && sec_mode_cmd != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Selected NAS Security Algorithms - liblte_mme_unpack_nas_security_algorithms_ie(&msg_ptr, &sec_mode_cmd->selected_nas_sec_algs); + // Skip Message Type + msg_ptr++; - // NAS Key Set Identifier & Spare Half Octet - liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 0, &sec_mode_cmd->nas_ksi); - msg_ptr++; + // Selected NAS Security Algorithms + liblte_mme_unpack_nas_security_algorithms_ie(&msg_ptr, &sec_mode_cmd->selected_nas_sec_algs); - // Replayed UE Security Capabilities - liblte_mme_unpack_ue_security_capabilities_ie(&msg_ptr, &sec_mode_cmd->ue_security_cap); + // NAS Key Set Identifier & Spare Half Octet + liblte_mme_unpack_nas_key_set_id_ie(&msg_ptr, 0, &sec_mode_cmd->nas_ksi); + msg_ptr++; - // IMEISV Request - if((LIBLTE_MME_IMEISV_REQUEST_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_imeisv_request_ie(&msg_ptr, 0, &sec_mode_cmd->imeisv_req); - msg_ptr++; - sec_mode_cmd->imeisv_req_present = true; - }else{ - sec_mode_cmd->imeisv_req_present = false; - } + // Replayed UE Security Capabilities + liblte_mme_unpack_ue_security_capabilities_ie(&msg_ptr, &sec_mode_cmd->ue_security_cap); - // Replayed NONCE_ue - if(LIBLTE_MME_REPLAYED_NONCE_UE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_nonce_ie(&msg_ptr, &sec_mode_cmd->nonce_ue); - sec_mode_cmd->nonce_ue_present = true; - }else{ - sec_mode_cmd->nonce_ue_present = false; - } + // IMEISV Request + if ((LIBLTE_MME_IMEISV_REQUEST_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_imeisv_request_ie(&msg_ptr, 0, &sec_mode_cmd->imeisv_req); + msg_ptr++; + sec_mode_cmd->imeisv_req_present = true; + } else { + sec_mode_cmd->imeisv_req_present = false; + } - // NONCE_mme - if(LIBLTE_MME_NONCE_MME_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_nonce_ie(&msg_ptr, &sec_mode_cmd->nonce_mme); - sec_mode_cmd->nonce_mme_present = true; - }else{ - sec_mode_cmd->nonce_mme_present = false; - } + // Replayed NONCE_ue + if (LIBLTE_MME_REPLAYED_NONCE_UE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_nonce_ie(&msg_ptr, &sec_mode_cmd->nonce_ue); + sec_mode_cmd->nonce_ue_present = true; + } else { + sec_mode_cmd->nonce_ue_present = false; + } - err = LIBLTE_SUCCESS; + // NONCE_mme + if (LIBLTE_MME_NONCE_MME_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_nonce_ie(&msg_ptr, &sec_mode_cmd->nonce_mme); + sec_mode_cmd->nonce_mme_present = true; + } else { + sec_mode_cmd->nonce_mme_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -7427,91 +6635,85 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_command_msg(LIBLTE_BYTE_MSG_ST Document Reference: 24.301 v10.2.0 Section 8.2.21 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_complete_msg(LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT *sec_mode_comp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(sec_mode_comp != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_security_mode_complete_msg(LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT* sec_mode_comp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (sec_mode_comp != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMPLETE; - msg_ptr++; - - // IMEISV - if(sec_mode_comp->imeisv_present) - { - *msg_ptr = LIBLTE_MME_IMEISV_IEI; - msg_ptr++; - liblte_mme_pack_mobile_id_ie(&sec_mode_comp->imeisv, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - err = LIBLTE_SUCCESS; + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_COMPLETE; + msg_ptr++; + + // IMEISV + if (sec_mode_comp->imeisv_present) { + *msg_ptr = LIBLTE_MME_IMEISV_IEI; + msg_ptr++; + liblte_mme_pack_mobile_id_ie(&sec_mode_comp->imeisv, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT *sec_mode_comp) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_COMPLETE_MSG_STRUCT* sec_mode_comp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - sec_mode_comp != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && sec_mode_comp != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; - - // IMEISV - if(LIBLTE_MME_IMEISV_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_mobile_id_ie(&msg_ptr, &sec_mode_comp->imeisv); - sec_mode_comp->imeisv_present = true; - }else{ - sec_mode_comp->imeisv_present = false; - } + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // IMEISV + if (LIBLTE_MME_IMEISV_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_mobile_id_ie(&msg_ptr, &sec_mode_comp->imeisv); + sec_mode_comp->imeisv_present = true; + } else { + sec_mode_comp->imeisv_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -7523,63 +6725,58 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_complete_msg(LIBLTE_BYTE_MSG_S Document Reference: 24.301 v10.2.0 Section 8.2.22 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_reject_msg(LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT *sec_mode_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_security_mode_reject_msg(LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT* sec_mode_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(sec_mode_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (sec_mode_rej != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_REJECT; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_SECURITY_MODE_REJECT; + msg_ptr++; - // EMM Cause - liblte_mme_pack_emm_cause_ie(sec_mode_rej->emm_cause, &msg_ptr); + // EMM Cause + liblte_mme_pack_emm_cause_ie(sec_mode_rej->emm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT *sec_mode_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SECURITY_MODE_REJECT_MSG_STRUCT* sec_mode_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - sec_mode_rej != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && sec_mode_rej != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &sec_mode_rej->emm_cause); + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &sec_mode_rej->emm_cause); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -7590,115 +6787,105 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_security_mode_reject_msg(LIBLTE_BYTE_MSG_STR Document Reference: 24.301 v10.2.0 Section 8.2.24 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_service_reject_msg(LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT *service_rej, +LIBLTE_ERROR_ENUM liblte_mme_pack_service_reject_msg(LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT* service_rej, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(service_rej != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (service_rej != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_SERVICE_REJECT; - msg_ptr++; - - // EMM Cause - liblte_mme_pack_emm_cause_ie(service_rej->emm_cause, &msg_ptr); - - // T3442 Value - if(service_rej->t3442_present) - { - *msg_ptr = LIBLTE_MME_T3442_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&service_rej->t3442, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; - // T3446 Value - if(service_rej->t3446_present) - { - *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_2_ie(service_rej->t3446, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_SERVICE_REJECT; + msg_ptr++; - err = LIBLTE_SUCCESS; + // EMM Cause + liblte_mme_pack_emm_cause_ie(service_rej->emm_cause, &msg_ptr); + + // T3442 Value + if (service_rej->t3442_present) { + *msg_ptr = LIBLTE_MME_T3442_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&service_rej->t3442, &msg_ptr); } - return(err); + // T3446 Value + if (service_rej->t3446_present) { + *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_2_ie(service_rej->t3446, &msg_ptr); + } + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT *service_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT* service_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - service_rej != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && service_rej != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &service_rej->emm_cause); + // Skip Message Type + msg_ptr++; - // T3442 Value - if(LIBLTE_MME_T3442_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &service_rej->t3442); - service_rej->t3442_present = true; - }else{ - service_rej->t3442_present = false; - } + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &service_rej->emm_cause); - // T3446 Value - if(LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &service_rej->t3446); - service_rej->t3446_present = true; - }else{ - service_rej->t3446_present = false; - } + // T3442 Value + if (LIBLTE_MME_T3442_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &service_rej->t3442); + service_rej->t3442_present = true; + } else { + service_rej->t3442_present = false; + } - err = LIBLTE_SUCCESS; + // T3446 Value + if (LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &service_rej->t3446); + service_rej->t3446_present = true; + } else { + service_rej->t3446_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -7710,55 +6897,51 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_reject_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.25 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_service_request_msg(LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT *service_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_service_request_msg(LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT* service_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(service_req != NULL && - msg != NULL) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (service_req != NULL && msg != NULL) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // KSI and Sequence Number - liblte_mme_pack_ksi_and_sequence_number_ie(&service_req->ksi_and_seq_num, &msg_ptr); + // KSI and Sequence Number + liblte_mme_pack_ksi_and_sequence_number_ie(&service_req->ksi_and_seq_num, &msg_ptr); - // Short MAC - liblte_mme_pack_short_mac_ie(service_req->short_mac, &msg_ptr); + // Short MAC + liblte_mme_pack_short_mac_ie(service_req->short_mac, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT *service_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_SERVICE_REQUEST_MSG_STRUCT* service_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(msg != NULL && - service_req != NULL) - { - // Protocol Discriminator and Security Header Type - msg_ptr++; + if (msg != NULL && service_req != NULL) { + // Protocol Discriminator and Security Header Type + msg_ptr++; - // KSI and Sequence Number - liblte_mme_unpack_ksi_and_sequence_number_ie(&msg_ptr, &service_req->ksi_and_seq_num); + // KSI and Sequence Number + liblte_mme_unpack_ksi_and_sequence_number_ie(&msg_ptr, &service_req->ksi_and_seq_num); - // Short MAC - liblte_mme_unpack_short_mac_ie(&msg_ptr, &service_req->short_mac); + // Short MAC + liblte_mme_unpack_short_mac_ie(&msg_ptr, &service_req->short_mac); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -7770,334 +6953,302 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_service_request_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.2.26 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_accept_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT *ta_update_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ta_update_accept != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_update_accept_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT* ta_update_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (ta_update_accept != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_ACCEPT; - msg_ptr++; - - // EPS Update Result & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_eps_update_result_ie(ta_update_accept->eps_update_result, 0, &msg_ptr); - msg_ptr++; - - // T3412 Value - if(ta_update_accept->t3412_present) - { - *msg_ptr = LIBLTE_MME_T3412_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3412, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; - // GUTI - if(ta_update_accept->guti_present) - { - *msg_ptr = LIBLTE_MME_GUTI_IEI; - msg_ptr++; - liblte_mme_pack_eps_mobile_id_ie(&ta_update_accept->guti, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // TAI List - if(ta_update_accept->tai_list_present) - { - *msg_ptr = LIBLTE_MME_TAI_LIST_IEI; - msg_ptr++; - liblte_mme_pack_tracking_area_identity_list_ie(&ta_update_accept->tai_list, &msg_ptr); - } + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // EPS Bearer Context Status - if(ta_update_accept->eps_bearer_context_status_present) - { - *msg_ptr = LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI; - msg_ptr++; - liblte_mme_pack_eps_bearer_context_status_ie(&ta_update_accept->eps_bearer_context_status, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_ACCEPT; + msg_ptr++; - // Location Area Identification - if(ta_update_accept->lai_present) - { - *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; - msg_ptr++; - liblte_mme_pack_location_area_id_ie(&ta_update_accept->lai, &msg_ptr); - } + // EPS Update Result & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_eps_update_result_ie(ta_update_accept->eps_update_result, 0, &msg_ptr); + msg_ptr++; - // MS Identity - if(ta_update_accept->ms_id_present) - { - *msg_ptr = LIBLTE_MME_MS_IDENTITY_IEI; - msg_ptr++; - liblte_mme_pack_mobile_id_ie(&ta_update_accept->ms_id, &msg_ptr); - } + // T3412 Value + if (ta_update_accept->t3412_present) { + *msg_ptr = LIBLTE_MME_T3412_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3412, &msg_ptr); + } - // EMM Cause - if(ta_update_accept->emm_cause_present) - { - *msg_ptr = LIBLTE_MME_EMM_CAUSE_IEI; - msg_ptr++; - liblte_mme_pack_emm_cause_ie(ta_update_accept->emm_cause, &msg_ptr); - } + // GUTI + if (ta_update_accept->guti_present) { + *msg_ptr = LIBLTE_MME_GUTI_IEI; + msg_ptr++; + liblte_mme_pack_eps_mobile_id_ie(&ta_update_accept->guti, &msg_ptr); + } - // T3402 Value - if(ta_update_accept->t3402_present) - { - *msg_ptr = LIBLTE_MME_T3402_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3402, &msg_ptr); - } + // TAI List + if (ta_update_accept->tai_list_present) { + *msg_ptr = LIBLTE_MME_TAI_LIST_IEI; + msg_ptr++; + liblte_mme_pack_tracking_area_identity_list_ie(&ta_update_accept->tai_list, &msg_ptr); + } - // T3423 Value - if(ta_update_accept->t3423_present) - { - *msg_ptr = LIBLTE_MME_T3423_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3423, &msg_ptr); - } + // EPS Bearer Context Status + if (ta_update_accept->eps_bearer_context_status_present) { + *msg_ptr = LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI; + msg_ptr++; + liblte_mme_pack_eps_bearer_context_status_ie(&ta_update_accept->eps_bearer_context_status, &msg_ptr); + } - // Equivalent PLMNs - if(ta_update_accept->equivalent_plmns_present) - { - *msg_ptr = LIBLTE_MME_EQUIVALENT_PLMNS_IEI; - msg_ptr++; - liblte_mme_pack_plmn_list_ie(&ta_update_accept->equivalent_plmns, &msg_ptr); - } + // Location Area Identification + if (ta_update_accept->lai_present) { + *msg_ptr = LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI; + msg_ptr++; + liblte_mme_pack_location_area_id_ie(&ta_update_accept->lai, &msg_ptr); + } - // Emergency Number List - if(ta_update_accept->emerg_num_list_present) - { - *msg_ptr = LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI; - msg_ptr++; - liblte_mme_pack_emergency_number_list_ie(&ta_update_accept->emerg_num_list, &msg_ptr); - } + // MS Identity + if (ta_update_accept->ms_id_present) { + *msg_ptr = LIBLTE_MME_MS_IDENTITY_IEI; + msg_ptr++; + liblte_mme_pack_mobile_id_ie(&ta_update_accept->ms_id, &msg_ptr); + } - // EPS Network Feature Support - if(ta_update_accept->eps_network_feature_support_present) - { - *msg_ptr = LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI; - msg_ptr++; - liblte_mme_pack_eps_network_feature_support_ie(&ta_update_accept->eps_network_feature_support, &msg_ptr); - } + // EMM Cause + if (ta_update_accept->emm_cause_present) { + *msg_ptr = LIBLTE_MME_EMM_CAUSE_IEI; + msg_ptr++; + liblte_mme_pack_emm_cause_ie(ta_update_accept->emm_cause, &msg_ptr); + } - // Additional Update Result - if(ta_update_accept->additional_update_result_present) - { - *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4; - liblte_mme_pack_additional_update_result_ie(ta_update_accept->additional_update_result, 0, &msg_ptr); - msg_ptr++; - } + // T3402 Value + if (ta_update_accept->t3402_present) { + *msg_ptr = LIBLTE_MME_T3402_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3402, &msg_ptr); + } - // T3412 Extended Value - if(ta_update_accept->t3412_ext_present) - { - *msg_ptr = LIBLTE_MME_T3412_EXTENDED_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_3_ie(&ta_update_accept->t3412_ext, &msg_ptr); - } + // T3423 Value + if (ta_update_accept->t3423_present) { + *msg_ptr = LIBLTE_MME_T3423_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_ie(&ta_update_accept->t3423, &msg_ptr); + } + + // Equivalent PLMNs + if (ta_update_accept->equivalent_plmns_present) { + *msg_ptr = LIBLTE_MME_EQUIVALENT_PLMNS_IEI; + msg_ptr++; + liblte_mme_pack_plmn_list_ie(&ta_update_accept->equivalent_plmns, &msg_ptr); + } + + // Emergency Number List + if (ta_update_accept->emerg_num_list_present) { + *msg_ptr = LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI; + msg_ptr++; + liblte_mme_pack_emergency_number_list_ie(&ta_update_accept->emerg_num_list, &msg_ptr); + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // EPS Network Feature Support + if (ta_update_accept->eps_network_feature_support_present) { + *msg_ptr = LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI; + msg_ptr++; + liblte_mme_pack_eps_network_feature_support_ie(&ta_update_accept->eps_network_feature_support, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // Additional Update Result + if (ta_update_accept->additional_update_result_present) { + *msg_ptr = LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4; + liblte_mme_pack_additional_update_result_ie(ta_update_accept->additional_update_result, 0, &msg_ptr); + msg_ptr++; } - return(err); + // T3412 Extended Value + if (ta_update_accept->t3412_ext_present) { + *msg_ptr = LIBLTE_MME_T3412_EXTENDED_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_3_ie(&ta_update_accept->t3412_ext, &msg_ptr); + } + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT *ta_update_accept) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_TRACKING_AREA_UPDATE_ACCEPT_MSG_STRUCT* ta_update_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - ta_update_accept != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && ta_update_accept != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; - - // EPS Update Result & Spare Half Octet - liblte_mme_unpack_eps_update_result_ie(&msg_ptr, 0, &ta_update_accept->eps_update_result); - msg_ptr++; - - // T3412 Value - if(LIBLTE_MME_T3412_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3412); - ta_update_accept->t3412_present = true; - }else{ - ta_update_accept->t3412_present = false; - } + // Skip Message Type + msg_ptr++; - // GUTI - if(LIBLTE_MME_GUTI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &ta_update_accept->guti); - ta_update_accept->guti_present = true; - }else{ - ta_update_accept->guti_present = false; - } + // EPS Update Result & Spare Half Octet + liblte_mme_unpack_eps_update_result_ie(&msg_ptr, 0, &ta_update_accept->eps_update_result); + msg_ptr++; - // TAI List - if(LIBLTE_MME_TAI_LIST_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &ta_update_accept->tai_list); - ta_update_accept->tai_list_present = true; - }else{ - ta_update_accept->tai_list_present = false; - } + // T3412 Value + if (LIBLTE_MME_T3412_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3412); + ta_update_accept->t3412_present = true; + } else { + ta_update_accept->t3412_present = false; + } - // EPS Bearer Context Status - if(LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_bearer_context_status_ie(&msg_ptr, &ta_update_accept->eps_bearer_context_status); - ta_update_accept->eps_bearer_context_status_present = true; - }else{ - ta_update_accept->eps_bearer_context_status_present = false; - } + // GUTI + if (LIBLTE_MME_GUTI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_mobile_id_ie(&msg_ptr, &ta_update_accept->guti); + ta_update_accept->guti_present = true; + } else { + ta_update_accept->guti_present = false; + } - // Location Area Identification - if(LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_location_area_id_ie(&msg_ptr, &ta_update_accept->lai); - ta_update_accept->lai_present = true; - }else{ - ta_update_accept->lai_present = false; - } + // TAI List + if (LIBLTE_MME_TAI_LIST_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_tracking_area_identity_list_ie(&msg_ptr, &ta_update_accept->tai_list); + ta_update_accept->tai_list_present = true; + } else { + ta_update_accept->tai_list_present = false; + } - // MS Identity - if(LIBLTE_MME_MS_IDENTITY_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_mobile_id_ie(&msg_ptr, &ta_update_accept->ms_id); - ta_update_accept->ms_id_present = true; - }else{ - ta_update_accept->ms_id_present = false; - } + // EPS Bearer Context Status + if (LIBLTE_MME_EPS_BEARER_CONTEXT_STATUS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_bearer_context_status_ie(&msg_ptr, &ta_update_accept->eps_bearer_context_status); + ta_update_accept->eps_bearer_context_status_present = true; + } else { + ta_update_accept->eps_bearer_context_status_present = false; + } - // EMM Cause - if(LIBLTE_MME_EMM_CAUSE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &ta_update_accept->emm_cause); - ta_update_accept->emm_cause_present = true; - }else{ - ta_update_accept->emm_cause_present = false; - } + // Location Area Identification + if (LIBLTE_MME_LOCATION_AREA_IDENTIFICATION_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_location_area_id_ie(&msg_ptr, &ta_update_accept->lai); + ta_update_accept->lai_present = true; + } else { + ta_update_accept->lai_present = false; + } - // T3402 Value - if(LIBLTE_MME_T3402_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3402); - ta_update_accept->t3402_present = true; - }else{ - ta_update_accept->t3402_present = false; - } + // MS Identity + if (LIBLTE_MME_MS_IDENTITY_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_mobile_id_ie(&msg_ptr, &ta_update_accept->ms_id); + ta_update_accept->ms_id_present = true; + } else { + ta_update_accept->ms_id_present = false; + } + + // EMM Cause + if (LIBLTE_MME_EMM_CAUSE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &ta_update_accept->emm_cause); + ta_update_accept->emm_cause_present = true; + } else { + ta_update_accept->emm_cause_present = false; + } - // T3423 Value - if(LIBLTE_MME_T3423_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3423); - ta_update_accept->t3423_present = true; - }else{ - ta_update_accept->t3423_present = false; - } + // T3402 Value + if (LIBLTE_MME_T3402_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3402); + ta_update_accept->t3402_present = true; + } else { + ta_update_accept->t3402_present = false; + } - // Equivalent PLMNs - if(LIBLTE_MME_EQUIVALENT_PLMNS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_plmn_list_ie(&msg_ptr, &ta_update_accept->equivalent_plmns); - ta_update_accept->equivalent_plmns_present = true; - }else{ - ta_update_accept->equivalent_plmns_present = false; - } + // T3423 Value + if (LIBLTE_MME_T3423_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_ie(&msg_ptr, &ta_update_accept->t3423); + ta_update_accept->t3423_present = true; + } else { + ta_update_accept->t3423_present = false; + } - // Emergency Number List - if(LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_emergency_number_list_ie(&msg_ptr, &ta_update_accept->emerg_num_list); - ta_update_accept->emerg_num_list_present = true; - }else{ - ta_update_accept->emerg_num_list_present = false; - } + // Equivalent PLMNs + if (LIBLTE_MME_EQUIVALENT_PLMNS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_plmn_list_ie(&msg_ptr, &ta_update_accept->equivalent_plmns); + ta_update_accept->equivalent_plmns_present = true; + } else { + ta_update_accept->equivalent_plmns_present = false; + } - // EPS Network Feature Support - if(LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_network_feature_support_ie(&msg_ptr, &ta_update_accept->eps_network_feature_support); - ta_update_accept->eps_network_feature_support_present = true; - }else{ - ta_update_accept->eps_network_feature_support_present = false; - } + // Emergency Number List + if (LIBLTE_MME_EMERGENCY_NUMBER_LIST_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_emergency_number_list_ie(&msg_ptr, &ta_update_accept->emerg_num_list); + ta_update_accept->emerg_num_list_present = true; + } else { + ta_update_accept->emerg_num_list_present = false; + } - // Additional Update Result - if((LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_additional_update_result_ie(&msg_ptr, 0, &ta_update_accept->additional_update_result); - msg_ptr++; - ta_update_accept->additional_update_result_present = true; - }else{ - ta_update_accept->additional_update_result_present = false; - } + // EPS Network Feature Support + if (LIBLTE_MME_EPS_NETWORK_FEATURE_SUPPORT_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_network_feature_support_ie(&msg_ptr, &ta_update_accept->eps_network_feature_support); + ta_update_accept->eps_network_feature_support_present = true; + } else { + ta_update_accept->eps_network_feature_support_present = false; + } - // T3412 Extended Value - if(LIBLTE_MME_T3412_EXTENDED_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &ta_update_accept->t3412_ext); - ta_update_accept->t3412_ext_present = true; - }else{ - ta_update_accept->t3412_ext_present = false; - } + // Additional Update Result + if ((LIBLTE_MME_ADDITIONAL_UPDATE_RESULT_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_additional_update_result_ie(&msg_ptr, 0, &ta_update_accept->additional_update_result); + msg_ptr++; + ta_update_accept->additional_update_result_present = true; + } else { + ta_update_accept->additional_update_result_present = false; + } - err = LIBLTE_SUCCESS; + // T3412 Extended Value + if (LIBLTE_MME_T3412_EXTENDED_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &ta_update_accept->t3412_ext); + ta_update_accept->t3412_ext_present = true; + } else { + ta_update_accept->t3412_ext_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -8109,73 +7260,68 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_accept_msg(LIBLTE_BYTE_ Document Reference: 24.301 v10.2.0 Section 8.2.27 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_complete_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT *ta_update_complete, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ta_update_complete != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } - - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; +LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_complete_msg( + LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_COMPLETE; - msg_ptr++; + if (ta_update_complete != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // MAC will be filled in later + msg_ptr += 4; - err = LIBLTE_SUCCESS; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; } - return(err); + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_COMPLETE; + msg_ptr++; + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT *ta_update_complete) +LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_TRACKING_AREA_UPDATE_COMPLETE_MSG_STRUCT* ta_update_complete) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - ta_update_complete != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && ta_update_complete != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -8186,97 +7332,91 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_complete_msg(LIBLTE_BYT Document Reference: 24.301 v10.2.0 Section 8.2.28 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_tracking_area_update_reject_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT *ta_update_rej, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ta_update_rej != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_tracking_area_update_reject_msg(LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT* ta_update_rej, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (ta_update_rej != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REJECT; - msg_ptr++; - - // EMM Cause - liblte_mme_pack_emm_cause_ie(ta_update_rej->emm_cause, &msg_ptr); - - // T3446 Value - if(ta_update_rej->t3446_present) - { - *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_2_ie(ta_update_rej->t3446, &msg_ptr); - } + // MAC will be filled in later + msg_ptr += 4; + + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // EMM Cause + liblte_mme_pack_emm_cause_ie(ta_update_rej->emm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // T3446 Value + if (ta_update_rej->t3446_present) { + *msg_ptr = LIBLTE_MME_T3446_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_2_ie(ta_update_rej->t3446, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT *ta_update_rej) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_TRACKING_AREA_UPDATE_REJECT_MSG_STRUCT* ta_update_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; - - if(msg != NULL && - ta_update_rej != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - // Skip Message Type - msg_ptr++; + if (msg != NULL && ta_update_rej != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // EMM Cause - liblte_mme_unpack_emm_cause_ie(&msg_ptr, &ta_update_rej->emm_cause); + // Skip Message Type + msg_ptr++; - // T3446 Value - if(LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &ta_update_rej->t3446); - ta_update_rej->t3446_present = true; - }else{ - ta_update_rej->t3446_present = false; - } + // EMM Cause + liblte_mme_unpack_emm_cause_ie(&msg_ptr, &ta_update_rej->emm_cause); - err = LIBLTE_SUCCESS; + // T3446 Value + if (LIBLTE_MME_T3446_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_2_ie(&msg_ptr, &ta_update_rej->t3446); + ta_update_rej->t3446_present = true; + } else { + ta_update_rej->t3446_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -8297,79 +7437,74 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_tracking_area_update_reject_msg(LIBLTE_BYTE_ Document Reference: 24.301 v10.2.0 Section 8.2.30 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_nas_transport_msg(LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT *ul_nas_transport, +LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_nas_transport_msg(LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT* ul_nas_transport, uint8 sec_hdr_type, uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ul_nas_transport != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + + if (ul_nas_transport != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_UPLINK_NAS_TRANSPORT; - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // NAS Message Container - liblte_mme_pack_nas_message_container_ie(&ul_nas_transport->nas_msg, &msg_ptr); + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_UPLINK_NAS_TRANSPORT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // NAS Message Container + liblte_mme_pack_nas_message_container_ie(&ul_nas_transport->nas_msg, &msg_ptr); - err = LIBLTE_SUCCESS; - } + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT *ul_nas_transport) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_UPLINK_NAS_TRANSPORT_MSG_STRUCT* ul_nas_transport) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - ul_nas_transport != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && ul_nas_transport != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // NAS Message Container - liblte_mme_unpack_nas_message_container_ie(&msg_ptr, &ul_nas_transport->nas_msg); + // NAS Message Container + liblte_mme_unpack_nas_message_container_ie(&msg_ptr, &ul_nas_transport->nas_msg); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -8380,91 +7515,86 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_nas_transport_msg(LIBLTE_BYTE_MSG_STR Document Reference: 24.301 v10.2.0 Section 8.2.31 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_generic_nas_transport_msg(LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *dl_generic_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(dl_generic_nas_transport != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_downlink_generic_nas_transport_msg( + LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (dl_generic_nas_transport != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_DOWNLINK_GENERIC_NAS_TRANSPORT; - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; + + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Generic Message Container Type - liblte_mme_pack_generic_message_container_type_ie(dl_generic_nas_transport->generic_msg_cont_type, &msg_ptr); + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_DOWNLINK_GENERIC_NAS_TRANSPORT; + msg_ptr++; - // Generic Message Container - liblte_mme_pack_generic_message_container_ie(&dl_generic_nas_transport->generic_msg_cont, &msg_ptr); + // Generic Message Container Type + liblte_mme_pack_generic_message_container_type_ie(dl_generic_nas_transport->generic_msg_cont_type, &msg_ptr); - // Additional Information - liblte_mme_pack_additional_information_ie(&dl_generic_nas_transport->add_info, &msg_ptr); + // Generic Message Container + liblte_mme_pack_generic_message_container_ie(&dl_generic_nas_transport->generic_msg_cont, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Additional Information + liblte_mme_pack_additional_information_ie(&dl_generic_nas_transport->add_info, &msg_ptr); - err = LIBLTE_SUCCESS; - } + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *dl_generic_nas_transport) +LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_DOWNLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* dl_generic_nas_transport) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - dl_generic_nas_transport != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && dl_generic_nas_transport != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Generic Message Container Type - liblte_mme_unpack_generic_message_container_type_ie(&msg_ptr, &dl_generic_nas_transport->generic_msg_cont_type); + // Generic Message Container Type + liblte_mme_unpack_generic_message_container_type_ie(&msg_ptr, &dl_generic_nas_transport->generic_msg_cont_type); - // Generic Message Container - liblte_mme_unpack_generic_message_container_ie(&msg_ptr, &dl_generic_nas_transport->generic_msg_cont); + // Generic Message Container + liblte_mme_unpack_generic_message_container_ie(&msg_ptr, &dl_generic_nas_transport->generic_msg_cont); - // Additional Information - liblte_mme_unpack_additional_information_ie(&msg_ptr, &dl_generic_nas_transport->add_info); + // Additional Information + liblte_mme_unpack_additional_information_ie(&msg_ptr, &dl_generic_nas_transport->add_info); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -8475,91 +7605,86 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_downlink_generic_nas_transport_msg(LIBLTE_BY Document Reference: 24.301 v10.2.0 Section 8.2.32 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_generic_nas_transport_msg(LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *ul_generic_nas_transport, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(ul_generic_nas_transport != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_uplink_generic_nas_transport_msg( + LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + + if (ul_generic_nas_transport != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Protocol Discriminator and Security Header Type - *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_UPLINK_GENERIC_NAS_TRANSPORT; - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + + // Protocol Discriminator and Security Header Type + *msg_ptr = (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Generic Message Container Type - liblte_mme_pack_generic_message_container_type_ie(ul_generic_nas_transport->generic_msg_cont_type, &msg_ptr); + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_UPLINK_GENERIC_NAS_TRANSPORT; + msg_ptr++; - // Generic Message Container - liblte_mme_pack_generic_message_container_ie(&ul_generic_nas_transport->generic_msg_cont, &msg_ptr); + // Generic Message Container Type + liblte_mme_pack_generic_message_container_type_ie(ul_generic_nas_transport->generic_msg_cont_type, &msg_ptr); - // Additional Information - liblte_mme_pack_additional_information_ie(&ul_generic_nas_transport->add_info, &msg_ptr); + // Generic Message Container + liblte_mme_pack_generic_message_container_ie(&ul_generic_nas_transport->generic_msg_cont, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Additional Information + liblte_mme_pack_additional_information_ie(&ul_generic_nas_transport->add_info, &msg_ptr); - err = LIBLTE_SUCCESS; - } + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT *ul_generic_nas_transport) +LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_UPLINK_GENERIC_NAS_TRANSPORT_MSG_STRUCT* ul_generic_nas_transport) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - ul_generic_nas_transport != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 7; - } + if (msg != NULL && ul_generic_nas_transport != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 7; + } - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Generic Message Container Type - liblte_mme_unpack_generic_message_container_type_ie(&msg_ptr, &ul_generic_nas_transport->generic_msg_cont_type); + // Generic Message Container Type + liblte_mme_unpack_generic_message_container_type_ie(&msg_ptr, &ul_generic_nas_transport->generic_msg_cont_type); - // Generic Message Container - liblte_mme_unpack_generic_message_container_ie(&msg_ptr, &ul_generic_nas_transport->generic_msg_cont); + // Generic Message Container + liblte_mme_unpack_generic_message_container_ie(&msg_ptr, &ul_generic_nas_transport->generic_msg_cont); - // Additional Information - liblte_mme_unpack_additional_information_ie(&msg_ptr, &ul_generic_nas_transport->add_info); + // Additional Information + liblte_mme_unpack_additional_information_ie(&msg_ptr, &ul_generic_nas_transport->add_info); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -8572,93 +7697,88 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_uplink_generic_nas_transport_msg(LIBLTE_BYTE Document Reference: 24.301 v10.2.0 Section 8.3.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_accept_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_ded_eps_bearer_context_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(act_ded_eps_bearer_context_accept != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_accept_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_ded_eps_bearer_context_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + + if (act_ded_eps_bearer_context_accept != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_ded_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Procedure Transaction ID - *msg_ptr = act_ded_eps_bearer_context_accept->proc_transaction_id; - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT; - msg_ptr++; - - // Protocol Configuration Options - if(act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); - } + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_ded_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; + + // Procedure Transaction ID + *msg_ptr = act_ded_eps_bearer_context_accept->proc_transaction_id; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT; + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_ded_eps_bearer_context_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_ded_eps_bearer_context_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_ded_eps_bearer_context_accept != NULL) - { - // EPS Bearer ID - act_ded_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - act_ded_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && act_ded_eps_bearer_context_accept != NULL) { + // EPS Bearer ID + act_ded_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_ded_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_accept->protocol_cnfg_opts); - act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present = true; - }else{ - act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present = false; - } + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_accept->protocol_cnfg_opts); + act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present = true; + } else { + act_ded_eps_bearer_context_accept->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -8669,83 +7789,79 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_accept Document Reference: 24.301 v10.2.0 Section 8.3.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_reject_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_ded_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_reject_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_ded_eps_bearer_context_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(act_ded_eps_bearer_context_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_ded_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (act_ded_eps_bearer_context_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_ded_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = act_ded_eps_bearer_context_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = act_ded_eps_bearer_context_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(act_ded_eps_bearer_context_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Cause + liblte_mme_pack_esm_cause_ie(act_ded_eps_bearer_context_rej->esm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_ded_eps_bearer_context_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_ded_eps_bearer_context_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_ded_eps_bearer_context_rej != NULL) - { - // EPS Bearer ID - act_ded_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - act_ded_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && act_ded_eps_bearer_context_rej != NULL) { + // EPS Bearer ID + act_ded_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_ded_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_ded_eps_bearer_context_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_rej->protocol_cnfg_opts); - act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present = true; - }else{ - act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_ded_eps_bearer_context_rej->esm_cause); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_rej->protocol_cnfg_opts); + act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present = true; + } else { + act_ded_eps_bearer_context_rej->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -8758,197 +7874,182 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reject Document Reference: 24.301 v10.2.0 Section 8.3.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_request_msg(LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_ded_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_dedicated_eps_bearer_context_request_msg( + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_ded_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(act_ded_eps_bearer_context_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_ded_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (act_ded_eps_bearer_context_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_ded_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; + + // Procedure Transaction ID + *msg_ptr = act_ded_eps_bearer_context_req->proc_transaction_id; + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = act_ded_eps_bearer_context_req->proc_transaction_id; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST; - msg_ptr++; - - // Linked EPS Bearer Identity & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_linked_eps_bearer_identity_ie(act_ded_eps_bearer_context_req->linked_eps_bearer_id, 0, &msg_ptr); - msg_ptr++; - - // EPS QoS - liblte_mme_pack_eps_quality_of_service_ie(&act_ded_eps_bearer_context_req->eps_qos, &msg_ptr); - - // TFT - liblte_mme_pack_traffic_flow_template_ie(&act_ded_eps_bearer_context_req->tft, &msg_ptr); - - // Transaction Identifier - if(act_ded_eps_bearer_context_req->transaction_id_present) - { - *msg_ptr = LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI; - msg_ptr++; - liblte_mme_pack_transaction_identifier_ie(&act_ded_eps_bearer_context_req->transaction_id, &msg_ptr); - } + // Linked EPS Bearer Identity & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_linked_eps_bearer_identity_ie(act_ded_eps_bearer_context_req->linked_eps_bearer_id, 0, &msg_ptr); + msg_ptr++; - // Negotiated QoS - if(act_ded_eps_bearer_context_req->negotiated_qos_present) - { - *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; - msg_ptr++; - liblte_mme_pack_quality_of_service_ie(&act_ded_eps_bearer_context_req->negotiated_qos, &msg_ptr); - } + // EPS QoS + liblte_mme_pack_eps_quality_of_service_ie(&act_ded_eps_bearer_context_req->eps_qos, &msg_ptr); - // Negotiated LLC SAPI - if(act_ded_eps_bearer_context_req->llc_sapi_present) - { - *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; - msg_ptr++; - liblte_mme_pack_llc_service_access_point_identifier_ie(act_ded_eps_bearer_context_req->llc_sapi, &msg_ptr); - } + // TFT + liblte_mme_pack_traffic_flow_template_ie(&act_ded_eps_bearer_context_req->tft, &msg_ptr); - // Radio Priority - if(act_ded_eps_bearer_context_req->radio_prio_present) - { - *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; - liblte_mme_pack_radio_priority_ie(act_ded_eps_bearer_context_req->radio_prio, 0, &msg_ptr); - msg_ptr++; - } + // Transaction Identifier + if (act_ded_eps_bearer_context_req->transaction_id_present) { + *msg_ptr = LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI; + msg_ptr++; + liblte_mme_pack_transaction_identifier_ie(&act_ded_eps_bearer_context_req->transaction_id, &msg_ptr); + } - // Packet Flow Identifier - if(act_ded_eps_bearer_context_req->packet_flow_id_present) - { - *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; - msg_ptr++; - liblte_mme_pack_packet_flow_identifier_ie(act_ded_eps_bearer_context_req->packet_flow_id, &msg_ptr); - } + // Negotiated QoS + if (act_ded_eps_bearer_context_req->negotiated_qos_present) { + *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; + msg_ptr++; + liblte_mme_pack_quality_of_service_ie(&act_ded_eps_bearer_context_req->negotiated_qos, &msg_ptr); + } - // Protocol Configuration Options - if(act_ded_eps_bearer_context_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); - } + // Negotiated LLC SAPI + if (act_ded_eps_bearer_context_req->llc_sapi_present) { + *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; + msg_ptr++; + liblte_mme_pack_llc_service_access_point_identifier_ie(act_ded_eps_bearer_context_req->llc_sapi, &msg_ptr); + } + + // Radio Priority + if (act_ded_eps_bearer_context_req->radio_prio_present) { + *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; + liblte_mme_pack_radio_priority_ie(act_ded_eps_bearer_context_req->radio_prio, 0, &msg_ptr); + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Packet Flow Identifier + if (act_ded_eps_bearer_context_req->packet_flow_id_present) { + *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; + msg_ptr++; + liblte_mme_pack_packet_flow_identifier_ie(act_ded_eps_bearer_context_req->packet_flow_id, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (act_ded_eps_bearer_context_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_ded_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_ded_eps_bearer_context_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_ded_eps_bearer_context_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_ded_eps_bearer_context_req != NULL) - { - // Security Header Type - uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 6; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // EPS Bearer ID - act_ded_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + if (msg != NULL && act_ded_eps_bearer_context_req != NULL) { + // Security Header Type + uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 6; + } - // Procedure Transaction ID - act_ded_eps_bearer_context_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + // EPS Bearer ID + act_ded_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_ded_eps_bearer_context_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Linked Bearer Identity & Spare Half Octet - liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &act_ded_eps_bearer_context_req->linked_eps_bearer_id); - msg_ptr++; + // Skip Message Type + msg_ptr++; - // EPS QoS - liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &act_ded_eps_bearer_context_req->eps_qos); + // Linked Bearer Identity & Spare Half Octet + liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &act_ded_eps_bearer_context_req->linked_eps_bearer_id); + msg_ptr++; - // TFT - liblte_mme_unpack_traffic_flow_template_ie(&msg_ptr, &act_ded_eps_bearer_context_req->tft); + // EPS QoS + liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &act_ded_eps_bearer_context_req->eps_qos); - // Transaction Identifier - if(LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_transaction_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->transaction_id); - act_ded_eps_bearer_context_req->transaction_id_present = true; - }else{ - act_ded_eps_bearer_context_req->transaction_id_present = false; - } + // TFT + liblte_mme_unpack_traffic_flow_template_ie(&msg_ptr, &act_ded_eps_bearer_context_req->tft); - // Negotiated QoS - if(LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &act_ded_eps_bearer_context_req->negotiated_qos); - act_ded_eps_bearer_context_req->negotiated_qos_present = true; - }else{ - act_ded_eps_bearer_context_req->negotiated_qos_present = false; - } + // Transaction Identifier + if (LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_transaction_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->transaction_id); + act_ded_eps_bearer_context_req->transaction_id_present = true; + } else { + act_ded_eps_bearer_context_req->transaction_id_present = false; + } - // Negotiated LLC SAPI - if(LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->llc_sapi); - act_ded_eps_bearer_context_req->llc_sapi_present = true; - }else{ - act_ded_eps_bearer_context_req->llc_sapi_present = false; - } + // Negotiated QoS + if (LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &act_ded_eps_bearer_context_req->negotiated_qos); + act_ded_eps_bearer_context_req->negotiated_qos_present = true; + } else { + act_ded_eps_bearer_context_req->negotiated_qos_present = false; + } - // Radio Priority - if((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &act_ded_eps_bearer_context_req->radio_prio); - msg_ptr++; - act_ded_eps_bearer_context_req->radio_prio_present = true; - }else{ - act_ded_eps_bearer_context_req->radio_prio_present = false; - } + // Negotiated LLC SAPI + if (LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->llc_sapi); + act_ded_eps_bearer_context_req->llc_sapi_present = true; + } else { + act_ded_eps_bearer_context_req->llc_sapi_present = false; + } - // Packet Flow Identifier - if(LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->packet_flow_id); - act_ded_eps_bearer_context_req->packet_flow_id_present = true; - }else{ - act_ded_eps_bearer_context_req->packet_flow_id_present = false; - } + // Radio Priority + if ((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &act_ded_eps_bearer_context_req->radio_prio); + msg_ptr++; + act_ded_eps_bearer_context_req->radio_prio_present = true; + } else { + act_ded_eps_bearer_context_req->radio_prio_present = false; + } - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_req->protocol_cnfg_opts); - act_ded_eps_bearer_context_req->protocol_cnfg_opts_present = true; - }else{ - act_ded_eps_bearer_context_req->protocol_cnfg_opts_present = false; - } + // Packet Flow Identifier + if (LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &act_ded_eps_bearer_context_req->packet_flow_id); + act_ded_eps_bearer_context_req->packet_flow_id_present = true; + } else { + act_ded_eps_bearer_context_req->packet_flow_id_present = false; + } - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_ded_eps_bearer_context_req->protocol_cnfg_opts); + act_ded_eps_bearer_context_req->protocol_cnfg_opts_present = true; + } else { + act_ded_eps_bearer_context_req->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -8959,77 +8060,73 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_dedicated_eps_bearer_context_reques Document Reference: 24.301 v10.2.0 Section 8.3.4 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_accept_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_def_eps_bearer_context_accept, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_accept_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_def_eps_bearer_context_accept, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(act_def_eps_bearer_context_accept != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_def_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - *msg_ptr = act_def_eps_bearer_context_accept->proc_transaction_id; - msg_ptr++; + if (act_def_eps_bearer_context_accept != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_def_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT; - msg_ptr++; - - // Protocol Configuration Options - if(act_def_eps_bearer_context_accept->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); - } + // Procedure Transaction ID + *msg_ptr = act_def_eps_bearer_context_accept->proc_transaction_id; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT; + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (act_def_eps_bearer_context_accept->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *act_def_eps_bearer_context_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* act_def_eps_bearer_context_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_def_eps_bearer_context_accept != NULL) - { - // EPS Bearer ID - act_def_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - act_def_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && act_def_eps_bearer_context_accept != NULL) { + // EPS Bearer ID + act_def_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_def_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_accept->protocol_cnfg_opts); - act_def_eps_bearer_context_accept->protocol_cnfg_opts_present = true; - }else{ - act_def_eps_bearer_context_accept->protocol_cnfg_opts_present = false; - } + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_accept->protocol_cnfg_opts); + act_def_eps_bearer_context_accept->protocol_cnfg_opts_present = true; + } else { + act_def_eps_bearer_context_accept->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9040,83 +8137,79 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_accept_m Document Reference: 24.301 v10.2.0 Section 8.3.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_reject_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_def_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_reject_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_def_eps_bearer_context_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(act_def_eps_bearer_context_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_def_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (act_def_eps_bearer_context_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_def_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = act_def_eps_bearer_context_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = act_def_eps_bearer_context_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(act_def_eps_bearer_context_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(act_def_eps_bearer_context_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Cause + liblte_mme_pack_esm_cause_ie(act_def_eps_bearer_context_rej->esm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (act_def_eps_bearer_context_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *act_def_eps_bearer_context_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* act_def_eps_bearer_context_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_def_eps_bearer_context_rej != NULL) - { - // EPS Bearer ID - act_def_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - act_def_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && act_def_eps_bearer_context_rej != NULL) { + // EPS Bearer ID + act_def_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_def_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_def_eps_bearer_context_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_rej->protocol_cnfg_opts); - act_def_eps_bearer_context_rej->protocol_cnfg_opts_present = true; - }else{ - act_def_eps_bearer_context_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_def_eps_bearer_context_rej->esm_cause); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_rej->protocol_cnfg_opts); + act_def_eps_bearer_context_rej->protocol_cnfg_opts_present = true; + } else { + act_def_eps_bearer_context_rej->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9127,240 +8220,220 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_reject_m Document Reference: 24.301 v10.2.0 Section 8.3.6 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_request_msg(LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_def_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_activate_default_eps_bearer_context_request_msg( + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_def_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(act_def_eps_bearer_context_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (act_def_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (act_def_eps_bearer_context_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (act_def_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = act_def_eps_bearer_context_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = act_def_eps_bearer_context_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST; + msg_ptr++; - // EPS QoS - liblte_mme_pack_eps_quality_of_service_ie(&act_def_eps_bearer_context_req->eps_qos, &msg_ptr); + // EPS QoS + liblte_mme_pack_eps_quality_of_service_ie(&act_def_eps_bearer_context_req->eps_qos, &msg_ptr); - // Access Point Name - liblte_mme_pack_access_point_name_ie(&act_def_eps_bearer_context_req->apn, &msg_ptr); + // Access Point Name + liblte_mme_pack_access_point_name_ie(&act_def_eps_bearer_context_req->apn, &msg_ptr); - // PDN Address - liblte_mme_pack_pdn_address_ie(&act_def_eps_bearer_context_req->pdn_addr, &msg_ptr); + // PDN Address + liblte_mme_pack_pdn_address_ie(&act_def_eps_bearer_context_req->pdn_addr, &msg_ptr); - // Transaction Identifier - if(act_def_eps_bearer_context_req->transaction_id_present) - { - *msg_ptr = LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI; - msg_ptr++; - liblte_mme_pack_transaction_identifier_ie(&act_def_eps_bearer_context_req->transaction_id, &msg_ptr); - } + // Transaction Identifier + if (act_def_eps_bearer_context_req->transaction_id_present) { + *msg_ptr = LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI; + msg_ptr++; + liblte_mme_pack_transaction_identifier_ie(&act_def_eps_bearer_context_req->transaction_id, &msg_ptr); + } - // Negotiated QoS - if(act_def_eps_bearer_context_req->negotiated_qos_present) - { - *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; - msg_ptr++; - liblte_mme_pack_quality_of_service_ie(&act_def_eps_bearer_context_req->negotiated_qos, &msg_ptr); - } + // Negotiated QoS + if (act_def_eps_bearer_context_req->negotiated_qos_present) { + *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; + msg_ptr++; + liblte_mme_pack_quality_of_service_ie(&act_def_eps_bearer_context_req->negotiated_qos, &msg_ptr); + } - // Negotiated LLC SAPI - if(act_def_eps_bearer_context_req->llc_sapi_present) - { - *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; - msg_ptr++; - liblte_mme_pack_llc_service_access_point_identifier_ie(act_def_eps_bearer_context_req->llc_sapi, &msg_ptr); - } + // Negotiated LLC SAPI + if (act_def_eps_bearer_context_req->llc_sapi_present) { + *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; + msg_ptr++; + liblte_mme_pack_llc_service_access_point_identifier_ie(act_def_eps_bearer_context_req->llc_sapi, &msg_ptr); + } - // Radio Priority - if(act_def_eps_bearer_context_req->radio_prio_present) - { - *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; - liblte_mme_pack_radio_priority_ie(act_def_eps_bearer_context_req->radio_prio, 0, &msg_ptr); - msg_ptr++; - } + // Radio Priority + if (act_def_eps_bearer_context_req->radio_prio_present) { + *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; + liblte_mme_pack_radio_priority_ie(act_def_eps_bearer_context_req->radio_prio, 0, &msg_ptr); + msg_ptr++; + } - // Packet Flow Identifier - if(act_def_eps_bearer_context_req->packet_flow_id_present) - { - *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; - msg_ptr++; - liblte_mme_pack_packet_flow_identifier_ie(act_def_eps_bearer_context_req->packet_flow_id, &msg_ptr); - } + // Packet Flow Identifier + if (act_def_eps_bearer_context_req->packet_flow_id_present) { + *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; + msg_ptr++; + liblte_mme_pack_packet_flow_identifier_ie(act_def_eps_bearer_context_req->packet_flow_id, &msg_ptr); + } - // APN-AMBR - if(act_def_eps_bearer_context_req->apn_ambr_present) - { - *msg_ptr = LIBLTE_MME_APN_AMBR_IEI; - msg_ptr++; - liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(&act_def_eps_bearer_context_req->apn_ambr, &msg_ptr); - } + // APN-AMBR + if (act_def_eps_bearer_context_req->apn_ambr_present) { + *msg_ptr = LIBLTE_MME_APN_AMBR_IEI; + msg_ptr++; + liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(&act_def_eps_bearer_context_req->apn_ambr, &msg_ptr); + } - // ESM Cause - if(act_def_eps_bearer_context_req->esm_cause_present) - { - *msg_ptr = LIBLTE_MME_ESM_CAUSE_IEI; - msg_ptr++; - liblte_mme_pack_esm_cause_ie(act_def_eps_bearer_context_req->esm_cause, &msg_ptr); - } + // ESM Cause + if (act_def_eps_bearer_context_req->esm_cause_present) { + *msg_ptr = LIBLTE_MME_ESM_CAUSE_IEI; + msg_ptr++; + liblte_mme_pack_esm_cause_ie(act_def_eps_bearer_context_req->esm_cause, &msg_ptr); + } - // Protocol Configuration Options - if(act_def_eps_bearer_context_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); - } + // Protocol Configuration Options + if (act_def_eps_bearer_context_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&act_def_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); + } - // Connectivity Type - if(act_def_eps_bearer_context_req->connectivity_type_present) - { - *msg_ptr = LIBLTE_MME_CONNECTIVITY_TYPE_IEI << 4; - liblte_mme_pack_connectivity_type_ie(act_def_eps_bearer_context_req->connectivity_type, 0, &msg_ptr); - msg_ptr++; - } + // Connectivity Type + if (act_def_eps_bearer_context_req->connectivity_type_present) { + *msg_ptr = LIBLTE_MME_CONNECTIVITY_TYPE_IEI << 4; + liblte_mme_pack_connectivity_type_ie(act_def_eps_bearer_context_req->connectivity_type, 0, &msg_ptr); + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *act_def_eps_bearer_context_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* act_def_eps_bearer_context_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - act_def_eps_bearer_context_req != NULL) - { + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // EPS Bearer ID - act_def_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + if (msg != NULL && act_def_eps_bearer_context_req != NULL) { - // Procedure Transaction ID - act_def_eps_bearer_context_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + // EPS Bearer ID + act_def_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + act_def_eps_bearer_context_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // EPS QoS - liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &act_def_eps_bearer_context_req->eps_qos); + // Skip Message Type + msg_ptr++; - // Access Point Name - liblte_mme_unpack_access_point_name_ie(&msg_ptr, &act_def_eps_bearer_context_req->apn); + // EPS QoS + liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &act_def_eps_bearer_context_req->eps_qos); - // PDN Address - liblte_mme_unpack_pdn_address_ie(&msg_ptr, &act_def_eps_bearer_context_req->pdn_addr); + // Access Point Name + liblte_mme_unpack_access_point_name_ie(&msg_ptr, &act_def_eps_bearer_context_req->apn); - // Transaction Identifier - if(LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_transaction_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->transaction_id); - act_def_eps_bearer_context_req->transaction_id_present = true; - }else{ - act_def_eps_bearer_context_req->transaction_id_present = false; - } + // PDN Address + liblte_mme_unpack_pdn_address_ie(&msg_ptr, &act_def_eps_bearer_context_req->pdn_addr); - // Negotiated QoS - if(LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &act_def_eps_bearer_context_req->negotiated_qos); - act_def_eps_bearer_context_req->negotiated_qos_present = true; - }else{ - act_def_eps_bearer_context_req->negotiated_qos_present = false; - } + // Transaction Identifier + if (LIBLTE_MME_TRANSACTION_IDENTIFIER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_transaction_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->transaction_id); + act_def_eps_bearer_context_req->transaction_id_present = true; + } else { + act_def_eps_bearer_context_req->transaction_id_present = false; + } - // Negotiated LLC SAPI - if(LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->llc_sapi); - act_def_eps_bearer_context_req->llc_sapi_present = true; - }else{ - act_def_eps_bearer_context_req->llc_sapi_present = false; - } + // Negotiated QoS + if (LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &act_def_eps_bearer_context_req->negotiated_qos); + act_def_eps_bearer_context_req->negotiated_qos_present = true; + } else { + act_def_eps_bearer_context_req->negotiated_qos_present = false; + } - // Radio Priority - if((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &act_def_eps_bearer_context_req->radio_prio); - msg_ptr++; - act_def_eps_bearer_context_req->radio_prio_present = true; - }else{ - act_def_eps_bearer_context_req->radio_prio_present = false; - } + // Negotiated LLC SAPI + if (LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->llc_sapi); + act_def_eps_bearer_context_req->llc_sapi_present = true; + } else { + act_def_eps_bearer_context_req->llc_sapi_present = false; + } - // Packet Flow Identifier - if(LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->packet_flow_id); - act_def_eps_bearer_context_req->packet_flow_id_present = true; - }else{ - act_def_eps_bearer_context_req->packet_flow_id_present = false; - } + // Radio Priority + if ((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &act_def_eps_bearer_context_req->radio_prio); + msg_ptr++; + act_def_eps_bearer_context_req->radio_prio_present = true; + } else { + act_def_eps_bearer_context_req->radio_prio_present = false; + } - // APN-AMBR - if(LIBLTE_MME_APN_AMBR_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(&msg_ptr, &act_def_eps_bearer_context_req->apn_ambr); - act_def_eps_bearer_context_req->apn_ambr_present = true; - }else{ - act_def_eps_bearer_context_req->apn_ambr_present = false; - } + // Packet Flow Identifier + if (LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &act_def_eps_bearer_context_req->packet_flow_id); + act_def_eps_bearer_context_req->packet_flow_id_present = true; + } else { + act_def_eps_bearer_context_req->packet_flow_id_present = false; + } - // ESM Cause - if(LIBLTE_MME_ESM_CAUSE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_def_eps_bearer_context_req->esm_cause); - act_def_eps_bearer_context_req->esm_cause_present = true; - }else{ - act_def_eps_bearer_context_req->esm_cause_present = false; - } + // APN-AMBR + if (LIBLTE_MME_APN_AMBR_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(&msg_ptr, &act_def_eps_bearer_context_req->apn_ambr); + act_def_eps_bearer_context_req->apn_ambr_present = true; + } else { + act_def_eps_bearer_context_req->apn_ambr_present = false; + } - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_req->protocol_cnfg_opts); - act_def_eps_bearer_context_req->protocol_cnfg_opts_present = true; - }else{ - act_def_eps_bearer_context_req->protocol_cnfg_opts_present = false; - } + // ESM Cause + if (LIBLTE_MME_ESM_CAUSE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &act_def_eps_bearer_context_req->esm_cause); + act_def_eps_bearer_context_req->esm_cause_present = true; + } else { + act_def_eps_bearer_context_req->esm_cause_present = false; + } - // Connectivity Type - if((LIBLTE_MME_CONNECTIVITY_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_connectivity_type_ie(&msg_ptr, 0, &act_def_eps_bearer_context_req->connectivity_type); - msg_ptr++; - act_def_eps_bearer_context_req->connectivity_type_present = true; - }else{ - act_def_eps_bearer_context_req->connectivity_type_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &act_def_eps_bearer_context_req->protocol_cnfg_opts); + act_def_eps_bearer_context_req->protocol_cnfg_opts_present = true; + } else { + act_def_eps_bearer_context_req->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // Connectivity Type + if ((LIBLTE_MME_CONNECTIVITY_TYPE_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_connectivity_type_ie(&msg_ptr, 0, &act_def_eps_bearer_context_req->connectivity_type); + msg_ptr++; + act_def_eps_bearer_context_req->connectivity_type_present = true; + } else { + act_def_eps_bearer_context_req->connectivity_type_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9371,101 +8444,93 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_activate_default_eps_bearer_context_request_ Document Reference: 24.301 v10.2.0 Section 8.3.7 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg(LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT *bearer_res_alloc_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_reject_msg( + LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(bearer_res_alloc_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (bearer_res_alloc_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (bearer_res_alloc_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (bearer_res_alloc_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = bearer_res_alloc_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = bearer_res_alloc_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(bearer_res_alloc_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(bearer_res_alloc_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&bearer_res_alloc_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REJECT; + msg_ptr++; - // T3496 Value - if(bearer_res_alloc_rej->t3496_present) - { - *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_3_ie(&bearer_res_alloc_rej->t3496, &msg_ptr); - } + // ESM Cause + liblte_mme_pack_esm_cause_ie(bearer_res_alloc_rej->esm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Configuration Options + if (bearer_res_alloc_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&bearer_res_alloc_rej->protocol_cnfg_opts, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (bearer_res_alloc_rej->t3496_present) { + *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_3_ie(&bearer_res_alloc_rej->t3496, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT *bearer_res_alloc_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REJECT_MSG_STRUCT* bearer_res_alloc_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - bearer_res_alloc_rej != NULL) - { - // EPS Bearer ID - bearer_res_alloc_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - bearer_res_alloc_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && bearer_res_alloc_rej != NULL) { + // EPS Bearer ID + bearer_res_alloc_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + bearer_res_alloc_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_alloc_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_alloc_rej->protocol_cnfg_opts); - bearer_res_alloc_rej->protocol_cnfg_opts_present = true; - }else{ - bearer_res_alloc_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_alloc_rej->esm_cause); - // T3496 Value - if(LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &bearer_res_alloc_rej->t3496); - bearer_res_alloc_rej->t3496_present = true; - }else{ - bearer_res_alloc_rej->t3496_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_alloc_rej->protocol_cnfg_opts); + bearer_res_alloc_rej->protocol_cnfg_opts_present = true; + } else { + bearer_res_alloc_rej->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &bearer_res_alloc_rej->t3496); + bearer_res_alloc_rej->t3496_present = true; + } else { + bearer_res_alloc_rej->t3496_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9476,113 +8541,105 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_reject_msg(LIBLTE Document Reference: 24.301 v10.2.0 Section 8.3.8 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg(LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT *bearer_res_alloc_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_allocation_request_msg( + LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(bearer_res_alloc_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (bearer_res_alloc_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (bearer_res_alloc_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (bearer_res_alloc_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = bearer_res_alloc_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = bearer_res_alloc_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_ALLOCATION_REQUEST; + msg_ptr++; - // Linked EPS Bearer Identity & Spare Half Octet - liblte_mme_pack_linked_eps_bearer_identity_ie(bearer_res_alloc_req->linked_eps_bearer_id, 0, &msg_ptr); + // Linked EPS Bearer Identity & Spare Half Octet + liblte_mme_pack_linked_eps_bearer_identity_ie(bearer_res_alloc_req->linked_eps_bearer_id, 0, &msg_ptr); - // Traffic Flow Aggregate - liblte_mme_pack_traffic_flow_aggregate_description_ie(&bearer_res_alloc_req->tfa, &msg_ptr); + // Traffic Flow Aggregate + liblte_mme_pack_traffic_flow_aggregate_description_ie(&bearer_res_alloc_req->tfa, &msg_ptr); - // Required Traffic Flow QoS - liblte_mme_pack_eps_quality_of_service_ie(&bearer_res_alloc_req->req_tf_qos, &msg_ptr); + // Required Traffic Flow QoS + liblte_mme_pack_eps_quality_of_service_ie(&bearer_res_alloc_req->req_tf_qos, &msg_ptr); - // Protocol Configuration Options - if(bearer_res_alloc_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&bearer_res_alloc_req->protocol_cnfg_opts, &msg_ptr); - } + // Protocol Configuration Options + if (bearer_res_alloc_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&bearer_res_alloc_req->protocol_cnfg_opts, &msg_ptr); + } - // Device Properties - if(bearer_res_alloc_req->device_properties_present) - { - *msg_ptr = LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_DEVICE_PROPERTIES_IEI << 4; - liblte_mme_pack_device_properties_ie(bearer_res_alloc_req->device_properties, 0, &msg_ptr); - msg_ptr++; - } + // Device Properties + if (bearer_res_alloc_req->device_properties_present) { + *msg_ptr = LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_DEVICE_PROPERTIES_IEI << 4; + liblte_mme_pack_device_properties_ie(bearer_res_alloc_req->device_properties, 0, &msg_ptr); + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT *bearer_res_alloc_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_MSG_STRUCT* bearer_res_alloc_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - bearer_res_alloc_req != NULL) - { - // EPS Bearer ID - bearer_res_alloc_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - bearer_res_alloc_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && bearer_res_alloc_req != NULL) { + // EPS Bearer ID + bearer_res_alloc_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + bearer_res_alloc_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Linked EPS Bearer Identity & Spare Half Octet - liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &bearer_res_alloc_req->linked_eps_bearer_id); + // Skip Message Type + msg_ptr++; - // Traffic Flow Aggregate - liblte_mme_unpack_traffic_flow_aggregate_description_ie(&msg_ptr, &bearer_res_alloc_req->tfa); + // Linked EPS Bearer Identity & Spare Half Octet + liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &bearer_res_alloc_req->linked_eps_bearer_id); - // Required Traffic Flow QoS - liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &bearer_res_alloc_req->req_tf_qos); + // Traffic Flow Aggregate + liblte_mme_unpack_traffic_flow_aggregate_description_ie(&msg_ptr, &bearer_res_alloc_req->tfa); - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_alloc_req->protocol_cnfg_opts); - bearer_res_alloc_req->protocol_cnfg_opts_present = true; - }else{ - bearer_res_alloc_req->protocol_cnfg_opts_present = false; - } + // Required Traffic Flow QoS + liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &bearer_res_alloc_req->req_tf_qos); - // Device Properties - if((LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_DEVICE_PROPERTIES_IEI << 4) == *msg_ptr) - { - liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &bearer_res_alloc_req->device_properties); - msg_ptr++; - bearer_res_alloc_req->device_properties_present = true; - }else{ - bearer_res_alloc_req->device_properties_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_alloc_req->protocol_cnfg_opts); + bearer_res_alloc_req->protocol_cnfg_opts_present = true; + } else { + bearer_res_alloc_req->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // Device Properties + if ((LIBLTE_MME_BEARER_RESOURCE_ALLOCATION_REQUEST_DEVICE_PROPERTIES_IEI << 4) == *msg_ptr) { + liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &bearer_res_alloc_req->device_properties); + msg_ptr++; + bearer_res_alloc_req->device_properties_present = true; + } else { + bearer_res_alloc_req->device_properties_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9593,101 +8650,93 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_allocation_request_msg(LIBLT Document Reference: 24.301 v10.2.0 Section 8.3.9 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg(LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT *bearer_res_mod_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_reject_msg( + LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(bearer_res_mod_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (bearer_res_mod_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (bearer_res_mod_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (bearer_res_mod_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = bearer_res_mod_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = bearer_res_mod_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(bearer_res_mod_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(bearer_res_mod_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&bearer_res_mod_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REJECT; + msg_ptr++; - // T3496 Value - if(bearer_res_mod_rej->t3496_present) - { - *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_3_ie(&bearer_res_mod_rej->t3496, &msg_ptr); - } + // ESM Cause + liblte_mme_pack_esm_cause_ie(bearer_res_mod_rej->esm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Configuration Options + if (bearer_res_mod_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&bearer_res_mod_rej->protocol_cnfg_opts, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (bearer_res_mod_rej->t3496_present) { + *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_3_ie(&bearer_res_mod_rej->t3496, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT *bearer_res_mod_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REJECT_MSG_STRUCT* bearer_res_mod_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - bearer_res_mod_rej != NULL) - { - // EPS Bearer ID - bearer_res_mod_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - bearer_res_mod_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && bearer_res_mod_rej != NULL) { + // EPS Bearer ID + bearer_res_mod_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + bearer_res_mod_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_mod_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_mod_rej->protocol_cnfg_opts); - bearer_res_mod_rej->protocol_cnfg_opts_present = true; - }else{ - bearer_res_mod_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_mod_rej->esm_cause); - // T3496 Value - if(LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &bearer_res_mod_rej->t3496); - bearer_res_mod_rej->t3496_present = true; - }else{ - bearer_res_mod_rej->t3496_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_mod_rej->protocol_cnfg_opts); + bearer_res_mod_rej->protocol_cnfg_opts_present = true; + } else { + bearer_res_mod_rej->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &bearer_res_mod_rej->t3496); + bearer_res_mod_rej->t3496_present = true; + } else { + bearer_res_mod_rej->t3496_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9698,143 +8747,131 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_reject_msg(LIBL Document Reference: 24.301 v10.2.0 Section 8.3.10 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg(LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT *bearer_res_mod_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_bearer_resource_modification_request_msg( + LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(bearer_res_mod_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (bearer_res_mod_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (bearer_res_mod_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (bearer_res_mod_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = bearer_res_mod_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = bearer_res_mod_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_BEARER_RESOURCE_MODIFICATION_REQUEST; + msg_ptr++; - // EPS Bearer Identity For Packet Filter & Spare Half Octet - liblte_mme_pack_linked_eps_bearer_identity_ie(bearer_res_mod_req->eps_bearer_id_for_packet_filter, 0, &msg_ptr); + // EPS Bearer Identity For Packet Filter & Spare Half Octet + liblte_mme_pack_linked_eps_bearer_identity_ie(bearer_res_mod_req->eps_bearer_id_for_packet_filter, 0, &msg_ptr); - // Traffic Flow Aggregate - liblte_mme_pack_traffic_flow_aggregate_description_ie(&bearer_res_mod_req->tfa, &msg_ptr); + // Traffic Flow Aggregate + liblte_mme_pack_traffic_flow_aggregate_description_ie(&bearer_res_mod_req->tfa, &msg_ptr); - // Required Traffic Flow QoS - if(bearer_res_mod_req->req_tf_qos_present) - { - *msg_ptr = LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI; - msg_ptr++; - liblte_mme_pack_eps_quality_of_service_ie(&bearer_res_mod_req->req_tf_qos, &msg_ptr); - } + // Required Traffic Flow QoS + if (bearer_res_mod_req->req_tf_qos_present) { + *msg_ptr = LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI; + msg_ptr++; + liblte_mme_pack_eps_quality_of_service_ie(&bearer_res_mod_req->req_tf_qos, &msg_ptr); + } - // ESM Cause - if(bearer_res_mod_req->esm_cause_present) - { - *msg_ptr = LIBLTE_MME_ESM_CAUSE_IEI; - msg_ptr++; - liblte_mme_pack_esm_cause_ie(bearer_res_mod_req->esm_cause, &msg_ptr); - } + // ESM Cause + if (bearer_res_mod_req->esm_cause_present) { + *msg_ptr = LIBLTE_MME_ESM_CAUSE_IEI; + msg_ptr++; + liblte_mme_pack_esm_cause_ie(bearer_res_mod_req->esm_cause, &msg_ptr); + } - // Protocol Configuration Options - if(bearer_res_mod_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&bearer_res_mod_req->protocol_cnfg_opts, &msg_ptr); - } + // Protocol Configuration Options + if (bearer_res_mod_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&bearer_res_mod_req->protocol_cnfg_opts, &msg_ptr); + } - // Device Properties - if(bearer_res_mod_req->device_properties_present) - { - *msg_ptr = LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_DEVICE_PROPERTIES_IEI << 4; - liblte_mme_pack_device_properties_ie(bearer_res_mod_req->device_properties, 0, &msg_ptr); - msg_ptr++; - } + // Device Properties + if (bearer_res_mod_req->device_properties_present) { + *msg_ptr = LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_DEVICE_PROPERTIES_IEI << 4; + liblte_mme_pack_device_properties_ie(bearer_res_mod_req->device_properties, 0, &msg_ptr); + msg_ptr++; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT *bearer_res_mod_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_bearer_resource_modification_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_MSG_STRUCT* bearer_res_mod_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - bearer_res_mod_req != NULL) - { - // EPS Bearer ID - bearer_res_mod_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - bearer_res_mod_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && bearer_res_mod_req != NULL) { + // EPS Bearer ID + bearer_res_mod_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + bearer_res_mod_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // EPS Bearer Identity For Packet Filter & Spare Half Octet - liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &bearer_res_mod_req->eps_bearer_id_for_packet_filter); + // Skip Message Type + msg_ptr++; - // Traffic Flow Aggregate - liblte_mme_unpack_traffic_flow_aggregate_description_ie(&msg_ptr, &bearer_res_mod_req->tfa); + // EPS Bearer Identity For Packet Filter & Spare Half Octet + liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &bearer_res_mod_req->eps_bearer_id_for_packet_filter); - // Required Traffic Flow QoS - if(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &bearer_res_mod_req->req_tf_qos); - bearer_res_mod_req->req_tf_qos_present = true; - }else{ - bearer_res_mod_req->req_tf_qos_present = false; - } + // Traffic Flow Aggregate + liblte_mme_unpack_traffic_flow_aggregate_description_ie(&msg_ptr, &bearer_res_mod_req->tfa); - // ESM Cause - if(LIBLTE_MME_ESM_CAUSE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_mod_req->esm_cause); - bearer_res_mod_req->esm_cause_present = true; - }else{ - bearer_res_mod_req->esm_cause_present = false; - } + // Required Traffic Flow QoS + if (LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &bearer_res_mod_req->req_tf_qos); + bearer_res_mod_req->req_tf_qos_present = true; + } else { + bearer_res_mod_req->req_tf_qos_present = false; + } - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_mod_req->protocol_cnfg_opts); - bearer_res_mod_req->protocol_cnfg_opts_present = true; - }else{ - bearer_res_mod_req->protocol_cnfg_opts_present = false; - } + // ESM Cause + if (LIBLTE_MME_ESM_CAUSE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &bearer_res_mod_req->esm_cause); + bearer_res_mod_req->esm_cause_present = true; + } else { + bearer_res_mod_req->esm_cause_present = false; + } - // Device Properties - if((LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_DEVICE_PROPERTIES_IEI << 4) == *msg_ptr) - { - liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &bearer_res_mod_req->device_properties); - msg_ptr++; - bearer_res_mod_req->device_properties_present = true; - }else{ - bearer_res_mod_req->device_properties_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &bearer_res_mod_req->protocol_cnfg_opts); + bearer_res_mod_req->protocol_cnfg_opts_present = true; + } else { + bearer_res_mod_req->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // Device Properties + if ((LIBLTE_MME_BEARER_RESOURCE_MODIFICATION_REQUEST_DEVICE_PROPERTIES_IEI << 4) == *msg_ptr) { + liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &bearer_res_mod_req->device_properties); + msg_ptr++; + bearer_res_mod_req->device_properties_present = true; + } else { + bearer_res_mod_req->device_properties_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9896,40 +8933,38 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_accept_msg( return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *deact_eps_bearer_context_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* deact_eps_bearer_context_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - deact_eps_bearer_context_accept != NULL) - { - // EPS Bearer ID - deact_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - deact_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && deact_eps_bearer_context_accept != NULL) { + // EPS Bearer ID + deact_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + deact_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &deact_eps_bearer_context_accept->protocol_cnfg_opts); - deact_eps_bearer_context_accept->protocol_cnfg_opts_present = true; - }else{ - deact_eps_bearer_context_accept->protocol_cnfg_opts_present = false; - } + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &deact_eps_bearer_context_accept->protocol_cnfg_opts); + deact_eps_bearer_context_accept->protocol_cnfg_opts_present = true; + } else { + deact_eps_bearer_context_accept->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -9940,92 +8975,87 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_accept_msg(LIB Document Reference: 24.301 v10.2.0 Section 8.3.12 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg(LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *deact_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_deactivate_eps_bearer_context_request_msg( + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(deact_eps_bearer_context_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (deact_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (deact_eps_bearer_context_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (deact_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = deact_eps_bearer_context_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = deact_eps_bearer_context_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(deact_eps_bearer_context_req->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(deact_eps_bearer_context_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&deact_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Cause + liblte_mme_pack_esm_cause_ie(deact_eps_bearer_context_req->esm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (deact_eps_bearer_context_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&deact_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *deact_eps_bearer_context_req) +LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* deact_eps_bearer_context_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - deact_eps_bearer_context_req != NULL) - { - // Security Header Type - uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 6; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // EPS Bearer ID - deact_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + if (msg != NULL && deact_eps_bearer_context_req != NULL) { + // Security Header Type + uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 6; + } - // Procedure Transaction ID - deact_eps_bearer_context_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + // EPS Bearer ID + deact_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + deact_eps_bearer_context_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &deact_eps_bearer_context_req->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &deact_eps_bearer_context_req->protocol_cnfg_opts); - deact_eps_bearer_context_req->protocol_cnfg_opts_present = true; - }else{ - deact_eps_bearer_context_req->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &deact_eps_bearer_context_req->esm_cause); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &deact_eps_bearer_context_req->protocol_cnfg_opts); + deact_eps_bearer_context_req->protocol_cnfg_opts_present = true; + } else { + deact_eps_bearer_context_req->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10034,58 +9064,55 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_deactivate_eps_bearer_context_request_msg(LI Description: Sent by the network to the UE to request the UE to provide ESM information, i.e. protocol configuration options or APN or both. This function is being added - to support encryption and integrety protection on + to support encryption and integrety protection on ESM information transfer. Document Reference: 24.301 v10.2.0 Section 8.3.13 *********************************************************************/ -LIBLTE_ERROR_ENUM srslte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM +srslte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(esm_info_req != NULL && - msg != NULL) - { + if (esm_info_req != NULL && msg != NULL) { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // MAC will be filled in later - msg_ptr += 4; + // MAC will be filled in later + msg_ptr += 4; - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (esm_info_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (esm_info_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = esm_info_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = esm_info_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } - /********************************************************************* Message Name: ESM Information Request @@ -10095,72 +9122,68 @@ LIBLTE_ERROR_ENUM srslte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INF Document Reference: 24.301 v10.2.0 Section 8.3.13 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_mme_pack_esm_information_request_msg(LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(esm_info_req != NULL && - msg != NULL) - { - - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (esm_info_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - *msg_ptr = esm_info_req->proc_transaction_id; - msg_ptr++; + if (esm_info_req != NULL && msg != NULL) { - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST; - msg_ptr++; + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (esm_info_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Procedure Transaction ID + *msg_ptr = esm_info_req->proc_transaction_id; + msg_ptr++; - err = LIBLTE_SUCCESS; - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_REQUEST; + msg_ptr++; - return(err); -} + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + err = LIBLTE_SUCCESS; + } + return (err); +} -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT *esm_info_req) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT* esm_info_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - esm_info_req != NULL) - { - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { - msg_ptr++; - } else{ - msg_ptr += 6; - } + if (msg != NULL && esm_info_req != NULL) { + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 6; + } - // EPS Bearer ID - esm_info_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + // EPS Bearer ID + esm_info_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Procedure Transaction ID - esm_info_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + // Procedure Transaction ID + esm_info_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -10172,169 +9195,157 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_request_msg(LIBLTE_BYTE_MSG_ Document Reference: 24.301 v10.2.0 Section 8.3.14 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(esm_info_resp != NULL && - msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; - - // MAC will be filled in later - msg_ptr += 4; - - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } +LIBLTE_ERROR_ENUM +liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (esm_info_resp->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (esm_info_resp != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = esm_info_resp->proc_transaction_id; - msg_ptr++; + // MAC will be filled in later + msg_ptr += 4; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_RESPONSE; - msg_ptr++; - - // Access Point Name - if(esm_info_resp->apn_present) - { - *msg_ptr = LIBLTE_MME_ACCESS_POINT_NAME_IEI; - msg_ptr++; - liblte_mme_pack_access_point_name_ie(&esm_info_resp->apn, &msg_ptr); - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Protocol Configuration Options - if(esm_info_resp->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&esm_info_resp->protocol_cnfg_opts, &msg_ptr); - } + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (esm_info_resp->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; + + // Procedure Transaction ID + *msg_ptr = esm_info_resp->proc_transaction_id; + msg_ptr++; + + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_RESPONSE; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Access Point Name + if (esm_info_resp->apn_present) { + *msg_ptr = LIBLTE_MME_ACCESS_POINT_NAME_IEI; + msg_ptr++; + liblte_mme_pack_access_point_name_ie(&esm_info_resp->apn, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (esm_info_resp->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&esm_info_resp->protocol_cnfg_opts, &msg_ptr); } - return(err); -} + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + return (err); +} -LIBLTE_ERROR_ENUM srslte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp) +LIBLTE_ERROR_ENUM +srslte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - uint8 sec_hdr_type; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; + uint8 sec_hdr_type; - if(msg != NULL && - esm_info_resp != NULL) - { - - // Security Header Type - sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 6; - } - // EPS Bearer ID - esm_info_resp->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; - - // Procedure Transaction ID - esm_info_resp->proc_transaction_id = *msg_ptr; - msg_ptr++; - - // Skip Message Type - msg_ptr++; - - // Access Point Name - if(LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_access_point_name_ie(&msg_ptr, &esm_info_resp->apn); - esm_info_resp->apn_present = true; - }else{ - esm_info_resp->apn_present = false; - } + if (msg != NULL && esm_info_resp != NULL) { - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &esm_info_resp->protocol_cnfg_opts); - esm_info_resp->protocol_cnfg_opts_present = true; - }else{ - esm_info_resp->protocol_cnfg_opts_present = false; - } + // Security Header Type + sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 6; + } + // EPS Bearer ID + esm_info_resp->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; + + // Procedure Transaction ID + esm_info_resp->proc_transaction_id = *msg_ptr; + msg_ptr++; + + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // Access Point Name + if (LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_access_point_name_ie(&msg_ptr, &esm_info_resp->apn); + esm_info_resp->apn_present = true; + } else { + esm_info_resp->apn_present = false; + } + + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &esm_info_resp->protocol_cnfg_opts); + esm_info_resp->protocol_cnfg_opts_present = true; + } else { + esm_info_resp->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT* esm_info_resp) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - esm_info_resp != NULL) - { - // EPS Bearer ID - esm_info_resp->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - esm_info_resp->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && esm_info_resp != NULL) { + // EPS Bearer ID + esm_info_resp->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + esm_info_resp->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Access Point Name - if(LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_access_point_name_ie(&msg_ptr, &esm_info_resp->apn); - esm_info_resp->apn_present = true; - }else{ - esm_info_resp->apn_present = false; - } + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &esm_info_resp->protocol_cnfg_opts); - esm_info_resp->protocol_cnfg_opts_present = true; - }else{ - esm_info_resp->protocol_cnfg_opts_present = false; - } + // Access Point Name + if (LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_access_point_name_ie(&msg_ptr, &esm_info_resp->apn); + esm_info_resp->apn_present = true; + } else { + esm_info_resp->apn_present = false; + } - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &esm_info_resp->protocol_cnfg_opts); + esm_info_resp->protocol_cnfg_opts_present = true; + } else { + esm_info_resp->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10346,65 +9357,61 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG Document Reference: 24.301 v10.2.0 Section 8.3.15 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_esm_status_msg(LIBLTE_MME_ESM_STATUS_MSG_STRUCT *esm_status, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_esm_status_msg(LIBLTE_MME_ESM_STATUS_MSG_STRUCT* esm_status, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(esm_status != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (esm_status->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (esm_status != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (esm_status->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = esm_status->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = esm_status->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_STATUS; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ESM_STATUS; + msg_ptr++; - // ESM Cause - liblte_mme_pack_esm_cause_ie(esm_status->esm_cause, &msg_ptr); + // ESM Cause + liblte_mme_pack_esm_cause_ie(esm_status->esm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_ESM_STATUS_MSG_STRUCT *esm_status) +LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_ESM_STATUS_MSG_STRUCT* esm_status) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(msg != NULL && - esm_status != NULL) - { - // EPS Bearer ID - esm_status->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + if (msg != NULL && esm_status != NULL) { + // EPS Bearer ID + esm_status->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Procedure Transaction ID - esm_status->proc_transaction_id = *msg_ptr; - msg_ptr++; + // Procedure Transaction ID + esm_status->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &esm_status->esm_cause); + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &esm_status->esm_cause); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -10415,92 +9422,87 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_status_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.3.16 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_accept_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *mod_eps_bearer_context_accept, - uint8 sec_hdr_type, - uint32 count, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_accept_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept, + uint8 sec_hdr_type, + uint32 count, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(mod_eps_bearer_context_accept != NULL && - msg != NULL) - { - if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // MAC will be filled in later - msg_ptr += 4; + if (mod_eps_bearer_context_accept != NULL && msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + // MAC will be filled in later + msg_ptr += 4; - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (mod_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Procedure Transaction ID - *msg_ptr = mod_eps_bearer_context_accept->proc_transaction_id; - msg_ptr++; + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (mod_eps_bearer_context_accept->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_ACCEPT; - msg_ptr++; - - // Protocol Configuration Options - if(mod_eps_bearer_context_accept->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); - } + // Procedure Transaction ID + *msg_ptr = mod_eps_bearer_context_accept->proc_transaction_id; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_ACCEPT; + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (mod_eps_bearer_context_accept->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_accept->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT *mod_eps_bearer_context_accept) +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT* mod_eps_bearer_context_accept) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - mod_eps_bearer_context_accept != NULL) - { - // EPS Bearer ID - mod_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - mod_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && mod_eps_bearer_context_accept != NULL) { + // EPS Bearer ID + mod_eps_bearer_context_accept->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + mod_eps_bearer_context_accept->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_accept->protocol_cnfg_opts); - mod_eps_bearer_context_accept->protocol_cnfg_opts_present = true; - }else{ - mod_eps_bearer_context_accept->protocol_cnfg_opts_present = false; - } + // Skip Message Type + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_accept->protocol_cnfg_opts); + mod_eps_bearer_context_accept->protocol_cnfg_opts_present = true; + } else { + mod_eps_bearer_context_accept->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10511,83 +9513,77 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_accept_msg(LIBLTE_ Document Reference: 24.301 v10.2.0 Section 8.3.17 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *mod_eps_bearer_context_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_reject_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(mod_eps_bearer_context_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (mod_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (mod_eps_bearer_context_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (mod_eps_bearer_context_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = mod_eps_bearer_context_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = mod_eps_bearer_context_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(mod_eps_bearer_context_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(mod_eps_bearer_context_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Cause + liblte_mme_pack_esm_cause_ie(mod_eps_bearer_context_rej->esm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (mod_eps_bearer_context_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_rej->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT *mod_eps_bearer_context_rej) +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REJECT_MSG_STRUCT* mod_eps_bearer_context_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - mod_eps_bearer_context_rej != NULL) - { - // EPS Bearer ID - mod_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - mod_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && mod_eps_bearer_context_rej != NULL) { + // EPS Bearer ID + mod_eps_bearer_context_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + mod_eps_bearer_context_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &mod_eps_bearer_context_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_rej->protocol_cnfg_opts); - mod_eps_bearer_context_rej->protocol_cnfg_opts_present = true; - }else{ - mod_eps_bearer_context_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &mod_eps_bearer_context_rej->esm_cause); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_rej->protocol_cnfg_opts); + mod_eps_bearer_context_rej->protocol_cnfg_opts_present = true; + } else { + mod_eps_bearer_context_rej->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10598,212 +9594,192 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_reject_msg(LIBLTE_ Document Reference: 24.301 v10.2.0 Section 8.3.18 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg(LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *mod_eps_bearer_context_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_modify_eps_bearer_context_request_msg( + LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(mod_eps_bearer_context_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (mod_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (mod_eps_bearer_context_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (mod_eps_bearer_context_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = mod_eps_bearer_context_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = mod_eps_bearer_context_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REQUEST; - msg_ptr++; - - // New EPS QoS - if(mod_eps_bearer_context_req->new_eps_qos_present) - { - *msg_ptr = LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI; - msg_ptr++; - liblte_mme_pack_eps_quality_of_service_ie(&mod_eps_bearer_context_req->new_eps_qos, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_MODIFY_EPS_BEARER_CONTEXT_REQUEST; + msg_ptr++; - // TFT - if(mod_eps_bearer_context_req->tft_present) - { - *msg_ptr = LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_IEI; - msg_ptr++; - liblte_mme_pack_traffic_flow_template_ie(&mod_eps_bearer_context_req->tft, &msg_ptr); - } + // New EPS QoS + if (mod_eps_bearer_context_req->new_eps_qos_present) { + *msg_ptr = LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI; + msg_ptr++; + liblte_mme_pack_eps_quality_of_service_ie(&mod_eps_bearer_context_req->new_eps_qos, &msg_ptr); + } - // New QoS - if(mod_eps_bearer_context_req->new_qos_present) - { - *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; - msg_ptr++; - liblte_mme_pack_quality_of_service_ie(&mod_eps_bearer_context_req->new_qos, &msg_ptr); - } + // TFT + if (mod_eps_bearer_context_req->tft_present) { + *msg_ptr = LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_IEI; + msg_ptr++; + liblte_mme_pack_traffic_flow_template_ie(&mod_eps_bearer_context_req->tft, &msg_ptr); + } - // Negotiated LLC SAPI - if(mod_eps_bearer_context_req->negotiated_llc_sapi_present) - { - *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; - msg_ptr++; - liblte_mme_pack_llc_service_access_point_identifier_ie(mod_eps_bearer_context_req->negotiated_llc_sapi, &msg_ptr); - } + // New QoS + if (mod_eps_bearer_context_req->new_qos_present) { + *msg_ptr = LIBLTE_MME_QUALITY_OF_SERVICE_IEI; + msg_ptr++; + liblte_mme_pack_quality_of_service_ie(&mod_eps_bearer_context_req->new_qos, &msg_ptr); + } - // Radio Priority - if(mod_eps_bearer_context_req->radio_prio_present) - { - *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; - liblte_mme_pack_radio_priority_ie(mod_eps_bearer_context_req->radio_prio, 0, &msg_ptr); - msg_ptr++; - } + // Negotiated LLC SAPI + if (mod_eps_bearer_context_req->negotiated_llc_sapi_present) { + *msg_ptr = LIBLTE_MME_LLC_SAPI_IEI; + msg_ptr++; + liblte_mme_pack_llc_service_access_point_identifier_ie(mod_eps_bearer_context_req->negotiated_llc_sapi, &msg_ptr); + } - // Packet Flow Identifier - if(mod_eps_bearer_context_req->packet_flow_id_present) - { - *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; - msg_ptr++; - liblte_mme_pack_packet_flow_identifier_ie(mod_eps_bearer_context_req->packet_flow_id, &msg_ptr); - } + // Radio Priority + if (mod_eps_bearer_context_req->radio_prio_present) { + *msg_ptr = LIBLTE_MME_RADIO_PRIORITY_IEI << 4; + liblte_mme_pack_radio_priority_ie(mod_eps_bearer_context_req->radio_prio, 0, &msg_ptr); + msg_ptr++; + } - // APN-AMBR - if(mod_eps_bearer_context_req->apn_ambr_present) - { - *msg_ptr = LIBLTE_MME_APN_AMBR_IEI; - msg_ptr++; - liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(&mod_eps_bearer_context_req->apn_ambr, &msg_ptr); - } + // Packet Flow Identifier + if (mod_eps_bearer_context_req->packet_flow_id_present) { + *msg_ptr = LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI; + msg_ptr++; + liblte_mme_pack_packet_flow_identifier_ie(mod_eps_bearer_context_req->packet_flow_id, &msg_ptr); + } - // Protocol Configuration Options - if(mod_eps_bearer_context_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); - } + // APN-AMBR + if (mod_eps_bearer_context_req->apn_ambr_present) { + *msg_ptr = LIBLTE_MME_APN_AMBR_IEI; + msg_ptr++; + liblte_mme_pack_apn_aggregate_maximum_bit_rate_ie(&mod_eps_bearer_context_req->apn_ambr, &msg_ptr); + } + + // Protocol Configuration Options + if (mod_eps_bearer_context_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&mod_eps_bearer_context_req->protocol_cnfg_opts, &msg_ptr); + } + + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + return (err); +} +LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg( + LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT* mod_eps_bearer_context_req) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - err = LIBLTE_SUCCESS; + if (msg != NULL && mod_eps_bearer_context_req != NULL) { + // Security Header Type + uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) { + msg_ptr++; + } else { + msg_ptr += 6; } - return(err); -} -LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_MODIFY_EPS_BEARER_CONTEXT_REQUEST_MSG_STRUCT *mod_eps_bearer_context_req) -{ - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + // EPS Bearer ID + mod_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - if(msg != NULL && - mod_eps_bearer_context_req != NULL) - { - // Security Header Type - uint8_t sec_hdr_type = (msg->msg[0] & 0xF0) >> 4; - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS == sec_hdr_type) - { - msg_ptr++; - }else{ - msg_ptr += 6; - } - - // EPS Bearer ID - mod_eps_bearer_context_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; - - // Procedure Transaction ID - mod_eps_bearer_context_req->proc_transaction_id = *msg_ptr; - msg_ptr++; - - // Skip Message Type - msg_ptr++; - - // New EPS QoS - if(LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &mod_eps_bearer_context_req->new_eps_qos); - mod_eps_bearer_context_req->new_eps_qos_present = true; - }else{ - mod_eps_bearer_context_req->new_eps_qos_present = false; - } + // Procedure Transaction ID + mod_eps_bearer_context_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // TFT - if(LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_traffic_flow_template_ie(&msg_ptr, &mod_eps_bearer_context_req->tft); - mod_eps_bearer_context_req->tft_present = true; - }else{ - mod_eps_bearer_context_req->tft_present = false; - } + // Skip Message Type + msg_ptr++; - // New QoS - if(LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &mod_eps_bearer_context_req->new_qos); - mod_eps_bearer_context_req->new_qos_present = true; - }else{ - mod_eps_bearer_context_req->new_qos_present = false; - } + // New EPS QoS + if (LIBLTE_MME_EPS_QUALITY_OF_SERVICE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_eps_quality_of_service_ie(&msg_ptr, &mod_eps_bearer_context_req->new_eps_qos); + mod_eps_bearer_context_req->new_eps_qos_present = true; + } else { + mod_eps_bearer_context_req->new_eps_qos_present = false; + } - // Negotiated LLC SAPI - if(LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, &mod_eps_bearer_context_req->negotiated_llc_sapi); - mod_eps_bearer_context_req->negotiated_llc_sapi_present = true; - }else{ - mod_eps_bearer_context_req->negotiated_llc_sapi_present = false; - } + // TFT + if (LIBLTE_MME_TRAFFIC_FLOW_TEMPLATE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_traffic_flow_template_ie(&msg_ptr, &mod_eps_bearer_context_req->tft); + mod_eps_bearer_context_req->tft_present = true; + } else { + mod_eps_bearer_context_req->tft_present = false; + } - // Radio Priority - if((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == *msg_ptr) - { - liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &mod_eps_bearer_context_req->radio_prio); - msg_ptr++; - mod_eps_bearer_context_req->radio_prio_present = true; - }else{ - mod_eps_bearer_context_req->radio_prio_present = false; - } + // New QoS + if (LIBLTE_MME_QUALITY_OF_SERVICE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_quality_of_service_ie(&msg_ptr, &mod_eps_bearer_context_req->new_qos); + mod_eps_bearer_context_req->new_qos_present = true; + } else { + mod_eps_bearer_context_req->new_qos_present = false; + } - // Packet Flow Identifier - if(LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &mod_eps_bearer_context_req->packet_flow_id); - mod_eps_bearer_context_req->packet_flow_id_present = true; - }else{ - mod_eps_bearer_context_req->packet_flow_id_present = false; - } + // Negotiated LLC SAPI + if (LIBLTE_MME_LLC_SAPI_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_llc_service_access_point_identifier_ie(&msg_ptr, + &mod_eps_bearer_context_req->negotiated_llc_sapi); + mod_eps_bearer_context_req->negotiated_llc_sapi_present = true; + } else { + mod_eps_bearer_context_req->negotiated_llc_sapi_present = false; + } - // APN-AMBR - if(LIBLTE_MME_APN_AMBR_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(&msg_ptr, &mod_eps_bearer_context_req->apn_ambr); - mod_eps_bearer_context_req->apn_ambr_present = true; - }else{ - mod_eps_bearer_context_req->apn_ambr_present = false; - } + // Radio Priority + if ((LIBLTE_MME_RADIO_PRIORITY_IEI << 4) == *msg_ptr) { + liblte_mme_unpack_radio_priority_ie(&msg_ptr, 0, &mod_eps_bearer_context_req->radio_prio); + msg_ptr++; + mod_eps_bearer_context_req->radio_prio_present = true; + } else { + mod_eps_bearer_context_req->radio_prio_present = false; + } - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_req->protocol_cnfg_opts); - mod_eps_bearer_context_req->protocol_cnfg_opts_present = true; - }else{ - mod_eps_bearer_context_req->protocol_cnfg_opts_present = false; - } + // Packet Flow Identifier + if (LIBLTE_MME_PACKET_FLOW_IDENTIFIER_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_packet_flow_identifier_ie(&msg_ptr, &mod_eps_bearer_context_req->packet_flow_id); + mod_eps_bearer_context_req->packet_flow_id_present = true; + } else { + mod_eps_bearer_context_req->packet_flow_id_present = false; + } + + // APN-AMBR + if (LIBLTE_MME_APN_AMBR_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_apn_aggregate_maximum_bit_rate_ie(&msg_ptr, &mod_eps_bearer_context_req->apn_ambr); + mod_eps_bearer_context_req->apn_ambr_present = true; + } else { + mod_eps_bearer_context_req->apn_ambr_present = false; + } - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &mod_eps_bearer_context_req->protocol_cnfg_opts); + mod_eps_bearer_context_req->protocol_cnfg_opts_present = true; + } else { + mod_eps_bearer_context_req->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10816,65 +9792,61 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_modify_eps_bearer_context_request_msg(LIBLTE Document Reference: 24.301 v10.2.0 Section 8.3.18A *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_notification_msg(LIBLTE_MME_NOTIFICATION_MSG_STRUCT *notification, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_notification_msg(LIBLTE_MME_NOTIFICATION_MSG_STRUCT* notification, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(notification != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (notification->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (notification != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (notification->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = notification->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = notification->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_NOTIFICATION; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_NOTIFICATION; + msg_ptr++; - // Notification Indicator - liblte_mme_pack_notification_indicator_ie(notification->notification_ind, &msg_ptr); + // Notification Indicator + liblte_mme_pack_notification_indicator_ie(notification->notification_ind, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_NOTIFICATION_MSG_STRUCT *notification) +LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_NOTIFICATION_MSG_STRUCT* notification) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(msg != NULL && - notification != NULL) - { - // EPS Bearer ID - notification->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + if (msg != NULL && notification != NULL) { + // EPS Bearer ID + notification->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Procedure Transaction ID - notification->proc_transaction_id = *msg_ptr; - msg_ptr++; + // Procedure Transaction ID + notification->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Notification Indicator - liblte_mme_unpack_notification_indicator_ie(&msg_ptr, ¬ification->notification_ind); + // Notification Indicator + liblte_mme_unpack_notification_indicator_ie(&msg_ptr, ¬ification->notification_ind); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -10885,101 +9857,95 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_notification_msg(LIBLTE_BYTE_MSG_STRUCT Document Reference: 24.301 v10.2.0 Section 8.3.19 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_connectivity_reject_msg(LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT *pdn_con_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_connectivity_reject_msg(LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT* pdn_con_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(pdn_con_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (pdn_con_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (pdn_con_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (pdn_con_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = pdn_con_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = pdn_con_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(pdn_con_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(pdn_con_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&pdn_con_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REJECT; + msg_ptr++; - // T3496 Value - if(pdn_con_rej->t3496_present) - { - *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; - msg_ptr++; - liblte_mme_pack_gprs_timer_3_ie(&pdn_con_rej->t3496, &msg_ptr); - } + // ESM Cause + liblte_mme_pack_esm_cause_ie(pdn_con_rej->esm_cause, &msg_ptr); - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Configuration Options + if (pdn_con_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&pdn_con_rej->protocol_cnfg_opts, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (pdn_con_rej->t3496_present) { + *msg_ptr = LIBLTE_MME_T3496_VALUE_IEI; + msg_ptr++; + liblte_mme_pack_gprs_timer_3_ie(&pdn_con_rej->t3496, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT *pdn_con_rej) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_CONNECTIVITY_REJECT_MSG_STRUCT* pdn_con_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - pdn_con_rej != NULL) - { - // EPS Bearer ID - pdn_con_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - pdn_con_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && pdn_con_rej != NULL) { + // EPS Bearer ID + pdn_con_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + pdn_con_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &pdn_con_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_con_rej->protocol_cnfg_opts); - pdn_con_rej->protocol_cnfg_opts_present = true; - }else{ - pdn_con_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &pdn_con_rej->esm_cause); - // T3496 Value - if(LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &pdn_con_rej->t3496); - pdn_con_rej->t3496_present = true; - }else{ - pdn_con_rej->t3496_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_con_rej->protocol_cnfg_opts); + pdn_con_rej->protocol_cnfg_opts_present = true; + } else { + pdn_con_rej->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // T3496 Value + if (LIBLTE_MME_T3496_VALUE_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_gprs_timer_3_ie(&msg_ptr, &pdn_con_rej->t3496); + pdn_con_rej->t3496_present = true; + } else { + pdn_con_rej->t3496_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -10990,142 +9956,132 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_reject_msg(LIBLTE_BYTE_MSG_ Document Reference: 24.301 v10.2.0 Section 8.3.20 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_connectivity_request_msg(LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_connectivity_request_msg(LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT* pdn_con_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(pdn_con_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (pdn_con_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (pdn_con_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (pdn_con_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = pdn_con_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = pdn_con_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REQUEST; - msg_ptr++; - - // Request Type & PDN Type - *msg_ptr = 0; - liblte_mme_pack_request_type_ie(pdn_con_req->request_type, 0, &msg_ptr); - liblte_mme_pack_pdn_type_ie(pdn_con_req->pdn_type, 4, &msg_ptr); - msg_ptr++; - - // ESM Information Transfer Flag - if(pdn_con_req->esm_info_transfer_flag_present) - { - *msg_ptr = LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI << 4; - liblte_mme_pack_esm_info_transfer_flag_ie(pdn_con_req->esm_info_transfer_flag, 0, &msg_ptr); - msg_ptr++; - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_CONNECTIVITY_REQUEST; + msg_ptr++; - // Access Point Name - if(pdn_con_req->apn_present) - { - *msg_ptr = LIBLTE_MME_ACCESS_POINT_NAME_IEI; - msg_ptr++; - liblte_mme_pack_access_point_name_ie(&pdn_con_req->apn, &msg_ptr); - } + // Request Type & PDN Type + *msg_ptr = 0; + liblte_mme_pack_request_type_ie(pdn_con_req->request_type, 0, &msg_ptr); + liblte_mme_pack_pdn_type_ie(pdn_con_req->pdn_type, 4, &msg_ptr); + msg_ptr++; - // Protocol Configuration Options - if(pdn_con_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&pdn_con_req->protocol_cnfg_opts, &msg_ptr); - } + // ESM Information Transfer Flag + if (pdn_con_req->esm_info_transfer_flag_present) { + *msg_ptr = LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI << 4; + liblte_mme_pack_esm_info_transfer_flag_ie(pdn_con_req->esm_info_transfer_flag, 0, &msg_ptr); + msg_ptr++; + } - // Device Properties - if(pdn_con_req->device_properties_present) - { - *msg_ptr = LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_IEI << 4; - liblte_mme_pack_device_properties_ie(pdn_con_req->device_properties, 0, &msg_ptr); - msg_ptr++; - } + // Access Point Name + if (pdn_con_req->apn_present) { + *msg_ptr = LIBLTE_MME_ACCESS_POINT_NAME_IEI; + msg_ptr++; + liblte_mme_pack_access_point_name_ie(&pdn_con_req->apn, &msg_ptr); + } - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Protocol Configuration Options + if (pdn_con_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&pdn_con_req->protocol_cnfg_opts, &msg_ptr); + } - err = LIBLTE_SUCCESS; + // Device Properties + if (pdn_con_req->device_properties_present) { + *msg_ptr = LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_IEI << 4; + liblte_mme_pack_device_properties_ie(pdn_con_req->device_properties, 0, &msg_ptr); + msg_ptr++; } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT *pdn_con_req) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_MSG_STRUCT* pdn_con_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - pdn_con_req != NULL) - { - // EPS Bearer ID - pdn_con_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - pdn_con_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && pdn_con_req != NULL) { + // EPS Bearer ID + pdn_con_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + pdn_con_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Request Type & PDN Type - liblte_mme_unpack_request_type_ie(&msg_ptr, 0, &pdn_con_req->request_type); - liblte_mme_unpack_pdn_type_ie(&msg_ptr, 4, &pdn_con_req->pdn_type); - msg_ptr++; + // Skip Message Type + msg_ptr++; - // ESM Information Transfer Flag - if((LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_esm_info_transfer_flag_ie(&msg_ptr, 0, &pdn_con_req->esm_info_transfer_flag); - msg_ptr++; - pdn_con_req->esm_info_transfer_flag_present = true; - }else{ - pdn_con_req->esm_info_transfer_flag_present = false; - } + // Request Type & PDN Type + liblte_mme_unpack_request_type_ie(&msg_ptr, 0, &pdn_con_req->request_type); + liblte_mme_unpack_pdn_type_ie(&msg_ptr, 4, &pdn_con_req->pdn_type); + msg_ptr++; - // Access Point Name - if(LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_access_point_name_ie(&msg_ptr, &pdn_con_req->apn); - pdn_con_req->apn_present = true; - }else{ - pdn_con_req->apn_present = false; - } + // ESM Information Transfer Flag + if ((LIBLTE_MME_ESM_INFO_TRANSFER_FLAG_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_esm_info_transfer_flag_ie(&msg_ptr, 0, &pdn_con_req->esm_info_transfer_flag); + msg_ptr++; + pdn_con_req->esm_info_transfer_flag_present = true; + } else { + pdn_con_req->esm_info_transfer_flag_present = false; + } - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_con_req->protocol_cnfg_opts); - pdn_con_req->protocol_cnfg_opts_present = true; - }else{ - pdn_con_req->protocol_cnfg_opts_present = false; - } + // Access Point Name + if (LIBLTE_MME_ACCESS_POINT_NAME_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_access_point_name_ie(&msg_ptr, &pdn_con_req->apn); + pdn_con_req->apn_present = true; + } else { + pdn_con_req->apn_present = false; + } - // Device Properties - if((LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) - { - liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &pdn_con_req->device_properties); - msg_ptr++; - pdn_con_req->device_properties_present = true; - }else{ - pdn_con_req->device_properties_present = false; - } + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_con_req->protocol_cnfg_opts); + pdn_con_req->protocol_cnfg_opts_present = true; + } else { + pdn_con_req->protocol_cnfg_opts_present = false; + } - err = LIBLTE_SUCCESS; + // Device Properties + if ((LIBLTE_MME_PDN_CONNECTIVITY_REQUEST_DEVICE_PROPERTIES_IEI << 4) == (*msg_ptr & 0xF0)) { + liblte_mme_unpack_device_properties_ie(&msg_ptr, 0, &pdn_con_req->device_properties); + msg_ptr++; + pdn_con_req->device_properties_present = true; + } else { + pdn_con_req->device_properties_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -11136,83 +10092,78 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_connectivity_request_msg(LIBLTE_BYTE_MSG Document Reference: 24.301 v10.2.0 Section 8.3.21 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_reject_msg(LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT *pdn_discon_rej, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_reject_msg(LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT* pdn_discon_rej, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(pdn_discon_rej != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (pdn_discon_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (pdn_discon_rej != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (pdn_discon_rej->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = pdn_discon_rej->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = pdn_discon_rej->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REJECT; - msg_ptr++; - - // ESM Cause - liblte_mme_pack_esm_cause_ie(pdn_discon_rej->esm_cause, &msg_ptr); - - // Protocol Configuration Options - if(pdn_discon_rej->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&pdn_discon_rej->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REJECT; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // ESM Cause + liblte_mme_pack_esm_cause_ie(pdn_discon_rej->esm_cause, &msg_ptr); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (pdn_discon_rej->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&pdn_discon_rej->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT *pdn_discon_rej) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_DISCONNECT_REJECT_MSG_STRUCT* pdn_discon_rej) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - pdn_discon_rej != NULL) - { - // EPS Bearer ID - pdn_discon_rej->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - pdn_discon_rej->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && pdn_discon_rej != NULL) { + // EPS Bearer ID + pdn_discon_rej->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + pdn_discon_rej->proc_transaction_id = *msg_ptr; + msg_ptr++; - // ESM Cause - liblte_mme_unpack_esm_cause_ie(&msg_ptr, &pdn_discon_rej->esm_cause); + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_discon_rej->protocol_cnfg_opts); - pdn_discon_rej->protocol_cnfg_opts_present = true; - }else{ - pdn_discon_rej->protocol_cnfg_opts_present = false; - } + // ESM Cause + liblte_mme_unpack_esm_cause_ie(&msg_ptr, &pdn_discon_rej->esm_cause); - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_discon_rej->protocol_cnfg_opts); + pdn_discon_rej->protocol_cnfg_opts_present = true; + } else { + pdn_discon_rej->protocol_cnfg_opts_present = false; } - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -11223,127 +10174,120 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_reject_msg(LIBLTE_BYTE_MSG_ST Document Reference: 24.301 v10.2.0 Section 8.3.22 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_mme_pack_pdn_disconnect_request_msg(LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT *pdn_discon_req, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_mme_pack_pdn_disconnect_request_msg(LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT* pdn_discon_req, + LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(pdn_discon_req != NULL && - msg != NULL) - { - // Protocol Discriminator and EPS Bearer ID - *msg_ptr = (pdn_discon_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); - msg_ptr++; + if (pdn_discon_req != NULL && msg != NULL) { + // Protocol Discriminator and EPS Bearer ID + *msg_ptr = (pdn_discon_req->eps_bearer_id << 4) | (LIBLTE_MME_PD_EPS_SESSION_MANAGEMENT); + msg_ptr++; - // Procedure Transaction ID - *msg_ptr = pdn_discon_req->proc_transaction_id; - msg_ptr++; + // Procedure Transaction ID + *msg_ptr = pdn_discon_req->proc_transaction_id; + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REQUEST; - msg_ptr++; - - // Linked EPS Bearer Identity & Spare Half Octet - *msg_ptr = 0; - liblte_mme_pack_linked_eps_bearer_identity_ie(pdn_discon_req->linked_eps_bearer_id, 0, &msg_ptr); - msg_ptr++; - - // Protocol Configuration Options - if(pdn_discon_req->protocol_cnfg_opts_present) - { - *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; - msg_ptr++; - liblte_mme_pack_protocol_config_options_ie(&pdn_discon_req->protocol_cnfg_opts, &msg_ptr); - } + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_PDN_DISCONNECT_REQUEST; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Linked EPS Bearer Identity & Spare Half Octet + *msg_ptr = 0; + liblte_mme_pack_linked_eps_bearer_identity_ie(pdn_discon_req->linked_eps_bearer_id, 0, &msg_ptr); + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (pdn_discon_req->protocol_cnfg_opts_present) { + *msg_ptr = LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI; + msg_ptr++; + liblte_mme_pack_protocol_config_options_ie(&pdn_discon_req->protocol_cnfg_opts, &msg_ptr); } - return(err); + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_mme_unpack_pdn_disconnect_request_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT *pdn_discon_req) +LIBLTE_ERROR_ENUM +liblte_mme_unpack_pdn_disconnect_request_msg(LIBLTE_BYTE_MSG_STRUCT* msg, + LIBLTE_MME_PDN_DISCONNECT_REQUEST_MSG_STRUCT* pdn_discon_req) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; - - if(msg != NULL && - pdn_discon_req != NULL) - { - // EPS Bearer ID - pdn_discon_req->eps_bearer_id = (*msg_ptr >> 4); - msg_ptr++; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - // Procedure Transaction ID - pdn_discon_req->proc_transaction_id = *msg_ptr; - msg_ptr++; + if (msg != NULL && pdn_discon_req != NULL) { + // EPS Bearer ID + pdn_discon_req->eps_bearer_id = (*msg_ptr >> 4); + msg_ptr++; - // Skip Message Type - msg_ptr++; + // Procedure Transaction ID + pdn_discon_req->proc_transaction_id = *msg_ptr; + msg_ptr++; - // Linked EPS Bearer Identity & Spare Half Octet - liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &pdn_discon_req->linked_eps_bearer_id); - msg_ptr++; + // Skip Message Type + msg_ptr++; - // Protocol Configuration Options - if(LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) - { - msg_ptr++; - liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_discon_req->protocol_cnfg_opts); - pdn_discon_req->protocol_cnfg_opts_present = true; - }else{ - pdn_discon_req->protocol_cnfg_opts_present = false; - } + // Linked EPS Bearer Identity & Spare Half Octet + liblte_mme_unpack_linked_eps_bearer_identity_ie(&msg_ptr, 0, &pdn_discon_req->linked_eps_bearer_id); + msg_ptr++; - err = LIBLTE_SUCCESS; + // Protocol Configuration Options + if (LIBLTE_MME_PROTOCOL_CONFIGURATION_OPTIONS_IEI == *msg_ptr) { + msg_ptr++; + liblte_mme_unpack_protocol_config_options_ie(&msg_ptr, &pdn_discon_req->protocol_cnfg_opts); + pdn_discon_req->protocol_cnfg_opts_present = true; + } else { + pdn_discon_req->protocol_cnfg_opts_present = false; } - return(err); -} + err = LIBLTE_SUCCESS; + } + return (err); +} -LIBLTE_ERROR_ENUM liblte_mme_pack_activate_test_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT *msg, - uint8 sec_hdr_type, - uint32 count) +LIBLTE_ERROR_ENUM +liblte_mme_pack_activate_test_mode_complete_msg(LIBLTE_BYTE_MSG_STRUCT* msg, uint8 sec_hdr_type, uint32 count) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 *msg_ptr = msg->msg; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8* msg_ptr = msg->msg; - if(msg != NULL) - { - if(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) - { - // Protocol Discriminator and Security Header Type - *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); - msg_ptr++; + if (msg != NULL) { + if (LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS != sec_hdr_type) { + // Protocol Discriminator and Security Header Type + *msg_ptr = (sec_hdr_type << 4) | (LIBLTE_MME_PD_EPS_MOBILITY_MANAGEMENT); + msg_ptr++; - // MAC will be filled in later - msg_ptr += 4; + // MAC will be filled in later + msg_ptr += 4; - // Sequence Number - *msg_ptr = count & 0xFF; - msg_ptr++; - } + // Sequence Number + *msg_ptr = count & 0xFF; + msg_ptr++; + } - // Protocol Discriminator and skip indicator (always 0x0F) - *msg_ptr = (LIBLTE_MME_MSG_TYPE_TEST_MODE_SKIP_INDICATOR << 4) | (LIBLTE_MME_MSG_TYPE_TEST_MODE_PROTOCOL_DISCRIMINATOR); - msg_ptr++; + // Protocol Discriminator and skip indicator (always 0x0F) + *msg_ptr = + (LIBLTE_MME_MSG_TYPE_TEST_MODE_SKIP_INDICATOR << 4) | (LIBLTE_MME_MSG_TYPE_TEST_MODE_PROTOCOL_DISCRIMINATOR); + msg_ptr++; - // Message Type - *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE_COMPLETE; - msg_ptr++; + // Message Type + *msg_ptr = LIBLTE_MME_MSG_TYPE_ACTIVATE_TEST_MODE_COMPLETE; + msg_ptr++; - // Fill in the number of bytes used - msg->N_bytes = msg_ptr - msg->msg; + // Fill in the number of bytes used + msg->N_bytes = msg_ptr - msg->msg; - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /******************************************************************************* @@ -11351,22 +10295,21 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_activate_test_mode_complete_msg(LIBLTE_BYTE_MS *******************************************************************************/ const char* liblte_nas_sec_hdr_type_to_string(int code) { - switch(code) - { - LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS); + switch (code) { + LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS); LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY); LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED); LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_WITH_NEW_EPS_SECURITY_CONTEXT); LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY_AND_CIPHERED_WITH_NEW_EPS_SECURITY_CONTEXT); LIBLTE_CASE_STR(LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST); - default: return "NAS Message Type Unknown"; + default: + return "NAS Message Type Unknown"; } } const char* liblte_nas_msg_type_to_string(int code) { - switch(code) - { + switch (code) { LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST); LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_ATTACH_ACCEPT); LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_ATTACH_COMPLETE); @@ -11420,6 +10363,7 @@ const char* liblte_nas_msg_type_to_string(int code) LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_ESM_INFORMATION_RESPONSE); LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_NOTIFICATION); LIBLTE_CASE_STR(LIBLTE_MME_MSG_TYPE_ESM_STATUS); - default: return "NAS Message Type Unknown"; + default: + return "NAS Message Type Unknown"; } } diff --git a/lib/src/asn1/liblte_s1ap.cc b/lib/src/asn1/liblte_s1ap.cc index fc2315f1e..07ce0336e 100644 --- a/lib/src/asn1/liblte_s1ap.cc +++ b/lib/src/asn1/liblte_s1ap.cc @@ -20,28 +20,30 @@ */ #include "srslte/asn1/liblte_s1ap.h" -# include -# include -# include +#include +#include +#include /******************************************************************************* LOGGING *******************************************************************************/ static log_handler_t log_handler; -static void *callback_ctx = NULL; +static void* callback_ctx = NULL; -void liblte_log_register_handler(void *ctx, log_handler_t handler) { +void liblte_log_register_handler(void* ctx, log_handler_t handler) +{ log_handler = handler; callback_ctx = ctx; } -static void liblte_log_print(const char *format, ...) { - va_list args; +static void liblte_log_print(const char* format, ...) +{ + va_list args; va_start(args, format); if (log_handler) { - char *args_msg = NULL; - if(vasprintf(&args_msg, format, args) > 0) { + char* args_msg = NULL; + if (vasprintf(&args_msg, format, args) > 0) { log_handler(callback_ctx, args_msg); } if (args_msg) { @@ -56,15 +58,11 @@ static void liblte_log_print(const char *format, ...) { /******************************************************************************* /* ProtocolIE Criticality ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticality( - LIBLTE_S1AP_CRITICALITY_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticality(LIBLTE_S1AP_CRITICALITY_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 2); err = LIBLTE_SUCCESS; @@ -72,15 +70,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticality( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticality( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITY_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticality(uint8_t** ptr, LIBLTE_S1AP_CRITICALITY_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); err = LIBLTE_SUCCESS; @@ -88,23 +82,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticality( return err; } - /******************************************************************************* /* ProtocolIE local INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_local( - LIBLTE_S1AP_LOCAL_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_local(LIBLTE_S1AP_LOCAL_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->local // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->local, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -112,72 +101,59 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_local( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_local( - uint8_t **ptr, - LIBLTE_S1AP_LOCAL_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_local(uint8_t** ptr, LIBLTE_S1AP_LOCAL_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->local // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->local = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->local = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } return err; } - /******************************************************************************* /* ProtocolIE PrivateIE_ID CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_id( - LIBLTE_S1AP_PRIVATEIE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_id(LIBLTE_S1AP_PRIVATEIE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_LOCAL) { - if(liblte_s1ap_pack_local(&ie->choice.local, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_LOCAL) { + if (liblte_s1ap_pack_local(&ie->choice.local, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_GLOBAL) { } - } else if(ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_GLOBAL) { - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_id( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_id(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Choice type ie->choice_type = (LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_LOCAL) { - if(liblte_s1ap_unpack_local(ptr, &ie->choice.local) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_LOCAL) { + if (liblte_s1ap_unpack_local(ptr, &ie->choice.local) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_GLOBAL) { } - } else if(ie->choice_type == LIBLTE_S1AP_PRIVATEIE_ID_CHOICE_GLOBAL) { - } err = LIBLTE_SUCCESS; } return err; @@ -186,19 +162,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_id( /******************************************************************************* /* ProtocolIE ProtocolExtensionID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid( - LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid(LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolExtensionID // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->ProtocolExtensionID, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -206,19 +178,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionid( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLEXTENSIONID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolExtensionID // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->ProtocolExtensionID = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->ProtocolExtensionID = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -228,15 +196,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionid( /******************************************************************************* /* ProtocolIE TriggeringMessage ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_triggeringmessage( - LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_triggeringmessage(LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 2); err = LIBLTE_SUCCESS; @@ -244,15 +208,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_triggeringmessage( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_triggeringmessage( - uint8_t **ptr, - LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_triggeringmessage(uint8_t** ptr, LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM)liblte_bits_2_value(ptr, 2); err = LIBLTE_SUCCESS; @@ -263,15 +223,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_triggeringmessage( /******************************************************************************* /* ProtocolIE Presence ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_presence( - LIBLTE_S1AP_PRESENCE_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_presence(LIBLTE_S1AP_PRESENCE_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 2); err = LIBLTE_SUCCESS; @@ -279,15 +235,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_presence( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_presence( - uint8_t **ptr, - LIBLTE_S1AP_PRESENCE_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_presence(uint8_t** ptr, LIBLTE_S1AP_PRESENCE_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_PRESENCE_ENUM)liblte_bits_2_value(ptr, 2); err = LIBLTE_SUCCESS; @@ -298,19 +250,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_presence( /******************************************************************************* /* ProtocolIE ProtocolIE_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_id( - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_id(LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolIE_ID // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->ProtocolIE_ID, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -318,19 +266,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_id( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_id(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProtocolIE_ID // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->ProtocolIE_ID = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->ProtocolIE_ID = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -340,19 +284,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_id( /******************************************************************************* /* ProtocolIE ProcedureCode INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_procedurecode( - LIBLTE_S1AP_PROCEDURECODE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_procedurecode(LIBLTE_S1AP_PROCEDURECODE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProcedureCode // lb:0, ub:255 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-8); + liblte_value_2_bits(0, ptr, (1 * 8) - 8); liblte_value_2_bits(ie->ProcedureCode, ptr, 8); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -360,19 +300,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_procedurecode( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_procedurecode( - uint8_t **ptr, - LIBLTE_S1AP_PROCEDURECODE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_procedurecode(uint8_t** ptr, LIBLTE_S1AP_PROCEDURECODE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ProcedureCode // lb:0, ub:255 liblte_align_up(ptr, 8); - ie->ProcedureCode = (uint8_t)liblte_bits_2_value(ptr, 1.0*8); + ie->ProcedureCode = (uint8_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -382,17 +318,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_procedurecode( /******************************************************************************* /* ProtocolIE ProtocolIE_Field SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_field( - LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_field(LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -404,17 +336,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_field( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_field( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_field(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_FIELD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -429,17 +357,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_field( /******************************************************************************* /* ProtocolIE ProtocolExtensionField SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionfield( - LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionfield(LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_pack_protocolextensionid(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolextensionid(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -451,17 +375,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensionfield( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionfield( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionfield(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLEXTENSIONFIELD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_unpack_protocolextensionid(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_protocolextensionid(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -476,24 +397,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensionfield( /******************************************************************************* /* ProtocolIE ProtocolIE_FieldPair SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_fieldpair( - LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_fieldpair(LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } // Enum - ie->firstCriticality liblte_value_2_bits(ie->firstCriticality, ptr, 2); - // Enum - ie->secondCriticality liblte_value_2_bits(ie->secondCriticality, ptr, 2); @@ -502,24 +418,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_fieldpair( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_fieldpair( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_fieldpair(uint8_t** ptr, LIBLTE_S1AP_PROTOCOLIE_FIELDPAIR_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } // Enum - ie->firstCriticality ie->firstCriticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); - // Enum - ie->secondCriticality ie->secondCriticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); @@ -532,25 +443,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_fieldpair( /* ProtocolIE ProtocolExtensionContainer DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensioncontainer( - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensioncontainer(LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ProtocolExtensionContainer pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "ProtocolExtensionContainer pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_protocolextensionfield(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_protocolextensionfield(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -559,25 +469,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolextensioncontainer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensioncontainer( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensioncontainer(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLEXTENSIONCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ProtocolExtensionContainer unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "ProtocolExtensionContainer unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolextensionfield(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolextensionfield(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -590,25 +499,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolextensioncontainer( /* ProtocolIE ProtocolIE_ContainerPair DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:0, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpair( - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpair(LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ProtocolIE_ContainerPair pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "ProtocolIE_ContainerPair pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-0, ptr, 16); + liblte_value_2_bits(ie->len - 0, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_protocolie_fieldpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_protocolie_fieldpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -617,25 +524,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpair( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpair( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpair(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIR_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 0; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ProtocolIE_ContainerPair unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "ProtocolIE_ContainerPair unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_fieldpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_fieldpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -648,33 +554,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpair( /* ProtocolIE ProtocolIE_ContainerPairList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:None, ub:None -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpairlist( - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpairlist(LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ProtocolIE_ContainerPairList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "ProtocolIE_ContainerPairList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - if(ie->len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->len, ptr, 7); - } else if(ie->len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of bits } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_protocolie_containerpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_protocolie_containerpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -683,32 +588,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_containerpairlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpairlist( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpairlist(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_CONTAINERPAIRLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of bits } } - if(ie->len > 32) { - liblte_log_print("ProtocolIE_ContainerPairList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "ProtocolIE_ContainerPairList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_containerpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_containerpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -720,17 +624,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_containerpairlist( /******************************************************************************* /* ProtocolIE PrivateIE_Field SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_field( - LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_field(LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_pack_privateie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_privateie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -742,17 +642,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_field( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_field( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_field(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_FIELD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_unpack_privateie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_privateie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -767,17 +663,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_field( /******************************************************************************* /* ProtocolIE ProtocolIE_SingleContainer SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer( - LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer(LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_id(&ie->id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -789,17 +682,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_singlecontainer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer( - uint8_t **ptr, - LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer(uint8_t** ptr, + LIBLTE_S1AP_PROTOCOLIE_SINGLECONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { - if(liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_protocolie_id(ptr, &ie->id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -815,25 +705,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_singlecontainer( /* ProtocolIE PrivateIE_Container DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_container( - LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_container(LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("PrivateIE_Container pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("PrivateIE_Container pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_privateie_field(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_privateie_field(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -842,25 +729,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_privateie_container( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_container( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_container(uint8_t** ptr, LIBLTE_S1AP_PRIVATEIE_CONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("PrivateIE_Container unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("PrivateIE_Container unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_privateie_field(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_privateie_field(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -872,47 +756,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privateie_container( /******************************************************************************* /* ProtocolIE BitRate INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bitrate( - LIBLTE_S1AP_BITRATE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_bitrate(LIBLTE_S1AP_BITRATE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->BitRate // lb:0, ub:10000000000 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->BitRate-0)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 3); + uint32_t n_bits = floor(log2(ie->BitRate - 0) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 3); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->BitRate-0, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->BitRate - 0, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bitrate( - uint8_t **ptr, - LIBLTE_S1AP_BITRATE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bitrate(uint8_t** ptr, LIBLTE_S1AP_BITRATE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->BitRate // lb:0, ub:10000000000 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 3) + 1; liblte_align_up(ptr, 8); - ie->BitRate = liblte_bits_2_value(ptr, n_octets*8) + 0; + ie->BitRate = liblte_bits_2_value(ptr, n_octets * 8) + 0; } err = LIBLTE_SUCCESS; } @@ -922,18 +798,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bitrate( /******************************************************************************* /* ProtocolIE CauseMisc ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causemisc( - LIBLTE_S1AP_CAUSEMISC_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causemisc(LIBLTE_S1AP_CAUSEMISC_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CauseMisc error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -946,18 +818,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_causemisc( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causemisc( - uint8_t **ptr, - LIBLTE_S1AP_CAUSEMISC_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causemisc(uint8_t** ptr, LIBLTE_S1AP_CAUSEMISC_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CauseMisc error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -973,18 +841,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causemisc( /******************************************************************************* /* ProtocolIE CauseRadioNetwork ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeradionetwork( - LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeradionetwork(LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CauseRadioNetwork error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -997,18 +861,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeradionetwork( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeradionetwork( - uint8_t **ptr, - LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeradionetwork(uint8_t** ptr, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CauseRadioNetwork error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1024,18 +884,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeradionetwork( /******************************************************************************* /* ProtocolIE CauseNas ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causenas( - LIBLTE_S1AP_CAUSENAS_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causenas(LIBLTE_S1AP_CAUSENAS_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CauseNas error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1048,18 +904,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_causenas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causenas( - uint8_t **ptr, - LIBLTE_S1AP_CAUSENAS_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causenas(uint8_t** ptr, LIBLTE_S1AP_CAUSENAS_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CauseNas error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1075,19 +927,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causenas( /******************************************************************************* /* ProtocolIE CellIdentity STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidentity( - LIBLTE_S1AP_CELLIDENTITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidentity(LIBLTE_S1AP_CELLIDENTITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - CellIdentity liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -1096,19 +944,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidentity( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidentity( - uint8_t **ptr, - LIBLTE_S1AP_CELLIDENTITY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidentity(uint8_t** ptr, LIBLTE_S1AP_CELLIDENTITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - CellIdentity liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -1120,31 +964,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidentity( /******************************************************************************* /* ProtocolIE Cdma2000PDU DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000pdu( - LIBLTE_S1AP_CDMA2000PDU_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000pdu(LIBLTE_S1AP_CDMA2000PDU_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000PDU // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1152,21 +992,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000pdu( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000PDU_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu(uint8_t** ptr, LIBLTE_S1AP_CDMA2000PDU_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000PDU // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -1175,7 +1011,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1186,31 +1022,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000pdu( /******************************************************************************* /* ProtocolIE Cdma2000SectorID DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000sectorid( - LIBLTE_S1AP_CDMA2000SECTORID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000sectorid(LIBLTE_S1AP_CDMA2000SECTORID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000SectorID // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1218,21 +1050,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000sectorid( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000SECTORID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid(uint8_t** ptr, LIBLTE_S1AP_CDMA2000SECTORID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000SectorID // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -1241,7 +1069,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1252,18 +1080,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000sectorid( /******************************************************************************* /* ProtocolIE Cdma2000HORequiredIndication ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000horequiredindication( - LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000horequiredindication(LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000HORequiredIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1276,18 +1101,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000horequiredindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000horequiredindication( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000horequiredindication(uint8_t** ptr, + LIBLTE_S1AP_CDMA2000HOREQUIREDINDICATION_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000HORequiredIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1303,31 +1125,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000horequiredindication( /******************************************************************************* /* ProtocolIE Cdma2000OneXMSI DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmsi( - LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmsi(LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXMSI // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1335,21 +1153,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmsi( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXMSI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXMSI // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -1358,7 +1172,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1369,31 +1183,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmsi( /******************************************************************************* /* ProtocolIE Cdma2000OneXRAND DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexrand( - LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexrand(LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXRAND // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1401,21 +1211,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexrand( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXRAND_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXRAND // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -1424,7 +1230,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1435,15 +1241,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexrand( /******************************************************************************* /* ProtocolIE CNDomain ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cndomain( - LIBLTE_S1AP_CNDOMAIN_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cndomain(LIBLTE_S1AP_CNDOMAIN_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 1); err = LIBLTE_SUCCESS; @@ -1451,15 +1253,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cndomain( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cndomain( - uint8_t **ptr, - LIBLTE_S1AP_CNDOMAIN_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cndomain(uint8_t** ptr, LIBLTE_S1AP_CNDOMAIN_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_CNDOMAIN_ENUM)liblte_bits_2_value(ptr, 1); err = LIBLTE_SUCCESS; @@ -1470,22 +1268,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cndomain( /******************************************************************************* /* ProtocolIE Correlation_ID STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_correlation_id( - LIBLTE_S1AP_CORRELATION_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_correlation_id(LIBLTE_S1AP_CORRELATION_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - Correlation-ID - if(LIBLTE_S1AP_CORRELATION_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_CORRELATION_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1493,22 +1287,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_correlation_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_correlation_id( - uint8_t **ptr, - LIBLTE_S1AP_CORRELATION_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_correlation_id(uint8_t** ptr, LIBLTE_S1AP_CORRELATION_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - Correlation-ID - if(LIBLTE_S1AP_CORRELATION_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_CORRELATION_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1519,18 +1309,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_correlation_id( /******************************************************************************* /* ProtocolIE AdditionalCSFallbackIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_additionalcsfallbackindicator( - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_additionalcsfallbackindicator(LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("AdditionalCSFallbackIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1543,18 +1330,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_additionalcsfallbackindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_additionalcsfallbackindicator( - uint8_t **ptr, - LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_additionalcsfallbackindicator(uint8_t** ptr, LIBLTE_S1AP_ADDITIONALCSFALLBACKINDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("AdditionalCSFallbackIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1570,18 +1354,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_additionalcsfallbackindicator( /******************************************************************************* /* ProtocolIE DL_Forwarding ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_dl_forwarding( - LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_dl_forwarding(LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("DL_Forwarding error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1594,18 +1374,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_dl_forwarding( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_dl_forwarding( - uint8_t **ptr, - LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_dl_forwarding(uint8_t** ptr, LIBLTE_S1AP_DL_FORWARDING_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("DL_Forwarding error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1621,18 +1397,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_dl_forwarding( /******************************************************************************* /* ProtocolIE Data_Forwarding_Not_Possible ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_data_forwarding_not_possible( - LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_data_forwarding_not_possible(LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Data_Forwarding_Not_Possible error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1645,18 +1418,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_data_forwarding_not_possible( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_data_forwarding_not_possible( - uint8_t **ptr, - LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_data_forwarding_not_possible(uint8_t** ptr, + LIBLTE_S1AP_DATA_FORWARDING_NOT_POSSIBLE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Data_Forwarding_Not_Possible error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1672,22 +1442,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_data_forwarding_not_possible( /******************************************************************************* /* ProtocolIE EmergencyAreaID STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid( - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid(LIBLTE_S1AP_EMERGENCYAREAID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - EmergencyAreaID - if(LIBLTE_S1AP_EMERGENCYAREAID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_EMERGENCYAREAID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1695,22 +1461,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - EmergencyAreaID - if(LIBLTE_S1AP_EMERGENCYAREAID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_EMERGENCYAREAID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1718,23 +1480,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid( return err; } - /******************************************************************************* /* ProtocolIE macroENB_ID STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_macroenb_id( - LIBLTE_S1AP_MACROENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_macroenb_id(LIBLTE_S1AP_MACROENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - macroENB-ID liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -1743,19 +1500,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_macroenb_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_macroenb_id( - uint8_t **ptr, - LIBLTE_S1AP_MACROENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_macroenb_id(uint8_t** ptr, LIBLTE_S1AP_MACROENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - macroENB-ID liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -1764,24 +1517,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_macroenb_id( return err; } - - /******************************************************************************* /* ProtocolIE homeENB_ID STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_homeenb_id( - LIBLTE_S1AP_HOMEENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_homeenb_id(LIBLTE_S1AP_HOMEENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - homeENB-ID liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -1790,19 +1537,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_homeenb_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_homeenb_id( - uint8_t **ptr, - LIBLTE_S1AP_HOMEENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_homeenb_id(uint8_t** ptr, LIBLTE_S1AP_HOMEENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - homeENB-ID liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -1811,22 +1554,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_homeenb_id( return err; } - /******************************************************************************* /* ProtocolIE ENB_ID CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_id( - LIBLTE_S1AP_ENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_id(LIBLTE_S1AP_ENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -1834,33 +1572,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_id( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_MACROENB_ID) { - if(liblte_s1ap_pack_macroenb_id(&ie->choice.macroENB_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_HOMEENB_ID) { - if(liblte_s1ap_pack_homeenb_id(&ie->choice.homeENB_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_MACROENB_ID) { + if (liblte_s1ap_pack_macroenb_id(&ie->choice.macroENB_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_HOMEENB_ID) { + if (liblte_s1ap_pack_homeenb_id(&ie->choice.homeENB_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id( - uint8_t **ptr, - LIBLTE_S1AP_ENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id(uint8_t** ptr, LIBLTE_S1AP_ENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1868,16 +1602,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id( // Choice type ie->choice_type = (LIBLTE_S1AP_ENB_ID_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_MACROENB_ID) { - if(liblte_s1ap_unpack_macroenb_id(ptr, &ie->choice.macroENB_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_HOMEENB_ID) { - if(liblte_s1ap_unpack_homeenb_id(ptr, &ie->choice.homeENB_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_MACROENB_ID) { + if (liblte_s1ap_unpack_macroenb_id(ptr, &ie->choice.macroENB_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_ENB_ID_CHOICE_HOMEENB_ID) { + if (liblte_s1ap_unpack_homeenb_id(ptr, &ie->choice.homeENB_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -1886,29 +1620,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_id( /******************************************************************************* /* ProtocolIE ENBname PrintableString ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbname( - LIBLTE_S1AP_ENBNAME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbname(LIBLTE_S1AP_ENBNAME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->n_octets-1, ptr, 8); + liblte_value_2_bits(ie->n_octets - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -1916,19 +1646,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbname( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname( - uint8_t **ptr, - LIBLTE_S1AP_ENBNAME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname(uint8_t** ptr, LIBLTE_S1AP_ENBNAME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - ENBname // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENBname error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -1938,7 +1664,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname( liblte_align_up(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -1949,25 +1675,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbname( /******************************************************************************* /* ProtocolIE EncryptionAlgorithms STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_encryptionalgorithms( - LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_encryptionalgorithms(LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - EncryptionAlgorithms // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("EncryptionAlgorithms error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -1975,25 +1697,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_encryptionalgorithms( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_encryptionalgorithms( - uint8_t **ptr, - LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_encryptionalgorithms(uint8_t** ptr, LIBLTE_S1AP_ENCRYPTIONALGORITHMS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - EncryptionAlgorithms // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("EncryptionAlgorithms error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -2004,18 +1722,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_encryptionalgorithms( /******************************************************************************* /* ProtocolIE EventType ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eventtype( - LIBLTE_S1AP_EVENTTYPE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eventtype(LIBLTE_S1AP_EVENTTYPE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("EventType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2028,18 +1742,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_eventtype( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eventtype( - uint8_t **ptr, - LIBLTE_S1AP_EVENTTYPE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eventtype(uint8_t** ptr, LIBLTE_S1AP_EVENTTYPE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("EventType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2055,19 +1765,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eventtype( /******************************************************************************* /* ProtocolIE ExtendedRNC_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrnc_id( - LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrnc_id(LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ExtendedRNC_ID // lb:4096, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->ExtendedRNC_ID, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -2075,19 +1781,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrnc_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrnc_id( - uint8_t **ptr, - LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrnc_id(uint8_t** ptr, LIBLTE_S1AP_EXTENDEDRNC_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ExtendedRNC_ID // lb:4096, ub:65535 liblte_align_up(ptr, 8); - ie->ExtendedRNC_ID = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->ExtendedRNC_ID = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -2097,18 +1799,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrnc_id( /******************************************************************************* /* ProtocolIE ForbiddenInterRATs ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddeninterrats( - LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddeninterrats(LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenInterRATs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2121,18 +1819,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddeninterrats( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddeninterrats( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddeninterrats(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENINTERRATS_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenInterRATs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2148,18 +1842,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddeninterrats( /******************************************************************************* /* ProtocolIE GWContextReleaseIndication ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gwcontextreleaseindication( - LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gwcontextreleaseindication(LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("GWContextReleaseIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2172,18 +1863,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gwcontextreleaseindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gwcontextreleaseindication( - uint8_t **ptr, - LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gwcontextreleaseindication(uint8_t** ptr, + LIBLTE_S1AP_GWCONTEXTRELEASEINDICATION_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("GWContextReleaseIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2199,47 +1887,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gwcontextreleaseindication( /******************************************************************************* /* ProtocolIE HFN INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfn( - LIBLTE_S1AP_HFN_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfn(LIBLTE_S1AP_HFN_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->HFN // lb:0, ub:1048575 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->HFN-0)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 2); + uint32_t n_bits = floor(log2(ie->HFN - 0) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 2); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->HFN-0, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->HFN - 0, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfn( - uint8_t **ptr, - LIBLTE_S1AP_HFN_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfn(uint8_t** ptr, LIBLTE_S1AP_HFN_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->HFN // lb:0, ub:1048575 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 2) + 1; liblte_align_up(ptr, 8); - ie->HFN = liblte_bits_2_value(ptr, n_octets*8) + 0; + ie->HFN = liblte_bits_2_value(ptr, n_octets * 8) + 0; } err = LIBLTE_SUCCESS; } @@ -2249,15 +1929,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfn( /******************************************************************************* /* ProtocolIE IMSI DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi( - LIBLTE_S1AP_IMSI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi(LIBLTE_S1AP_IMSI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // max length of IE buffer is 8, so limit if (ie->n_octets > 7) { printf("Length in struct exceeds buffer (%d > 7).\n", ie->n_octets); @@ -2266,20 +1942,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi( // Dynamic octet string - IMSI // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2287,21 +1963,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_imsi( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi( - uint8_t **ptr, - LIBLTE_S1AP_IMSI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi(uint8_t** ptr, LIBLTE_S1AP_IMSI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - IMSI // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -2310,7 +1982,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2321,18 +1993,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_imsi( /******************************************************************************* /* ProtocolIE InterfacesToTrace STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_interfacestotrace( - LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_interfacestotrace(LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - InterfacesToTrace uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -2340,18 +2008,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_interfacestotrace( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_interfacestotrace( - uint8_t **ptr, - LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_interfacestotrace(uint8_t** ptr, LIBLTE_S1AP_INTERFACESTOTRACE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - InterfacesToTrace uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -2362,22 +2026,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_interfacestotrace( /******************************************************************************* /* ProtocolIE LAC STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lac( - LIBLTE_S1AP_LAC_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lac(LIBLTE_S1AP_LAC_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - LAC - if(LIBLTE_S1AP_LAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_LAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2385,22 +2045,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lac( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lac( - uint8_t **ptr, - LIBLTE_S1AP_LAC_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lac(uint8_t** ptr, LIBLTE_S1AP_LAC_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - LAC - if(LIBLTE_S1AP_LAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_LAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2411,31 +2067,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lac( /******************************************************************************* /* ProtocolIE LastVisitedUTRANCellInformation DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedutrancellinformation( - LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedutrancellinformation(LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LastVisitedUTRANCellInformation // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2443,21 +2096,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedutrancellinformation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedutrancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedutrancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDUTRANCELLINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LastVisitedUTRANCellInformation // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -2466,7 +2117,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedutrancellinformation( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2477,31 +2128,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedutrancellinformation( /******************************************************************************* /* ProtocolIE L3_Information DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_l3_information( - LIBLTE_S1AP_L3_INFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_l3_information(LIBLTE_S1AP_L3_INFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - L3-Information // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2509,21 +2156,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_l3_information( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information( - uint8_t **ptr, - LIBLTE_S1AP_L3_INFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information(uint8_t** ptr, LIBLTE_S1AP_L3_INFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - L3-Information // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -2532,7 +2175,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2543,31 +2186,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_l3_information( /******************************************************************************* /* ProtocolIE LHN_ID DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lhn_id( - LIBLTE_S1AP_LHN_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lhn_id(LIBLTE_S1AP_LHN_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LHN-ID // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2575,21 +2214,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lhn_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id( - uint8_t **ptr, - LIBLTE_S1AP_LHN_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id(uint8_t** ptr, LIBLTE_S1AP_LHN_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LHN-ID // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -2598,7 +2233,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2609,15 +2244,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lhn_id( /******************************************************************************* /* ProtocolIE LoggingDuration ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggingduration( - LIBLTE_S1AP_LOGGINGDURATION_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggingduration(LIBLTE_S1AP_LOGGINGDURATION_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 3); err = LIBLTE_SUCCESS; @@ -2625,15 +2256,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggingduration( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggingduration( - uint8_t **ptr, - LIBLTE_S1AP_LOGGINGDURATION_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggingduration(uint8_t** ptr, LIBLTE_S1AP_LOGGINGDURATION_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_LOGGINGDURATION_ENUM)liblte_bits_2_value(ptr, 3); err = LIBLTE_SUCCESS; @@ -2644,18 +2271,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggingduration( /******************************************************************************* /* ProtocolIE MDT_Activation ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_activation( - LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_activation(LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MDT_Activation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2668,18 +2291,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_activation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_activation( - uint8_t **ptr, - LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_activation(uint8_t** ptr, LIBLTE_S1AP_MDT_ACTIVATION_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MDT_Activation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2695,18 +2314,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_activation( /******************************************************************************* /* ProtocolIE ManagementBasedMDTAllowed ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_managementbasedmdtallowed( - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_managementbasedmdtallowed(LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ManagementBasedMDTAllowed error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2719,18 +2335,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_managementbasedmdtallowed( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_managementbasedmdtallowed( - uint8_t **ptr, - LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_managementbasedmdtallowed(uint8_t** ptr, + LIBLTE_S1AP_MANAGEMENTBASEDMDTALLOWED_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ManagementBasedMDTAllowed error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2746,18 +2359,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_managementbasedmdtallowed( /******************************************************************************* /* ProtocolIE PrivacyIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privacyindicator( - LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privacyindicator(LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PrivacyIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -2770,18 +2379,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_privacyindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privacyindicator( - uint8_t **ptr, - LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privacyindicator(uint8_t** ptr, LIBLTE_S1AP_PRIVACYINDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("PrivacyIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2797,18 +2402,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privacyindicator( /******************************************************************************* /* ProtocolIE MeasurementsToActivate STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementstoactivate( - LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementstoactivate(LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MeasurementsToActivate uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -2816,18 +2417,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementstoactivate( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementstoactivate( - uint8_t **ptr, - LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementstoactivate(uint8_t** ptr, + LIBLTE_S1AP_MEASUREMENTSTOACTIVATE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MeasurementsToActivate uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -2838,18 +2436,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementstoactivate( /******************************************************************************* /* ProtocolIE MessageIdentifier STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_messageidentifier( - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_messageidentifier(LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MessageIdentifier uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -2857,18 +2451,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_messageidentifier( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_messageidentifier( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_messageidentifier(uint8_t** ptr, LIBLTE_S1AP_MESSAGEIDENTIFIER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MessageIdentifier uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -2879,29 +2469,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_messageidentifier( /******************************************************************************* /* ProtocolIE MMEname PrintableString ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmename( - LIBLTE_S1AP_MMENAME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmename(LIBLTE_S1AP_MMENAME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - MMEname // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MMEname error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->n_octets-1, ptr, 8); + liblte_value_2_bits(ie->n_octets - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2909,19 +2495,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmename( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename( - uint8_t **ptr, - LIBLTE_S1AP_MMENAME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename(uint8_t** ptr, LIBLTE_S1AP_MMENAME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Printable string - MMEname // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MMEname error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -2931,7 +2513,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename( liblte_align_up(ptr, 8); uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2942,22 +2524,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmename( /******************************************************************************* /* ProtocolIE MME_Group_ID STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_group_id( - LIBLTE_S1AP_MME_GROUP_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_group_id(LIBLTE_S1AP_MME_GROUP_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - MME-Group-ID - if(LIBLTE_S1AP_MME_GROUP_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_MME_GROUP_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -2965,22 +2543,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_group_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_group_id( - uint8_t **ptr, - LIBLTE_S1AP_MME_GROUP_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_group_id(uint8_t** ptr, LIBLTE_S1AP_MME_GROUP_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - MME-Group-ID - if(LIBLTE_S1AP_MME_GROUP_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_MME_GROUP_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -2991,47 +2565,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_group_id( /******************************************************************************* /* ProtocolIE MME_UE_S1AP_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_ue_s1ap_id( - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_ue_s1ap_id(LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->MME_UE_S1AP_ID // lb:0, ub:4294967295 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->MME_UE_S1AP_ID-0)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 2); + uint32_t n_bits = floor(log2(ie->MME_UE_S1AP_ID - 0) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 2); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->MME_UE_S1AP_ID-0, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->MME_UE_S1AP_ID - 0, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_ue_s1ap_id( - uint8_t **ptr, - LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_ue_s1ap_id(uint8_t** ptr, LIBLTE_S1AP_MME_UE_S1AP_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->MME_UE_S1AP_ID // lb:0, ub:4294967295 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 2) + 1; liblte_align_up(ptr, 8); - ie->MME_UE_S1AP_ID = liblte_bits_2_value(ptr, n_octets*8) + 0; + ie->MME_UE_S1AP_ID = liblte_bits_2_value(ptr, n_octets * 8) + 0; } err = LIBLTE_SUCCESS; } @@ -3041,31 +2607,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_ue_s1ap_id( /******************************************************************************* /* ProtocolIE MSClassmark2 DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark2( - LIBLTE_S1AP_MSCLASSMARK2_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark2(LIBLTE_S1AP_MSCLASSMARK2_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - MSClassmark2 // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -3073,21 +2635,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark2( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2( - uint8_t **ptr, - LIBLTE_S1AP_MSCLASSMARK2_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2(uint8_t** ptr, LIBLTE_S1AP_MSCLASSMARK2_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - MSClassmark2 // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -3096,7 +2654,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -3107,31 +2665,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark2( /******************************************************************************* /* ProtocolIE NAS_PDU DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nas_pdu( - LIBLTE_S1AP_NAS_PDU_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nas_pdu(LIBLTE_S1AP_NAS_PDU_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NAS-PDU // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -3139,21 +2693,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nas_pdu( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu( - uint8_t **ptr, - LIBLTE_S1AP_NAS_PDU_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu(uint8_t** ptr, LIBLTE_S1AP_NAS_PDU_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NAS-PDU // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -3162,7 +2712,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -3173,31 +2723,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nas_pdu( /******************************************************************************* /* ProtocolIE NASSecurityParameterstoE_UTRAN DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparameterstoe_utran( - LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparameterstoe_utran(LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NASSecurityParameterstoE-UTRAN // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -3205,21 +2752,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparameterstoe_utran( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparameterstoe_utran( - uint8_t **ptr, - LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_nassecurityparameterstoe_utran(uint8_t** ptr, LIBLTE_S1AP_NASSECURITYPARAMETERSTOE_UTRAN_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NASSecurityParameterstoE-UTRAN // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -3228,7 +2772,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparameterstoe_utran( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -3239,19 +2783,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparameterstoe_utran( /******************************************************************************* /* ProtocolIE NumberOfBroadcasts INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcasts( - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcasts(LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->NumberOfBroadcasts // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->NumberOfBroadcasts, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -3259,19 +2799,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcasts( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcasts( - uint8_t **ptr, - LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcasts(uint8_t** ptr, LIBLTE_S1AP_NUMBEROFBROADCASTS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->NumberOfBroadcasts // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->NumberOfBroadcasts = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->NumberOfBroadcasts = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -3281,18 +2817,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcasts( /******************************************************************************* /* ProtocolIE OverloadAction ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadaction( - LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadaction(LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("OverloadAction error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3305,18 +2837,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadaction( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadaction( - uint8_t **ptr, - LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadaction(uint8_t** ptr, LIBLTE_S1AP_OVERLOADACTION_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("OverloadAction error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3332,18 +2860,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadaction( /******************************************************************************* /* ProtocolIE PagingDRX ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingdrx( - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingdrx(LIBLTE_S1AP_PAGINGDRX_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PagingDRX error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3356,18 +2880,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingdrx( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingdrx( - uint8_t **ptr, - LIBLTE_S1AP_PAGINGDRX_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingdrx(uint8_t** ptr, LIBLTE_S1AP_PAGINGDRX_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("PagingDRX error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3383,19 +2903,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingdrx( /******************************************************************************* /* ProtocolIE PDCP_SN INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_sn( - LIBLTE_S1AP_PDCP_SN_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_sn(LIBLTE_S1AP_PDCP_SN_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PDCP_SN // lb:0, ub:4095 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-12); + liblte_value_2_bits(0, ptr, (2 * 8) - 12); liblte_value_2_bits(ie->PDCP_SN, ptr, 12); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -3403,19 +2919,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_sn( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_sn( - uint8_t **ptr, - LIBLTE_S1AP_PDCP_SN_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_sn(uint8_t** ptr, LIBLTE_S1AP_PDCP_SN_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PDCP_SN // lb:0, ub:4095 liblte_align_up(ptr, 8); - ie->PDCP_SN = (uint16_t)liblte_bits_2_value(ptr, 2*8); + ie->PDCP_SN = (uint16_t)liblte_bits_2_value(ptr, 2 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -3425,22 +2937,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_sn( /******************************************************************************* /* ProtocolIE Port_Number STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_port_number( - LIBLTE_S1AP_PORT_NUMBER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_port_number(LIBLTE_S1AP_PORT_NUMBER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - Port-Number - if(LIBLTE_S1AP_PORT_NUMBER_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_PORT_NUMBER_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -3448,22 +2956,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_port_number( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_port_number( - uint8_t **ptr, - LIBLTE_S1AP_PORT_NUMBER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_port_number(uint8_t** ptr, LIBLTE_S1AP_PORT_NUMBER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - Port-Number - if(LIBLTE_S1AP_PORT_NUMBER_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_PORT_NUMBER_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -3474,15 +2978,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_port_number( /******************************************************************************* /* ProtocolIE Pre_emptionVulnerability ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptionvulnerability( - LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptionvulnerability(LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 1); err = LIBLTE_SUCCESS; @@ -3490,15 +2991,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptionvulnerability( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptionvulnerability( - uint8_t **ptr, - LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptionvulnerability(uint8_t** ptr, + LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM)liblte_bits_2_value(ptr, 1); err = LIBLTE_SUCCESS; @@ -3509,18 +3007,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptionvulnerability( /******************************************************************************* /* ProtocolIE PS_ServiceNotAvailable ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ps_servicenotavailable( - LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ps_servicenotavailable(LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PS_ServiceNotAvailable error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3533,18 +3028,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ps_servicenotavailable( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ps_servicenotavailable( - uint8_t **ptr, - LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ps_servicenotavailable(uint8_t** ptr, + LIBLTE_S1AP_PS_SERVICENOTAVAILABLE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("PS_ServiceNotAvailable error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3560,19 +3052,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ps_servicenotavailable( /******************************************************************************* /* ProtocolIE ReceiveStatusofULPDCPSDUs STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdus( - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdus(LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - ReceiveStatusofULPDCPSDUs liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -3581,19 +3070,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdus( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdus( - uint8_t **ptr, - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdus(uint8_t** ptr, + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - ReceiveStatusofULPDCPSDUs liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -3605,19 +3091,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdus( /******************************************************************************* /* ProtocolIE RelativeMMECapacity INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_relativemmecapacity( - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_relativemmecapacity(LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RelativeMMECapacity // lb:0, ub:255 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-8); + liblte_value_2_bits(0, ptr, (1 * 8) - 8); liblte_value_2_bits(ie->RelativeMMECapacity, ptr, 8); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -3625,19 +3107,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_relativemmecapacity( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relativemmecapacity( - uint8_t **ptr, - LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relativemmecapacity(uint8_t** ptr, LIBLTE_S1AP_RELATIVEMMECAPACITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RelativeMMECapacity // lb:0, ub:255 liblte_align_up(ptr, 8); - ie->RelativeMMECapacity = (uint8_t)liblte_bits_2_value(ptr, 1.0*8); + ie->RelativeMMECapacity = (uint8_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -3647,22 +3125,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relativemmecapacity( /******************************************************************************* /* ProtocolIE RAC STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rac( - LIBLTE_S1AP_RAC_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rac(LIBLTE_S1AP_RAC_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - RAC - if(LIBLTE_S1AP_RAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_RAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -3670,22 +3144,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rac( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rac( - uint8_t **ptr, - LIBLTE_S1AP_RAC_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rac(uint8_t** ptr, LIBLTE_S1AP_RAC_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - RAC - if(LIBLTE_S1AP_RAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_RAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -3696,15 +3166,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rac( /******************************************************************************* /* ProtocolIE ReportIntervalMDT ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportintervalmdt( - LIBLTE_S1AP_REPORTINTERVALMDT_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportintervalmdt(LIBLTE_S1AP_REPORTINTERVALMDT_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 4); err = LIBLTE_SUCCESS; @@ -3712,15 +3178,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportintervalmdt( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportintervalmdt( - uint8_t **ptr, - LIBLTE_S1AP_REPORTINTERVALMDT_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportintervalmdt(uint8_t** ptr, LIBLTE_S1AP_REPORTINTERVALMDT_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_REPORTINTERVALMDT_ENUM)liblte_bits_2_value(ptr, 4); err = LIBLTE_SUCCESS; @@ -3731,18 +3193,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportintervalmdt( /******************************************************************************* /* ProtocolIE ReportArea ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportarea( - LIBLTE_S1AP_REPORTAREA_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportarea(LIBLTE_S1AP_REPORTAREA_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ReportArea error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3755,18 +3213,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportarea( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportarea( - uint8_t **ptr, - LIBLTE_S1AP_REPORTAREA_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportarea(uint8_t** ptr, LIBLTE_S1AP_REPORTAREA_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ReportArea error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3782,19 +3236,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportarea( /******************************************************************************* /* ProtocolIE RNC_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rnc_id( - LIBLTE_S1AP_RNC_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rnc_id(LIBLTE_S1AP_RNC_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RNC_ID // lb:0, ub:4095 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-12); + liblte_value_2_bits(0, ptr, (1 * 8) - 12); liblte_value_2_bits(ie->RNC_ID, ptr, 12); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -3802,19 +3252,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rnc_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rnc_id( - uint8_t **ptr, - LIBLTE_S1AP_RNC_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rnc_id(uint8_t** ptr, LIBLTE_S1AP_RNC_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RNC_ID // lb:0, ub:4095 liblte_align_up(ptr, 8); - ie->RNC_ID = (uint16_t)liblte_bits_2_value(ptr, 1.0*8); + ie->RNC_ID = (uint16_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -3824,18 +3270,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rnc_id( /******************************************************************************* /* ProtocolIE RRC_Establishment_Cause ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_establishment_cause( - LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_establishment_cause(LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("RRC_Establishment_Cause error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3848,18 +3291,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_establishment_cause( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_establishment_cause( - uint8_t **ptr, - LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_establishment_cause(uint8_t** ptr, + LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("RRC_Establishment_Cause error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3875,19 +3315,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_establishment_cause( /******************************************************************************* /* ProtocolIE Routing_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_routing_id( - LIBLTE_S1AP_ROUTING_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_routing_id(LIBLTE_S1AP_ROUTING_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Routing_ID // lb:0, ub:255 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-8); + liblte_value_2_bits(0, ptr, (1 * 8) - 8); liblte_value_2_bits(ie->Routing_ID, ptr, 8); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -3895,19 +3331,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_routing_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_routing_id( - uint8_t **ptr, - LIBLTE_S1AP_ROUTING_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_routing_id(uint8_t** ptr, LIBLTE_S1AP_ROUTING_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Routing_ID // lb:0, ub:255 liblte_align_up(ptr, 8); - ie->Routing_ID = (uint8_t)liblte_bits_2_value(ptr, 1.0*8); + ie->Routing_ID = (uint8_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -3917,18 +3349,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_routing_id( /******************************************************************************* /* ProtocolIE SONInformationRequest ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationrequest( - LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationrequest(LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SONInformationRequest error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -3941,18 +3369,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationrequest( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationrequest(uint8_t** ptr, + LIBLTE_S1AP_SONINFORMATIONREQUEST_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SONInformationRequest error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -3968,31 +3393,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationrequest( /******************************************************************************* /* ProtocolIE Source_ToTarget_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_source_totarget_transparentcontainer( - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_source_totarget_transparentcontainer(LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Source-ToTarget-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4000,21 +3423,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_source_totarget_transparentcontainer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_source_totarget_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_source_totarget_transparentcontainer(uint8_t** ptr, + LIBLTE_S1AP_SOURCE_TOTARGET_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Source-ToTarget-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4023,7 +3444,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_source_totarget_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4034,18 +3455,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_source_totarget_transparentcontainer( /******************************************************************************* /* ProtocolIE SRVCCHOIndication ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvcchoindication( - LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvcchoindication(LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SRVCCHOIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4058,18 +3475,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvcchoindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvcchoindication( - uint8_t **ptr, - LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvcchoindication(uint8_t** ptr, LIBLTE_S1AP_SRVCCHOINDICATION_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SRVCCHOIndication error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4086,30 +3499,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvcchoindication( /* ProtocolIE SourceRNC_ToTargetRNC_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcernc_totargetrnc_transparentcontainer( - LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - SourceRNC-ToTargetRNC-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4118,20 +3528,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcernc_totargetrnc_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_SOURCERNC_TOTARGETRNC_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - SourceRNC-ToTargetRNC-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4140,7 +3547,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4151,19 +3558,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcernc_totargetrnc_transparentcontainer( /******************************************************************************* /* ProtocolIE SubscriberProfileIDforRFP INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_subscriberprofileidforrfp( - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_subscriberprofileidforrfp(LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->SubscriberProfileIDforRFP // lb:1, ub:256 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-8); + liblte_value_2_bits(0, ptr, (1 * 8) - 8); liblte_value_2_bits(ie->SubscriberProfileIDforRFP, ptr, 8); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -4171,19 +3575,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_subscriberprofileidforrfp( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_subscriberprofileidforrfp( - uint8_t **ptr, - LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_subscriberprofileidforrfp(uint8_t** ptr, + LIBLTE_S1AP_SUBSCRIBERPROFILEIDFORRFP_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->SubscriberProfileIDforRFP // lb:1, ub:256 liblte_align_up(ptr, 8); - ie->SubscriberProfileIDforRFP = (uint8_t)liblte_bits_2_value(ptr, 1.0*8); + ie->SubscriberProfileIDforRFP = (uint8_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -4193,18 +3594,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_subscriberprofileidforrfp( /******************************************************************************* /* ProtocolIE SynchronizationStatus ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_synchronizationstatus( - LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_synchronizationstatus(LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SynchronizationStatus error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4217,18 +3614,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_synchronizationstatus( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_synchronizationstatus( - uint8_t **ptr, - LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_synchronizationstatus(uint8_t** ptr, + LIBLTE_S1AP_SYNCHRONIZATIONSTATUS_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SynchronizationStatus error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4245,30 +3639,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_synchronizationstatus( /* ProtocolIE TargetRNC_ToSourceRNC_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_tosourcernc_transparentcontainer( - LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - TargetRNC-ToSourceRNC-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4277,20 +3668,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_tosourcernc_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_TARGETRNC_TOSOURCERNC_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - TargetRNC-ToSourceRNC-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4299,7 +3687,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4310,15 +3698,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_tosourcernc_transparentcontainer( /******************************************************************************* /* ProtocolIE Threshold_RSRQ INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrq( - LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrq(LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Threshold_RSRQ // lb:0, ub:34 liblte_value_2_bits(ie->Threshold_RSRQ, ptr, 6); @@ -4327,19 +3711,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrq( - uint8_t **ptr, - LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrq(uint8_t** ptr, LIBLTE_S1AP_THRESHOLD_RSRQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Threshold_RSRQ // lb:0, ub:34 ie->Threshold_RSRQ = (uint8_t)liblte_bits_2_value(ptr, 6); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -4347,19 +3727,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrq( /******************************************************************************* /* ProtocolIE Time_UE_StayedInCell INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell( - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell(LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Time_UE_StayedInCell // lb:0, ub:4095 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-12); + liblte_value_2_bits(0, ptr, (1 * 8) - 12); liblte_value_2_bits(ie->Time_UE_StayedInCell, ptr, 12); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -4367,19 +3743,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell( - uint8_t **ptr, - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell(uint8_t** ptr, LIBLTE_S1AP_TIME_UE_STAYEDINCELL_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Time_UE_StayedInCell // lb:0, ub:4095 liblte_align_up(ptr, 8); - ie->Time_UE_StayedInCell = (uint16_t)liblte_bits_2_value(ptr, 1.0*8); + ie->Time_UE_StayedInCell = (uint16_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -4389,31 +3761,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell( /******************************************************************************* /* ProtocolIE TransportLayerAddress DYNAMIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportlayeraddress( - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportlayeraddress(LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic bit string - TransportLayerAddress // lb:1, ub:160 // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TransportLayerAddress error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->n_bits-1, ptr, 8); + liblte_value_2_bits(ie->n_bits - 1, ptr, 8); liblte_align_up_zero(ptr, 8); - + // Bits uint32_t i; - for(i=0;in_bits;i++) { + for (i = 0; i < ie->n_bits; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -4422,20 +3790,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportlayeraddress( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress( - uint8_t **ptr, - LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress(uint8_t** ptr, LIBLTE_S1AP_TRANSPORTLAYERADDRESS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic bit string - TransportLayerAddress // lb:1, ub:160 // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TransportLayerAddress error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4446,7 +3810,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress( // Bits uint32_t i; - for(i=0;in_bits;i++) { + for (i = 0; i < ie->n_bits; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -4458,18 +3822,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportlayeraddress( /******************************************************************************* /* ProtocolIE TraceDepth ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracedepth( - LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracedepth(LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TraceDepth error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4482,18 +3842,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracedepth( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracedepth( - uint8_t **ptr, - LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracedepth(uint8_t** ptr, LIBLTE_S1AP_TRACEDEPTH_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TraceDepth error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4509,15 +3865,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracedepth( /******************************************************************************* /* ProtocolIE TrafficLoadReductionIndication INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_trafficloadreductionindication( - LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_trafficloadreductionindication(LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->TrafficLoadReductionIndication // lb:1, ub:99 liblte_value_2_bits(ie->TrafficLoadReductionIndication, ptr, 7); @@ -4526,19 +3879,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_trafficloadreductionindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_trafficloadreductionindication( - uint8_t **ptr, - LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_trafficloadreductionindication(uint8_t** ptr, LIBLTE_S1AP_TRAFFICLOADREDUCTIONINDICATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->TrafficLoadReductionIndication // lb:1, ub:99 ie->TrafficLoadReductionIndication = (uint8_t)liblte_bits_2_value(ptr, 7); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -4546,31 +3896,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_trafficloadreductionindication( /******************************************************************************* /* ProtocolIE UERadioCapability DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapability( - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapability(LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - UERadioCapability // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4578,21 +3924,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapability( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability( - uint8_t **ptr, - LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability(uint8_t** ptr, LIBLTE_S1AP_UERADIOCAPABILITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - UERadioCapability // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4601,7 +3943,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4612,22 +3954,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapability( /******************************************************************************* /* ProtocolIE WarningType STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningtype( - LIBLTE_S1AP_WARNINGTYPE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningtype(LIBLTE_S1AP_WARNINGTYPE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - WarningType - if(LIBLTE_S1AP_WARNINGTYPE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_WARNINGTYPE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4635,22 +3973,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningtype( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningtype( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGTYPE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningtype(uint8_t** ptr, LIBLTE_S1AP_WARNINGTYPE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - WarningType - if(LIBLTE_S1AP_WARNINGTYPE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_WARNINGTYPE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4661,31 +3995,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningtype( /******************************************************************************* /* ProtocolIE WarningMessageContents DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningmessagecontents( - LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningmessagecontents(LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - WarningMessageContents // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4693,21 +4023,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningmessagecontents( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents(uint8_t** ptr, + LIBLTE_S1AP_WARNINGMESSAGECONTENTS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - WarningMessageContents // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4716,7 +4043,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4727,18 +4054,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningmessagecontents( /******************************************************************************* /* ProtocolIE CauseProtocol ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeprotocol( - LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeprotocol(LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CauseProtocol error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4751,18 +4074,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_causeprotocol( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeprotocol( - uint8_t **ptr, - LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeprotocol(uint8_t** ptr, LIBLTE_S1AP_CAUSEPROTOCOL_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CauseProtocol error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4778,18 +4097,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causeprotocol( /******************************************************************************* /* ProtocolIE CellAccessMode ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellaccessmode( - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellaccessmode(LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CellAccessMode error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4802,18 +4117,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellaccessmode( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellaccessmode( - uint8_t **ptr, - LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellaccessmode(uint8_t** ptr, LIBLTE_S1AP_CELLACCESSMODE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CellAccessMode error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4829,18 +4140,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellaccessmode( /******************************************************************************* /* ProtocolIE Cdma2000RATType ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000rattype( - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000rattype(LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000RATType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4853,18 +4160,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000rattype( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000rattype( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000rattype(uint8_t** ptr, LIBLTE_S1AP_CDMA2000RATTYPE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000RATType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4880,31 +4183,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000rattype( /******************************************************************************* /* ProtocolIE Cdma2000OneXMEID DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmeid( - LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmeid(LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXMEID // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -4912,21 +4211,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexmeid( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXMEID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXMEID // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -4935,7 +4230,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -4946,18 +4241,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexmeid( /******************************************************************************* /* ProtocolIE Cell_Size ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cell_size( - LIBLTE_S1AP_CELL_SIZE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cell_size(LIBLTE_S1AP_CELL_SIZE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cell_Size error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -4970,18 +4261,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cell_size( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cell_size( - uint8_t **ptr, - LIBLTE_S1AP_CELL_SIZE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cell_size(uint8_t** ptr, LIBLTE_S1AP_CELL_SIZE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cell_Size error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -4997,22 +4284,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cell_size( /******************************************************************************* /* ProtocolIE CI STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ci( - LIBLTE_S1AP_CI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ci(LIBLTE_S1AP_CI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - CI - if(LIBLTE_S1AP_CI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_CI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -5020,22 +4303,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ci( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ci( - uint8_t **ptr, - LIBLTE_S1AP_CI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ci(uint8_t** ptr, LIBLTE_S1AP_CI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - CI - if(LIBLTE_S1AP_CI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_CI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -5046,18 +4325,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ci( /******************************************************************************* /* ProtocolIE CSFallbackIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csfallbackindicator( - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csfallbackindicator(LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CSFallbackIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5070,18 +4345,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_csfallbackindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csfallbackindicator( - uint8_t **ptr, - LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csfallbackindicator(uint8_t** ptr, LIBLTE_S1AP_CSFALLBACKINDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CSFallbackIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5097,15 +4368,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csfallbackindicator( /******************************************************************************* /* ProtocolIE CSGMembershipStatus ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csgmembershipstatus( - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csgmembershipstatus(LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 1); err = LIBLTE_SUCCESS; @@ -5113,15 +4380,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_csgmembershipstatus( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csgmembershipstatus( - uint8_t **ptr, - LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csgmembershipstatus(uint8_t** ptr, LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_CSGMEMBERSHIPSTATUS_ENUM)liblte_bits_2_value(ptr, 1); err = LIBLTE_SUCCESS; @@ -5132,18 +4395,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csgmembershipstatus( /******************************************************************************* /* ProtocolIE DataCodingScheme STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_datacodingscheme( - LIBLTE_S1AP_DATACODINGSCHEME_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_datacodingscheme(LIBLTE_S1AP_DATACODINGSCHEME_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - DataCodingScheme uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -5151,18 +4410,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_datacodingscheme( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_datacodingscheme( - uint8_t **ptr, - LIBLTE_S1AP_DATACODINGSCHEME_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_datacodingscheme(uint8_t** ptr, LIBLTE_S1AP_DATACODINGSCHEME_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - DataCodingScheme uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -5174,25 +4429,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_datacodingscheme( /* ProtocolIE EmergencyAreaIDList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlist( - LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlist(LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("EmergencyAreaIDList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("EmergencyAreaIDList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_emergencyareaid(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_emergencyareaid(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -5201,25 +4453,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlist( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlist(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAIDLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("EmergencyAreaIDList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("EmergencyAreaIDList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_emergencyareaid(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_emergencyareaid(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -5232,25 +4481,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlist( /* ProtocolIE EmergencyAreaIDListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlistforrestart( - LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlistforrestart(LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("EmergencyAreaIDListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaIDListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_emergencyareaid(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_emergencyareaid(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -5259,25 +4507,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaidlistforrestart( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlistforrestart(uint8_t** ptr, + LIBLTE_S1AP_EMERGENCYAREAIDLISTFORRESTART_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("EmergencyAreaIDListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaIDListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_emergencyareaid(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_emergencyareaid(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -5289,47 +4536,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaidlistforrestart( /******************************************************************************* /* ProtocolIE ENB_UE_S1AP_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_ue_s1ap_id( - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_ue_s1ap_id(LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ENB_UE_S1AP_ID // lb:0, ub:16777215 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->ENB_UE_S1AP_ID-0)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 2); + uint32_t n_bits = floor(log2(ie->ENB_UE_S1AP_ID - 0) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 2); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->ENB_UE_S1AP_ID-0, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->ENB_UE_S1AP_ID - 0, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_ue_s1ap_id( - uint8_t **ptr, - LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_ue_s1ap_id(uint8_t** ptr, LIBLTE_S1AP_ENB_UE_S1AP_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ENB_UE_S1AP_ID // lb:0, ub:16777215 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 2) + 1; liblte_align_up(ptr, 8); - ie->ENB_UE_S1AP_ID = liblte_bits_2_value(ptr, n_octets*8) + 0; + ie->ENB_UE_S1AP_ID = liblte_bits_2_value(ptr, n_octets * 8) + 0; } err = LIBLTE_SUCCESS; } @@ -5339,20 +4578,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_ue_s1ap_id( /******************************************************************************* /* ProtocolIE E_RAB_ID INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_id( - LIBLTE_S1AP_E_RAB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_id(LIBLTE_S1AP_E_RAB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->E_RAB_ID // lb:0, ub:15 // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ie->E_RAB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5362,25 +4597,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_id( - uint8_t **ptr, - LIBLTE_S1AP_E_RAB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_id(uint8_t** ptr, LIBLTE_S1AP_E_RAB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->E_RAB_ID // lb:0, ub:15 // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ie->E_RAB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->E_RAB_ID = (uint8_t)liblte_bits_2_value(ptr, 4); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -5388,57 +4619,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_id( /******************************************************************************* /* ProtocolIE E_RABInformationListItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem( - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem(LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABInformationListItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->dL_Forwarding_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->dL_Forwarding_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->dL_Forwarding_present) { - if(liblte_s1ap_pack_dl_forwarding(&ie->dL_Forwarding, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->dL_Forwarding_present) { + if (liblte_s1ap_pack_dl_forwarding(&ie->dL_Forwarding, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABINFORMATIONLISTITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABInformationListItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5446,20 +4671,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem( ie->dL_Forwarding_present = liblte_bits_2_value(ptr, 1); ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->dL_Forwarding_present) { - if(liblte_s1ap_unpack_dl_forwarding(ptr, &ie->dL_Forwarding) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->dL_Forwarding_present) { + if (liblte_s1ap_unpack_dl_forwarding(ptr, &ie->dL_Forwarding) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -5469,19 +4694,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem( /******************************************************************************* /* ProtocolIE EUTRANRoundTripDelayEstimationInfo INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutranroundtripdelayestimationinfo( - LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_eutranroundtripdelayestimationinfo(LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->EUTRANRoundTripDelayEstimationInfo // lb:0, ub:2047 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-11); + liblte_value_2_bits(0, ptr, (1 * 8) - 11); liblte_value_2_bits(ie->EUTRANRoundTripDelayEstimationInfo, ptr, 11); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -5489,19 +4712,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutranroundtripdelayestimationinfo( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutranroundtripdelayestimationinfo( - uint8_t **ptr, - LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_eutranroundtripdelayestimationinfo(uint8_t** ptr, + LIBLTE_S1AP_EUTRANROUNDTRIPDELAYESTIMATIONINFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->EUTRANRoundTripDelayEstimationInfo // lb:0, ub:2047 liblte_align_up(ptr, 8); - ie->EUTRANRoundTripDelayEstimationInfo = (uint16_t)liblte_bits_2_value(ptr, 1.0*8); + ie->EUTRANRoundTripDelayEstimationInfo = (uint16_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -5512,25 +4733,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutranroundtripdelayestimationinfo( /* ProtocolIE ForbiddenLACs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:4096 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlacs( - LIBLTE_S1AP_FORBIDDENLACS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlacs(LIBLTE_S1AP_FORBIDDENLACS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ForbiddenLACs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ForbiddenLACs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 12); + liblte_value_2_bits(ie->len - 1, ptr, 12); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_lac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_lac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -5539,25 +4757,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlacs( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlacs( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLACS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlacs(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLACS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 12) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ForbiddenLACs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ForbiddenLACs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_lac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_lac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -5569,22 +4784,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlacs( /******************************************************************************* /* ProtocolIE GTP_TEID STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gtp_teid( - LIBLTE_S1AP_GTP_TEID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gtp_teid(LIBLTE_S1AP_GTP_TEID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - GTP-TEID - if(LIBLTE_S1AP_GTP_TEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_GTP_TEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -5592,22 +4803,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gtp_teid( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gtp_teid( - uint8_t **ptr, - LIBLTE_S1AP_GTP_TEID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gtp_teid(uint8_t** ptr, LIBLTE_S1AP_GTP_TEID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - GTP-TEID - if(LIBLTE_S1AP_GTP_TEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_GTP_TEID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -5618,18 +4825,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gtp_teid( /******************************************************************************* /* ProtocolIE GUMMEIType ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeitype( - LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeitype(LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("GUMMEIType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5642,18 +4845,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeitype( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeitype( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeitype(uint8_t** ptr, LIBLTE_S1AP_GUMMEITYPE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("GUMMEIType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5669,18 +4868,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeitype( /******************************************************************************* /* ProtocolIE HandoverType ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovertype( - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovertype(LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("HandoverType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5693,18 +4888,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovertype( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovertype( - uint8_t **ptr, - LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovertype(uint8_t** ptr, LIBLTE_S1AP_HANDOVERTYPE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("HandoverType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5720,25 +4911,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovertype( /******************************************************************************* /* ProtocolIE IntegrityProtectionAlgorithms STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_integrityprotectionalgorithms( - LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_integrityprotectionalgorithms(LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - IntegrityProtectionAlgorithms // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("IntegrityProtectionAlgorithms error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -5746,25 +4934,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_integrityprotectionalgorithms( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_integrityprotectionalgorithms( - uint8_t **ptr, - LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_integrityprotectionalgorithms(uint8_t** ptr, + LIBLTE_S1AP_INTEGRITYPROTECTIONALGORITHMS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - IntegrityProtectionAlgorithms // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("IntegrityProtectionAlgorithms error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -5775,18 +4960,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_integrityprotectionalgorithms( /******************************************************************************* /* ProtocolIE LastVisitedGERANCellInformation CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedgerancellinformation( - LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedgerancellinformation(LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedGERANCellInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5794,26 +4976,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedgerancellinformation( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNDEFINED) { - } + // Choice + if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNDEFINED) { + } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedgerancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedgerancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedGERANCellInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5821,9 +5001,9 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedgerancellinformation( // Choice type ie->choice_type = (LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_ENUM)liblte_bits_2_value(ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNDEFINED) { - } + // Choice + if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDGERANCELLINFORMATION_CHOICE_UNDEFINED) { + } err = LIBLTE_SUCCESS; } return err; @@ -5832,18 +5012,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedgerancellinformation( /******************************************************************************* /* ProtocolIE Links_to_log ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_links_to_log( - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_links_to_log(LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Links_to_log error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5856,18 +5032,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_links_to_log( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_links_to_log( - uint8_t **ptr, - LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_links_to_log(uint8_t** ptr, LIBLTE_S1AP_LINKS_TO_LOG_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Links_to_log error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5883,15 +5055,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_links_to_log( /******************************************************************************* /* ProtocolIE LoggingInterval ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_logginginterval( - LIBLTE_S1AP_LOGGINGINTERVAL_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_logginginterval(LIBLTE_S1AP_LOGGINGINTERVAL_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 3); err = LIBLTE_SUCCESS; @@ -5899,15 +5067,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_logginginterval( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_logginginterval( - uint8_t **ptr, - LIBLTE_S1AP_LOGGINGINTERVAL_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_logginginterval(uint8_t** ptr, LIBLTE_S1AP_LOGGINGINTERVAL_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_LOGGINGINTERVAL_ENUM)liblte_bits_2_value(ptr, 3); err = LIBLTE_SUCCESS; @@ -5918,18 +5082,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_logginginterval( /******************************************************************************* /* ProtocolIE M3period ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3period( - LIBLTE_S1AP_M3PERIOD_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3period(LIBLTE_S1AP_M3PERIOD_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M3period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5942,18 +5102,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3period( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3period( - uint8_t **ptr, - LIBLTE_S1AP_M3PERIOD_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3period(uint8_t** ptr, LIBLTE_S1AP_M3PERIOD_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M3period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -5969,18 +5125,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3period( /******************************************************************************* /* ProtocolIE M4period ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4period( - LIBLTE_S1AP_M4PERIOD_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4period(LIBLTE_S1AP_M4PERIOD_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M4period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -5993,18 +5145,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4period( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4period( - uint8_t **ptr, - LIBLTE_S1AP_M4PERIOD_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4period(uint8_t** ptr, LIBLTE_S1AP_M4PERIOD_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M4period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6020,18 +5168,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4period( /******************************************************************************* /* ProtocolIE M5period ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5period( - LIBLTE_S1AP_M5PERIOD_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5period(LIBLTE_S1AP_M5PERIOD_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M5period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6044,18 +5188,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5period( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5period( - uint8_t **ptr, - LIBLTE_S1AP_M5PERIOD_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5period(uint8_t** ptr, LIBLTE_S1AP_M5PERIOD_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M5period error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6071,19 +5211,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5period( /******************************************************************************* /* ProtocolIE MobilityInformation STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mobilityinformation( - LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mobilityinformation(LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MobilityInformation liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -6092,19 +5228,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mobilityinformation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mobilityinformation( - uint8_t **ptr, - LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mobilityinformation(uint8_t** ptr, LIBLTE_S1AP_MOBILITYINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MobilityInformation liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -6116,22 +5248,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mobilityinformation( /******************************************************************************* /* ProtocolIE MME_Code STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_code( - LIBLTE_S1AP_MME_CODE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_code(LIBLTE_S1AP_MME_CODE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - MME-Code - if(LIBLTE_S1AP_MME_CODE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_MME_CODE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -6139,22 +5267,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mme_code( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_code( - uint8_t **ptr, - LIBLTE_S1AP_MME_CODE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_code(uint8_t** ptr, LIBLTE_S1AP_MME_CODE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - MME-Code - if(LIBLTE_S1AP_MME_CODE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_MME_CODE_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -6165,31 +5289,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mme_code( /******************************************************************************* /* ProtocolIE MSClassmark3 DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark3( - LIBLTE_S1AP_MSCLASSMARK3_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark3(LIBLTE_S1AP_MSCLASSMARK3_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - MSClassmark3 // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -6197,21 +5317,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_msclassmark3( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3( - uint8_t **ptr, - LIBLTE_S1AP_MSCLASSMARK3_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3(uint8_t** ptr, LIBLTE_S1AP_MSCLASSMARK3_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - MSClassmark3 // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -6220,7 +5336,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -6231,19 +5347,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_msclassmark3( /******************************************************************************* /* ProtocolIE NumberofBroadcastRequest INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcastrequest( - LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcastrequest(LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->NumberofBroadcastRequest // lb:0, ub:65535 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->NumberofBroadcastRequest, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -6251,19 +5364,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_numberofbroadcastrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcastrequest( - uint8_t **ptr, - LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcastrequest(uint8_t** ptr, + LIBLTE_S1AP_NUMBEROFBROADCASTREQUEST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->NumberofBroadcastRequest // lb:0, ub:65535 liblte_align_up(ptr, 8); - ie->NumberofBroadcastRequest = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->NumberofBroadcastRequest = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -6273,18 +5383,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_numberofbroadcastrequest( /******************************************************************************* /* ProtocolIE OverloadResponse CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadresponse( - LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadresponse(LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("OverloadResponse error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6292,29 +5398,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadresponse( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_OVERLOADACTION) { - if(liblte_s1ap_pack_overloadaction(&ie->choice.overloadAction, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_OVERLOADACTION) { + if (liblte_s1ap_pack_overloadaction(&ie->choice.overloadAction, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse( - uint8_t **ptr, - LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse(uint8_t** ptr, LIBLTE_S1AP_OVERLOADRESPONSE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("OverloadResponse error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6322,12 +5424,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse( // Choice type ie->choice_type = (LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_ENUM)liblte_bits_2_value(ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_OVERLOADACTION) { - if(liblte_s1ap_unpack_overloadaction(ptr, &ie->choice.overloadAction) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_OVERLOADRESPONSE_CHOICE_OVERLOADACTION) { + if (liblte_s1ap_unpack_overloadaction(ptr, &ie->choice.overloadAction) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -6336,19 +5438,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadresponse( /******************************************************************************* /* ProtocolIE PDCP_SNExtended INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_snextended( - LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_snextended(LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PDCP_SNExtended // lb:0, ub:32767 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-15); + liblte_value_2_bits(0, ptr, (1 * 8) - 15); liblte_value_2_bits(ie->PDCP_SNExtended, ptr, 15); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -6356,19 +5454,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pdcp_snextended( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_snextended( - uint8_t **ptr, - LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_snextended(uint8_t** ptr, LIBLTE_S1AP_PDCP_SNEXTENDED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PDCP_SNExtended // lb:0, ub:32767 liblte_align_up(ptr, 8); - ie->PDCP_SNExtended = (uint16_t)liblte_bits_2_value(ptr, 1.0*8); + ie->PDCP_SNExtended = (uint16_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -6378,15 +5472,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pdcp_snextended( /******************************************************************************* /* ProtocolIE Pre_emptionCapability ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptioncapability( - LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptioncapability(LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 1); err = LIBLTE_SUCCESS; @@ -6394,15 +5484,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pre_emptioncapability( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptioncapability( - uint8_t **ptr, - LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptioncapability(uint8_t** ptr, LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_ENUM)liblte_bits_2_value(ptr, 1); err = LIBLTE_SUCCESS; @@ -6413,19 +5499,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pre_emptioncapability( /******************************************************************************* /* ProtocolIE QCI INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_qci( - LIBLTE_S1AP_QCI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_qci(LIBLTE_S1AP_QCI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->QCI // lb:0, ub:255 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-8); + liblte_value_2_bits(0, ptr, (1 * 8) - 8); liblte_value_2_bits(ie->QCI, ptr, 8); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -6433,19 +5515,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_qci( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_qci( - uint8_t **ptr, - LIBLTE_S1AP_QCI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_qci(uint8_t** ptr, LIBLTE_S1AP_QCI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->QCI // lb:0, ub:255 liblte_align_up(ptr, 8); - ie->QCI = (uint8_t)liblte_bits_2_value(ptr, 1.0*8); + ie->QCI = (uint8_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -6455,18 +5533,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_qci( /******************************************************************************* /* ProtocolIE RelayNode_Indicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_relaynode_indicator( - LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_relaynode_indicator(LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("RelayNode_Indicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6479,18 +5553,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_relaynode_indicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relaynode_indicator( - uint8_t **ptr, - LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relaynode_indicator(uint8_t** ptr, LIBLTE_S1AP_RELAYNODE_INDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("RelayNode_Indicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6506,18 +5576,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_relaynode_indicator( /******************************************************************************* /* ProtocolIE M1ReportingTrigger ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1reportingtrigger( - LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1reportingtrigger(LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M1ReportingTrigger error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6530,18 +5596,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1reportingtrigger( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1reportingtrigger( - uint8_t **ptr, - LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1reportingtrigger(uint8_t** ptr, LIBLTE_S1AP_M1REPORTINGTRIGGER_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M1ReportingTrigger error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6557,31 +5619,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1reportingtrigger( /******************************************************************************* /* ProtocolIE RIMInformation DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_riminformation( - LIBLTE_S1AP_RIMINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_riminformation(LIBLTE_S1AP_RIMINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - RIMInformation // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -6589,21 +5647,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_riminformation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation( - uint8_t **ptr, - LIBLTE_S1AP_RIMINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation(uint8_t** ptr, LIBLTE_S1AP_RIMINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - RIMInformation // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -6612,7 +5666,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -6623,19 +5677,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_riminformation( /******************************************************************************* /* ProtocolIE RepetitionPeriod INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_repetitionperiod( - LIBLTE_S1AP_REPETITIONPERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_repetitionperiod(LIBLTE_S1AP_REPETITIONPERIOD_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RepetitionPeriod // lb:0, ub:4095 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (1*8)-12); + liblte_value_2_bits(0, ptr, (1 * 8) - 12); liblte_value_2_bits(ie->RepetitionPeriod, ptr, 12); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -6643,19 +5693,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_repetitionperiod( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_repetitionperiod( - uint8_t **ptr, - LIBLTE_S1AP_REPETITIONPERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_repetitionperiod(uint8_t** ptr, LIBLTE_S1AP_REPETITIONPERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->RepetitionPeriod // lb:0, ub:4095 liblte_align_up(ptr, 8); - ie->RepetitionPeriod = (uint16_t)liblte_bits_2_value(ptr, 1.0*8); + ie->RepetitionPeriod = (uint16_t)liblte_bits_2_value(ptr, 1.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -6665,19 +5711,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_repetitionperiod( /******************************************************************************* /* ProtocolIE SecurityKey STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitykey( - LIBLTE_S1AP_SECURITYKEY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitykey(LIBLTE_S1AP_SECURITYKEY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - SecurityKey liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -6686,19 +5728,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitykey( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitykey( - uint8_t **ptr, - LIBLTE_S1AP_SECURITYKEY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitykey(uint8_t** ptr, LIBLTE_S1AP_SECURITYKEY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - SecurityKey liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -6710,18 +5748,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitykey( /******************************************************************************* /* ProtocolIE SerialNumber STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_serialnumber( - LIBLTE_S1AP_SERIALNUMBER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_serialnumber(LIBLTE_S1AP_SERIALNUMBER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - SerialNumber uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -6729,18 +5763,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_serialnumber( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_serialnumber( - uint8_t **ptr, - LIBLTE_S1AP_SERIALNUMBER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_serialnumber(uint8_t** ptr, LIBLTE_S1AP_SERIALNUMBER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - SerialNumber uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -6752,30 +5782,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_serialnumber( /* ProtocolIE SourceBSS_ToTargetBSS_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcebss_totargetbss_transparentcontainer( - LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - SourceBSS-ToTargetBSS-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -6784,20 +5811,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourcebss_totargetbss_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_SOURCEBSS_TOTARGETBSS_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - SourceBSS-ToTargetBSS-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -6806,7 +5830,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -6817,18 +5841,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourcebss_totargetbss_transparentcontainer( /******************************************************************************* /* ProtocolIE SRVCCOperationPossible ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvccoperationpossible( - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvccoperationpossible(LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SRVCCOperationPossible error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6841,18 +5862,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_srvccoperationpossible( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvccoperationpossible( - uint8_t **ptr, - LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvccoperationpossible(uint8_t** ptr, + LIBLTE_S1AP_SRVCCOPERATIONPOSSIBLE_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SRVCCOperationPossible error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -6869,25 +5887,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_srvccoperationpossible( /* ProtocolIE ServedGroupIDs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgroupids( - LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgroupids(LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ServedGroupIDs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ServedGroupIDs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_mme_group_id(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_mme_group_id(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -6896,25 +5911,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgroupids( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgroupids( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgroupids(uint8_t** ptr, LIBLTE_S1AP_SERVEDGROUPIDS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ServedGroupIDs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ServedGroupIDs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_mme_group_id(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_mme_group_id(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -6926,20 +5938,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgroupids( /******************************************************************************* /* ProtocolIE StratumLevel INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_stratumlevel( - LIBLTE_S1AP_STRATUMLEVEL_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_stratumlevel(LIBLTE_S1AP_STRATUMLEVEL_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->StratumLevel // lb:0, ub:3 // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ie->StratumLevel error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -6949,25 +5957,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_stratumlevel( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_stratumlevel( - uint8_t **ptr, - LIBLTE_S1AP_STRATUMLEVEL_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_stratumlevel(uint8_t** ptr, LIBLTE_S1AP_STRATUMLEVEL_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->StratumLevel // lb:0, ub:3 // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ie->StratumLevel error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->StratumLevel = (uint8_t)liblte_bits_2_value(ptr, 2); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -6975,22 +5979,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_stratumlevel( /******************************************************************************* /* ProtocolIE TAC STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tac( - LIBLTE_S1AP_TAC_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tac(LIBLTE_S1AP_TAC_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - TAC - if(LIBLTE_S1AP_TAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_TAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -6998,22 +5998,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tac( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tac( - uint8_t **ptr, - LIBLTE_S1AP_TAC_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tac(uint8_t** ptr, LIBLTE_S1AP_TAC_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - TAC - if(LIBLTE_S1AP_TAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_TAC_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7025,25 +6021,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tac( /* ProtocolIE TAListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_talistformdt( - LIBLTE_S1AP_TALISTFORMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_talistformdt(LIBLTE_S1AP_TALISTFORMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("TAListforMDT pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 3); + liblte_value_2_bits(ie->len - 1, ptr, 3); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -7052,25 +6044,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_talistformdt( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_talistformdt( - uint8_t **ptr, - LIBLTE_S1AP_TALISTFORMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_talistformdt(uint8_t** ptr, LIBLTE_S1AP_TALISTFORMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 3) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -7082,22 +6071,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_talistformdt( /******************************************************************************* /* ProtocolIE TBCD_STRING STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tbcd_string( - LIBLTE_S1AP_TBCD_STRING_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tbcd_string(LIBLTE_S1AP_TBCD_STRING_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - TBCD-STRING - if(LIBLTE_S1AP_TBCD_STRING_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_TBCD_STRING_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -7105,22 +6090,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tbcd_string( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tbcd_string( - uint8_t **ptr, - LIBLTE_S1AP_TBCD_STRING_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tbcd_string(uint8_t** ptr, LIBLTE_S1AP_TBCD_STRING_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - TBCD-STRING - if(LIBLTE_S1AP_TBCD_STRING_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_TBCD_STRING_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7131,31 +6112,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tbcd_string( /******************************************************************************* /* ProtocolIE Target_ToSource_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_target_tosource_transparentcontainer( - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_target_tosource_transparentcontainer(LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Target-ToSource-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -7163,21 +6142,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_target_tosource_transparentcontainer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_target_tosource_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_target_tosource_transparentcontainer(uint8_t** ptr, + LIBLTE_S1AP_TARGET_TOSOURCE_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Target-ToSource-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -7186,7 +6163,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_target_tosource_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7197,15 +6174,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_target_tosource_transparentcontainer( /******************************************************************************* /* ProtocolIE Threshold_RSRP INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrp( - LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrp(LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Threshold_RSRP // lb:0, ub:97 liblte_value_2_bits(ie->Threshold_RSRP, ptr, 7); @@ -7214,19 +6187,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_threshold_rsrp( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrp( - uint8_t **ptr, - LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrp(uint8_t** ptr, LIBLTE_S1AP_THRESHOLD_RSRP_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Threshold_RSRP // lb:0, ub:97 ie->Threshold_RSRP = (uint8_t)liblte_bits_2_value(ptr, 7); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -7235,18 +6204,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_threshold_rsrp( /* ProtocolIE Time_UE_StayedInCell_EnhancedGranularity INTEGER ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity( - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Time_UE_StayedInCell_EnhancedGranularity // lb:0, ub:40950 liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (2*8)-16); + liblte_value_2_bits(0, ptr, (2 * 8) - 16); liblte_value_2_bits(ie->Time_UE_StayedInCell_EnhancedGranularity, ptr, 16); liblte_align_up_zero(ptr, 8); err = LIBLTE_SUCCESS; @@ -7255,18 +6221,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity( - uint8_t **ptr, - LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->Time_UE_StayedInCell_EnhancedGranularity // lb:0, ub:40950 liblte_align_up(ptr, 8); - ie->Time_UE_StayedInCell_EnhancedGranularity = (uint16_t)liblte_bits_2_value(ptr, 2.0*8); + ie->Time_UE_StayedInCell_EnhancedGranularity = (uint16_t)liblte_bits_2_value(ptr, 2.0 * 8); liblte_align_up(ptr, 8); err = LIBLTE_SUCCESS; } @@ -7276,22 +6239,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity( /******************************************************************************* /* ProtocolIE E_UTRAN_Trace_ID STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_utran_trace_id( - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_utran_trace_id(LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - E-UTRAN-Trace-ID - if(LIBLTE_S1AP_E_UTRAN_TRACE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_E_UTRAN_TRACE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -7299,22 +6258,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_utran_trace_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_utran_trace_id( - uint8_t **ptr, - LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_utran_trace_id(uint8_t** ptr, LIBLTE_S1AP_E_UTRAN_TRACE_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - E-UTRAN-Trace-ID - if(LIBLTE_S1AP_E_UTRAN_TRACE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_E_UTRAN_TRACE_ID_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7325,18 +6280,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_utran_trace_id( /******************************************************************************* /* ProtocolIE TypeOfError ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_typeoferror( - LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_typeoferror(LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TypeOfError error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -7349,18 +6300,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_typeoferror( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_typeoferror( - uint8_t **ptr, - LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_typeoferror(uint8_t** ptr, LIBLTE_S1AP_TYPEOFERROR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TypeOfError error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -7376,72 +6323,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_typeoferror( /******************************************************************************* /* ProtocolIE UEAggregateMaximumBitrate SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregatemaximumbitrate( - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregatemaximumbitrate(LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UEAggregateMaximumBitrate error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_bitrate(&ie->uEaggregateMaximumBitRateDL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->uEaggregateMaximumBitRateDL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_bitrate(&ie->uEaggregateMaximumBitRateUL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->uEaggregateMaximumBitRateUL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregatemaximumbitrate( - uint8_t **ptr, - LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregatemaximumbitrate(uint8_t** ptr, + LIBLTE_S1AP_UEAGGREGATEMAXIMUMBITRATE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UEAggregateMaximumBitrate error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_bitrate(ptr, &ie->uEaggregateMaximumBitRateDL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->uEaggregateMaximumBitRateDL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bitrate(ptr, &ie->uEaggregateMaximumBitRateUL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->uEaggregateMaximumBitRateUL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -7451,72 +6392,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregatemaximumbitrate( /******************************************************************************* /* ProtocolIE UE_S1AP_ID_pair SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair( - LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair(LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UE_S1AP_ID_pair error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_mme_ue_s1ap_id(&ie->mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&ie->mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_enb_ue_s1ap_id(&ie->eNB_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&ie->eNB_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair( - uint8_t **ptr, - LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair(uint8_t** ptr, LIBLTE_S1AP_UE_S1AP_ID_PAIR_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UE_S1AP_ID_pair error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &ie->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &ie->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -7526,18 +6459,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair( /******************************************************************************* /* ProtocolIE UEIdentityIndexValue STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueidentityindexvalue( - LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueidentityindexvalue(LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - UEIdentityIndexValue uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -7545,18 +6474,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueidentityindexvalue( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueidentityindexvalue( - uint8_t **ptr, - LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueidentityindexvalue(uint8_t** ptr, LIBLTE_S1AP_UEIDENTITYINDEXVALUE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - UEIdentityIndexValue uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -7567,72 +6492,65 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueidentityindexvalue( /******************************************************************************* /* ProtocolIE UESecurityCapabilities SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities( - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities(LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UESecurityCapabilities error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_encryptionalgorithms(&ie->encryptionAlgorithms, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_encryptionalgorithms(&ie->encryptionAlgorithms, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_integrityprotectionalgorithms(&ie->integrityProtectionAlgorithms, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_integrityprotectionalgorithms(&ie->integrityProtectionAlgorithms, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities( - uint8_t **ptr, - LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities(uint8_t** ptr, + LIBLTE_S1AP_UESECURITYCAPABILITIES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UESecurityCapabilities error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_encryptionalgorithms(ptr, &ie->encryptionAlgorithms) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_encryptionalgorithms(ptr, &ie->encryptionAlgorithms) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_integrityprotectionalgorithms(ptr, &ie->integrityProtectionAlgorithms) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_integrityprotectionalgorithms(ptr, &ie->integrityProtectionAlgorithms) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -7642,18 +6560,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities( /******************************************************************************* /* ProtocolIE VoiceSupportMatchIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_voicesupportmatchindicator( - LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_voicesupportmatchindicator(LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("VoiceSupportMatchIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -7666,18 +6581,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_voicesupportmatchindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_voicesupportmatchindicator( - uint8_t **ptr, - LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_voicesupportmatchindicator(uint8_t** ptr, + LIBLTE_S1AP_VOICESUPPORTMATCHINDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("VoiceSupportMatchIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -7693,22 +6605,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_voicesupportmatchindicator( /******************************************************************************* /* ProtocolIE WarningSecurityInfo STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningsecurityinfo( - LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningsecurityinfo(LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - WarningSecurityInfo - if(LIBLTE_S1AP_WARNINGSECURITYINFO_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_WARNINGSECURITYINFO_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -7716,22 +6624,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningsecurityinfo( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningsecurityinfo( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningsecurityinfo(uint8_t** ptr, LIBLTE_S1AP_WARNINGSECURITYINFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - WarningSecurityInfo - if(LIBLTE_S1AP_WARNINGSECURITYINFO_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_WARNINGSECURITYINFO_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7743,25 +6647,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningsecurityinfo( /* ProtocolIE ENBX2GTPTLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2gtptlas( - LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2gtptlas(LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ENBX2GTPTLAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -7770,25 +6670,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2gtptlas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2gtptlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2gtptlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2GTPTLAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ENBX2GTPTLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ENBX2GTPTLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -7800,18 +6697,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2gtptlas( /******************************************************************************* /* ProtocolIE CauseTransport ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_causetransport( - LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_causetransport(LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CauseTransport error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -7824,18 +6717,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_causetransport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causetransport( - uint8_t **ptr, - LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causetransport(uint8_t** ptr, LIBLTE_S1AP_CAUSETRANSPORT_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CauseTransport error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -7851,18 +6740,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_causetransport( /******************************************************************************* /* ProtocolIE Cdma2000HOStatus ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000hostatus( - LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000hostatus(LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000HOStatus error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -7875,18 +6760,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000hostatus( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000hostatus( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000hostatus(uint8_t** ptr, LIBLTE_S1AP_CDMA2000HOSTATUS_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000HOStatus error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -7902,31 +6783,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000hostatus( /******************************************************************************* /* ProtocolIE Cdma2000OneXPilot DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexpilot( - LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexpilot(LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXPilot // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -7934,21 +6811,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexpilot( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXPILOT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - Cdma2000OneXPilot // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -7957,7 +6830,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -7968,15 +6841,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexpilot( /******************************************************************************* /* ProtocolIE ConcurrentWarningMessageIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_concurrentwarningmessageindicator( - LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_concurrentwarningmessageindicator(LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 0); err = LIBLTE_SUCCESS; @@ -7984,15 +6855,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_concurrentwarningmessageindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_concurrentwarningmessageindicator( - uint8_t **ptr, - LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_concurrentwarningmessageindicator(uint8_t** ptr, + LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_CONCURRENTWARNINGMESSAGEINDICATOR_ENUM)liblte_bits_2_value(ptr, 0); err = LIBLTE_SUCCESS; @@ -8003,72 +6872,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_concurrentwarningmessageindicator( /******************************************************************************* /* ProtocolIE COUNTvalue SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue( - LIBLTE_S1AP_COUNTVALUE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue(LIBLTE_S1AP_COUNTVALUE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("COUNTvalue error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_pdcp_sn(&ie->pDCP_SN, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pdcp_sn(&ie->pDCP_SN, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_hfn(&ie->hFN, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_hfn(&ie->hFN, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue( - uint8_t **ptr, - LIBLTE_S1AP_COUNTVALUE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue(uint8_t** ptr, LIBLTE_S1AP_COUNTVALUE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("COUNTvalue error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_pdcp_sn(ptr, &ie->pDCP_SN) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pdcp_sn(ptr, &ie->pDCP_SN) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_hfn(ptr, &ie->hFN) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_hfn(ptr, &ie->hFN) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -8078,57 +6939,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue( /******************************************************************************* /* ProtocolIE CriticalityDiagnostics_IE_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CriticalityDiagnostics_IE_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); // Enum - ie->iECriticality liblte_value_2_bits(ie->iECriticality, ptr, 2); - if(liblte_s1ap_pack_protocolie_id(&ie->iE_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_id(&ie->iE_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_typeoferror(&ie->typeOfError, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_typeoferror(&ie->typeOfError, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ie_item(uint8_t** ptr, LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CriticalityDiagnostics_IE_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -8138,18 +6993,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item( // Enum - ie->iECriticality ie->iECriticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); - if(liblte_s1ap_unpack_protocolie_id(ptr, &ie->iE_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_protocolie_id(ptr, &ie->iE_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_typeoferror(ptr, &ie->typeOfError) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_typeoferror(ptr, &ie->typeOfError) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -8160,25 +7015,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item( /* ProtocolIE ENBX2TLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:2 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2tlas( - LIBLTE_S1AP_ENBX2TLAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2tlas(LIBLTE_S1AP_ENBX2TLAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ENBX2TLAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 0); + liblte_value_2_bits(ie->len - 1, ptr, 0); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -8187,25 +7038,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2tlas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2tlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2TLAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2tlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2TLAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 0) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("ENBX2TLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -8217,47 +7064,41 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2tlas( /******************************************************************************* /* ProtocolIE ExtendedRepetitionPeriod INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrepetitionperiod( - LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_extendedrepetitionperiod(LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ExtendedRepetitionPeriod // lb:4096, ub:131071 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->ExtendedRepetitionPeriod-4096)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 2); + uint32_t n_bits = floor(log2(ie->ExtendedRepetitionPeriod - 4096) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 2); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->ExtendedRepetitionPeriod-4096, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->ExtendedRepetitionPeriod - 4096, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrepetitionperiod( - uint8_t **ptr, - LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrepetitionperiod(uint8_t** ptr, + LIBLTE_S1AP_EXTENDEDREPETITIONPERIOD_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->ExtendedRepetitionPeriod // lb:4096, ub:131071 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 2) + 1; liblte_align_up(ptr, 8); - ie->ExtendedRepetitionPeriod = liblte_bits_2_value(ptr, n_octets*8) + 4096; + ie->ExtendedRepetitionPeriod = liblte_bits_2_value(ptr, n_octets * 8) + 4096; } err = LIBLTE_SUCCESS; } @@ -8268,25 +7109,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_extendedrepetitionperiod( /* ProtocolIE ForbiddenTACs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:4096 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentacs( - LIBLTE_S1AP_FORBIDDENTACS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentacs(LIBLTE_S1AP_FORBIDDENTACS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ForbiddenTACs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ForbiddenTACs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 12); + liblte_value_2_bits(ie->len - 1, ptr, 12); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tac(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -8295,25 +7133,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentacs( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentacs( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTACS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentacs(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTACS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 12) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ForbiddenTACs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ForbiddenTACs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tac(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -8325,88 +7160,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentacs( /******************************************************************************* /* ProtocolIE GBR_QosInformation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation( - LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation(LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("GBR_QosInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_bitrate(&ie->e_RAB_MaximumBitrateDL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->e_RAB_MaximumBitrateDL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_bitrate(&ie->e_RAB_MaximumBitrateUL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->e_RAB_MaximumBitrateUL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_bitrate(&ie->e_RAB_GuaranteedBitrateDL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->e_RAB_GuaranteedBitrateDL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_bitrate(&ie->e_RAB_GuaranteedBitrateUL, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bitrate(&ie->e_RAB_GuaranteedBitrateUL, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation( - uint8_t **ptr, - LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation(uint8_t** ptr, LIBLTE_S1AP_GBR_QOSINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("GBR_QosInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_MaximumBitrateDL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_MaximumBitrateDL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_MaximumBitrateUL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_MaximumBitrateUL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_GuaranteedBitrateDL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_GuaranteedBitrateDL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_GuaranteedBitrateUL) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bitrate(ptr, &ie->e_RAB_GuaranteedBitrateUL) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -8416,47 +7243,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation( /******************************************************************************* /* ProtocolIE HFNModified INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfnmodified( - LIBLTE_S1AP_HFNMODIFIED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_hfnmodified(LIBLTE_S1AP_HFNMODIFIED_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->HFNModified // lb:0, ub:131071 // Range > 65536 - encoded based on value { - uint32_t n_bits = floor(log2(ie->HFNModified-0)+1); - uint32_t n_octets = (n_bits+7)/8; - liblte_value_2_bits(n_octets-1, ptr, 2); + uint32_t n_bits = floor(log2(ie->HFNModified - 0) + 1); + uint32_t n_octets = (n_bits + 7) / 8; + liblte_value_2_bits(n_octets - 1, ptr, 2); liblte_align_up_zero(ptr, 8); - liblte_value_2_bits(0, ptr, (n_octets*8)-n_bits); - liblte_value_2_bits(ie->HFNModified-0, ptr, n_bits); + liblte_value_2_bits(0, ptr, (n_octets * 8) - n_bits); + liblte_value_2_bits(ie->HFNModified - 0, ptr, n_bits); } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfnmodified( - uint8_t **ptr, - LIBLTE_S1AP_HFNMODIFIED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfnmodified(uint8_t** ptr, LIBLTE_S1AP_HFNMODIFIED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->HFNModified // lb:0, ub:131071 // Range > 65536 - encoded based on value { uint32_t n_octets = liblte_bits_2_value(ptr, 2) + 1; liblte_align_up(ptr, 8); - ie->HFNModified = liblte_bits_2_value(ptr, n_octets*8) + 0; + ie->HFNModified = liblte_bits_2_value(ptr, n_octets * 8) + 0; } err = LIBLTE_SUCCESS; } @@ -8466,15 +7285,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_hfnmodified( /******************************************************************************* /* ProtocolIE KillAllWarningMessages ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killallwarningmessages( - LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killallwarningmessages(LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 0); err = LIBLTE_SUCCESS; @@ -8482,15 +7297,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_killallwarningmessages( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killallwarningmessages( - uint8_t **ptr, - LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killallwarningmessages(uint8_t** ptr, LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_KILLALLWARNINGMESSAGES_ENUM)liblte_bits_2_value(ptr, 0); err = LIBLTE_SUCCESS; @@ -8501,31 +7312,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killallwarningmessages( /******************************************************************************* /* ProtocolIE LPPa_PDU DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lppa_pdu( - LIBLTE_S1AP_LPPA_PDU_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lppa_pdu(LIBLTE_S1AP_LPPA_PDU_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LPPa-PDU // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -8533,21 +7340,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lppa_pdu( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu( - uint8_t **ptr, - LIBLTE_S1AP_LPPA_PDU_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu(uint8_t** ptr, LIBLTE_S1AP_LPPA_PDU_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - LPPa-PDU // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -8556,7 +7359,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -8567,64 +7370,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lppa_pdu( /******************************************************************************* /* ProtocolIE M3Configuration SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration( - LIBLTE_S1AP_M3CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration(LIBLTE_S1AP_M3CONFIGURATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M3Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_m3period(&ie->m3period, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m3period(&ie->m3period, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration( - uint8_t **ptr, - LIBLTE_S1AP_M3CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration(uint8_t** ptr, LIBLTE_S1AP_M3CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M3Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_m3period(ptr, &ie->m3period) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_m3period(ptr, &ie->m3period) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -8634,72 +7429,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration( /******************************************************************************* /* ProtocolIE M5Configuration SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration( - LIBLTE_S1AP_M5CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration(LIBLTE_S1AP_M5CONFIGURATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M5Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_m5period(&ie->m5period, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m5period(&ie->m5period, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_links_to_log(&ie->m5_links_to_log, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_links_to_log(&ie->m5_links_to_log, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration( - uint8_t **ptr, - LIBLTE_S1AP_M5CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration(uint8_t** ptr, LIBLTE_S1AP_M5CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M5Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_m5period(ptr, &ie->m5period) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_m5period(ptr, &ie->m5period) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_links_to_log(ptr, &ie->m5_links_to_log) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_links_to_log(ptr, &ie->m5_links_to_log) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -8709,18 +7496,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration( /******************************************************************************* /* ProtocolIE MeasurementThresholdA2 CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementthresholda2( - LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementthresholda2(LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MeasurementThresholdA2 error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -8728,33 +7511,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_measurementthresholda2( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRP) { - if(liblte_s1ap_pack_threshold_rsrp(&ie->choice.threshold_RSRP, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRQ) { - if(liblte_s1ap_pack_threshold_rsrq(&ie->choice.threshold_RSRQ, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRP) { + if (liblte_s1ap_pack_threshold_rsrp(&ie->choice.threshold_RSRP, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRQ) { + if (liblte_s1ap_pack_threshold_rsrq(&ie->choice.threshold_RSRQ, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2( - uint8_t **ptr, - LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2(uint8_t** ptr, + LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MeasurementThresholdA2 error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -8762,16 +7542,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2( // Choice type ie->choice_type = (LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRP) { - if(liblte_s1ap_unpack_threshold_rsrp(ptr, &ie->choice.threshold_RSRP) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRQ) { - if(liblte_s1ap_unpack_threshold_rsrq(ptr, &ie->choice.threshold_RSRQ) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRP) { + if (liblte_s1ap_unpack_threshold_rsrp(ptr, &ie->choice.threshold_RSRP) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_MEASUREMENTTHRESHOLDA2_CHOICE_THRESHOLD_RSRQ) { + if (liblte_s1ap_unpack_threshold_rsrq(ptr, &ie->choice.threshold_RSRQ) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -8780,22 +7560,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_measurementthresholda2( /******************************************************************************* /* ProtocolIE M_TMSI STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m_tmsi( - LIBLTE_S1AP_M_TMSI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m_tmsi(LIBLTE_S1AP_M_TMSI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - M-TMSI - if(LIBLTE_S1AP_M_TMSI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_M_TMSI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -8803,22 +7579,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m_tmsi( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m_tmsi( - uint8_t **ptr, - LIBLTE_S1AP_M_TMSI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m_tmsi(uint8_t** ptr, LIBLTE_S1AP_M_TMSI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - M-TMSI - if(LIBLTE_S1AP_M_TMSI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_M_TMSI_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -8829,31 +7601,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m_tmsi( /******************************************************************************* /* ProtocolIE OldBSS_ToNewBSS_Information DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_oldbss_tonewbss_information( - LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_oldbss_tonewbss_information(LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - OldBSS-ToNewBSS-Information // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -8861,21 +7630,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_oldbss_tonewbss_information( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information( - uint8_t **ptr, - LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information(uint8_t** ptr, + LIBLTE_S1AP_OLDBSS_TONEWBSS_INFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - OldBSS-ToNewBSS-Information // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -8884,7 +7650,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -8895,22 +7661,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_oldbss_tonewbss_information( /******************************************************************************* /* ProtocolIE PLMNidentity STATIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_plmnidentity( - LIBLTE_S1AP_PLMNIDENTITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_plmnidentity(LIBLTE_S1AP_PLMNIDENTITY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - PLMNidentity - if(LIBLTE_S1AP_PLMNIDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_PLMNIDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up_zero(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -8918,22 +7680,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_plmnidentity( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_plmnidentity( - uint8_t **ptr, - LIBLTE_S1AP_PLMNIDENTITY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_plmnidentity(uint8_t** ptr, LIBLTE_S1AP_PLMNIDENTITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static octet string - PLMNidentity - if(LIBLTE_S1AP_PLMNIDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 + if (LIBLTE_S1AP_PLMNIDENTITY_OCTET_STRING_LEN > 2) { // X.691 Sec.16 liblte_align_up(ptr, 8); } // Octets uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -8944,24 +7702,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_plmnidentity( /******************************************************************************* /* ProtocolIE ReceiveStatusOfULPDCPSDUsExtended DYNAMIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdusextended( - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_receivestatusofulpdcpsdusextended(LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic bit string - ReceiveStatusOfULPDCPSDUsExtended // lb:1, ub:16384 // Length - liblte_value_2_bits(ie->n_bits-1, ptr, 14); + liblte_value_2_bits(ie->n_bits - 1, ptr, 14); liblte_align_up_zero(ptr, 8); - + // Bits uint32_t i; - for(i=0;in_bits;i++) { + for (i = 0; i < ie->n_bits; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -8970,15 +7726,13 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_receivestatusofulpdcpsdusextended( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdusextended( - uint8_t **ptr, - LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_receivestatusofulpdcpsdusextended(uint8_t** ptr, + LIBLTE_S1AP_RECEIVESTATUSOFULPDCPSDUSEXTENDED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic bit string - ReceiveStatusOfULPDCPSDUsExtended // lb:1, ub:16384 // Length @@ -8987,7 +7741,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdusextended( // Bits uint32_t i; - for(i=0;in_bits;i++) { + for (i = 0; i < ie->n_bits; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -8999,72 +7753,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_receivestatusofulpdcpsdusextended( /******************************************************************************* /* ProtocolIE RequestType SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype( - LIBLTE_S1AP_REQUESTTYPE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype(LIBLTE_S1AP_REQUESTTYPE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("RequestType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eventtype(&ie->eventType, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eventtype(&ie->eventType, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_reportarea(&ie->reportArea, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_reportarea(&ie->reportArea, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype( - uint8_t **ptr, - LIBLTE_S1AP_REQUESTTYPE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype(uint8_t** ptr, LIBLTE_S1AP_REQUESTTYPE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("RequestType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eventtype(ptr, &ie->eventType) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eventtype(ptr, &ie->eventType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_reportarea(ptr, &ie->reportArea) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_reportarea(ptr, &ie->reportArea) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9074,31 +7820,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype( /******************************************************************************* /* ProtocolIE RRC_Container DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_container( - LIBLTE_S1AP_RRC_CONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_container(LIBLTE_S1AP_RRC_CONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - RRC-Container // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -9106,21 +7848,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rrc_container( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container( - uint8_t **ptr, - LIBLTE_S1AP_RRC_CONTAINER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container(uint8_t** ptr, LIBLTE_S1AP_RRC_CONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - RRC-Container // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -9129,7 +7867,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -9137,19 +7875,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rrc_container( return err; } - /******************************************************************************* /* ProtocolIE nextHopChainingCount INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nexthopchainingcount( - LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nexthopchainingcount(LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->nextHopChainingCount // lb:0, ub:7 liblte_value_2_bits(ie->nextHopChainingCount, ptr, 3); @@ -9158,93 +7891,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nexthopchainingcount( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nexthopchainingcount( - uint8_t **ptr, - LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nexthopchainingcount(uint8_t** ptr, LIBLTE_S1AP_NEXTHOPCHAININGCOUNT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->nextHopChainingCount // lb:0, ub:7 ie->nextHopChainingCount = (uint8_t)liblte_bits_2_value(ptr, 3); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } - /******************************************************************************* /* ProtocolIE SecurityContext SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext( - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext(LIBLTE_S1AP_SECURITYCONTEXT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SecurityContext error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_nexthopchainingcount(&ie->nextHopChainingCount, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nexthopchainingcount(&ie->nextHopChainingCount, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_securitykey(&ie->nextHopParameter, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_securitykey(&ie->nextHopParameter, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext( - uint8_t **ptr, - LIBLTE_S1AP_SECURITYCONTEXT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext(uint8_t** ptr, LIBLTE_S1AP_SECURITYCONTEXT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SecurityContext error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_nexthopchainingcount(ptr, &ie->nextHopChainingCount) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_nexthopchainingcount(ptr, &ie->nextHopChainingCount) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_securitykey(ptr, &ie->nextHopParameter) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_securitykey(ptr, &ie->nextHopParameter) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9255,25 +7975,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext( /* ProtocolIE ServedMMECs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedmmecs( - LIBLTE_S1AP_SERVEDMMECS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedmmecs(LIBLTE_S1AP_SERVEDMMECS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ServedMMECs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_mme_code(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_mme_code(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -9282,25 +7998,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedmmecs( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedmmecs( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDMMECS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedmmecs(uint8_t** ptr, LIBLTE_S1AP_SERVEDMMECS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ServedMMECs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ServedMMECs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_mme_code(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_mme_code(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -9312,72 +8025,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedmmecs( /******************************************************************************* /* ProtocolIE TimeSynchronizationInfo SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo( - LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo(LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TimeSynchronizationInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_stratumlevel(&ie->stratumLevel, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_stratumlevel(&ie->stratumLevel, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_synchronizationstatus(&ie->synchronizationStatus, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_synchronizationstatus(&ie->synchronizationStatus, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo( - uint8_t **ptr, - LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo(uint8_t** ptr, + LIBLTE_S1AP_TIMESYNCHRONIZATIONINFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TimeSynchronizationInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_stratumlevel(ptr, &ie->stratumLevel) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_stratumlevel(ptr, &ie->stratumLevel) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_synchronizationstatus(ptr, &ie->synchronizationStatus) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_synchronizationstatus(ptr, &ie->synchronizationStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9387,72 +8094,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo( /******************************************************************************* /* ProtocolIE TAI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai( - LIBLTE_S1AP_TAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai(LIBLTE_S1AP_TAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TAI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_tac(&ie->tAC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tac(&ie->tAC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai( - uint8_t **ptr, - LIBLTE_S1AP_TAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai(uint8_t** ptr, LIBLTE_S1AP_TAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TAI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_tac(ptr, &ie->tAC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tac(ptr, &ie->tAC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9462,64 +8161,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai( /******************************************************************************* /* ProtocolIE TABasedMDT SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt( - LIBLTE_S1AP_TABASEDMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt(LIBLTE_S1AP_TABASEDMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TABasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_talistformdt(&ie->tAListforMDT, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_talistformdt(&ie->tAListforMDT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_TABASEDMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt(uint8_t** ptr, LIBLTE_S1AP_TABASEDMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TABasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_talistformdt(ptr, &ie->tAListforMDT) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_talistformdt(ptr, &ie->tAListforMDT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9530,31 +8221,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt( /* ProtocolIE TargeteNB_ToSourceeNB_TransparentContainer SEQUENCE ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer( - LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { - liblte_log_print("TargeteNB_ToSourceeNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { + liblte_log_print( + "TargeteNB_ToSourceeNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_rrc_container(&ie->rRC_Container, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_rrc_container(&ie->rRC_Container, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9562,31 +8251,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { - liblte_log_print("TargeteNB_ToSourceeNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { + liblte_log_print( + "TargeteNB_ToSourceeNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_rrc_container(ptr, &ie->rRC_Container) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_rrc_container(ptr, &ie->rRC_Container) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9596,64 +8283,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer( /******************************************************************************* /* ProtocolIE M1ThresholdEventA2 SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2( - LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2(LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M1ThresholdEventA2 error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_measurementthresholda2(&ie->measurementThreshold, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_measurementthresholda2(&ie->measurementThreshold, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2( - uint8_t **ptr, - LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2(uint8_t** ptr, LIBLTE_S1AP_M1THRESHOLDEVENTA2_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M1ThresholdEventA2 error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_measurementthresholda2(ptr, &ie->measurementThreshold) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_measurementthresholda2(ptr, &ie->measurementThreshold) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9663,28 +8342,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2( /******************************************************************************* /* ProtocolIE TransportInformation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportinformation( - LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportinformation(LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TransportInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -9692,28 +8366,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_transportinformation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportinformation( - uint8_t **ptr, - LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportinformation(uint8_t** ptr, LIBLTE_S1AP_TRANSPORTINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TransportInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -9724,78 +8393,70 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_transportinformation( /******************************************************************************* /* ProtocolIE TunnelInformation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnelinformation( - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnelinformation(LIBLTE_S1AP_TUNNELINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TunnelInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->uDP_Port_Number_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->uDP_Port_Number_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->uDP_Port_Number_present) { - if(liblte_s1ap_pack_port_number(&ie->uDP_Port_Number, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->uDP_Port_Number_present) { + if (liblte_s1ap_pack_port_number(&ie->uDP_Port_Number, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnelinformation( - uint8_t **ptr, - LIBLTE_S1AP_TUNNELINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnelinformation(uint8_t** ptr, LIBLTE_S1AP_TUNNELINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TunnelInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->uDP_Port_Number_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->uDP_Port_Number_present) { - if(liblte_s1ap_unpack_port_number(ptr, &ie->uDP_Port_Number) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->uDP_Port_Number_present) { + if (liblte_s1ap_unpack_port_number(ptr, &ie->uDP_Port_Number) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9805,18 +8466,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnelinformation( /******************************************************************************* /* ProtocolIE UE_S1AP_IDs CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_ids( - LIBLTE_S1AP_UE_S1AP_IDS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_ids(LIBLTE_S1AP_UE_S1AP_IDS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UE_S1AP_IDs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -9824,33 +8481,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_ids( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UE_S1AP_ID_PAIR) { - if(liblte_s1ap_pack_ue_s1ap_id_pair(&ie->choice.uE_S1AP_ID_pair, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_MME_UE_S1AP_ID) { - if(liblte_s1ap_pack_mme_ue_s1ap_id(&ie->choice.mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UE_S1AP_ID_PAIR) { + if (liblte_s1ap_pack_ue_s1ap_id_pair(&ie->choice.uE_S1AP_ID_pair, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_MME_UE_S1AP_ID) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&ie->choice.mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids( - uint8_t **ptr, - LIBLTE_S1AP_UE_S1AP_IDS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids(uint8_t** ptr, LIBLTE_S1AP_UE_S1AP_IDS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UE_S1AP_IDs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -9858,16 +8511,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids( // Choice type ie->choice_type = (LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UE_S1AP_ID_PAIR) { - if(liblte_s1ap_unpack_ue_s1ap_id_pair(ptr, &ie->choice.uE_S1AP_ID_pair) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_MME_UE_S1AP_ID) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->choice.mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_UE_S1AP_ID_PAIR) { + if (liblte_s1ap_unpack_ue_s1ap_id_pair(ptr, &ie->choice.uE_S1AP_ID_pair) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_UE_S1AP_IDS_CHOICE_MME_UE_S1AP_ID) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->choice.mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -9876,84 +8529,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_ids( /******************************************************************************* /* ProtocolIE ENBX2ExtTLA SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla( - LIBLTE_S1AP_ENBX2EXTTLA_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla(LIBLTE_S1AP_ENBX2EXTTLA_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENBX2ExtTLA error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iPsecTLA_present?1:0, ptr, 1); - liblte_value_2_bits(ie->gTPTLAa_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iPsecTLA_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->gTPTLAa_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(ie->iPsecTLA_present) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->iPsecTLA, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iPsecTLA_present) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->iPsecTLA, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->gTPTLAa_present) { - if(liblte_s1ap_pack_enbx2gtptlas(&ie->gTPTLAa, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->gTPTLAa_present) { + if (liblte_s1ap_pack_enbx2gtptlas(&ie->gTPTLAa, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2EXTTLA_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla(uint8_t** ptr, LIBLTE_S1AP_ENBX2EXTTLA_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENBX2ExtTLA error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->iPsecTLA_present = liblte_bits_2_value(ptr, 1); - ie->gTPTLAa_present = liblte_bits_2_value(ptr, 1); + ie->iPsecTLA_present = liblte_bits_2_value(ptr, 1); + ie->gTPTLAa_present = liblte_bits_2_value(ptr, 1); ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(ie->iPsecTLA_present) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->iPsecTLA) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iPsecTLA_present) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->iPsecTLA) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->gTPTLAa_present) { - if(liblte_s1ap_unpack_enbx2gtptlas(ptr, &ie->gTPTLAa) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->gTPTLAa_present) { + if (liblte_s1ap_unpack_enbx2gtptlas(ptr, &ie->gTPTLAa) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -9964,25 +8609,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla( /* ProtocolIE BPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:6 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bplmns( - LIBLTE_S1AP_BPLMNS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_bplmns(LIBLTE_S1AP_BPLMNS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("BPLMNs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 3); + liblte_value_2_bits(ie->len - 1, ptr, 3); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -9991,25 +8632,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bplmns( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bplmns( - uint8_t **ptr, - LIBLTE_S1AP_BPLMNS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bplmns(uint8_t** ptr, LIBLTE_S1AP_BPLMNS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 3) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("BPLMNs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -10021,18 +8658,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bplmns( /******************************************************************************* /* ProtocolIE Cause CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cause( - LIBLTE_S1AP_CAUSE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cause(LIBLTE_S1AP_CAUSE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cause error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -10040,45 +8673,41 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cause( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 3); - // Choice - if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_RADIONETWORK) { - if(liblte_s1ap_pack_causeradionetwork(&ie->choice.radioNetwork, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_TRANSPORT) { - if(liblte_s1ap_pack_causetransport(&ie->choice.transport, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_NAS) { - if(liblte_s1ap_pack_causenas(&ie->choice.nas, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_PROTOCOL) { - if(liblte_s1ap_pack_causeprotocol(&ie->choice.protocol, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_MISC) { - if(liblte_s1ap_pack_causemisc(&ie->choice.misc, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_RADIONETWORK) { + if (liblte_s1ap_pack_causeradionetwork(&ie->choice.radioNetwork, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_TRANSPORT) { + if (liblte_s1ap_pack_causetransport(&ie->choice.transport, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_NAS) { + if (liblte_s1ap_pack_causenas(&ie->choice.nas, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_PROTOCOL) { + if (liblte_s1ap_pack_causeprotocol(&ie->choice.protocol, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_MISC) { + if (liblte_s1ap_pack_causemisc(&ie->choice.misc, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause( - uint8_t **ptr, - LIBLTE_S1AP_CAUSE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause(uint8_t** ptr, LIBLTE_S1AP_CAUSE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cause error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -10086,28 +8715,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause( // Choice type ie->choice_type = (LIBLTE_S1AP_CAUSE_CHOICE_ENUM)liblte_bits_2_value(ptr, 3); - // Choice - if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_RADIONETWORK) { - if(liblte_s1ap_unpack_causeradionetwork(ptr, &ie->choice.radioNetwork) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_TRANSPORT) { - if(liblte_s1ap_unpack_causetransport(ptr, &ie->choice.transport) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_NAS) { - if(liblte_s1ap_unpack_causenas(ptr, &ie->choice.nas) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_PROTOCOL) { - if(liblte_s1ap_unpack_causeprotocol(ptr, &ie->choice.protocol) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_MISC) { - if(liblte_s1ap_unpack_causemisc(ptr, &ie->choice.misc) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_RADIONETWORK) { + if (liblte_s1ap_unpack_causeradionetwork(ptr, &ie->choice.radioNetwork) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_TRANSPORT) { + if (liblte_s1ap_unpack_causetransport(ptr, &ie->choice.transport) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_NAS) { + if (liblte_s1ap_unpack_causenas(ptr, &ie->choice.nas) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_PROTOCOL) { + if (liblte_s1ap_unpack_causeprotocol(ptr, &ie->choice.protocol) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_CAUSE_CHOICE_MISC) { + if (liblte_s1ap_unpack_causemisc(ptr, &ie->choice.misc) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -10116,80 +8745,72 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cause( /******************************************************************************* /* ProtocolIE Cdma2000OneXSRVCCInfo SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo( - LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo(LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000OneXSRVCCInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_cdma2000onexmeid(&ie->cdma2000OneXMEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000onexmeid(&ie->cdma2000OneXMEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cdma2000onexmsi(&ie->cdma2000OneXMSI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000onexmsi(&ie->cdma2000OneXMSI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cdma2000onexpilot(&ie->cdma2000OneXPilot, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000onexpilot(&ie->cdma2000OneXPilot, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo( - uint8_t **ptr, - LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo(uint8_t** ptr, LIBLTE_S1AP_CDMA2000ONEXSRVCCINFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Cdma2000OneXSRVCCInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_cdma2000onexmeid(ptr, &ie->cdma2000OneXMEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cdma2000onexmeid(ptr, &ie->cdma2000OneXMEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cdma2000onexmsi(ptr, &ie->cdma2000OneXMSI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cdma2000onexmsi(ptr, &ie->cdma2000OneXMSI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cdma2000onexpilot(ptr, &ie->cdma2000OneXPilot) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cdma2000onexpilot(ptr, &ie->cdma2000OneXPilot) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10199,94 +8820,86 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo( /******************************************************************************* /* ProtocolIE CGI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi( - LIBLTE_S1AP_CGI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi(LIBLTE_S1AP_CGI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CGI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->rAC_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->rAC_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_lac(&ie->lAC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lac(&ie->lAC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_ci(&ie->cI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ci(&ie->cI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->rAC_present) { - if(liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->rAC_present) { + if (liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi( - uint8_t **ptr, - LIBLTE_S1AP_CGI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi(uint8_t** ptr, LIBLTE_S1AP_CGI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CGI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->rAC_present = liblte_bits_2_value(ptr, 1); + ie->rAC_present = liblte_bits_2_value(ptr, 1); ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_lac(ptr, &ie->lAC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_lac(ptr, &ie->lAC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_ci(ptr, &ie->cI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ci(ptr, &ie->cI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->rAC_present) { - if(liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->rAC_present) { + if (liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10296,72 +8909,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi( /******************************************************************************* /* ProtocolIE COUNTValueExtended SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended( - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended(LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("COUNTValueExtended error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_pdcp_snextended(&ie->pDCP_SNExtended, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pdcp_snextended(&ie->pDCP_SNExtended, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_hfnmodified(&ie->hFNModified, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_hfnmodified(&ie->hFNModified, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended( - uint8_t **ptr, - LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended(uint8_t** ptr, LIBLTE_S1AP_COUNTVALUEEXTENDED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("COUNTValueExtended error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_pdcp_snextended(ptr, &ie->pDCP_SNExtended) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pdcp_snextended(ptr, &ie->pDCP_SNExtended) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_hfnmodified(ptr, &ie->hFNModified) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_hfnmodified(ptr, &ie->hFNModified) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10372,25 +8977,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended( /* ProtocolIE CriticalityDiagnostics_IE_List DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_list( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_list(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CriticalityDiagnostics_IE_List pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "CriticalityDiagnostics_IE_List pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_criticalitydiagnostics_ie_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_criticalitydiagnostics_ie_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -10399,25 +9003,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_list( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_list( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ie_list(uint8_t** ptr, LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_IE_LIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CriticalityDiagnostics_IE_List unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "CriticalityDiagnostics_IE_List unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_criticalitydiagnostics_ie_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_criticalitydiagnostics_ie_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -10429,72 +9032,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_list( /******************************************************************************* /* ProtocolIE Global_ENB_ID SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_global_enb_id( - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_global_enb_id(LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_enb_id(&ie->eNB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_id(&ie->eNB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_global_enb_id( - uint8_t **ptr, - LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_global_enb_id(uint8_t** ptr, LIBLTE_S1AP_GLOBAL_ENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Global_ENB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_enb_id(ptr, &ie->eNB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enb_id(ptr, &ie->eNB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10505,25 +9100,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_global_enb_id( /* ProtocolIE EPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:15 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eplmns( - LIBLTE_S1AP_EPLMNS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eplmns(LIBLTE_S1AP_EPLMNS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("EPLMNs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -10532,25 +9123,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_eplmns( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eplmns( - uint8_t **ptr, - LIBLTE_S1AP_EPLMNS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eplmns(uint8_t** ptr, LIBLTE_S1AP_EPLMNS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("EPLMNs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -10562,72 +9149,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eplmns( /******************************************************************************* /* ProtocolIE E_RABItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( - LIBLTE_S1AP_E_RABITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem(LIBLTE_S1AP_E_RABITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cause(&ie->cause, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&ie->cause, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem(uint8_t** ptr, LIBLTE_S1AP_E_RABITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cause(ptr, &ie->cause) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cause(ptr, &ie->cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10637,72 +9216,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( /******************************************************************************* /* ProtocolIE EUTRAN_CGI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi( - LIBLTE_S1AP_EUTRAN_CGI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi(LIBLTE_S1AP_EUTRAN_CGI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("EUTRAN_CGI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cellidentity(&ie->cell_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellidentity(&ie->cell_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi( - uint8_t **ptr, - LIBLTE_S1AP_EUTRAN_CGI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi(uint8_t** ptr, LIBLTE_S1AP_EUTRAN_CGI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("EUTRAN_CGI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cellidentity(ptr, &ie->cell_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cellidentity(ptr, &ie->cell_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10712,72 +9283,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi( /******************************************************************************* /* ProtocolIE ForbiddenTAs_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item( - LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item(LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenTAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_forbiddentacs(&ie->forbiddenTACs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_forbiddentacs(&ie->forbiddenTACs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTAS_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenTAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_forbiddentacs(ptr, &ie->forbiddenTACs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_forbiddentacs(ptr, &ie->forbiddenTACs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10787,72 +9350,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item( /******************************************************************************* /* ProtocolIE ForbiddenLAs_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item( - LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item(LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenLAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_forbiddenlacs(&ie->forbiddenLACs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_forbiddenlacs(&ie->forbiddenLACs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLAS_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ForbiddenLAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_forbiddenlacs(ptr, &ie->forbiddenLACs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_forbiddenlacs(ptr, &ie->forbiddenLACs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10862,72 +9417,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item( /******************************************************************************* /* ProtocolIE LAI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai( - LIBLTE_S1AP_LAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai(LIBLTE_S1AP_LAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("LAI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMNidentity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_lac(&ie->lAC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lac(&ie->lAC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai( - uint8_t **ptr, - LIBLTE_S1AP_LAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai(uint8_t** ptr, LIBLTE_S1AP_LAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("LAI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMNidentity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_lac(ptr, &ie->lAC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_lac(ptr, &ie->lAC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -10937,72 +9484,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai( /******************************************************************************* /* ProtocolIE M4Configuration SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration( - LIBLTE_S1AP_M4CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration(LIBLTE_S1AP_M4CONFIGURATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M4Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_m4period(&ie->m4period, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m4period(&ie->m4period, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_links_to_log(&ie->m4_links_to_log, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_links_to_log(&ie->m4_links_to_log, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration( - uint8_t **ptr, - LIBLTE_S1AP_M4CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration(uint8_t** ptr, LIBLTE_S1AP_M4CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M4Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_m4period(ptr, &ie->m4period) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_m4period(ptr, &ie->m4period) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_links_to_log(ptr, &ie->m4_links_to_log) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_links_to_log(ptr, &ie->m4_links_to_log) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11013,25 +9552,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration( /* ProtocolIE MDTPLMNList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtplmnlist( - LIBLTE_S1AP_MDTPLMNLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtplmnlist(LIBLTE_S1AP_MDTPLMNLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("MDTPLMNList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11040,25 +9575,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtplmnlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtplmnlist( - uint8_t **ptr, - LIBLTE_S1AP_MDTPLMNLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtplmnlist(uint8_t** ptr, LIBLTE_S1AP_MDTPLMNLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("MDTPLMNList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("MDTPLMNList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11070,18 +9602,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtplmnlist( /******************************************************************************* /* ProtocolIE MMERelaySupportIndicator ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmerelaysupportindicator( - LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmerelaysupportindicator(LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MMERelaySupportIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -11094,18 +9623,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmerelaysupportindicator( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmerelaysupportindicator( - uint8_t **ptr, - LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmerelaysupportindicator(uint8_t** ptr, + LIBLTE_S1AP_MMERELAYSUPPORTINDICATOR_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MMERelaySupportIndicator error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -11121,18 +9647,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmerelaysupportindicator( /******************************************************************************* /* ProtocolIE PagingPriority ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingpriority( - LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingpriority(LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PagingPriority error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -11145,18 +9667,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pagingpriority( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingpriority( - uint8_t **ptr, - LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingpriority(uint8_t** ptr, LIBLTE_S1AP_PAGINGPRIORITY_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("PagingPriority error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -11172,15 +9690,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pagingpriority( /******************************************************************************* /* ProtocolIE PriorityLevel INTEGER ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_prioritylevel( - LIBLTE_S1AP_PRIORITYLEVEL_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_prioritylevel(LIBLTE_S1AP_PRIORITYLEVEL_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PriorityLevel // lb:0, ub:15 liblte_value_2_bits(ie->PriorityLevel, ptr, 4); @@ -11189,19 +9703,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_prioritylevel( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_prioritylevel( - uint8_t **ptr, - LIBLTE_S1AP_PRIORITYLEVEL_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_prioritylevel(uint8_t** ptr, LIBLTE_S1AP_PRIORITYLEVEL_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Integer - ie->PriorityLevel // lb:0, ub:15 ie->PriorityLevel = (uint8_t)liblte_bits_2_value(ptr, 4); - err = LIBLTE_SUCCESS; + err = LIBLTE_SUCCESS; } return err; } @@ -11210,25 +9720,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_prioritylevel( /* ProtocolIE ECGIListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilistforrestart( - LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilistforrestart(LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ECGIListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ECGIListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11237,25 +9744,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilistforrestart( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilistforrestart(uint8_t** ptr, LIBLTE_S1AP_ECGILISTFORRESTART_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ECGIListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ECGIListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11267,58 +9771,50 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilistforrestart( /******************************************************************************* /* ProtocolIE SourceeNB_ID SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id( - LIBLTE_S1AP_SOURCEENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id(LIBLTE_S1AP_SOURCEENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + if (ie != NULL && ptr != NULL) { + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_global_enb_id(&ie->global_ENB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_global_enb_id(&ie->global_ENB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_tai(&ie->selected_TAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->selected_TAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id(uint8_t** ptr, LIBLTE_S1AP_SOURCEENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_global_enb_id(ptr, &ie->global_ENB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_global_enb_id(ptr, &ie->global_ENB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_tai(ptr, &ie->selected_TAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->selected_TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11329,25 +9825,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id( /* ProtocolIE ServedPLMNs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:32 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedplmns( - LIBLTE_S1AP_SERVEDPLMNS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedplmns(LIBLTE_S1AP_SERVEDPLMNS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ServedPLMNs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 5); + liblte_value_2_bits(ie->len - 1, ptr, 5); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tbcd_string(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11356,25 +9848,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedplmns( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedplmns( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDPLMNS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedplmns(uint8_t** ptr, LIBLTE_S1AP_SERVEDPLMNS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 5) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ServedPLMNs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ServedPLMNs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11386,72 +9875,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedplmns( /******************************************************************************* /* ProtocolIE SupportedTAs_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item( - LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item(LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SupportedTAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tac(&ie->tAC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tac(&ie->tAC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_bplmns(&ie->broadcastPLMNs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bplmns(&ie->broadcastPLMNs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item( - uint8_t **ptr, - LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item(uint8_t** ptr, LIBLTE_S1AP_SUPPORTEDTAS_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SupportedTAs_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tac(ptr, &ie->tAC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tac(ptr, &ie->tAC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bplmns(ptr, &ie->broadcastPLMNs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bplmns(ptr, &ie->broadcastPLMNs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11462,25 +9943,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item( /* ProtocolIE TAIListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistformdt( - LIBLTE_S1AP_TAILISTFORMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistformdt(LIBLTE_S1AP_TAILISTFORMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("TAIListforMDT pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("TAIListforMDT pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 3); + liblte_value_2_bits(ie->len - 1, ptr, 3); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11489,25 +9967,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistformdt( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistformdt( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistformdt(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 3) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAIListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAIListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11519,64 +9994,58 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistformdt( /******************************************************************************* /* ProtocolIE CompletedCellinTAI_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item( - LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item(LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CompletedCellinTAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item(uint8_t** ptr, + LIBLTE_S1AP_COMPLETEDCELLINTAI_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CompletedCellinTAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11586,72 +10055,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item( /******************************************************************************* /* ProtocolIE TargeteNB_ID SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id( - LIBLTE_S1AP_TARGETENB_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id(LIBLTE_S1AP_TARGETENB_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TargeteNB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_global_enb_id(&ie->global_ENB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_global_enb_id(&ie->global_ENB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_tai(&ie->selected_TAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->selected_TAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id( - uint8_t **ptr, - LIBLTE_S1AP_TARGETENB_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id(uint8_t** ptr, LIBLTE_S1AP_TARGETENB_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TargeteNB_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_global_enb_id(ptr, &ie->global_ENB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_global_enb_id(ptr, &ie->global_ENB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_tai(ptr, &ie->selected_TAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->selected_TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11662,30 +10123,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id( /* ProtocolIE TargetBSS_ToSourceBSS_TransparentContainer DYNAMIC OCTET STRING ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetbss_tosourcebss_transparentcontainer( - LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - TargetBSS-ToSourceBSS-TransparentContainer // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -11694,20 +10152,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetbss_tosourcebss_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_TARGETBSS_TOSOURCEBSS_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - TargetBSS-ToSourceBSS-TransparentContainer // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -11716,7 +10171,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -11728,25 +10183,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetbss_tosourcebss_transparentcontainer( /* ProtocolIE TAIListForRestart DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:2048 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforrestart( - LIBLTE_S1AP_TAILISTFORRESTART_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforrestart(LIBLTE_S1AP_TAILISTFORRESTART_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("TAIListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("TAIListForRestart pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 11); + liblte_value_2_bits(ie->len - 1, ptr, 11); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11755,25 +10207,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforrestart( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforrestart( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORRESTART_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforrestart(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORRESTART_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 11) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAIListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAIListForRestart unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11785,72 +10234,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforrestart( /******************************************************************************* /* ProtocolIE UserLocationInformation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation( - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation(LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UserLocationInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eutran_cgi, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eutran_cgi, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_tai(&ie->tai, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->tai, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation( - uint8_t **ptr, - LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation(uint8_t** ptr, + LIBLTE_S1AP_USERLOCATIONINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UserLocationInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eutran_cgi) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eutran_cgi) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_tai(ptr, &ie->tai) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->tai) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11861,25 +10304,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation( /* ProtocolIE ENBX2ExtTLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttlas( - LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttlas(LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ENBX2ExtTLAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_enbx2exttla(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_enbx2exttla(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -11888,25 +10327,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttlas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttlas( - uint8_t **ptr, - LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttlas(uint8_t** ptr, LIBLTE_S1AP_ENBX2EXTTLAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ENBX2ExtTLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ENBX2ExtTLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_enbx2exttla(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_enbx2exttla(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -11918,25 +10354,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttlas( /******************************************************************************* /* ProtocolIE AllocationAndRetentionPriority SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority( - LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority(LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("AllocationAndRetentionPriority error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_prioritylevel(&ie->priorityLevel, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_prioritylevel(&ie->priorityLevel, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } @@ -11946,35 +10379,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority( // Enum - ie->pre_emptionVulnerability liblte_value_2_bits(ie->pre_emptionVulnerability, ptr, 1); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority( - uint8_t **ptr, - LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_allocationandretentionpriority(uint8_t** ptr, LIBLTE_S1AP_ALLOCATIONANDRETENTIONPRIORITY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("AllocationAndRetentionPriority error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_prioritylevel(ptr, &ie->priorityLevel) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_prioritylevel(ptr, &ie->priorityLevel) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } @@ -11984,10 +10414,10 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority( // Enum - ie->pre_emptionVulnerability ie->pre_emptionVulnerability = (LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_ENUM)liblte_bits_2_value(ptr, 1); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -11997,72 +10427,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority( /******************************************************************************* /* ProtocolIE CancelledCellinEAI_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item( - LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item(LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CancelledCellinEAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item(uint8_t** ptr, + LIBLTE_S1AP_CANCELLEDCELLINEAI_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CancelledCellinEAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12072,72 +10496,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item( /******************************************************************************* /* ProtocolIE CancelledCellinTAI_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item( - LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item(LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CancelledCellinTAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item(uint8_t** ptr, + LIBLTE_S1AP_CANCELLEDCELLINTAI_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CancelledCellinTAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12147,64 +10565,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item( /******************************************************************************* /* ProtocolIE CellID_Broadcast_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item( - LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item(LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CellID_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_CELLID_BROADCAST_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CellID_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12214,72 +10624,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item( /******************************************************************************* /* ProtocolIE CellID_Cancelled_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item( - LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item(LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CellID_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_numberofbroadcasts(&ie->numberOfBroadcasts, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_CELLID_CANCELLED_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CellID_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_numberofbroadcasts(ptr, &ie->numberOfBroadcasts) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12290,25 +10692,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item( /* ProtocolIE CellIdListforMDT DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:32 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidlistformdt( - LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidlistformdt(LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CellIdListforMDT pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CellIdListforMDT pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 5); + liblte_value_2_bits(ie->len - 1, ptr, 5); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -12317,25 +10716,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellidlistformdt( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidlistformdt( - uint8_t **ptr, - LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidlistformdt(uint8_t** ptr, LIBLTE_S1AP_CELLIDLISTFORMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 5) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CellIdListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CellIdListforMDT unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -12347,19 +10743,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellidlistformdt( /******************************************************************************* /* ProtocolIE CSG_Id STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_id( - LIBLTE_S1AP_CSG_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_id(LIBLTE_S1AP_CSG_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - CSG-Id liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } liblte_align_up_zero(ptr, 8); @@ -12368,19 +10760,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_id( - uint8_t **ptr, - LIBLTE_S1AP_CSG_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_id(uint8_t** ptr, LIBLTE_S1AP_CSG_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - CSG-Id liblte_align_up(ptr, 8); uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } liblte_align_up(ptr, 8); @@ -12392,64 +10780,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_id( /******************************************************************************* /* ProtocolIE CSG_IdList_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item( - LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item(LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CSG_IdList_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_csg_id(&ie->cSG_Id, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&ie->cSG_Id, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item( - uint8_t **ptr, - LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item(uint8_t** ptr, LIBLTE_S1AP_CSG_IDLIST_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CSG_IdList_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_csg_id(ptr, &ie->cSG_Id) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_csg_id(ptr, &ie->cSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12459,18 +10839,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item( /******************************************************************************* /* ProtocolIE Direct_Forwarding_Path_Availability ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_direct_forwarding_path_availability( - LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_direct_forwarding_path_availability(LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Direct_Forwarding_Path_Availability error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -12483,18 +10861,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_direct_forwarding_path_availability( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_direct_forwarding_path_availability( - uint8_t **ptr, - LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_direct_forwarding_path_availability(uint8_t** ptr, + LIBLTE_S1AP_DIRECT_FORWARDING_PATH_AVAILABILITY_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Direct_Forwarding_Path_Availability error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -12510,64 +10886,58 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_direct_forwarding_path_availability( /******************************************************************************* /* ProtocolIE CompletedCellinEAI_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item( - LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item(LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CompletedCellinEAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->eCGI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item(uint8_t** ptr, + LIBLTE_S1AP_COMPLETEDCELLINEAI_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CompletedCellinEAI_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->eCGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12578,40 +10948,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item( /* Protocol Container List E_RABInformationList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( - LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist(LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABInformationList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("E_RABInformationList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabinformationlistitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabinformationlistitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -12622,36 +10988,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist(uint8_t** ptr, LIBLTE_S1AP_E_RABINFORMATIONLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABInformationList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("E_RABInformationList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabinformationlistitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabinformationlistitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -12664,25 +11027,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( /* ProtocolIE ForbiddenTAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas( - LIBLTE_S1AP_FORBIDDENTAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas(LIBLTE_S1AP_FORBIDDENTAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ForbiddenTAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_forbiddentas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_forbiddentas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -12691,25 +11050,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENTAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENTAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ForbiddenTAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ForbiddenTAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_forbiddentas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_forbiddentas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -12721,80 +11077,72 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas( /******************************************************************************* /* ProtocolIE GUMMEI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei( - LIBLTE_S1AP_GUMMEI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei(LIBLTE_S1AP_GUMMEI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("GUMMEI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->pLMN_Identity, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_mme_group_id(&ie->mME_Group_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_group_id(&ie->mME_Group_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_mme_code(&ie->mME_Code, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_code(&ie->mME_Code, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei(uint8_t** ptr, LIBLTE_S1AP_GUMMEI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("GUMMEI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->pLMN_Identity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_mme_group_id(ptr, &ie->mME_Group_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mme_group_id(ptr, &ie->mME_Group_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_mme_code(ptr, &ie->mME_Code) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mme_code(ptr, &ie->mME_Code) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12804,23 +11152,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei( /******************************************************************************* /* ProtocolIE LoggedMDT SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt( - LIBLTE_S1AP_LOGGEDMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt(LIBLTE_S1AP_LOGGEDMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("LoggedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); // Enum - ie->loggingInterval liblte_value_2_bits(ie->loggingInterval, ptr, 3); @@ -12828,28 +11172,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt( // Enum - ie->loggingDuration liblte_value_2_bits(ie->loggingDuration, ptr, 3); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt( - uint8_t **ptr, - LIBLTE_S1AP_LOGGEDMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt(uint8_t** ptr, LIBLTE_S1AP_LOGGEDMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("LoggedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -12862,10 +11202,10 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt( // Enum - ie->loggingDuration ie->loggingDuration = (LIBLTE_S1AP_LOGGINGDURATION_ENUM)liblte_bits_2_value(ptr, 3); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -12875,31 +11215,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt( /******************************************************************************* /* ProtocolIE NASSecurityParametersfromE_UTRAN DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparametersfrome_utran( - LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_nassecurityparametersfrome_utran(LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NASSecurityParametersfromE-UTRAN // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -12907,21 +11245,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nassecurityparametersfrome_utran( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparametersfrome_utran( - uint8_t **ptr, - LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_nassecurityparametersfrome_utran(uint8_t** ptr, + LIBLTE_S1AP_NASSECURITYPARAMETERSFROME_UTRAN_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - NASSecurityParametersfromE-UTRAN // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -12930,7 +11266,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparametersfrome_utran( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -12941,15 +11277,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nassecurityparametersfrome_utran( /******************************************************************************* /* ProtocolIE ReportAmountMDT ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportamountmdt( - LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportamountmdt(LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie liblte_value_2_bits(*ie, ptr, 3); err = LIBLTE_SUCCESS; @@ -12957,15 +11289,11 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_reportamountmdt( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportamountmdt( - uint8_t **ptr, - LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportamountmdt(uint8_t** ptr, LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Enum - *ie *ie = (LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM)liblte_bits_2_value(ptr, 3); err = LIBLTE_SUCCESS; @@ -12976,80 +11304,72 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reportamountmdt( /******************************************************************************* /* ProtocolIE ServedGUMMEIsItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem( - LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem(LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ServedGUMMEIsItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_servedplmns(&ie->servedPLMNs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_servedplmns(&ie->servedPLMNs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_servedgroupids(&ie->servedGroupIDs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_servedgroupids(&ie->servedGroupIDs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_servedmmecs(&ie->servedMMECs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_servedmmecs(&ie->servedMMECs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem(uint8_t** ptr, LIBLTE_S1AP_SERVEDGUMMEISITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ServedGUMMEIsItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_servedplmns(ptr, &ie->servedPLMNs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_servedplmns(ptr, &ie->servedPLMNs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_servedgroupids(ptr, &ie->servedGroupIDs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_servedgroupids(ptr, &ie->servedGroupIDs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_servedmmecs(ptr, &ie->servedMMECs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_servedmmecs(ptr, &ie->servedMMECs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13059,72 +11379,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem( /******************************************************************************* /* ProtocolIE S_TMSI SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi( - LIBLTE_S1AP_S_TMSI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi(LIBLTE_S1AP_S_TMSI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("S_TMSI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_mme_code(&ie->mMEC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_code(&ie->mMEC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_m_tmsi(&ie->m_TMSI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m_tmsi(&ie->m_TMSI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi( - uint8_t **ptr, - LIBLTE_S1AP_S_TMSI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi(uint8_t** ptr, LIBLTE_S1AP_S_TMSI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("S_TMSI error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_mme_code(ptr, &ie->mMEC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mme_code(ptr, &ie->mMEC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_m_tmsi(ptr, &ie->m_TMSI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_m_tmsi(ptr, &ie->m_TMSI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13135,25 +11447,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi( /* ProtocolIE TAIListforWarning DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforwarning( - LIBLTE_S1AP_TAILISTFORWARNING_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforwarning(LIBLTE_S1AP_TAILISTFORWARNING_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("TAIListforWarning pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("TAIListforWarning pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tai(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13162,25 +11471,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailistforwarning( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforwarning( - uint8_t **ptr, - LIBLTE_S1AP_TAILISTFORWARNING_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforwarning(uint8_t** ptr, LIBLTE_S1AP_TAILISTFORWARNING_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAIListforWarning unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAIListforWarning unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tai(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13193,25 +11499,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailistforwarning( /* ProtocolIE CompletedCellinTAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai( - LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai(LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CompletedCellinTAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CompletedCellinTAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_completedcellintai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_completedcellintai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13220,25 +11523,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai(uint8_t** ptr, LIBLTE_S1AP_COMPLETEDCELLINTAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CompletedCellinTAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CompletedCellinTAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_completedcellintai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_completedcellintai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13250,100 +11550,92 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai( /******************************************************************************* /* ProtocolIE TargetRNC_ID SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id( - LIBLTE_S1AP_TARGETRNC_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id(LIBLTE_S1AP_TARGETRNC_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TargetRNC_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->rAC_present?1:0, ptr, 1); - liblte_value_2_bits(ie->extendedRNC_ID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->rAC_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->extendedRNC_ID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_lai(&ie->lAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lai(&ie->lAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->rAC_present) { - if(liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->rAC_present) { + if (liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(liblte_s1ap_pack_rnc_id(&ie->rNC_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_rnc_id(&ie->rNC_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->extendedRNC_ID_present) { - if(liblte_s1ap_pack_extendedrnc_id(&ie->extendedRNC_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->extendedRNC_ID_present) { + if (liblte_s1ap_pack_extendedrnc_id(&ie->extendedRNC_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id( - uint8_t **ptr, - LIBLTE_S1AP_TARGETRNC_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id(uint8_t** ptr, LIBLTE_S1AP_TARGETRNC_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TargetRNC_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->rAC_present = liblte_bits_2_value(ptr, 1); + ie->rAC_present = liblte_bits_2_value(ptr, 1); ie->extendedRNC_ID_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_lai(ptr, &ie->lAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_lai(ptr, &ie->lAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->rAC_present) { - if(liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->rAC_present) { + if (liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(liblte_s1ap_unpack_rnc_id(ptr, &ie->rNC_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_rnc_id(ptr, &ie->rNC_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->extendedRNC_ID_present) { - if(liblte_s1ap_unpack_extendedrnc_id(ptr, &ie->extendedRNC_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->extendedRNC_ID_present) { + if (liblte_s1ap_unpack_extendedrnc_id(ptr, &ie->extendedRNC_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13353,84 +11645,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id( /******************************************************************************* /* ProtocolIE UE_associatedLogicalS1_ConnectionItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UE_associatedLogicalS1_ConnectionItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->mME_UE_S1AP_ID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->eNB_UE_S1AP_ID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->mME_UE_S1AP_ID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->eNB_UE_S1AP_ID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(ie->mME_UE_S1AP_ID_present) { - if(liblte_s1ap_pack_mme_ue_s1ap_id(&ie->mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->mME_UE_S1AP_ID_present) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&ie->mME_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->eNB_UE_S1AP_ID_present) { - if(liblte_s1ap_pack_enb_ue_s1ap_id(&ie->eNB_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->eNB_UE_S1AP_ID_present) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&ie->eNB_UE_S1AP_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(uint8_t** ptr, + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UE_associatedLogicalS1_ConnectionItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->mME_UE_S1AP_ID_present = liblte_bits_2_value(ptr, 1); ie->eNB_UE_S1AP_ID_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(ie->mME_UE_S1AP_ID_present) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->mME_UE_S1AP_ID_present) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &ie->mME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->eNB_UE_S1AP_ID_present) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &ie->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->eNB_UE_S1AP_ID_present) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &ie->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13440,18 +11728,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( /******************************************************************************* /* ProtocolIE UEPagingID CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uepagingid( - LIBLTE_S1AP_UEPAGINGID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uepagingid(LIBLTE_S1AP_UEPAGINGID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("UEPagingID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -13459,33 +11743,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uepagingid( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_S_TMSI) { - if(liblte_s1ap_pack_s_tmsi(&ie->choice.s_TMSI, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) { - if(liblte_s1ap_pack_imsi(&ie->choice.iMSI, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_S_TMSI) { + if (liblte_s1ap_pack_s_tmsi(&ie->choice.s_TMSI, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) { + if (liblte_s1ap_pack_imsi(&ie->choice.iMSI, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid( - uint8_t **ptr, - LIBLTE_S1AP_UEPAGINGID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid(uint8_t** ptr, LIBLTE_S1AP_UEPAGINGID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("UEPagingID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -13493,16 +11773,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid( // Choice type ie->choice_type = (LIBLTE_S1AP_UEPAGINGID_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_S_TMSI) { - if(liblte_s1ap_unpack_s_tmsi(ptr, &ie->choice.s_TMSI) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) { - if(liblte_s1ap_unpack_imsi(ptr, &ie->choice.iMSI) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_S_TMSI) { + if (liblte_s1ap_unpack_s_tmsi(ptr, &ie->choice.s_TMSI) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_UEPAGINGID_CHOICE_IMSI) { + if (liblte_s1ap_unpack_imsi(ptr, &ie->choice.iMSI) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -13511,94 +11791,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uepagingid( /******************************************************************************* /* ProtocolIE Bearers_SubjectToStatusTransfer_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_bearers_subjecttostatustransfer_item(LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Bearers_SubjectToStatusTransfer_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->receiveStatusofULPDCPSDUs_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->receiveStatusofULPDCPSDUs_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_countvalue(&ie->uL_COUNTvalue, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_countvalue(&ie->uL_COUNTvalue, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_countvalue(&ie->dL_COUNTvalue, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_countvalue(&ie->dL_COUNTvalue, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->receiveStatusofULPDCPSDUs_present) { - if(liblte_s1ap_pack_receivestatusofulpdcpsdus(&ie->receiveStatusofULPDCPSDUs, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->receiveStatusofULPDCPSDUs_present) { + if (liblte_s1ap_pack_receivestatusofulpdcpsdus(&ie->receiveStatusofULPDCPSDUs, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( - uint8_t **ptr, - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(uint8_t** ptr, + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Bearers_SubjectToStatusTransfer_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->receiveStatusofULPDCPSDUs_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_countvalue(ptr, &ie->uL_COUNTvalue) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_countvalue(ptr, &ie->uL_COUNTvalue) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_countvalue(ptr, &ie->dL_COUNTvalue) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_countvalue(ptr, &ie->dL_COUNTvalue) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->receiveStatusofULPDCPSDUs_present) { - if(liblte_s1ap_unpack_receivestatusofulpdcpsdus(ptr, &ie->receiveStatusofULPDCPSDUs) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->receiveStatusofULPDCPSDUs_present) { + if (liblte_s1ap_unpack_receivestatusofulpdcpsdus(ptr, &ie->receiveStatusofULPDCPSDUs) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13609,25 +11885,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( /* ProtocolIE CancelledCellinEAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai( - LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai(LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CancelledCellinEAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CancelledCellinEAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_cancelledcellineai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_cancelledcellineai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13636,25 +11909,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai(uint8_t** ptr, LIBLTE_S1AP_CANCELLEDCELLINEAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CancelledCellinEAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CancelledCellinEAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_cancelledcellineai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_cancelledcellineai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13667,25 +11937,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai( /* ProtocolIE CellID_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast( - LIBLTE_S1AP_CELLID_BROADCAST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast(LIBLTE_S1AP_CELLID_BROADCAST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CellID_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CellID_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_cellid_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_cellid_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13694,25 +11961,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_BROADCAST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast(uint8_t** ptr, LIBLTE_S1AP_CELLID_BROADCAST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CellID_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CellID_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_cellid_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_cellid_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13724,64 +11988,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast( /******************************************************************************* /* ProtocolIE CellBasedMDT SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt( - LIBLTE_S1AP_CELLBASEDMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt(LIBLTE_S1AP_CELLBASEDMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CellBasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_cellidlistformdt(&ie->cellIdListforMDT, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellidlistformdt(&ie->cellIdListforMDT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_CELLBASEDMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt(uint8_t** ptr, LIBLTE_S1AP_CELLBASEDMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CellBasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_cellidlistformdt(ptr, &ie->cellIdListforMDT) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cellidlistformdt(ptr, &ie->cellIdListforMDT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13792,25 +12048,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt( /* ProtocolIE CSG_IdList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist( - LIBLTE_S1AP_CSG_IDLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist(LIBLTE_S1AP_CSG_IDLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("CSG_IdList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_csg_idlist_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_csg_idlist_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13819,25 +12071,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist( - uint8_t **ptr, - LIBLTE_S1AP_CSG_IDLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist(uint8_t** ptr, LIBLTE_S1AP_CSG_IDLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("CSG_IdList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_csg_idlist_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_csg_idlist_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13850,25 +12098,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist( /* ProtocolIE ECGIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilist( - LIBLTE_S1AP_ECGILIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilist(LIBLTE_S1AP_ECGILIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ECGIList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_eutran_cgi(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -13877,25 +12121,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ecgilist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilist( - uint8_t **ptr, - LIBLTE_S1AP_ECGILIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilist(uint8_t** ptr, LIBLTE_S1AP_ECGILIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("ECGIList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -13907,72 +12147,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ecgilist( /******************************************************************************* /* ProtocolIE EmergencyAreaID_Cancelled_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item( - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item(LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("EmergencyAreaID_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_emergencyareaid(&ie->emergencyAreaID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_emergencyareaid(&ie->emergencyAreaID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cancelledcellineai(&ie->cancelledCellinEAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cancelledcellineai(&ie->cancelledCellinEAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_emergencyareaid_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("EmergencyAreaID_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_emergencyareaid(ptr, &ie->emergencyAreaID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_emergencyareaid(ptr, &ie->emergencyAreaID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cancelledcellineai(ptr, &ie->cancelledCellinEAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cancelledcellineai(ptr, &ie->cancelledCellinEAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -13982,80 +12216,72 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item( /******************************************************************************* /* ProtocolIE GERAN_Cell_ID SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id( - LIBLTE_S1AP_GERAN_CELL_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id(LIBLTE_S1AP_GERAN_CELL_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("GERAN_Cell_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_lai(&ie->lAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lai(&ie->lAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_rac(&ie->rAC, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_ci(&ie->cI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ci(&ie->cI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id( - uint8_t **ptr, - LIBLTE_S1AP_GERAN_CELL_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id(uint8_t** ptr, LIBLTE_S1AP_GERAN_CELL_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("GERAN_Cell_ID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_lai(ptr, &ie->lAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_lai(ptr, &ie->lAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_rac(ptr, &ie->rAC) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_ci(ptr, &ie->cI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ci(ptr, &ie->cI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -14066,40 +12292,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id( /* Protocol Container List E_RABList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablist( - LIBLTE_S1AP_E_RABLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablist(LIBLTE_S1AP_E_RABLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("E_RABList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -14110,36 +12330,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablist(uint8_t** ptr, LIBLTE_S1AP_E_RABLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("E_RABList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -14152,25 +12368,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablist( /* ProtocolIE ForbiddenLAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas( - LIBLTE_S1AP_FORBIDDENLAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas(LIBLTE_S1AP_FORBIDDENLAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("ForbiddenLAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_forbiddenlas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_forbiddenlas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -14179,25 +12391,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas( - uint8_t **ptr, - LIBLTE_S1AP_FORBIDDENLAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas(uint8_t** ptr, LIBLTE_S1AP_FORBIDDENLAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ForbiddenLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ForbiddenLAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_forbiddenlas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_forbiddenlas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -14209,18 +12418,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas( /******************************************************************************* /* ProtocolIE MDT_Location_Info STATIC BIT STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_location_info( - LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_location_info(LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MDT-Location-Info uint32_t i; - for(i=0;ibuffer[i], ptr, 1); } err = LIBLTE_SUCCESS; @@ -14228,18 +12433,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_location_info( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_location_info( - uint8_t **ptr, - LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_location_info(uint8_t** ptr, LIBLTE_S1AP_MDT_LOCATION_INFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Static bit string - MDT-Location-Info uint32_t i; - for(i=0;ibuffer[i] = liblte_bits_2_value(ptr, 1); } err = LIBLTE_SUCCESS; @@ -14250,23 +12451,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_location_info( /******************************************************************************* /* ProtocolIE M1PeriodicReporting SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting( - LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting(LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("M1PeriodicReporting error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); // Enum - ie->reportInterval liblte_value_2_bits(ie->reportInterval, ptr, 4); @@ -14274,28 +12471,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting( // Enum - ie->reportAmount liblte_value_2_bits(ie->reportAmount, ptr, 3); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting( - uint8_t **ptr, - LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting(uint8_t** ptr, LIBLTE_S1AP_M1PERIODICREPORTING_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("M1PeriodicReporting error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -14308,45 +12501,40 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting( // Enum - ie->reportAmount ie->reportAmount = (LIBLTE_S1AP_REPORTAMOUNTMDT_ENUM)liblte_bits_2_value(ptr, 3); - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } - /******************************************************************************* /* ProtocolIE eHRPD_Sector_ID DYNAMIC OCTET STRING ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ehrpd_sector_id( - LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ehrpd_sector_id(LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - eHRPD-Sector-ID // Length - if(ie->n_octets < 128) { - liblte_value_2_bits(0, ptr, 1); + if (ie->n_octets < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 7); - } else if(ie->n_octets < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (ie->n_octets < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(ie->n_octets, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets } - + // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { liblte_value_2_bits(ie->buffer[i], ptr, 8); } err = LIBLTE_SUCCESS; @@ -14354,21 +12542,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ehrpd_sector_id( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id( - uint8_t **ptr, - LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id(uint8_t** ptr, LIBLTE_S1AP_EHRPD_SECTOR_ID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Dynamic octet string - eHRPD-Sector-ID // Length - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { ie->n_octets = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -14377,7 +12561,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id( // Octets uint32_t i; - for(i=0;in_octets;i++) { + for (i = 0; i < ie->n_octets; i++) { ie->buffer[i] = liblte_bits_2_value(ptr, 8); } err = LIBLTE_SUCCESS; @@ -14385,22 +12569,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ehrpd_sector_id( return err; } - /******************************************************************************* /* ProtocolIE RIMRoutingAddress CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimroutingaddress( - LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimroutingaddress(LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("RIMRoutingAddress error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -14408,37 +12587,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimroutingaddress( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_GERAN_CELL_ID) { - if(liblte_s1ap_pack_geran_cell_id(&ie->choice.gERAN_Cell_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_TARGETRNC_ID) { - if(liblte_s1ap_pack_targetrnc_id(&ie->choice.targetRNC_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_EHRPD_SECTOR_ID) { - if(liblte_s1ap_pack_ehrpd_sector_id(&ie->choice.eHRPD_Sector_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_GERAN_CELL_ID) { + if (liblte_s1ap_pack_geran_cell_id(&ie->choice.gERAN_Cell_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_TARGETRNC_ID) { + if (liblte_s1ap_pack_targetrnc_id(&ie->choice.targetRNC_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_EHRPD_SECTOR_ID) { + if (liblte_s1ap_pack_ehrpd_sector_id(&ie->choice.eHRPD_Sector_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress( - uint8_t **ptr, - LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress(uint8_t** ptr, LIBLTE_S1AP_RIMROUTINGADDRESS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("RIMRoutingAddress error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -14446,20 +12621,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress( // Choice type ie->choice_type = (LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_GERAN_CELL_ID) { - if(liblte_s1ap_unpack_geran_cell_id(ptr, &ie->choice.gERAN_Cell_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_TARGETRNC_ID) { - if(liblte_s1ap_unpack_targetrnc_id(ptr, &ie->choice.targetRNC_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_EHRPD_SECTOR_ID) { - if(liblte_s1ap_unpack_ehrpd_sector_id(ptr, &ie->choice.eHRPD_Sector_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_GERAN_CELL_ID) { + if (liblte_s1ap_unpack_geran_cell_id(ptr, &ie->choice.gERAN_Cell_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_TARGETRNC_ID) { + if (liblte_s1ap_unpack_targetrnc_id(ptr, &ie->choice.targetRNC_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RIMROUTINGADDRESS_CHOICE_EHRPD_SECTOR_ID) { + if (liblte_s1ap_unpack_ehrpd_sector_id(ptr, &ie->choice.eHRPD_Sector_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -14469,25 +12644,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimroutingaddress( /* ProtocolIE ServedGUMMEIs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:8 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeis( - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeis(LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("ServedGUMMEIs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("ServedGUMMEIs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 3); + liblte_value_2_bits(ie->len - 1, ptr, 3); // liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_servedgummeisitem(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_servedgummeisitem(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -14496,25 +12668,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeis( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeis( - uint8_t **ptr, - LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeis(uint8_t** ptr, LIBLTE_S1AP_SERVEDGUMMEIS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 3) + 1; // liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("ServedGUMMEIs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("ServedGUMMEIs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_servedgummeisitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_servedgummeisitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -14526,64 +12695,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeis( /******************************************************************************* /* ProtocolIE TAIBasedMDT SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt( - LIBLTE_S1AP_TAIBASEDMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt(LIBLTE_S1AP_TAIBASEDMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TAIBasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tailistformdt(&ie->tAIListforMDT, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tailistformdt(&ie->tAIListforMDT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt( - uint8_t **ptr, - LIBLTE_S1AP_TAIBASEDMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt(uint8_t** ptr, LIBLTE_S1AP_TAIBASEDMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TAIBasedMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tailistformdt(ptr, &ie->tAIListforMDT) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tailistformdt(ptr, &ie->tAIListforMDT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -14593,72 +12754,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt( /******************************************************************************* /* ProtocolIE TAI_Broadcast_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item( - LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item(LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TAI_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_completedcellintai(&ie->completedCellinTAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_completedcellintai(&ie->completedCellinTAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_TAI_BROADCAST_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TAI_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_completedcellintai(ptr, &ie->completedCellinTAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_completedcellintai(ptr, &ie->completedCellinTAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -14668,18 +12821,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item( /******************************************************************************* /* ProtocolIE TargetID CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetid( - LIBLTE_S1AP_TARGETID_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetid(LIBLTE_S1AP_TARGETID_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TargetID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -14687,37 +12836,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetid( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETENB_ID) { - if(liblte_s1ap_pack_targetenb_id(&ie->choice.targeteNB_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETRNC_ID) { - if(liblte_s1ap_pack_targetrnc_id(&ie->choice.targetRNC_ID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_CGI) { - if(liblte_s1ap_pack_cgi(&ie->choice.cGI, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETENB_ID) { + if (liblte_s1ap_pack_targetenb_id(&ie->choice.targeteNB_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETRNC_ID) { + if (liblte_s1ap_pack_targetrnc_id(&ie->choice.targetRNC_ID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_CGI) { + if (liblte_s1ap_pack_cgi(&ie->choice.cGI, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid( - uint8_t **ptr, - LIBLTE_S1AP_TARGETID_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid(uint8_t** ptr, LIBLTE_S1AP_TARGETID_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TargetID error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -14725,20 +12870,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid( // Choice type ie->choice_type = (LIBLTE_S1AP_TARGETID_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETENB_ID) { - if(liblte_s1ap_unpack_targetenb_id(ptr, &ie->choice.targeteNB_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETRNC_ID) { - if(liblte_s1ap_unpack_targetrnc_id(ptr, &ie->choice.targetRNC_ID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_CGI) { - if(liblte_s1ap_unpack_cgi(ptr, &ie->choice.cGI) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETENB_ID) { + if (liblte_s1ap_unpack_targetenb_id(ptr, &ie->choice.targeteNB_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_TARGETRNC_ID) { + if (liblte_s1ap_unpack_targetrnc_id(ptr, &ie->choice.targetRNC_ID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_TARGETID_CHOICE_CGI) { + if (liblte_s1ap_unpack_cgi(ptr, &ie->choice.cGI) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -14747,18 +12892,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetid( /******************************************************************************* /* ProtocolIE WarningAreaList CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningarealist( - LIBLTE_S1AP_WARNINGAREALIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningarealist(LIBLTE_S1AP_WARNINGAREALIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("WarningAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -14766,37 +12907,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_warningarealist( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_CELLIDLIST) { - if(liblte_s1ap_pack_ecgilist(&ie->choice.cellIDList, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_TRACKINGAREALISTFORWARNING) { - if(liblte_s1ap_pack_tailistforwarning(&ie->choice.trackingAreaListforWarning, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_EMERGENCYAREAIDLIST) { - if(liblte_s1ap_pack_emergencyareaidlist(&ie->choice.emergencyAreaIDList, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_CELLIDLIST) { + if (liblte_s1ap_pack_ecgilist(&ie->choice.cellIDList, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_TRACKINGAREALISTFORWARNING) { + if (liblte_s1ap_pack_tailistforwarning(&ie->choice.trackingAreaListforWarning, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_EMERGENCYAREAIDLIST) { + if (liblte_s1ap_pack_emergencyareaidlist(&ie->choice.emergencyAreaIDList, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist( - uint8_t **ptr, - LIBLTE_S1AP_WARNINGAREALIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist(uint8_t** ptr, LIBLTE_S1AP_WARNINGAREALIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("WarningAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -14804,20 +12941,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist( // Choice type ie->choice_type = (LIBLTE_S1AP_WARNINGAREALIST_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_CELLIDLIST) { - if(liblte_s1ap_unpack_ecgilist(ptr, &ie->choice.cellIDList) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_TRACKINGAREALISTFORWARNING) { - if(liblte_s1ap_unpack_tailistforwarning(ptr, &ie->choice.trackingAreaListforWarning) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_EMERGENCYAREAIDLIST) { - if(liblte_s1ap_unpack_emergencyareaidlist(ptr, &ie->choice.emergencyAreaIDList) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_CELLIDLIST) { + if (liblte_s1ap_unpack_ecgilist(ptr, &ie->choice.cellIDList) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_TRACKINGAREALISTFORWARNING) { + if (liblte_s1ap_unpack_tailistforwarning(ptr, &ie->choice.trackingAreaListforWarning) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_WARNINGAREALIST_CHOICE_EMERGENCYAREAIDLIST) { + if (liblte_s1ap_unpack_emergencyareaidlist(ptr, &ie->choice.emergencyAreaIDList) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -14826,18 +12963,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_warningarealist( /******************************************************************************* /* ProtocolIE AreaScopeOfMDT CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_areascopeofmdt( - LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_areascopeofmdt(LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("AreaScopeOfMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -14845,38 +12978,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_areascopeofmdt( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_CELLBASED) { - if(liblte_s1ap_pack_cellbasedmdt(&ie->choice.cellBased, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TABASED) { - if(liblte_s1ap_pack_tabasedmdt(&ie->choice.tABased, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_PLMNWIDE) { - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TAIBASED) { - if(liblte_s1ap_pack_taibasedmdt(&ie->choice.tAIBased, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_CELLBASED) { + if (liblte_s1ap_pack_cellbasedmdt(&ie->choice.cellBased, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TABASED) { + if (liblte_s1ap_pack_tabasedmdt(&ie->choice.tABased, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_PLMNWIDE) { + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TAIBASED) { + if (liblte_s1ap_pack_taibasedmdt(&ie->choice.tAIBased, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt( - uint8_t **ptr, - LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt(uint8_t** ptr, LIBLTE_S1AP_AREASCOPEOFMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("AreaScopeOfMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -14884,21 +13013,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt( // Choice type ie->choice_type = (LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_CELLBASED) { - if(liblte_s1ap_unpack_cellbasedmdt(ptr, &ie->choice.cellBased) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TABASED) { - if(liblte_s1ap_unpack_tabasedmdt(ptr, &ie->choice.tABased) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_PLMNWIDE) { - } else if(ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TAIBASED) { - if(liblte_s1ap_unpack_taibasedmdt(ptr, &ie->choice.tAIBased) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_CELLBASED) { + if (liblte_s1ap_unpack_cellbasedmdt(ptr, &ie->choice.cellBased) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TABASED) { + if (liblte_s1ap_unpack_tabasedmdt(ptr, &ie->choice.tABased) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_PLMNWIDE) { + } else if (ie->choice_type == LIBLTE_S1AP_AREASCOPEOFMDT_CHOICE_TAIBASED) { + if (liblte_s1ap_unpack_taibasedmdt(ptr, &ie->choice.tAIBased) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -14908,25 +13037,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_areascopeofmdt( /* ProtocolIE CancelledCellinTAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai( - LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai(LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CancelledCellinTAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CancelledCellinTAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_cancelledcellintai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_cancelledcellintai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -14935,25 +13061,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai( - uint8_t **ptr, - LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai(uint8_t** ptr, LIBLTE_S1AP_CANCELLEDCELLINTAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CancelledCellinTAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CancelledCellinTAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_cancelledcellintai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_cancelledcellintai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -14965,64 +13088,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai( /******************************************************************************* /* ProtocolIE CellType SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype( - LIBLTE_S1AP_CELLTYPE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype(LIBLTE_S1AP_CELLTYPE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CellType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_cell_size(&ie->cell_Size, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cell_size(&ie->cell_Size, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype( - uint8_t **ptr, - LIBLTE_S1AP_CELLTYPE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype(uint8_t** ptr, LIBLTE_S1AP_CELLTYPE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CellType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_cell_size(ptr, &ie->cell_Size) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cell_size(ptr, &ie->cell_Size) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15033,25 +13148,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype( /* ProtocolIE EmergencyAreaID_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled( - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled(LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("EmergencyAreaID_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaID_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_emergencyareaid_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_emergencyareaid_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -15060,25 +13173,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled(uint8_t** ptr, + LIBLTE_S1AP_EMERGENCYAREAID_CANCELLED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("EmergencyAreaID_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaID_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_emergencyareaid_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_emergencyareaid_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15091,25 +13203,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled( /* ProtocolIE GUMMEIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeilist( - LIBLTE_S1AP_GUMMEILIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeilist(LIBLTE_S1AP_GUMMEILIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("GUMMEIList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_gummei(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_gummei(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -15118,25 +13226,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummeilist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeilist( - uint8_t **ptr, - LIBLTE_S1AP_GUMMEILIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeilist(uint8_t** ptr, LIBLTE_S1AP_GUMMEILIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("GUMMEIList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_gummei(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_gummei(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15148,86 +13252,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummeilist( /******************************************************************************* /* ProtocolIE E_RABLevelQoSParameters SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablevelqosparameters( - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rablevelqosparameters(LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABLevelQoSParameters error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->gbrQosInformation_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->gbrQosInformation_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_qci(&ie->qCI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_qci(&ie->qCI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_allocationandretentionpriority(&ie->allocationRetentionPriority, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_allocationandretentionpriority(&ie->allocationRetentionPriority, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->gbrQosInformation_present) { - if(liblte_s1ap_pack_gbr_qosinformation(&ie->gbrQosInformation, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->gbrQosInformation_present) { + if (liblte_s1ap_pack_gbr_qosinformation(&ie->gbrQosInformation, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablevelqosparameters( - uint8_t **ptr, - LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablevelqosparameters(uint8_t** ptr, + LIBLTE_S1AP_E_RABLEVELQOSPARAMETERS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABLevelQoSParameters error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->gbrQosInformation_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_qci(ptr, &ie->qCI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_qci(ptr, &ie->qCI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_allocationandretentionpriority(ptr, &ie->allocationRetentionPriority) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_allocationandretentionpriority(ptr, &ie->allocationRetentionPriority) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->gbrQosInformation_present) { - if(liblte_s1ap_unpack_gbr_qosinformation(ptr, &ie->gbrQosInformation) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->gbrQosInformation_present) { + if (liblte_s1ap_unpack_gbr_qosinformation(ptr, &ie->gbrQosInformation) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15237,80 +13335,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rablevelqosparameters( /******************************************************************************* /* ProtocolIE LastVisitedEUTRANCellInformation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation( - LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_lastvisitedeutrancellinformation(LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedEUTRANCellInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_eutran_cgi(&ie->global_Cell_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->global_Cell_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_celltype(&ie->cellType, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_celltype(&ie->cellType, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_time_ue_stayedincell(&ie->time_UE_StayedInCell, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_time_ue_stayedincell(&ie->time_UE_StayedInCell, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_lastvisitedeutrancellinformation(uint8_t** ptr, + LIBLTE_S1AP_LASTVISITEDEUTRANCELLINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedEUTRANCellInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->global_Cell_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->global_Cell_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_celltype(ptr, &ie->cellType) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_celltype(ptr, &ie->cellType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_time_ue_stayedincell(ptr, &ie->time_UE_StayedInCell) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_time_ue_stayedincell(ptr, &ie->time_UE_StayedInCell) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15320,78 +13414,70 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation( /******************************************************************************* /* ProtocolIE RIMTransfer SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer( - LIBLTE_S1AP_RIMTRANSFER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer(LIBLTE_S1AP_RIMTRANSFER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("RIMTransfer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->rIMRoutingAddress_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->rIMRoutingAddress_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_riminformation(&ie->rIMInformation, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_riminformation(&ie->rIMInformation, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->rIMRoutingAddress_present) { - if(liblte_s1ap_pack_rimroutingaddress(&ie->rIMRoutingAddress, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->rIMRoutingAddress_present) { + if (liblte_s1ap_pack_rimroutingaddress(&ie->rIMRoutingAddress, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer( - uint8_t **ptr, - LIBLTE_S1AP_RIMTRANSFER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer(uint8_t** ptr, LIBLTE_S1AP_RIMTRANSFER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("RIMTransfer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->rIMRoutingAddress_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_riminformation(ptr, &ie->rIMInformation) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_riminformation(ptr, &ie->rIMInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->rIMRoutingAddress_present) { - if(liblte_s1ap_unpack_rimroutingaddress(ptr, &ie->rIMRoutingAddress) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->rIMRoutingAddress_present) { + if (liblte_s1ap_unpack_rimroutingaddress(ptr, &ie->rIMRoutingAddress) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15402,25 +13488,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer( /* ProtocolIE SupportedTAs DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas( - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas(LIBLTE_S1AP_SUPPORTEDTAS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("SupportedTAs pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_supportedtas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_supportedtas_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -15429,25 +13511,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas( - uint8_t **ptr, - LIBLTE_S1AP_SUPPORTEDTAS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas(uint8_t** ptr, LIBLTE_S1AP_SUPPORTEDTAS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("SupportedTAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("SupportedTAs unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_supportedtas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_supportedtas_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15459,72 +13538,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas( /******************************************************************************* /* ProtocolIE TAI_Cancelled_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item( - LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item(LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TAI_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cancelledcellintai(&ie->cancelledCellinTAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cancelledcellintai(&ie->cancelledCellinTAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item( - uint8_t **ptr, - LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item(uint8_t** ptr, LIBLTE_S1AP_TAI_CANCELLED_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TAI_Cancelled_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cancelledcellintai(ptr, &ie->cancelledCellinTAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cancelledcellintai(ptr, &ie->cancelledCellinTAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15534,64 +13605,57 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item( /******************************************************************************* /* ProtocolIE X2TNLConfigurationInfo SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo( - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo(LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("X2TNLConfigurationInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_enbx2tlas(&ie->eNBX2TransportLayerAddresses, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enbx2tlas(&ie->eNBX2TransportLayerAddresses, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo( - uint8_t **ptr, - LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo(uint8_t** ptr, + LIBLTE_S1AP_X2TNLCONFIGURATIONINFO_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("X2TNLConfigurationInfo error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_enbx2tlas(ptr, &ie->eNBX2TransportLayerAddresses) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbx2tlas(ptr, &ie->eNBX2TransportLayerAddresses) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15602,40 +13666,40 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo( /* Protocol Container List Bearers_SubjectToStatusTransferList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransferlist( - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_bearers_subjecttostatustransferlist(LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("Bearers_SubjectToStatusTransferList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "Bearers_SubjectToStatusTransferList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_bearers_subjecttostatustransfer_item(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bearers_subjecttostatustransfer_item(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -15646,36 +13710,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransferlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransferlist( - uint8_t **ptr, - LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_bearers_subjecttostatustransferlist(uint8_t** ptr, + LIBLTE_S1AP_BEARERS_SUBJECTTOSTATUSTRANSFERLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("Bearers_SubjectToStatusTransferList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("Bearers_SubjectToStatusTransferList unpack error - max supported dynamic sequence length = 32, " + "ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15688,25 +13752,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransferlist( /* ProtocolIE CellID_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled( - LIBLTE_S1AP_CELLID_CANCELLED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled(LIBLTE_S1AP_CELLID_CANCELLED_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CellID_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CellID_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_cellid_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_cellid_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -15715,25 +13776,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_CELLID_CANCELLED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled(uint8_t** ptr, LIBLTE_S1AP_CELLID_CANCELLED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CellID_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CellID_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_cellid_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_cellid_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15746,25 +13804,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled( /* ProtocolIE CompletedCellinEAI DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai( - LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai(LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("CompletedCellinEAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("CompletedCellinEAI pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_completedcellineai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_completedcellineai_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -15773,25 +13828,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai( - uint8_t **ptr, - LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai(uint8_t** ptr, LIBLTE_S1AP_COMPLETEDCELLINEAI_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("CompletedCellinEAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("CompletedCellinEAI unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_completedcellineai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_completedcellineai_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -15803,120 +13855,114 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai( /******************************************************************************* /* ProtocolIE HandoverRestrictionList SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist( - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist(LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("HandoverRestrictionList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->equivalentPLMNs_present?1:0, ptr, 1); - liblte_value_2_bits(ie->forbiddenTAs_present?1:0, ptr, 1); - liblte_value_2_bits(ie->forbiddenLAs_present?1:0, ptr, 1); - liblte_value_2_bits(ie->forbiddenInterRATs_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->equivalentPLMNs_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->forbiddenTAs_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->forbiddenLAs_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->forbiddenInterRATs_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tbcd_string(&ie->servingPLMN, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tbcd_string(&ie->servingPLMN, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->equivalentPLMNs_present) { - if(liblte_s1ap_pack_eplmns(&ie->equivalentPLMNs, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->equivalentPLMNs_present) { + if (liblte_s1ap_pack_eplmns(&ie->equivalentPLMNs, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->forbiddenTAs_present) { - if(liblte_s1ap_pack_forbiddentas(&ie->forbiddenTAs, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->forbiddenTAs_present) { + if (liblte_s1ap_pack_forbiddentas(&ie->forbiddenTAs, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->forbiddenLAs_present) { - if(liblte_s1ap_pack_forbiddenlas(&ie->forbiddenLAs, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->forbiddenLAs_present) { + if (liblte_s1ap_pack_forbiddenlas(&ie->forbiddenLAs, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->forbiddenInterRATs_present) { - if(liblte_s1ap_pack_forbiddeninterrats(&ie->forbiddenInterRATs, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->forbiddenInterRATs_present) { + if (liblte_s1ap_pack_forbiddeninterrats(&ie->forbiddenInterRATs, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist( - uint8_t **ptr, - LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist(uint8_t** ptr, + LIBLTE_S1AP_HANDOVERRESTRICTIONLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("HandoverRestrictionList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->equivalentPLMNs_present = liblte_bits_2_value(ptr, 1); - ie->forbiddenTAs_present = liblte_bits_2_value(ptr, 1); - ie->forbiddenLAs_present = liblte_bits_2_value(ptr, 1); + ie->equivalentPLMNs_present = liblte_bits_2_value(ptr, 1); + ie->forbiddenTAs_present = liblte_bits_2_value(ptr, 1); + ie->forbiddenLAs_present = liblte_bits_2_value(ptr, 1); ie->forbiddenInterRATs_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tbcd_string(ptr, &ie->servingPLMN) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tbcd_string(ptr, &ie->servingPLMN) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->equivalentPLMNs_present) { - if(liblte_s1ap_unpack_eplmns(ptr, &ie->equivalentPLMNs) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->equivalentPLMNs_present) { + if (liblte_s1ap_unpack_eplmns(ptr, &ie->equivalentPLMNs) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->forbiddenTAs_present) { - if(liblte_s1ap_unpack_forbiddentas(ptr, &ie->forbiddenTAs) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->forbiddenTAs_present) { + if (liblte_s1ap_unpack_forbiddentas(ptr, &ie->forbiddenTAs) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->forbiddenLAs_present) { - if(liblte_s1ap_unpack_forbiddenlas(ptr, &ie->forbiddenLAs) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->forbiddenLAs_present) { + if (liblte_s1ap_unpack_forbiddenlas(ptr, &ie->forbiddenLAs) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->forbiddenInterRATs_present) { - if(liblte_s1ap_unpack_forbiddeninterrats(ptr, &ie->forbiddenInterRATs) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->forbiddenInterRATs_present) { + if (liblte_s1ap_unpack_forbiddeninterrats(ptr, &ie->forbiddenInterRATs) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -15926,18 +13972,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist( /******************************************************************************* /* ProtocolIE LastVisitedCell_Item CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedcell_item( - LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedcell_item(LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedCell_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -15945,37 +13987,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedcell_item( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_E_UTRAN_CELL) { - if(liblte_s1ap_pack_lastvisitedeutrancellinformation(&ie->choice.e_UTRAN_Cell, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UTRAN_CELL) { - if(liblte_s1ap_pack_lastvisitedutrancellinformation(&ie->choice.uTRAN_Cell, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_GERAN_CELL) { - if(liblte_s1ap_pack_lastvisitedgerancellinformation(&ie->choice.gERAN_Cell, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_E_UTRAN_CELL) { + if (liblte_s1ap_pack_lastvisitedeutrancellinformation(&ie->choice.e_UTRAN_Cell, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UTRAN_CELL) { + if (liblte_s1ap_pack_lastvisitedutrancellinformation(&ie->choice.uTRAN_Cell, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_GERAN_CELL) { + if (liblte_s1ap_pack_lastvisitedgerancellinformation(&ie->choice.gERAN_Cell, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item( - uint8_t **ptr, - LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item(uint8_t** ptr, LIBLTE_S1AP_LASTVISITEDCELL_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("LastVisitedCell_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -15983,20 +14021,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item( // Choice type ie->choice_type = (LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_E_UTRAN_CELL) { - if(liblte_s1ap_unpack_lastvisitedeutrancellinformation(ptr, &ie->choice.e_UTRAN_Cell) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UTRAN_CELL) { - if(liblte_s1ap_unpack_lastvisitedutrancellinformation(ptr, &ie->choice.uTRAN_Cell) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_GERAN_CELL) { - if(liblte_s1ap_unpack_lastvisitedgerancellinformation(ptr, &ie->choice.gERAN_Cell) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_E_UTRAN_CELL) { + if (liblte_s1ap_unpack_lastvisitedeutrancellinformation(ptr, &ie->choice.e_UTRAN_Cell) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_UTRAN_CELL) { + if (liblte_s1ap_unpack_lastvisitedutrancellinformation(ptr, &ie->choice.uTRAN_Cell) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_LASTVISITEDCELL_ITEM_CHOICE_GERAN_CELL) { + if (liblte_s1ap_unpack_lastvisitedgerancellinformation(ptr, &ie->choice.gERAN_Cell) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -16005,70 +14043,62 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedcell_item( /******************************************************************************* /* ProtocolIE SONInformationReply SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply( - LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply(LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SONInformationReply error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->x2TNLConfigurationInfo_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->x2TNLConfigurationInfo_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(ie->x2TNLConfigurationInfo_present) { - if(liblte_s1ap_pack_x2tnlconfigurationinfo(&ie->x2TNLConfigurationInfo, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->x2TNLConfigurationInfo_present) { + if (liblte_s1ap_pack_x2tnlconfigurationinfo(&ie->x2TNLConfigurationInfo, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply(uint8_t** ptr, LIBLTE_S1AP_SONINFORMATIONREPLY_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SONInformationReply error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->x2TNLConfigurationInfo_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(ie->x2TNLConfigurationInfo_present) { - if(liblte_s1ap_unpack_x2tnlconfigurationinfo(ptr, &ie->x2TNLConfigurationInfo) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->x2TNLConfigurationInfo_present) { + if (liblte_s1ap_unpack_x2tnlconfigurationinfo(ptr, &ie->x2TNLConfigurationInfo) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16079,25 +14109,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply( /* ProtocolIE TAI_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast( - LIBLTE_S1AP_TAI_BROADCAST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast(LIBLTE_S1AP_TAI_BROADCAST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("TAI_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("TAI_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tai_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tai_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -16106,25 +14133,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_TAI_BROADCAST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast(uint8_t** ptr, LIBLTE_S1AP_TAI_BROADCAST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAI_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAI_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tai_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tai_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -16136,18 +14160,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast( /******************************************************************************* /* ProtocolIE TimeToWait ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timetowait( - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_timetowait(LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TimeToWait error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -16160,18 +14180,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_timetowait( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timetowait( - uint8_t **ptr, - LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timetowait(uint8_t** ptr, LIBLTE_S1AP_TIMETOWAIT_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TimeToWait error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -16188,25 +14204,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timetowait( /* ProtocolIE UE_HistoryInformation DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:16 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_historyinformation( - LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_historyinformation(LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("UE_HistoryInformation pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("UE_HistoryInformation pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 4); + liblte_value_2_bits(ie->len - 1, ptr, 4); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_lastvisitedcell_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_lastvisitedcell_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -16215,25 +14228,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_historyinformation( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_historyinformation( - uint8_t **ptr, - LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_historyinformation(uint8_t** ptr, LIBLTE_S1AP_UE_HISTORYINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 4) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("UE_HistoryInformation unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "UE_HistoryInformation unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_lastvisitedcell_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_lastvisitedcell_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -16245,108 +14255,101 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_historyinformation( /******************************************************************************* /* ProtocolIE CriticalityDiagnostics SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics( - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics(LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("CriticalityDiagnostics error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->procedureCode_present?1:0, ptr, 1); - liblte_value_2_bits(ie->triggeringMessage_present?1:0, ptr, 1); - liblte_value_2_bits(ie->procedureCriticality_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iEsCriticalityDiagnostics_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->procedureCode_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->triggeringMessage_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->procedureCriticality_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iEsCriticalityDiagnostics_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(ie->procedureCode_present) { - if(liblte_s1ap_pack_procedurecode(&ie->procedureCode, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->procedureCode_present) { + if (liblte_s1ap_pack_procedurecode(&ie->procedureCode, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->triggeringMessage_present) { + if (ie->triggeringMessage_present) { // Enum - ie->triggeringMessage - liblte_value_2_bits(ie->triggeringMessage, ptr, 2); + liblte_value_2_bits(ie->triggeringMessage, ptr, 2); } - if(ie->procedureCriticality_present) { + if (ie->procedureCriticality_present) { // Enum - ie->procedureCriticality - liblte_value_2_bits(ie->procedureCriticality, ptr, 2); + liblte_value_2_bits(ie->procedureCriticality, ptr, 2); } - if(ie->iEsCriticalityDiagnostics_present) { - if(liblte_s1ap_pack_criticalitydiagnostics_ie_list(&ie->iEsCriticalityDiagnostics, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iEsCriticalityDiagnostics_present) { + if (liblte_s1ap_pack_criticalitydiagnostics_ie_list(&ie->iEsCriticalityDiagnostics, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics( - uint8_t **ptr, - LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics(uint8_t** ptr, + LIBLTE_S1AP_CRITICALITYDIAGNOSTICS_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("CriticalityDiagnostics error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->procedureCode_present = liblte_bits_2_value(ptr, 1); - ie->triggeringMessage_present = liblte_bits_2_value(ptr, 1); - ie->procedureCriticality_present = liblte_bits_2_value(ptr, 1); + ie->procedureCode_present = liblte_bits_2_value(ptr, 1); + ie->triggeringMessage_present = liblte_bits_2_value(ptr, 1); + ie->procedureCriticality_present = liblte_bits_2_value(ptr, 1); ie->iEsCriticalityDiagnostics_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(ie->procedureCode_present) { - if(liblte_s1ap_unpack_procedurecode(ptr, &ie->procedureCode) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->procedureCode_present) { + if (liblte_s1ap_unpack_procedurecode(ptr, &ie->procedureCode) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->triggeringMessage_present) { + if (ie->triggeringMessage_present) { // Enum - ie->triggeringMessage - ie->triggeringMessage = (LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM)liblte_bits_2_value(ptr, 2); + ie->triggeringMessage = (LIBLTE_S1AP_TRIGGERINGMESSAGE_ENUM)liblte_bits_2_value(ptr, 2); } - if(ie->procedureCriticality_present) { + if (ie->procedureCriticality_present) { // Enum - ie->procedureCriticality - ie->procedureCriticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + ie->procedureCriticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); } - if(ie->iEsCriticalityDiagnostics_present) { - if(liblte_s1ap_unpack_criticalitydiagnostics_ie_list(ptr, &ie->iEsCriticalityDiagnostics) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iEsCriticalityDiagnostics_present) { + if (liblte_s1ap_unpack_criticalitydiagnostics_ie_list(ptr, &ie->iEsCriticalityDiagnostics) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16356,72 +14359,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics( /******************************************************************************* /* ProtocolIE EmergencyAreaID_Broadcast_Item SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item( - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item(LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("EmergencyAreaID_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_emergencyareaid(&ie->emergencyAreaID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_emergencyareaid(&ie->emergencyAreaID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_completedcellineai(&ie->completedCellinEAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_completedcellineai(&ie->completedCellinEAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_emergencyareaid_broadcast_item(uint8_t** ptr, LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_ITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("EmergencyAreaID_Broadcast_Item error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_emergencyareaid(ptr, &ie->emergencyAreaID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_emergencyareaid(ptr, &ie->emergencyAreaID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_completedcellineai(ptr, &ie->completedCellinEAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_completedcellineai(ptr, &ie->completedCellinEAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16431,100 +14428,92 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item( /******************************************************************************* /* ProtocolIE ImmediateMDT SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt( - LIBLTE_S1AP_IMMEDIATEMDT_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt(LIBLTE_S1AP_IMMEDIATEMDT_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ImmediateMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->m1thresholdeventA2_present?1:0, ptr, 1); - liblte_value_2_bits(ie->m1periodicReporting_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->m1thresholdeventA2_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->m1periodicReporting_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_measurementstoactivate(&ie->measurementsToActivate, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_measurementstoactivate(&ie->measurementsToActivate, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_m1reportingtrigger(&ie->m1reportingTrigger, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m1reportingtrigger(&ie->m1reportingTrigger, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->m1thresholdeventA2_present) { - if(liblte_s1ap_pack_m1thresholdeventa2(&ie->m1thresholdeventA2, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->m1thresholdeventA2_present) { + if (liblte_s1ap_pack_m1thresholdeventa2(&ie->m1thresholdeventA2, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->m1periodicReporting_present) { - if(liblte_s1ap_pack_m1periodicreporting(&ie->m1periodicReporting, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->m1periodicReporting_present) { + if (liblte_s1ap_pack_m1periodicreporting(&ie->m1periodicReporting, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt( - uint8_t **ptr, - LIBLTE_S1AP_IMMEDIATEMDT_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt(uint8_t** ptr, LIBLTE_S1AP_IMMEDIATEMDT_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ImmediateMDT error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->m1thresholdeventA2_present = liblte_bits_2_value(ptr, 1); + ie->m1thresholdeventA2_present = liblte_bits_2_value(ptr, 1); ie->m1periodicReporting_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_measurementstoactivate(ptr, &ie->measurementsToActivate) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_measurementstoactivate(ptr, &ie->measurementsToActivate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_m1reportingtrigger(ptr, &ie->m1reportingTrigger) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_m1reportingtrigger(ptr, &ie->m1reportingTrigger) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->m1thresholdeventA2_present) { - if(liblte_s1ap_unpack_m1thresholdeventa2(ptr, &ie->m1thresholdeventA2) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->m1thresholdeventA2_present) { + if (liblte_s1ap_unpack_m1thresholdeventa2(ptr, &ie->m1thresholdeventA2) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->m1periodicReporting_present) { - if(liblte_s1ap_unpack_m1periodicreporting(ptr, &ie->m1periodicReporting) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->m1periodicReporting_present) { + if (liblte_s1ap_unpack_m1periodicreporting(ptr, &ie->m1periodicReporting) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16534,18 +14523,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt( /******************************************************************************* /* ProtocolIE MDTMode CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtmode( - LIBLTE_S1AP_MDTMODE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtmode(LIBLTE_S1AP_MDTMODE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MDTMode error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -16553,33 +14538,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdtmode( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_IMMEDIATEMDT) { - if(liblte_s1ap_pack_immediatemdt(&ie->choice.immediateMDT, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_LOGGEDMDT) { - if(liblte_s1ap_pack_loggedmdt(&ie->choice.loggedMDT, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_IMMEDIATEMDT) { + if (liblte_s1ap_pack_immediatemdt(&ie->choice.immediateMDT, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_LOGGEDMDT) { + if (liblte_s1ap_pack_loggedmdt(&ie->choice.loggedMDT, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode( - uint8_t **ptr, - LIBLTE_S1AP_MDTMODE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode(uint8_t** ptr, LIBLTE_S1AP_MDTMODE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MDTMode error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -16587,16 +14568,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode( // Choice type ie->choice_type = (LIBLTE_S1AP_MDTMODE_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_IMMEDIATEMDT) { - if(liblte_s1ap_unpack_immediatemdt(ptr, &ie->choice.immediateMDT) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_LOGGEDMDT) { - if(liblte_s1ap_unpack_loggedmdt(ptr, &ie->choice.loggedMDT) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_IMMEDIATEMDT) { + if (liblte_s1ap_unpack_immediatemdt(ptr, &ie->choice.immediateMDT) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_MDTMODE_CHOICE_LOGGEDMDT) { + if (liblte_s1ap_unpack_loggedmdt(ptr, &ie->choice.loggedMDT) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -16606,53 +14587,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdtmode( /* ProtocolIE SourceeNB_ToTargeteNB_TransparentContainer SEQUENCE ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer( - LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { - liblte_log_print("SourceeNB_ToTargeteNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { + liblte_log_print( + "SourceeNB_ToTargeteNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->e_RABInformationList_present?1:0, ptr, 1); - liblte_value_2_bits(ie->subscriberProfileIDforRFP_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->e_RABInformationList_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->subscriberProfileIDforRFP_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_rrc_container(&ie->rRC_Container, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_rrc_container(&ie->rRC_Container, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->e_RABInformationList_present) { - if(liblte_s1ap_pack_e_rabinformationlist(&ie->e_RABInformationList, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->e_RABInformationList_present) { + if (liblte_s1ap_pack_e_rabinformationlist(&ie->e_RABInformationList, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(liblte_s1ap_pack_eutran_cgi(&ie->targetCell_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&ie->targetCell_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->subscriberProfileIDforRFP_present) { - if(liblte_s1ap_pack_subscriberprofileidforrfp(&ie->subscriberProfileIDforRFP, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->subscriberProfileIDforRFP_present) { + if (liblte_s1ap_pack_subscriberprofileidforrfp(&ie->subscriberProfileIDforRFP, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(liblte_s1ap_pack_ue_historyinformation(&ie->uE_HistoryInformation, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_historyinformation(&ie->uE_HistoryInformation, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16660,53 +14639,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { - liblte_log_print("SourceeNB_ToTargeteNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { + liblte_log_print( + "SourceeNB_ToTargeteNB_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->e_RABInformationList_present = liblte_bits_2_value(ptr, 1); + ie->e_RABInformationList_present = liblte_bits_2_value(ptr, 1); ie->subscriberProfileIDforRFP_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_rrc_container(ptr, &ie->rRC_Container) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_rrc_container(ptr, &ie->rRC_Container) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->e_RABInformationList_present) { - if(liblte_s1ap_unpack_e_rabinformationlist(ptr, &ie->e_RABInformationList) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->e_RABInformationList_present) { + if (liblte_s1ap_unpack_e_rabinformationlist(ptr, &ie->e_RABInformationList) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(liblte_s1ap_unpack_eutran_cgi(ptr, &ie->targetCell_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &ie->targetCell_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->subscriberProfileIDforRFP_present) { - if(liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &ie->subscriberProfileIDforRFP) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->subscriberProfileIDforRFP_present) { + if (liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &ie->subscriberProfileIDforRFP) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(liblte_s1ap_unpack_ue_historyinformation(ptr, &ie->uE_HistoryInformation) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ue_historyinformation(ptr, &ie->uE_HistoryInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16717,25 +14694,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer( /* ProtocolIE EmergencyAreaID_Broadcast DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast( - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast(LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("EmergencyAreaID_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaID_Broadcast pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_emergencyareaid_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_emergencyareaid_broadcast_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -16744,25 +14719,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast( - uint8_t **ptr, - LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast(uint8_t** ptr, + LIBLTE_S1AP_EMERGENCYAREAID_BROADCAST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("EmergencyAreaID_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "EmergencyAreaID_Broadcast unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_emergencyareaid_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_emergencyareaid_broadcast_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -16774,80 +14748,72 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast( /******************************************************************************* /* ProtocolIE MDT_Configuration SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration( - LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration(LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("MDT_Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_mdt_activation(&ie->mdt_Activation, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdt_activation(&ie->mdt_Activation, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_areascopeofmdt(&ie->areaScopeOfMDT, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_areascopeofmdt(&ie->areaScopeOfMDT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_mdtmode(&ie->mDTMode, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdtmode(&ie->mDTMode, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration( - uint8_t **ptr, - LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration(uint8_t** ptr, LIBLTE_S1AP_MDT_CONFIGURATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("MDT_Configuration error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_mdt_activation(ptr, &ie->mdt_Activation) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mdt_activation(ptr, &ie->mdt_Activation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_areascopeofmdt(ptr, &ie->areaScopeOfMDT) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_areascopeofmdt(ptr, &ie->areaScopeOfMDT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_mdtmode(ptr, &ie->mDTMode) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mdtmode(ptr, &ie->mDTMode) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -16858,25 +14824,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration( /* ProtocolIE TAI_Cancelled DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:65535 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled( - LIBLTE_S1AP_TAI_CANCELLED_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled(LIBLTE_S1AP_TAI_CANCELLED_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("TAI_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("TAI_Cancelled pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 16); + liblte_value_2_bits(ie->len - 1, ptr, 16); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_tai_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_tai_cancelled_item(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -16885,25 +14848,22 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled( - uint8_t **ptr, - LIBLTE_S1AP_TAI_CANCELLED_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled(uint8_t** ptr, LIBLTE_S1AP_TAI_CANCELLED_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 16) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("TAI_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("TAI_Cancelled unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_tai_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_tai_cancelled_item(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -16915,18 +14875,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled( /******************************************************************************* /* ProtocolIE BroadcastCancelledAreaList CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcancelledarealist( - LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcancelledarealist(LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("BroadcastCancelledAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -16934,37 +14891,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcancelledarealist( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_CELLID_CANCELLED) { - if(liblte_s1ap_pack_cellid_cancelled(&ie->choice.cellID_Cancelled, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_TAI_CANCELLED) { - if(liblte_s1ap_pack_tai_cancelled(&ie->choice.tAI_Cancelled, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_EMERGENCYAREAID_CANCELLED) { - if(liblte_s1ap_pack_emergencyareaid_cancelled(&ie->choice.emergencyAreaID_Cancelled, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_CELLID_CANCELLED) { + if (liblte_s1ap_pack_cellid_cancelled(&ie->choice.cellID_Cancelled, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_TAI_CANCELLED) { + if (liblte_s1ap_pack_tai_cancelled(&ie->choice.tAI_Cancelled, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_EMERGENCYAREAID_CANCELLED) { + if (liblte_s1ap_pack_emergencyareaid_cancelled(&ie->choice.emergencyAreaID_Cancelled, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist( - uint8_t **ptr, - LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist(uint8_t** ptr, + LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("BroadcastCancelledAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -16972,20 +14926,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist( // Choice type ie->choice_type = (LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_CELLID_CANCELLED) { - if(liblte_s1ap_unpack_cellid_cancelled(ptr, &ie->choice.cellID_Cancelled) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_TAI_CANCELLED) { - if(liblte_s1ap_unpack_tai_cancelled(ptr, &ie->choice.tAI_Cancelled) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_EMERGENCYAREAID_CANCELLED) { - if(liblte_s1ap_unpack_emergencyareaid_cancelled(ptr, &ie->choice.emergencyAreaID_Cancelled) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_CELLID_CANCELLED) { + if (liblte_s1ap_unpack_cellid_cancelled(ptr, &ie->choice.cellID_Cancelled) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_TAI_CANCELLED) { + if (liblte_s1ap_unpack_tai_cancelled(ptr, &ie->choice.tAI_Cancelled) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCANCELLEDAREALIST_CHOICE_EMERGENCYAREAID_CANCELLED) { + if (liblte_s1ap_unpack_emergencyareaid_cancelled(ptr, &ie->choice.emergencyAreaID_Cancelled) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -16994,32 +14948,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcancelledarealist( /******************************************************************************* /* ProtocolIE ENB_StatusTransfer_TransparentContainer SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer( - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enb_statustransfer_transparentcontainer(LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ENB_StatusTransfer_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_bearers_subjecttostatustransferlist(&ie->bearers_SubjectToStatusTransferList, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bearers_subjecttostatustransferlist(&ie->bearers_SubjectToStatusTransferList, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17027,31 +14980,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( - uint8_t **ptr, - LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ENB_StatusTransfer_TransparentContainer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_bearers_subjecttostatustransferlist(ptr, &ie->bearers_SubjectToStatusTransferList) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_bearers_subjecttostatustransferlist(ptr, &ie->bearers_SubjectToStatusTransferList) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17061,88 +15012,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( /******************************************************************************* /* ProtocolIE TraceActivation SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation( - LIBLTE_S1AP_TRACEACTIVATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation(LIBLTE_S1AP_TRACEACTIVATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TraceActivation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_utran_trace_id(&ie->e_UTRAN_Trace_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_utran_trace_id(&ie->e_UTRAN_Trace_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_interfacestotrace(&ie->interfacesToTrace, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_interfacestotrace(&ie->interfacesToTrace, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_tracedepth(&ie->traceDepth, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tracedepth(&ie->traceDepth, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->traceCollectionEntityIPAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->traceCollectionEntityIPAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation( - uint8_t **ptr, - LIBLTE_S1AP_TRACEACTIVATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation(uint8_t** ptr, LIBLTE_S1AP_TRACEACTIVATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TraceActivation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_utran_trace_id(ptr, &ie->e_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_utran_trace_id(ptr, &ie->e_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_interfacestotrace(ptr, &ie->interfacesToTrace) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_interfacestotrace(ptr, &ie->interfacesToTrace) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_tracedepth(ptr, &ie->traceDepth) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tracedepth(ptr, &ie->traceDepth) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->traceCollectionEntityIPAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->traceCollectionEntityIPAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17152,18 +15095,15 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation( /******************************************************************************* /* ProtocolIE BroadcastCompletedAreaList CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcompletedarealist( - LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcompletedarealist(LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("BroadcastCompletedAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -17171,37 +15111,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_broadcastcompletedarealist( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_CELLID_BROADCAST) { - if(liblte_s1ap_pack_cellid_broadcast(&ie->choice.cellID_Broadcast, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_TAI_BROADCAST) { - if(liblte_s1ap_pack_tai_broadcast(&ie->choice.tAI_Broadcast, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_EMERGENCYAREAID_BROADCAST) { - if(liblte_s1ap_pack_emergencyareaid_broadcast(&ie->choice.emergencyAreaID_Broadcast, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_CELLID_BROADCAST) { + if (liblte_s1ap_pack_cellid_broadcast(&ie->choice.cellID_Broadcast, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_TAI_BROADCAST) { + if (liblte_s1ap_pack_tai_broadcast(&ie->choice.tAI_Broadcast, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_EMERGENCYAREAID_BROADCAST) { + if (liblte_s1ap_pack_emergencyareaid_broadcast(&ie->choice.emergencyAreaID_Broadcast, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist( - uint8_t **ptr, - LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist(uint8_t** ptr, + LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("BroadcastCompletedAreaList error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -17209,20 +15146,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist( // Choice type ie->choice_type = (LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_ENUM)liblte_bits_2_value(ptr, 2); - // Choice - if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_CELLID_BROADCAST) { - if(liblte_s1ap_unpack_cellid_broadcast(ptr, &ie->choice.cellID_Broadcast) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_TAI_BROADCAST) { - if(liblte_s1ap_unpack_tai_broadcast(ptr, &ie->choice.tAI_Broadcast) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_EMERGENCYAREAID_BROADCAST) { - if(liblte_s1ap_unpack_emergencyareaid_broadcast(ptr, &ie->choice.emergencyAreaID_Broadcast) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_CELLID_BROADCAST) { + if (liblte_s1ap_unpack_cellid_broadcast(ptr, &ie->choice.cellID_Broadcast) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_TAI_BROADCAST) { + if (liblte_s1ap_unpack_tai_broadcast(ptr, &ie->choice.tAI_Broadcast) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_BROADCASTCOMPLETEDAREALIST_CHOICE_EMERGENCYAREAID_BROADCAST) { + if (liblte_s1ap_unpack_emergencyareaid_broadcast(ptr, &ie->choice.emergencyAreaID_Broadcast) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -17231,18 +15168,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_broadcastcompletedarealist( /******************************************************************************* /* ProtocolIE SONInformation CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformation( - LIBLTE_S1AP_SONINFORMATION_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformation(LIBLTE_S1AP_SONINFORMATION_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SONInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -17250,33 +15183,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformation( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREQUEST) { - if(liblte_s1ap_pack_soninformationrequest(&ie->choice.sONInformationRequest, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREPLY) { - if(liblte_s1ap_pack_soninformationreply(&ie->choice.sONInformationReply, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREQUEST) { + if (liblte_s1ap_pack_soninformationrequest(&ie->choice.sONInformationRequest, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREPLY) { + if (liblte_s1ap_pack_soninformationreply(&ie->choice.sONInformationReply, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation( - uint8_t **ptr, - LIBLTE_S1AP_SONINFORMATION_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation(uint8_t** ptr, LIBLTE_S1AP_SONINFORMATION_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SONInformation error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -17284,16 +15213,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation( // Choice type ie->choice_type = (LIBLTE_S1AP_SONINFORMATION_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREQUEST) { - if(liblte_s1ap_unpack_soninformationrequest(ptr, &ie->choice.sONInformationRequest) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREPLY) { - if(liblte_s1ap_unpack_soninformationreply(ptr, &ie->choice.sONInformationReply) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREQUEST) { + if (liblte_s1ap_unpack_soninformationrequest(ptr, &ie->choice.sONInformationRequest) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_SONINFORMATION_CHOICE_SONINFORMATIONREPLY) { + if (liblte_s1ap_unpack_soninformationreply(ptr, &ie->choice.sONInformationReply) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -17302,80 +15231,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformation( /******************************************************************************* /* ProtocolIE SONConfigurationTransfer SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer( - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer(LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("SONConfigurationTransfer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_targetenb_id(&ie->targeteNB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_targetenb_id(&ie->targeteNB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_sourceenb_id(&ie->sourceeNB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_sourceenb_id(&ie->sourceeNB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_soninformation(&ie->sONInformation, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_soninformation(&ie->sONInformation, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_SONCONFIGURATIONTRANSFER_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("SONConfigurationTransfer error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_targetenb_id(ptr, &ie->targeteNB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_targetenb_id(ptr, &ie->targeteNB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_sourceenb_id(ptr, &ie->sourceeNB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_sourceenb_id(ptr, &ie->sourceeNB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_soninformation(ptr, &ie->sONInformation) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_soninformation(ptr, &ie->sONInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17385,18 +15308,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer( /******************************************************************************* /* ProtocolIE ResetAll ENUMERATED ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetall( - LIBLTE_S1AP_RESETALL_ENUM_EXT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetall(LIBLTE_S1AP_RESETALL_ENUM_EXT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ResetAll error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -17409,18 +15328,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetall( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetall( - uint8_t **ptr, - LIBLTE_S1AP_RESETALL_ENUM_EXT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetall(uint8_t** ptr, LIBLTE_S1AP_RESETALL_ENUM_EXT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ResetAll error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -17436,18 +15351,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetall( /******************************************************************************* /* ProtocolIE Inter_SystemInformationTransferType CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_inter_systeminformationtransfertype( - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_inter_systeminformationtransfertype(LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("Inter_SystemInformationTransferType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -17455,29 +15368,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_inter_systeminformationtransfertype( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_RIMTRANSFER) { - if(liblte_s1ap_pack_rimtransfer(&ie->choice.rIMTransfer, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_RIMTRANSFER) { + if (liblte_s1ap_pack_rimtransfer(&ie->choice.rIMTransfer, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_inter_systeminformationtransfertype( - uint8_t **ptr, - LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_inter_systeminformationtransfertype(uint8_t** ptr, + LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("Inter_SystemInformationTransferType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -17485,12 +15396,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_inter_systeminformationtransfertype( // Choice type ie->choice_type = (LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_ENUM)liblte_bits_2_value(ptr, 0); - // Choice - if(ie->choice_type == LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_RIMTRANSFER) { - if(liblte_s1ap_unpack_rimtransfer(ptr, &ie->choice.rIMTransfer) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_INTER_SYSTEMINFORMATIONTRANSFERTYPE_CHOICE_RIMTRANSFER) { + if (liblte_s1ap_unpack_rimtransfer(ptr, &ie->choice.rIMTransfer) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -17500,25 +15411,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_inter_systeminformationtransfertype( /* ProtocolIE E_RAB_IE_ContainerPairList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_ie_containerpairlist( - LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_ie_containerpairlist(LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RAB_IE_ContainerPairList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RAB_IE_ContainerPairList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_pack_protocolie_containerpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_pack_protocolie_containerpair(&ie->buffer[i], ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -17527,25 +15437,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rab_ie_containerpairlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_ie_containerpairlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_ie_containerpairlist(uint8_t** ptr, + LIBLTE_S1AP_E_RAB_IE_CONTAINERPAIRLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RAB_IE_ContainerPairList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RAB_IE_ContainerPairList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_containerpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_containerpair(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -17557,120 +15466,114 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rab_ie_containerpairlist( /******************************************************************************* /* ProtocolIE E_RABDataForwardingItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem(LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABDataForwardingItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->dL_transportLayerAddress_present?1:0, ptr, 1); - liblte_value_2_bits(ie->dL_gTP_TEID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->uL_TransportLayerAddress_present?1:0, ptr, 1); - liblte_value_2_bits(ie->uL_GTP_TEID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->dL_transportLayerAddress_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->dL_gTP_TEID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->uL_TransportLayerAddress_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->uL_GTP_TEID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->dL_transportLayerAddress_present) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->dL_transportLayerAddress, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->dL_transportLayerAddress_present) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->dL_transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->dL_gTP_TEID_present) { - if(liblte_s1ap_pack_gtp_teid(&ie->dL_gTP_TEID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->dL_gTP_TEID_present) { + if (liblte_s1ap_pack_gtp_teid(&ie->dL_gTP_TEID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->uL_TransportLayerAddress_present) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->uL_TransportLayerAddress, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->uL_TransportLayerAddress_present) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->uL_TransportLayerAddress, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->uL_GTP_TEID_present) { - if(liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->uL_GTP_TEID_present) { + if (liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABDATAFORWARDINGITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABDataForwardingItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->dL_transportLayerAddress_present = liblte_bits_2_value(ptr, 1); - ie->dL_gTP_TEID_present = liblte_bits_2_value(ptr, 1); + ie->dL_gTP_TEID_present = liblte_bits_2_value(ptr, 1); ie->uL_TransportLayerAddress_present = liblte_bits_2_value(ptr, 1); - ie->uL_GTP_TEID_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->uL_GTP_TEID_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->dL_transportLayerAddress_present) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->dL_transportLayerAddress) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->dL_transportLayerAddress_present) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->dL_transportLayerAddress) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->dL_gTP_TEID_present) { - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->dL_gTP_TEID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->dL_gTP_TEID_present) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->dL_gTP_TEID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->uL_TransportLayerAddress_present) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->uL_TransportLayerAddress) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->uL_TransportLayerAddress_present) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->uL_TransportLayerAddress) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->uL_GTP_TEID_present) { - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->uL_GTP_TEID_present) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17680,88 +15583,82 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemHOReq SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq(LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemHOReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQosParameters, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQosParameters, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPITEMHOREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemHOReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQosParameters) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQosParameters) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17771,136 +15668,128 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( /******************************************************************************* /* ProtocolIE E_RABAdmittedItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem(LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABAdmittedItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->dL_transportLayerAddress_present?1:0, ptr, 1); - liblte_value_2_bits(ie->dL_gTP_TEID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->uL_TransportLayerAddress_present?1:0, ptr, 1); - liblte_value_2_bits(ie->uL_GTP_TEID_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->dL_transportLayerAddress_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->dL_gTP_TEID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->uL_TransportLayerAddress_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->uL_GTP_TEID_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->dL_transportLayerAddress_present) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->dL_transportLayerAddress, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->dL_transportLayerAddress_present) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->dL_transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->dL_gTP_TEID_present) { - if(liblte_s1ap_pack_gtp_teid(&ie->dL_gTP_TEID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->dL_gTP_TEID_present) { + if (liblte_s1ap_pack_gtp_teid(&ie->dL_gTP_TEID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->uL_TransportLayerAddress_present) { - if(liblte_s1ap_pack_transportlayeraddress(&ie->uL_TransportLayerAddress, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->uL_TransportLayerAddress_present) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->uL_TransportLayerAddress, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->uL_GTP_TEID_present) { - if(liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->uL_GTP_TEID_present) { + if (liblte_s1ap_pack_gtp_teid(&ie->uL_GTP_TEID, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem(uint8_t** ptr, LIBLTE_S1AP_E_RABADMITTEDITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABAdmittedItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->dL_transportLayerAddress_present = liblte_bits_2_value(ptr, 1); - ie->dL_gTP_TEID_present = liblte_bits_2_value(ptr, 1); + ie->dL_gTP_TEID_present = liblte_bits_2_value(ptr, 1); ie->uL_TransportLayerAddress_present = liblte_bits_2_value(ptr, 1); - ie->uL_GTP_TEID_present = liblte_bits_2_value(ptr, 1); - ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); + ie->uL_GTP_TEID_present = liblte_bits_2_value(ptr, 1); + ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->dL_transportLayerAddress_present) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->dL_transportLayerAddress) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->dL_transportLayerAddress_present) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->dL_transportLayerAddress) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->dL_gTP_TEID_present) { - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->dL_gTP_TEID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->dL_gTP_TEID_present) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->dL_gTP_TEID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->uL_TransportLayerAddress_present) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->uL_TransportLayerAddress) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->uL_TransportLayerAddress_present) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->uL_TransportLayerAddress) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->uL_GTP_TEID_present) { - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->uL_GTP_TEID_present) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->uL_GTP_TEID) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17910,72 +15799,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( /******************************************************************************* /* ProtocolIE E_RABFailedToSetupItemHOReqAck SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABFailedToSetupItemHOReqAck error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_cause(&ie->cause, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&ie->cause, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( - uint8_t **ptr, - LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(uint8_t** ptr, LIBLTE_S1AP_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABFailedToSetupItemHOReqAck error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_cause(ptr, &ie->cause) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_cause(ptr, &ie->cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -17985,80 +15868,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( /******************************************************************************* /* ProtocolIE E_RABToBeSwitchedDLItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem(LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSwitchedDLItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDDLITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSwitchedDLItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18068,80 +15945,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( /******************************************************************************* /* ProtocolIE E_RABToBeSwitchedULItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem(LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSwitchedULItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDULITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSwitchedULItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18151,96 +16022,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemBearerSUReq SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq(LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemBearerSUReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQoSParameters, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQoSParameters, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemBearerSUReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQoSParameters) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQoSParameters) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18250,80 +16115,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( /******************************************************************************* /* ProtocolIE E_RABSetupItemBearerSURes SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures(LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABSetupItemBearerSURes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPITEMBEARERSURES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABSetupItemBearerSURes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18333,80 +16192,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( /******************************************************************************* /* ProtocolIE E_RABToBeModifiedItemBearerModReq SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeModifiedItemBearerModReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABLevelQoSParameters, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABLevelQoSParameters, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeModifiedItemBearerModReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABLevelQoSParameters) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABLevelQoSParameters) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18416,64 +16271,58 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( /******************************************************************************* /* ProtocolIE E_RABModifyItemBearerModRes SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres(LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABModifyItemBearerModRes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( - uint8_t **ptr, - LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres(uint8_t** ptr, + LIBLTE_S1AP_E_RABMODIFYITEMBEARERMODRES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABModifyItemBearerModRes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18483,64 +16332,58 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( /******************************************************************************* /* ProtocolIE E_RABReleaseItemBearerRelComp SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABReleaseItemBearerRelComp error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(uint8_t** ptr, + LIBLTE_S1AP_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABReleaseItemBearerRelComp error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18550,102 +16393,96 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( /******************************************************************************* /* ProtocolIE E_RABToBeSetupItemCtxtSUReq SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemCtxtSUReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->nAS_PDU_present?1:0, ptr, 1); - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->nAS_PDU_present ? 1 : 0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQoSParameters, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablevelqosparameters(&ie->e_RABlevelQoSParameters, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->nAS_PDU_present) { - if(liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->nAS_PDU_present) { + if (liblte_s1ap_pack_nas_pdu(&ie->nAS_PDU, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABToBeSetupItemCtxtSUReq error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - ie->nAS_PDU_present = liblte_bits_2_value(ptr, 1); + ie->nAS_PDU_present = liblte_bits_2_value(ptr, 1); ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQoSParameters) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rablevelqosparameters(ptr, &ie->e_RABlevelQoSParameters) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->nAS_PDU_present) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->nAS_PDU_present) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &ie->nAS_PDU) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18655,80 +16492,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( /******************************************************************************* /* ProtocolIE E_RABSetupItemCtxtSURes SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures(LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("E_RABSetupItemCtxtSURes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rab_id(&ie->e_RAB_ID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&ie->transportLayerAddress, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gtp_teid(&ie->gTP_TEID, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPITEMCTXTSURES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("E_RABSetupItemCtxtSURes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rab_id(ptr, &ie->e_RAB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &ie->transportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_gtp_teid(ptr, &ie->gTP_TEID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18738,64 +16569,56 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( /******************************************************************************* /* ProtocolIE TAIItem SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( - LIBLTE_S1AP_TAIITEM_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem(LIBLTE_S1AP_TAIITEM_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("TAIItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - liblte_value_2_bits(ie->iE_Extensions_present?1:0, ptr, 1); + liblte_value_2_bits(ie->iE_Extensions_present ? 1 : 0, ptr, 1); - if(liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&ie->tAI, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_pack_protocolextensioncontainer(&ie->iE_Extensions, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( - uint8_t **ptr, - LIBLTE_S1AP_TAIITEM_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem(uint8_t** ptr, LIBLTE_S1AP_TAIITEM_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("TAIItem error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } ie->iE_Extensions_present = liblte_bits_2_value(ptr, 1); - if(liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tai(ptr, &ie->tAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(ie->iE_Extensions_present) { - if(liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } + if (ie->iE_Extensions_present) { + if (liblte_s1ap_unpack_protocolextensioncontainer(ptr, &ie->iE_Extensions) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } err = LIBLTE_SUCCESS; } @@ -18807,39 +16630,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( ********************************************************************************/ // lb:1, ub:256 LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("UE_associatedLogicalS1_ConnectionListRes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("UE_associatedLogicalS1_ConnectionListRes pack error - max supported dynamic sequence length = " + "32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -18851,35 +16673,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("UE_associatedLogicalS1_ConnectionListRes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("UE_associatedLogicalS1_ConnectionListRes unpack error - max supported dynamic sequence length " + "= 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -18893,39 +16714,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres( ********************************************************************************/ // lb:1, ub:256 LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack( - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT *ie, - uint8_t **ptr) + LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("UE_associatedLogicalS1_ConnectionListResAck pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("UE_associatedLogicalS1_ConnectionListResAck pack error - max supported dynamic sequence length " + "= 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -18937,35 +16757,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack( - uint8_t **ptr, - LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT *ie) + uint8_t** ptr, LIBLTE_S1AP_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("UE_associatedLogicalS1_ConnectionListResAck unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("UE_associatedLogicalS1_ConnectionListResAck unpack error - max supported dynamic sequence " + "length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -18977,24 +16796,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack /******************************************************************************* /* ProtocolIE PrivateMessage SEQUENCE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( - LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage(LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("PrivateMessage error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } - - if(liblte_s1ap_pack_privateie_container(&ie->privateIEs, ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_privateie_container(&ie->privateIEs, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } err = LIBLTE_SUCCESS; @@ -19002,24 +16816,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( - uint8_t **ptr, - LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage(uint8_t** ptr, LIBLTE_S1AP_PRIVATEMESSAGE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("PrivateMessage error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } - - if(liblte_s1ap_unpack_privateie_container(ptr, &ie->privateIEs) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_privateie_container(ptr, &ie->privateIEs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } err = LIBLTE_SUCCESS; @@ -19030,18 +16839,14 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( /******************************************************************************* /* ProtocolIE ResetType CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resettype( - LIBLTE_S1AP_RESETTYPE_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resettype(LIBLTE_S1AP_RESETTYPE_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(ie->ext?1:0, ptr, 1); - if(ie->ext) { + liblte_value_2_bits(ie->ext ? 1 : 0, ptr, 1); + if (ie->ext) { liblte_log_print("ResetType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -19049,33 +16854,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_resettype( // Choice type liblte_value_2_bits(ie->choice_type, ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_S1_INTERFACE) { - if(liblte_s1ap_pack_resetall(&ie->choice.s1_Interface, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_PARTOFS1_INTERFACE) { - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres(&ie->choice.partOfS1_Interface, ptr) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_ENCODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_S1_INTERFACE) { + if (liblte_s1ap_pack_resetall(&ie->choice.s1_Interface, ptr) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_PARTOFS1_INTERFACE) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionlistres(&ie->choice.partOfS1_Interface, ptr) != + LIBLTE_SUCCESS) { + return LIBLTE_ERROR_ENCODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype( - uint8_t **ptr, - LIBLTE_S1AP_RESETTYPE_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype(uint8_t** ptr, LIBLTE_S1AP_RESETTYPE_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { // Extension - ie->ext = liblte_bits_2_value(ptr, 1); - if(ie->ext) { + ie->ext = liblte_bits_2_value(ptr, 1); + if (ie->ext) { liblte_log_print("ResetType error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -19083,16 +16885,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype( // Choice type ie->choice_type = (LIBLTE_S1AP_RESETTYPE_CHOICE_ENUM)liblte_bits_2_value(ptr, 1); - // Choice - if(ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_S1_INTERFACE) { - if(liblte_s1ap_unpack_resetall(ptr, &ie->choice.s1_Interface) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; - } - } else if(ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_PARTOFS1_INTERFACE) { - if(liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres(ptr, &ie->choice.partOfS1_Interface) != LIBLTE_SUCCESS) { - return LIBLTE_ERROR_DECODE_FAIL; + // Choice + if (ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_S1_INTERFACE) { + if (liblte_s1ap_unpack_resetall(ptr, &ie->choice.s1_Interface) != LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } + } else if (ie->choice_type == LIBLTE_S1AP_RESETTYPE_CHOICE_PARTOFS1_INTERFACE) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistres(ptr, &ie->choice.partOfS1_Interface) != + LIBLTE_SUCCESS) { + return LIBLTE_ERROR_DECODE_FAIL; + } } - } err = LIBLTE_SUCCESS; } return err; @@ -19102,40 +16905,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resettype( /* Protocol Container List E_RABSubjecttoDataForwardingList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsubjecttodataforwardinglist( - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABSubjecttoDataForwardingList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABSubjecttoDataForwardingList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabdataforwardingitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabdataforwardingitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19146,36 +16948,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsubjecttodataforwardinglist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(uint8_t** ptr, + LIBLTE_S1AP_E_RABSUBJECTTODATAFORWARDINGLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABSubjecttoDataForwardingList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABSubjecttoDataForwardingList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabdataforwardingitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabdataforwardingitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19188,40 +16990,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist( /* Protocol Container List E_RABToBeSetupListHOReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplisthoreq( - LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplisthoreq(LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListHOReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListHOReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitemhoreq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitemhoreq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19232,36 +17031,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplisthoreq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplisthoreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplisthoreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPLISTHOREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListHOReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListHOReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobesetupitemhoreq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobesetupitemhoreq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19274,40 +17071,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplisthoreq( /* Protocol Container List E_RABAdmittedList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmittedlist( - LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmittedlist(LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABAdmittedList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print("E_RABAdmittedList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabadmitteditem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabadmitteditem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19318,36 +17111,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmittedlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmittedlist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmittedlist(uint8_t** ptr, LIBLTE_S1AP_E_RABADMITTEDLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABAdmittedList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print("E_RABAdmittedList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabadmitteditem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabadmitteditem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19360,40 +17150,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmittedlist( /* Protocol Container List E_RABToBeSwitchedDLList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddllist( - LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddllist(LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeSwitchedDLList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSwitchedDLList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitcheddlitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitcheddlitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19404,36 +17191,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddllist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddllist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddllist(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDDLLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeSwitchedDLList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSwitchedDLList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobeswitcheddlitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobeswitcheddlitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19446,40 +17231,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddllist( /* Protocol Container List E_RABToBeSwitchedULList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedullist( - LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedullist(LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeSwitchedULList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSwitchedULList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitchedulitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitchedulitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19490,36 +17272,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedullist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedullist( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedullist(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESWITCHEDULLIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeSwitchedULList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSwitchedULList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobeswitchedulitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobeswitchedulitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19532,40 +17312,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedullist( /* Protocol Container List E_RABToBeSetupListBearerSUReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistbearersureq( - LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistbearersureq(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListBearerSUReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListBearerSUReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitembearersureq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitembearersureq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19576,36 +17355,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistbearersureq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistbearersureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistbearersureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListBearerSUReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListBearerSUReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobesetupitembearersureq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobesetupitembearersureq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19618,40 +17396,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistbearersureq( /* Protocol Container List E_RABSetupListBearerSURes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistbearersures( - LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistbearersures(LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABSetupListBearerSURes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABSetupListBearerSURes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetupitembearersures(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetupitembearersures(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19662,36 +17437,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistbearersures( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistbearersures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistbearersures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPLISTBEARERSURES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABSetupListBearerSURes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABSetupListBearerSURes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabsetupitembearersures(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabsetupitembearersures(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19704,40 +17478,40 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistbearersures( /* Protocol Container List E_RABToBeModifiedListBearerModReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq( - LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq(LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeModifiedListBearerModReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeModifiedListBearerModReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19748,36 +17522,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBEMODIFIEDLISTBEARERMODREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeModifiedListBearerModReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeModifiedListBearerModReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19790,40 +17564,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq( /* Protocol Container List E_RABModifyListBearerModRes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifylistbearermodres( - LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifylistbearermodres(LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABModifyListBearerModRes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABModifyListBearerModRes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabmodifyitembearermodres(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabmodifyitembearermodres(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19834,36 +17606,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifylistbearermodres( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifylistbearermodres( - uint8_t **ptr, - LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifylistbearermodres(uint8_t** ptr, + LIBLTE_S1AP_E_RABMODIFYLISTBEARERMODRES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABModifyListBearerModRes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABModifyListBearerModRes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabmodifyitembearermodres(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabmodifyitembearermodres(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19876,40 +17647,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifylistbearermodres( /* Protocol Container List E_RABReleaseListBearerRelComp DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaselistbearerrelcomp( - LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaselistbearerrelcomp(LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABReleaseListBearerRelComp pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABReleaseListBearerRelComp pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -19920,36 +17690,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaselistbearerrelcomp( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp(uint8_t** ptr, + LIBLTE_S1AP_E_RABRELEASELISTBEARERRELCOMP_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABReleaseListBearerRelComp unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABReleaseListBearerRelComp unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -19962,40 +17731,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp( /* Protocol Container List E_RABToBeSetupListCtxtSUReq DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistctxtsureq( - LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistctxtsureq(LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListCtxtSUReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListCtxtSUReq pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -20006,36 +17773,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetuplistctxtsureq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_E_RABTOBESETUPLISTCTXTSUREQ_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABToBeSetupListCtxtSUReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABToBeSetupListCtxtSUReq unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -20048,40 +17814,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq( /* Protocol Container List E_RABSetupListCtxtSURes DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistctxtsures( - LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistctxtsures(LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABSetupListCtxtSURes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABSetupListCtxtSURes pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetupitemctxtsures(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetupitemctxtsures(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -20092,36 +17855,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuplistctxtsures( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistctxtsures(uint8_t** ptr, + LIBLTE_S1AP_E_RABSETUPLISTCTXTSURES_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABSetupListCtxtSURes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABSetupListCtxtSURes unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabsetupitemctxtsures(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabsetupitemctxtsures(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -20134,40 +17895,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuplistctxtsures( /* Protocol Container List TAIList DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailist( - LIBLTE_S1AP_TAILIST_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailist(LIBLTE_S1AP_TAILIST_STRUCT* ie, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { liblte_log_print("TAIList pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_taiitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_taiitem(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAIITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAIITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -20178,36 +17933,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tailist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailist( - uint8_t **ptr, - LIBLTE_S1AP_TAILIST_STRUCT *ie) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailist(uint8_t** ptr, LIBLTE_S1AP_TAILIST_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { + if (ie->len > 32) { liblte_log_print("TAIList unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_TAIITEM != ie_id) { + if (LIBLTE_S1AP_IE_ID_TAIITEM != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_taiitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_taiitem(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -20220,40 +17971,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tailist( /* Protocol Container List E_RABFailedtoSetupListHOReqAck DYNAMIC SEQUENCE OF ********************************************************************************/ // lb:1, ub:256 -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack( - LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT *ie, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack(LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT* ie, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { - if(ie->len > 32) { - liblte_log_print("E_RABFailedtoSetupListHOReqAck pack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie != NULL && ptr != NULL) { + if (ie->len > 32) { + liblte_log_print( + "E_RABFailedtoSetupListHOReqAck pack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_ENCODE_FAIL; } // Length - liblte_value_2_bits(ie->len-1, ptr, 8); + liblte_value_2_bits(ie->len - 1, ptr, 8); liblte_align_up_zero(ptr, 8); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; uint32_t i; - for(i=0;ilen;i++) { - + for (i = 0; i < ie->len; i++) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(&ie->buffer[i], &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -20264,36 +18014,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack( - uint8_t **ptr, - LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT *ie) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack(uint8_t** ptr, LIBLTE_S1AP_E_RABFAILEDTOSETUPLISTHOREQACK_STRUCT* ie) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(ie != NULL && - ptr != NULL) - { + if (ie != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; + uint32_t ie_id; + uint32_t len; // Length ie->len = liblte_bits_2_value(ptr, 8) + 1; liblte_align_up(ptr, 8); - if(ie->len > 32) { - liblte_log_print("E_RABFailedtoSetupListHOReqAck unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", ie->len); + if (ie->len > 32) { + liblte_log_print( + "E_RABFailedtoSetupListHOReqAck unpack error - max supported dynamic sequence length = 32, ie->len = %d\n", + ie->len); return LIBLTE_ERROR_DECODE_FAIL; } uint32_t i; - for(i=0;ilen;i++) { - if(liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { + for (i = 0; i < ie->len; i++) { + if (liblte_s1ap_unpack_protocolie_header(ptr, &ie_id, &crit, &len) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK != ie_id) { + if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK != ie_id) { return LIBLTE_ERROR_DECODE_FAIL; } - if(liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(ptr, &ie->buffer[i]) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } @@ -20305,20 +18054,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack( /******************************************************************************* /* Protocol Message AllocationAndRetentionPriority_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority_ext( - LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_allocationandretentionpriority_ext(LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("AllocationAndRetentionPriority-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20329,7 +18076,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -20337,26 +18084,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_allocationandretentionpriority_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ALLOCATIONANDRETENTIONPRIORITY_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("AllocationAndRetentionPriority-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20364,7 +18108,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20373,20 +18116,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_allocationandretentionpriority_ext( /******************************************************************************* /* Protocol Message CancelledCellinEAI_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item_ext( - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_cancelledcellineai_item_ext(LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CancelledCellinEAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20397,34 +18137,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellineai_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cancelledcellineai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINEAI_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CancelledCellinEAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20432,7 +18170,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20441,20 +18178,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellineai_item_ext( /******************************************************************************* /* Protocol Message CancelledCellinTAI_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item_ext( - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_cancelledcellintai_item_ext(LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CancelledCellinTAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20465,34 +18199,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cancelledcellintai_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cancelledcellintai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CANCELLEDCELLINTAI_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CancelledCellinTAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20500,7 +18232,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20509,20 +18240,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cancelledcellintai_item_ext( /******************************************************************************* /* Protocol Message CellID_Broadcast_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellID-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20533,34 +18261,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_broadcast_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cellid_broadcast_item_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLID_BROADCAST_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellID-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20568,7 +18293,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20577,20 +18301,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_broadcast_item_ext( /******************************************************************************* /* Protocol Message CellID_Cancelled_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellID-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20601,34 +18322,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellid_cancelled_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cellid_cancelled_item_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLID_CANCELLED_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellID-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20636,7 +18354,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20645,20 +18362,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellid_cancelled_item_ext( /******************************************************************************* /* Protocol Message CellBasedMDT_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt_ext( - LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt_ext(LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellBasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20669,34 +18382,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cellbasedmdt_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLBASEDMDT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellBasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20704,7 +18413,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20713,20 +18421,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cellbasedmdt_ext( /******************************************************************************* /* Protocol Message Cdma2000OneXSRVCCInfo_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo_ext( - LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo_ext(LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Cdma2000OneXSRVCCInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20737,34 +18442,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cdma2000onexsrvccinfo_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CDMA2000ONEXSRVCCINFO_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Cdma2000OneXSRVCCInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20772,7 +18474,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20781,20 +18482,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cdma2000onexsrvccinfo_ext( /******************************************************************************* /* Protocol Message CellType_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype_ext( - LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype_ext(LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellType-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20805,34 +18502,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltype_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLTYPE_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellType-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20840,7 +18533,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20849,20 +18541,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltype_ext( /******************************************************************************* /* Protocol Message CGI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi_ext( - LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi_ext(LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CGI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20873,34 +18561,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_cgi_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CGI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CGI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20908,7 +18592,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20917,20 +18600,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_cgi_ext( /******************************************************************************* /* Protocol Message CSG_IdList_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item_ext( - LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item_ext(LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CSG-IdList-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -20941,34 +18621,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_csg_idlist_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_CSG_IDLIST_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CSG-IdList-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -20976,7 +18653,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -20985,20 +18661,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_csg_idlist_item_ext( /******************************************************************************* /* Protocol Message COUNTvalue_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue_ext( - LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue_ext(LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("COUNTvalue-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21009,34 +18681,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalue_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_COUNTVALUE_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("COUNTvalue-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21044,7 +18712,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21053,20 +18720,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalue_ext( /******************************************************************************* /* Protocol Message COUNTValueExtended_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended_ext( - LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended_ext(LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("COUNTValueExtended-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21077,34 +18741,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_countvalueextended_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COUNTVALUEEXTENDED_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("COUNTValueExtended-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21112,7 +18773,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21121,20 +18781,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_countvalueextended_ext( /******************************************************************************* /* Protocol Message CriticalityDiagnostics_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ext( - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_criticalitydiagnostics_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CriticalityDiagnostics-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21145,34 +18802,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_criticalitydiagnostics_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CriticalityDiagnostics-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21180,7 +18834,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21189,20 +18842,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ext( /******************************************************************************* /* Protocol Message CriticalityDiagnostics_IE_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext( - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext(LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CriticalityDiagnostics-IE-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21213,7 +18864,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -21221,26 +18872,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_criticalitydiagnostics_ie_item_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CRITICALITYDIAGNOSTICS_IE_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CriticalityDiagnostics-IE-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21248,7 +18896,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21257,20 +18904,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_criticalitydiagnostics_ie_item_ext( /******************************************************************************* /* Protocol Message EmergencyAreaID_Broadcast_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_emergencyareaid_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EmergencyAreaID-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21281,7 +18926,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -21289,26 +18934,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_broadcast_item_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_BROADCAST_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EmergencyAreaID-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21316,7 +18958,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21325,20 +18966,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_broadcast_item_ext( /******************************************************************************* /* Protocol Message EmergencyAreaID_Cancelled_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_emergencyareaid_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EmergencyAreaID-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21349,7 +18988,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -21357,26 +18996,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_emergencyareaid_cancelled_item_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EMERGENCYAREAID_CANCELLED_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EmergencyAreaID-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21384,7 +19020,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21393,20 +19028,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_emergencyareaid_cancelled_item_ext( /******************************************************************************* /* Protocol Message CompletedCellinEAI_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item_ext( - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_completedcellineai_item_ext(LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CompletedCellinEAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21417,34 +19049,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellineai_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_completedcellineai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINEAI_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CompletedCellinEAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21452,7 +19082,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21461,20 +19090,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellineai_item_ext( /******************************************************************************* /* Protocol Message GERAN_Cell_ID_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id_ext( - LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id_ext(LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GERAN-Cell-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21485,34 +19110,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_geran_cell_id_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GERAN_CELL_ID_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GERAN-Cell-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21520,7 +19141,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21529,20 +19149,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_geran_cell_id_ext( /******************************************************************************* /* Protocol Message GlobalENB_ID_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_globalenb_id_ext( - LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_globalenb_id_ext(LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GlobalENB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21553,34 +19169,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_globalenb_id_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GLOBALENB_ID_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GlobalENB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21588,7 +19200,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21598,20 +19209,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_globalenb_id_ext( /* Protocol Message ENB_StatusTransfer_TransparentContainer_Ext STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("ENB-StatusTransfer-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "ENB-StatusTransfer-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21621,7 +19230,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -21629,34 +19238,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enb_statustransfer_transparentcontainer_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("ENB-StatusTransfer-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "ENB-StatusTransfer-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21665,20 +19271,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enb_statustransfer_transparentcontainer_ext /******************************************************************************* /* Protocol Message E_RABInformationListItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabinformationlistitem_ext(LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABInformationListItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21689,34 +19293,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlistitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabinformationlistitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLISTITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABInformationListItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21724,7 +19326,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21733,20 +19334,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlistitem_ext( /******************************************************************************* /* Protocol Message E_RABItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem_ext(LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21757,34 +19354,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21792,7 +19385,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21801,20 +19393,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem_ext( /******************************************************************************* /* Protocol Message E_RABQoSParameters_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabqosparameters_ext( - LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabqosparameters_ext(LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABQoSParameters-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21825,34 +19414,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabqosparameters_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABQOSPARAMETERS_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABQoSParameters-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21860,7 +19446,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21869,20 +19454,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabqosparameters_ext( /******************************************************************************* /* Protocol Message EUTRAN_CGI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi_ext( - LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi_ext(LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EUTRAN-CGI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21893,34 +19474,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_eutran_cgi_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_EUTRAN_CGI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("EUTRAN-CGI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21928,7 +19505,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -21937,20 +19513,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_eutran_cgi_ext( /******************************************************************************* /* Protocol Message ForbiddenTAs_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item_ext( - LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item_ext(LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ForbiddenTAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -21961,34 +19534,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddentas_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_FORBIDDENTAS_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ForbiddenTAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -21996,7 +19566,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22005,20 +19574,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddentas_item_ext( /******************************************************************************* /* Protocol Message ForbiddenLAs_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item_ext( - LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item_ext(LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ForbiddenLAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22029,34 +19595,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_forbiddenlas_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_FORBIDDENLAS_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ForbiddenLAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22064,7 +19627,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22073,20 +19635,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_forbiddenlas_item_ext( /******************************************************************************* /* Protocol Message GBR_QosInformation_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation_ext( - LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation_ext(LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GBR-QosInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22097,34 +19656,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gbr_qosinformation_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_GBR_QOSINFORMATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GBR-QosInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22132,7 +19688,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22141,20 +19696,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gbr_qosinformation_ext( /******************************************************************************* /* Protocol Message GUMMEI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei_ext( - LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei_ext(LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GUMMEI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22165,34 +19716,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_gummei_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_GUMMEI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("GUMMEI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22200,7 +19747,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22209,20 +19755,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_gummei_ext( /******************************************************************************* /* Protocol Message HandoverRestrictionList_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist_ext( - LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_handoverrestrictionlist_ext(LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRestrictionList-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22233,34 +19776,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrestrictionlist_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverrestrictionlist_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_HANDOVERRESTRICTIONLIST_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRestrictionList-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22268,7 +19809,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22277,20 +19817,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrestrictionlist_ext( /******************************************************************************* /* Protocol Message LAI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai_ext( - LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai_ext(LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LAI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22301,34 +19837,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lai_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LAI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LAI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22336,7 +19868,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22345,20 +19876,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lai_ext( /******************************************************************************* /* Protocol Message LoggedMDT_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt_ext( - LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt_ext(LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LoggedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22369,34 +19896,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_loggedmdt_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOGGEDMDT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LoggedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22404,7 +19927,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22413,20 +19935,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_loggedmdt_ext( /******************************************************************************* /* Protocol Message M3Configuration_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration_ext( - LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration_ext(LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M3Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22437,34 +19956,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m3configuration_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M3CONFIGURATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M3Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22472,7 +19988,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22481,20 +19996,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m3configuration_ext( /******************************************************************************* /* Protocol Message M4Configuration_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration_ext( - LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration_ext(LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M4Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22505,34 +20017,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m4configuration_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M4CONFIGURATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M4Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22540,7 +20049,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22549,20 +20057,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m4configuration_ext( /******************************************************************************* /* Protocol Message M5Configuration_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration_ext( - LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration_ext(LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M5Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22573,34 +20078,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m5configuration_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M5CONFIGURATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M5Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22608,7 +20110,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22617,20 +20118,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m5configuration_ext( /******************************************************************************* /* Protocol Message M1PeriodicReporting_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting_ext( - LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting_ext(LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M1PeriodicReporting-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22641,34 +20139,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1periodicreporting_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M1PERIODICREPORTING_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M1PeriodicReporting-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22676,7 +20171,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22685,20 +20179,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1periodicreporting_ext( /******************************************************************************* /* Protocol Message RequestType_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype_ext( - LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype_ext(LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("RequestType-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22709,34 +20199,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_requesttype_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_REQUESTTYPE_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("RequestType-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22744,7 +20230,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22753,20 +20238,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_requesttype_ext( /******************************************************************************* /* Protocol Message RIMTransfer_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer_ext( - LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer_ext(LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("RIMTransfer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22777,34 +20258,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_rimtransfer_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RIMTRANSFER_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("RIMTransfer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22812,7 +20289,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22821,20 +20297,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_rimtransfer_ext( /******************************************************************************* /* Protocol Message SecurityContext_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext_ext( - LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext_ext(LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SecurityContext-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22845,34 +20318,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_securitycontext_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SECURITYCONTEXT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SecurityContext-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22880,7 +20350,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22889,20 +20358,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_securitycontext_ext( /******************************************************************************* /* Protocol Message SourceeNB_ID_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id_ext( - LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id_ext(LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SourceeNB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22913,34 +20378,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_id_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_SOURCEENB_ID_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SourceeNB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -22948,7 +20409,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -22957,20 +20417,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_id_ext( /******************************************************************************* /* Protocol Message ServedGUMMEIsItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem_ext( - LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem_ext(LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ServedGUMMEIsItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -22981,34 +20438,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_servedgummeisitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SERVEDGUMMEISITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ServedGUMMEIsItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23016,7 +20470,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23025,20 +20478,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_servedgummeisitem_ext( /******************************************************************************* /* Protocol Message SupportedTAs_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item_ext( - LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item_ext(LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SupportedTAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23049,34 +20499,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_supportedtas_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SUPPORTEDTAS_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SupportedTAs-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23084,7 +20531,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23093,20 +20539,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_supportedtas_item_ext( /******************************************************************************* /* Protocol Message TimeSynchronizationInfo_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo_ext( - LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_timesynchronizationinfo_ext(LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TimeSynchronizationInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23117,34 +20560,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_timesynchronizationinfo_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_timesynchronizationinfo_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TIMESYNCHRONIZATIONINFO_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TimeSynchronizationInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23152,7 +20593,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23161,20 +20601,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_timesynchronizationinfo_ext( /******************************************************************************* /* Protocol Message S_TMSI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi_ext( - LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi_ext(LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S-TMSI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23185,34 +20621,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s_tmsi_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S_TMSI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S-TMSI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23220,7 +20652,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23229,20 +20660,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s_tmsi_ext( /******************************************************************************* /* Protocol Message TAIBasedMDT_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt_ext( - LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt_ext(LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIBasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23253,34 +20680,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_taibasedmdt_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIBASEDMDT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIBasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23288,7 +20711,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23297,20 +20719,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taibasedmdt_ext( /******************************************************************************* /* Protocol Message TAI_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_ext( - LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_ext(LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23321,34 +20739,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAI_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23356,7 +20770,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23365,20 +20778,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_ext( /******************************************************************************* /* Protocol Message TAI_Broadcast_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item_ext( - LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item_ext(LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23389,34 +20799,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_broadcast_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TAI_BROADCAST_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-Broadcast-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23424,7 +20831,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23433,20 +20839,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_broadcast_item_ext( /******************************************************************************* /* Protocol Message TAI_Cancelled_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item_ext( - LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item_ext(LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23457,34 +20860,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tai_cancelled_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TAI_CANCELLED_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAI-Cancelled-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23492,7 +20892,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23501,20 +20900,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tai_cancelled_item_ext( /******************************************************************************* /* Protocol Message TABasedMDT_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt_ext( - LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt_ext(LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TABasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23525,34 +20920,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tabasedmdt_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TABASEDMDT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TABasedMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23560,7 +20951,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23569,20 +20959,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tabasedmdt_ext( /******************************************************************************* /* Protocol Message CompletedCellinTAI_Item_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item_ext( - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_completedcellintai_item_ext(LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CompletedCellinTAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23593,34 +20980,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_completedcellintai_item_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_completedcellintai_item_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_COMPLETEDCELLINTAI_ITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CompletedCellinTAI-Item-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23628,7 +21013,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23637,20 +21021,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_completedcellintai_item_ext( /******************************************************************************* /* Protocol Message TargeteNB_ID_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id_ext( - LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id_ext(LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TargeteNB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23661,34 +21041,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_id_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETENB_ID_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TargeteNB-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23696,7 +21072,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23705,20 +21080,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_id_ext( /******************************************************************************* /* Protocol Message TargetRNC_ID_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id_ext( - LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id_ext(LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TargetRNC-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23729,34 +21100,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetrnc_id_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETRNC_ID_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TargetRNC-ID-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23764,7 +21131,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23774,20 +21140,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetrnc_id_ext( /* Protocol Message TargeteNB_ToSourceeNB_TransparentContainer_Ext STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23797,7 +21161,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ex // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -23805,34 +21169,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_targetenb_tosourceenb_transparentcontainer_ex } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TARGETENB_TOSOURCEENB_TRANSPARENTCONTAINER_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23841,20 +21202,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_targetenb_tosourceenb_transparentcontainer_ /******************************************************************************* /* Protocol Message M1ThresholdEventA2_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2_ext( - LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2_ext(LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M1ThresholdEventA2-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23865,34 +21223,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_m1thresholdeventa2_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_M1THRESHOLDEVENTA2_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("M1ThresholdEventA2-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23900,7 +21255,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23909,20 +21263,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_m1thresholdeventa2_ext( /******************************************************************************* /* Protocol Message Tunnel_Information_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnel_information_ext( - LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnel_information_ext(LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Tunnel-Information-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -23933,34 +21284,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tunnel_information_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TUNNEL_INFORMATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Tunnel-Information-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -23968,7 +21316,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -23977,20 +21324,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tunnel_information_ext( /******************************************************************************* /* Protocol Message UEAggregate_MaximumBitrates_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregate_maximumbitrates_ext( - LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueaggregate_maximumbitrates_ext(LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEAggregate-MaximumBitrates-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24001,34 +21346,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueaggregate_maximumbitrates_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UEAGGREGATE_MAXIMUMBITRATES_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEAggregate-MaximumBitrates-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24036,7 +21379,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24045,20 +21387,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueaggregate_maximumbitrates_ext( /******************************************************************************* /* Protocol Message UE_S1AP_ID_pair_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair_ext( - LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair_ext(LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UE-S1AP-ID-pair-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24069,34 +21408,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_s1ap_id_pair_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UE_S1AP_ID_PAIR_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UE-S1AP-ID-pair-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24104,7 +21440,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24114,20 +21449,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_s1ap_id_pair_ext( /* Protocol Message UE_associatedLogicalS1_ConnectionItemExt STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("UE-associatedLogicalS1-ConnectionItemExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "UE-associatedLogicalS1-ConnectionItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24137,7 +21470,7 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } @@ -24145,34 +21478,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("UE-associatedLogicalS1-ConnectionItemExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "UE-associatedLogicalS1-ConnectionItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24181,20 +21511,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemext( /******************************************************************************* /* Protocol Message UESecurityCapabilities_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities_ext( - LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uesecuritycapabilities_ext(LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UESecurityCapabilities-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24205,34 +21532,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uesecuritycapabilities_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uesecuritycapabilities_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UESECURITYCAPABILITIES_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UESecurityCapabilities-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24240,7 +21564,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24249,20 +21572,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uesecuritycapabilities_ext( /******************************************************************************* /* Protocol Message UserLocationInformation_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation_ext( - LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_userlocationinformation_ext(LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UserLocationInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24273,34 +21593,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_userlocationinformation_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_userlocationinformation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_USERLOCATIONINFORMATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UserLocationInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24308,7 +21626,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24317,20 +21634,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_userlocationinformation_ext( /******************************************************************************* /* Protocol Message ENBX2ExtTLA_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla_ext( - LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla_ext(LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBX2ExtTLA-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24341,34 +21654,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbx2exttla_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENBX2EXTTLA_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBX2ExtTLA-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24376,7 +21685,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -24386,46 +21694,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbx2exttla_ext( /* Protocol Message SourceeNB_ToTargeteNB_TransparentContainer_Ext STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer_ext( - LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->MobilityInformation_present) + if (!msg->MobilityInformation_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MobilityInformation - if(msg->MobilityInformation_present) { - + if (msg->MobilityInformation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mobilityinformation(&msg->MobilityInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mobilityinformation(&msg->MobilityInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MOBILITYINFORMATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MOBILITYINFORMATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24438,28 +21743,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sourceenb_totargetenb_transparentcontainer_ex } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_SOURCEENB_TOTARGETENB_TRANSPARENTCONTAINER_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->MobilityInformation_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24467,17 +21770,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMobilityInformation) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MOBILITYINFORMATION == ie_id) { + if (liblte_s1ap_unpack_mobilityinformation(ptr, &msg->MobilityInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MobilityInformation_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -24488,20 +21791,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sourceenb_totargetenb_transparentcontainer_ /******************************************************************************* /* Protocol Message E_RABInformationList STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist(LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABInformationListIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -24512,20 +21812,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABInformationListItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabinformationlistitem(&msg->E_RABInformationListItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabinformationlistitem(&msg->E_RABInformationListItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24536,27 +21835,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabinformationlist( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABINFORMATIONLIST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABInformationListIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24565,16 +21861,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABInformationListItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABINFORMATIONLISTITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabinformationlistitem(ptr, &msg->E_RABInformationListItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -24586,48 +21882,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabinformationlist( /* Protocol Message LastVisitedEUTRANCellInformation_Ext STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext( - LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LastVisitedEUTRANCellInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 2; - if(!msg->Time_UE_StayedInCell_EnhancedGranularity_present) + if (!msg->Time_UE_StayedInCell_EnhancedGranularity_present) n_ie--; - if(!msg->HO_Cause_present) + if (!msg->HO_Cause_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Time_UE_StayedInCell_EnhancedGranularity - if(msg->Time_UE_StayedInCell_EnhancedGranularity_present) { - + if (msg->Time_UE_StayedInCell_EnhancedGranularity_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity(&msg->Time_UE_StayedInCell_EnhancedGranularity, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_time_ue_stayedincell_enhancedgranularity(&msg->Time_UE_StayedInCell_EnhancedGranularity, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24635,18 +21929,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext( } // ProtocolIE - HO_Cause - if(msg->HO_Cause_present) { - + if (msg->HO_Cause_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->HO_Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->HO_Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HO_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HO_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24659,28 +21951,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_lastvisitedeutrancellinformation_ext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LASTVISITEDEUTRANCELLINFORMATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->Time_UE_StayedInCell_EnhancedGranularity_present = false; - msg->HO_Cause_present = false; + msg->HO_Cause_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LastVisitedEUTRANCellInformation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24689,23 +21978,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iTime_UE_StayedInCell_EnhancedGranularity) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_TIME_UE_STAYEDINCELL_ENHANCEDGRANULARITY == ie_id) { + if (liblte_s1ap_unpack_time_ue_stayedincell_enhancedgranularity( + ptr, &msg->Time_UE_StayedInCell_EnhancedGranularity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Time_UE_StayedInCell_EnhancedGranularity_present = true; - } else if(LIBLTE_S1AP_IE_ID_HO_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->HO_Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HO_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->HO_Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->HO_Cause_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -24716,47 +22006,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_lastvisitedeutrancellinformation_ext( /******************************************************************************* /* Protocol Message SONInformationReply_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply_ext( - LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply_ext(LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SONInformationReply-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->Time_Synchronization_Info_present) + if (!msg->Time_Synchronization_Info_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Time_Synchronization_Info - if(msg->Time_Synchronization_Info_present) { - + if (msg->Time_Synchronization_Info_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_timesynchronizationinfo(&msg->Time_Synchronization_Info, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_timesynchronizationinfo(&msg->Time_Synchronization_Info, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TIME_SYNCHRONIZATION_INFO, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TIME_SYNCHRONIZATION_INFO, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24768,28 +22054,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_soninformationreply_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SONINFORMATIONREPLY_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->Time_Synchronization_Info_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SONInformationReply-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24798,17 +22081,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iTime_Synchronization_Info) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_TIME_SYNCHRONIZATION_INFO == ie_id) { + if (liblte_s1ap_unpack_timesynchronizationinfo(ptr, &msg->Time_Synchronization_Info) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Time_Synchronization_Info_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -24820,50 +22103,47 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_soninformationreply_ext( /* Protocol Message Bearers_SubjectToStatusTransfer_ItemExt STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("Bearers-SubjectToStatusTransfer-ItemExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "Bearers-SubjectToStatusTransfer-ItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->ULCOUNTValueExtended_present) + if (!msg->ULCOUNTValueExtended_present) n_ie--; - if(!msg->DLCOUNTValueExtended_present) + if (!msg->DLCOUNTValueExtended_present) n_ie--; - if(!msg->ReceiveStatusOfULPDCPSDUsExtended_present) + if (!msg->ReceiveStatusOfULPDCPSDUsExtended_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - ULCOUNTValueExtended - if(msg->ULCOUNTValueExtended_present) { - + if (msg->ULCOUNTValueExtended_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_countvalueextended(&msg->ULCOUNTValueExtended, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_countvalueextended(&msg->ULCOUNTValueExtended, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ULCOUNTVALUEEXTENDED, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ULCOUNTVALUEEXTENDED, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24871,18 +22151,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( } // ProtocolIE - DLCOUNTValueExtended - if(msg->DLCOUNTValueExtended_present) { - + if (msg->DLCOUNTValueExtended_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_countvalueextended(&msg->DLCOUNTValueExtended, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_countvalueextended(&msg->DLCOUNTValueExtended, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24890,18 +22169,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( } // ProtocolIE - ReceiveStatusOfULPDCPSDUsExtended - if(msg->ReceiveStatusOfULPDCPSDUsExtended_present) { - + if (msg->ReceiveStatusOfULPDCPSDUsExtended_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_receivestatusofulpdcpsdusextended(&msg->ReceiveStatusOfULPDCPSDUsExtended, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_receivestatusofulpdcpsdusextended(&msg->ReceiveStatusOfULPDCPSDUsExtended, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -24914,30 +22194,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_itemext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEMEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->ULCOUNTValueExtended_present = false; - msg->DLCOUNTValueExtended_present = false; + msg->ULCOUNTValueExtended_present = false; + msg->DLCOUNTValueExtended_present = false; msg->ReceiveStatusOfULPDCPSDUsExtended_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("Bearers-SubjectToStatusTransfer-ItemExtIEs error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "Bearers-SubjectToStatusTransfer-ItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -24945,29 +22223,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iULCOUNTValueExtended) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ULCOUNTVALUEEXTENDED == ie_id) { + if (liblte_s1ap_unpack_countvalueextended(ptr, &msg->ULCOUNTValueExtended) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ULCOUNTValueExtended_present = true; - } else if(LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED == ie_id) { - if(liblte_s1ap_unpack_countvalueextended(ptr, &msg->DLCOUNTValueExtended) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_DLCOUNTVALUEEXTENDED == ie_id) { + if (liblte_s1ap_unpack_countvalueextended(ptr, &msg->DLCOUNTValueExtended) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->DLCOUNTValueExtended_present = true; - } else if(LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED == ie_id) { - if(liblte_s1ap_unpack_receivestatusofulpdcpsdusextended(ptr, &msg->ReceiveStatusOfULPDCPSDUsExtended) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RECEIVESTATUSOFULPDCPSDUSEXTENDED == ie_id) { + if (liblte_s1ap_unpack_receivestatusofulpdcpsdusextended(ptr, &msg->ReceiveStatusOfULPDCPSDUsExtended) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ReceiveStatusOfULPDCPSDUsExtended_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -24978,20 +22257,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_itemext( /******************************************************************************* /* Protocol Message E_RABItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( - LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem(LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -25002,20 +22277,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabitem(&msg->E_RABItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabitem(&msg->E_RABItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25026,27 +22299,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabitem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25055,16 +22324,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabitem(ptr, &msg->E_RABItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -25075,47 +22344,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabitem( /******************************************************************************* /* Protocol Message MDT_Configuration_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration_ext( - LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration_ext(LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MDT-Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->SignallingBasedMDTPLMNList_present) + if (!msg->SignallingBasedMDTPLMNList_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - SignallingBasedMDTPLMNList - if(msg->SignallingBasedMDTPLMNList_present) { - + if (msg->SignallingBasedMDTPLMNList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mdtplmnlist(&msg->SignallingBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdtplmnlist(&msg->SignallingBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SIGNALLINGBASEDMDTPLMNLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SIGNALLINGBASEDMDTPLMNLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25127,28 +22392,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mdt_configuration_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MDT_CONFIGURATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->SignallingBasedMDTPLMNList_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MDT-Configuration-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25157,17 +22419,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iSignallingBasedMDTPLMNList) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_SIGNALLINGBASEDMDTPLMNLIST == ie_id) { + if (liblte_s1ap_unpack_mdtplmnlist(ptr, &msg->SignallingBasedMDTPLMNList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SignallingBasedMDTPLMNList_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -25178,47 +22440,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mdt_configuration_ext( /******************************************************************************* /* Protocol Message X2TNLConfigurationInfo_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo_ext( - LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_x2tnlconfigurationinfo_ext(LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("X2TNLConfigurationInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->eNBX2ExtendedTransportLayerAddresses_present) + if (!msg->eNBX2ExtendedTransportLayerAddresses_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - eNBX2ExtendedTransportLayerAddresses - if(msg->eNBX2ExtendedTransportLayerAddresses_present) { - + if (msg->eNBX2ExtendedTransportLayerAddresses_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enbx2exttlas(&msg->eNBX2ExtendedTransportLayerAddresses, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enbx2exttlas(&msg->eNBX2ExtendedTransportLayerAddresses, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENBX2EXTENDEDTRANSPORTLAYERADDRESSES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_ENBX2EXTENDEDTRANSPORTLAYERADDRESSES, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25230,28 +22489,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_x2tnlconfigurationinfo_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_x2tnlconfigurationinfo_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_X2TNLCONFIGURATIONINFO_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->eNBX2ExtendedTransportLayerAddresses_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("X2TNLConfigurationInfo-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25260,17 +22516,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;ieNBX2ExtendedTransportLayerAddresses) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ENBX2EXTENDEDTRANSPORTLAYERADDRESSES == ie_id) { + if (liblte_s1ap_unpack_enbx2exttlas(ptr, &msg->eNBX2ExtendedTransportLayerAddresses) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->eNBX2ExtendedTransportLayerAddresses_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -25282,19 +22538,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_x2tnlconfigurationinfo_ext( /* Protocol Message Bearers_SubjectToStatusTransfer_Item STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Bearers-SubjectToStatusTransfer-ItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -25305,20 +22558,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Bearers_SubjectToStatusTransfer_Item - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_bearers_subjecttostatustransfer_item(&msg->Bearers_SubjectToStatusTransfer_Item, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_bearers_subjecttostatustransfer_item(&msg->Bearers_SubjectToStatusTransfer_Item, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25330,26 +22584,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_bearers_subjecttostatustransfer_item( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("Bearers-SubjectToStatusTransfer-ItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25358,16 +22609,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iBearers_SubjectToStatusTransfer_Item) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_BEARERS_SUBJECTTOSTATUSTRANSFER_ITEM == ie_id) { + if (liblte_s1ap_unpack_bearers_subjecttostatustransfer_item(ptr, &msg->Bearers_SubjectToStatusTransfer_Item) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -25378,53 +22630,48 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_bearers_subjecttostatustransfer_item( /******************************************************************************* /* Protocol Message ImmediateMDT_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( - LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext(LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ImmediateMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->M3Configuration_present) + if (!msg->M3Configuration_present) n_ie--; - if(!msg->M4Configuration_present) + if (!msg->M4Configuration_present) n_ie--; - if(!msg->M5Configuration_present) + if (!msg->M5Configuration_present) n_ie--; - if(!msg->MDT_Location_Info_present) + if (!msg->MDT_Location_Info_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - M3Configuration - if(msg->M3Configuration_present) { - + if (msg->M3Configuration_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_m3configuration(&msg->M3Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m3configuration(&msg->M3Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_M3CONFIGURATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_M3CONFIGURATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25432,18 +22679,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( } // ProtocolIE - M4Configuration - if(msg->M4Configuration_present) { - + if (msg->M4Configuration_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_m4configuration(&msg->M4Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m4configuration(&msg->M4Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_M4CONFIGURATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_M4CONFIGURATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25451,18 +22697,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( } // ProtocolIE - M5Configuration - if(msg->M5Configuration_present) { - + if (msg->M5Configuration_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_m5configuration(&msg->M5Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_m5configuration(&msg->M5Configuration, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_M5CONFIGURATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_M5CONFIGURATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25470,18 +22715,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( } // ProtocolIE - MDT_Location_Info - if(msg->MDT_Location_Info_present) { - + if (msg->MDT_Location_Info_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mdt_location_info(&msg->MDT_Location_Info, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdt_location_info(&msg->MDT_Location_Info, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25493,31 +22737,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_immediatemdt_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_IMMEDIATEMDT_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->M3Configuration_present = false; - msg->M4Configuration_present = false; - msg->M5Configuration_present = false; + msg->M3Configuration_present = false; + msg->M4Configuration_present = false; + msg->M5Configuration_present = false; msg->MDT_Location_Info_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ImmediateMDT-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25526,32 +22766,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iM3Configuration) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_M3CONFIGURATION == ie_id) { + if (liblte_s1ap_unpack_m3configuration(ptr, &msg->M3Configuration) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_M4CONFIGURATION == ie_id) { - if(liblte_s1ap_unpack_m4configuration(ptr, &msg->M4Configuration) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_M4CONFIGURATION == ie_id) { + if (liblte_s1ap_unpack_m4configuration(ptr, &msg->M4Configuration) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_M5CONFIGURATION == ie_id) { - if(liblte_s1ap_unpack_m5configuration(ptr, &msg->M5Configuration) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_M5CONFIGURATION == ie_id) { + if (liblte_s1ap_unpack_m5configuration(ptr, &msg->M5Configuration) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO == ie_id) { - if(liblte_s1ap_unpack_mdt_location_info(ptr, &msg->MDT_Location_Info) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MDT_LOCATION_INFO == ie_id) { + if (liblte_s1ap_unpack_mdt_location_info(ptr, &msg->MDT_Location_Info) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MDT_Location_Info_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -25562,47 +22802,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_immediatemdt_ext( /******************************************************************************* /* Protocol Message SONConfigurationTransfer_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer_ext( - LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_sonconfigurationtransfer_ext(LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SONConfigurationTransfer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->x2TNLConfigurationInfo_present) + if (!msg->x2TNLConfigurationInfo_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - x2TNLConfigurationInfo - if(msg->x2TNLConfigurationInfo_present) { - + if (msg->x2TNLConfigurationInfo_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_x2tnlconfigurationinfo(&msg->x2TNLConfigurationInfo, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_x2tnlconfigurationinfo(&msg->x2TNLConfigurationInfo, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_X2TNLCONFIGURATIONINFO, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_X2TNLCONFIGURATIONINFO, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25614,28 +22851,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_sonconfigurationtransfer_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_sonconfigurationtransfer_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_SONCONFIGURATIONTRANSFER_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->x2TNLConfigurationInfo_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("SONConfigurationTransfer-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25644,16 +22879,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;ix2TNLConfigurationInfo) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_X2TNLCONFIGURATIONINFO == ie_id) { + if (liblte_s1ap_unpack_x2tnlconfigurationinfo(ptr, &msg->x2TNLConfigurationInfo) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -25664,47 +22899,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_sonconfigurationtransfer_ext( /******************************************************************************* /* Protocol Message TraceActivation_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation_ext( - LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation_ext(LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceActivation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->MDTConfiguration_present) + if (!msg->MDTConfiguration_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MDTConfiguration - if(msg->MDTConfiguration_present) { - + if (msg->MDTConfiguration_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mdt_configuration(&msg->MDTConfiguration, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdt_configuration(&msg->MDTConfiguration, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MDTCONFIGURATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MDTCONFIGURATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25716,28 +22947,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_traceactivation_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TRACEACTIVATION_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->MDTConfiguration_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceActivation-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -25746,17 +22974,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMDTConfiguration) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MDTCONFIGURATION == ie_id) { + if (liblte_s1ap_unpack_mdt_configuration(ptr, &msg->MDTConfiguration) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MDTConfiguration_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -25767,146 +22995,136 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_traceactivation_ext( /******************************************************************************* /* Protocol Message HandoverRequired STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired(LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequiredIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 14; - if(!msg->Direct_Forwarding_Path_Availability_present) + if (!msg->Direct_Forwarding_Path_Availability_present) n_ie--; - if(!msg->SRVCCHOIndication_present) + if (!msg->SRVCCHOIndication_present) n_ie--; - if(!msg->Source_ToTarget_TransparentContainer_Secondary_present) + if (!msg->Source_ToTarget_TransparentContainer_Secondary_present) n_ie--; - if(!msg->MSClassmark2_present) + if (!msg->MSClassmark2_present) n_ie--; - if(!msg->MSClassmark3_present) + if (!msg->MSClassmark3_present) n_ie--; - if(!msg->CSG_Id_present) + if (!msg->CSG_Id_present) n_ie--; - if(!msg->CellAccessMode_present) + if (!msg->CellAccessMode_present) n_ie--; - if(!msg->PS_ServiceNotAvailable_present) + if (!msg->PS_ServiceNotAvailable_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - HandoverType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TargetID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_targetid(&msg->TargetID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_targetid(&msg->TargetID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TARGETID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TARGETID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Direct_Forwarding_Path_Availability - if(msg->Direct_Forwarding_Path_Availability_present) { - + if (msg->Direct_Forwarding_Path_Availability_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_direct_forwarding_path_availability(&msg->Direct_Forwarding_Path_Availability, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_direct_forwarding_path_availability(&msg->Direct_Forwarding_Path_Availability, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25914,18 +23132,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - SRVCCHOIndication - if(msg->SRVCCHOIndication_present) { - + if (msg->SRVCCHOIndication_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_srvcchoindication(&msg->SRVCCHOIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_srvcchoindication(&msg->SRVCCHOIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25933,35 +23150,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - Source_ToTarget_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Source_ToTarget_TransparentContainer_Secondary - if(msg->Source_ToTarget_TransparentContainer_Secondary_present) { - + if (msg->Source_ToTarget_TransparentContainer_Secondary_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer_Secondary, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer_Secondary, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25969,18 +23188,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - MSClassmark2 - if(msg->MSClassmark2_present) { - + if (msg->MSClassmark2_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_msclassmark2(&msg->MSClassmark2, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_msclassmark2(&msg->MSClassmark2, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MSCLASSMARK2, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MSCLASSMARK2, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -25988,18 +23206,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - MSClassmark3 - if(msg->MSClassmark3_present) { - + if (msg->MSClassmark3_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_msclassmark3(&msg->MSClassmark3, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_msclassmark3(&msg->MSClassmark3, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MSCLASSMARK3, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MSCLASSMARK3, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26007,18 +23224,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - CSG_Id - if(msg->CSG_Id_present) { - + if (msg->CSG_Id_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26026,18 +23241,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - CellAccessMode - if(msg->CellAccessMode_present) { - + if (msg->CellAccessMode_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CELLACCESSMODE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CELLACCESSMODE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26045,18 +23259,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( } // ProtocolIE - PS_ServiceNotAvailable - if(msg->PS_ServiceNotAvailable_present) { - + if (msg->PS_ServiceNotAvailable_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ps_servicenotavailable(&msg->PS_ServiceNotAvailable, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ps_servicenotavailable(&msg->PS_ServiceNotAvailable, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26068,35 +23281,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequired( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUIRED_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->Direct_Forwarding_Path_Availability_present = false; - msg->SRVCCHOIndication_present = false; + msg->Direct_Forwarding_Path_Availability_present = false; + msg->SRVCCHOIndication_present = false; msg->Source_ToTarget_TransparentContainer_Secondary_present = false; - msg->MSClassmark2_present = false; - msg->MSClassmark3_present = false; - msg->CSG_Id_present = false; - msg->CellAccessMode_present = false; - msg->PS_ServiceNotAvailable_present = false; + msg->MSClassmark2_present = false; + msg->MSClassmark3_present = false; + msg->CSG_Id_present = false; + msg->CellAccessMode_present = false; + msg->PS_ServiceNotAvailable_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequiredIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26105,87 +23314,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { - if(liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { + if (liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TARGETID == ie_id) { - if(liblte_s1ap_unpack_targetid(ptr, &msg->TargetID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TARGETID == ie_id) { + if (liblte_s1ap_unpack_targetid(ptr, &msg->TargetID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY == ie_id) { - if(liblte_s1ap_unpack_direct_forwarding_path_availability(ptr, &msg->Direct_Forwarding_Path_Availability) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_DIRECT_FORWARDING_PATH_AVAILABILITY == ie_id) { + if (liblte_s1ap_unpack_direct_forwarding_path_availability(ptr, &msg->Direct_Forwarding_Path_Availability) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Direct_Forwarding_Path_Availability_present = true; - } else if(LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION == ie_id) { - if(liblte_s1ap_unpack_srvcchoindication(ptr, &msg->SRVCCHOIndication) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SRVCCHOINDICATION == ie_id) { + if (liblte_s1ap_unpack_srvcchoindication(ptr, &msg->SRVCCHOIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SRVCCHOIndication_present = true; - } else if(LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_source_totarget_transparentcontainer(ptr, &msg->Source_ToTarget_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_source_totarget_transparentcontainer(ptr, &msg->Source_ToTarget_TransparentContainer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY == ie_id) { - if(liblte_s1ap_unpack_source_totarget_transparentcontainer(ptr, &msg->Source_ToTarget_TransparentContainer_Secondary) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER_SECONDARY == ie_id) { + if (liblte_s1ap_unpack_source_totarget_transparentcontainer( + ptr, &msg->Source_ToTarget_TransparentContainer_Secondary) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Source_ToTarget_TransparentContainer_Secondary_present = true; - } else if(LIBLTE_S1AP_IE_ID_MSCLASSMARK2 == ie_id) { - if(liblte_s1ap_unpack_msclassmark2(ptr, &msg->MSClassmark2) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MSCLASSMARK2 == ie_id) { + if (liblte_s1ap_unpack_msclassmark2(ptr, &msg->MSClassmark2) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_MSCLASSMARK3 == ie_id) { - if(liblte_s1ap_unpack_msclassmark3(ptr, &msg->MSClassmark3) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MSCLASSMARK3 == ie_id) { + if (liblte_s1ap_unpack_msclassmark3(ptr, &msg->MSClassmark3) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { - if(liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { + if (liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_Id_present = true; - } else if(LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { - if(liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { + if (liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CellAccessMode_present = true; - } else if(LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE == ie_id) { - if(liblte_s1ap_unpack_ps_servicenotavailable(ptr, &msg->PS_ServiceNotAvailable) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_PS_SERVICENOTAVAILABLE == ie_id) { + if (liblte_s1ap_unpack_ps_servicenotavailable(ptr, &msg->PS_ServiceNotAvailable) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->PS_ServiceNotAvailable_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -26196,20 +23408,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequired( /******************************************************************************* /* Protocol Message E_RABDataForwardingItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabdataforwardingitem_ext(LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABDataForwardingItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -26220,34 +23429,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabdataforwardingitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABDataForwardingItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26255,7 +23462,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -26264,98 +23470,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem_ext( /******************************************************************************* /* Protocol Message HandoverPreparationFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverpreparationfailure( - LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_handoverpreparationfailure(LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverPreparationFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26367,28 +23565,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverpreparationfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverpreparationfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverpreparationfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERPREPARATIONFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverPreparationFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26397,32 +23592,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverpreparationfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -26433,47 +23628,45 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverpreparationfailure( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemHOReq_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemhoreq_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemHOReq-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->Data_Forwarding_Not_Possible_present) + if (!msg->Data_Forwarding_Not_Possible_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Data_Forwarding_Not_Possible - if(msg->Data_Forwarding_Not_Possible_present) { - + if (msg->Data_Forwarding_Not_Possible_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_data_forwarding_not_possible(&msg->Data_Forwarding_Not_Possible, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_data_forwarding_not_possible(&msg->Data_Forwarding_Not_Possible, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DATA_FORWARDING_NOT_POSSIBLE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_DATA_FORWARDING_NOT_POSSIBLE, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26485,28 +23678,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq_ext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->Data_Forwarding_Not_Possible_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemHOReq-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26515,17 +23706,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iData_Forwarding_Not_Possible) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_DATA_FORWARDING_NOT_POSSIBLE == ie_id) { + if (liblte_s1ap_unpack_data_forwarding_not_possible(ptr, &msg->Data_Forwarding_Not_Possible) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Data_Forwarding_Not_Possible_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -26536,20 +23728,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq_ext( /******************************************************************************* /* Protocol Message E_RABAdmittedItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem_ext( - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem_ext(LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABAdmittedItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -26560,34 +23749,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABAdmittedItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26595,7 +23781,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -26604,20 +23789,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem_ext( /******************************************************************************* /* Protocol Message E_RABFailedToSetupItemHOReqAckExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqackext( - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabfailedtosetupitemhoreqackext(LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABFailedToSetupItemHOReqAckExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -26628,34 +23811,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqackext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACKEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABFailedToSetupItemHOReqAckExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26663,7 +23844,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -26672,81 +23852,73 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqackext( /******************************************************************************* /* Protocol Message HandoverFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverfailure( - LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverfailure(LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26758,28 +23930,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26788,27 +23956,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -26819,117 +23987,106 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverfailure( /******************************************************************************* /* Protocol Message HandoverNotify STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify( - LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify(LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverNotifyIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 6; - if(!msg->Tunnel_Information_for_BBF_present) + if (!msg->Tunnel_Information_for_BBF_present) n_ie--; - if(!msg->LHN_ID_present) + if (!msg->LHN_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Tunnel_Information_for_BBF - if(msg->Tunnel_Information_for_BBF_present) { - + if (msg->Tunnel_Information_for_BBF_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26937,18 +24094,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify( } // ProtocolIE - LHN_ID - if(msg->LHN_ID_present) { - + if (msg->LHN_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LHN_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LHN_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -26960,29 +24115,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovernotify( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERNOTIFY_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->Tunnel_Information_for_BBF_present = false; - msg->LHN_ID_present = false; + msg->LHN_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverNotifyIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -26991,43 +24142,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAI == ie_id) { - if(liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAI == ie_id) { + if (liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { - if(liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { + if (liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Tunnel_Information_for_BBF_present = true; - } else if(LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { - if(liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { + if (liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->LHN_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -27038,20 +24189,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovernotify( /******************************************************************************* /* Protocol Message E_RABToBeSwitchedDLItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobeswitcheddlitem_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedDLItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -27062,34 +24210,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedDLItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27097,7 +24243,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -27106,20 +24251,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem_ext( /******************************************************************************* /* Protocol Message E_RABToBeSwitchedULItem_Ext STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem_ext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobeswitchedulitem_ext(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedULItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -27130,34 +24272,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem_ext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_EXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedULItem-ExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27165,7 +24305,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -27174,98 +24313,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem_ext( /******************************************************************************* /* Protocol Message PathSwitchRequestFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestfailure( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestfailure(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27277,28 +24408,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27307,32 +24435,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -27343,20 +24471,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestfailure( /******************************************************************************* /* Protocol Message HandoverCancel STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel( - LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel(LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCancelIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -27367,54 +24491,50 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27425,27 +24545,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancel( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCANCEL_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCancelIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27454,26 +24570,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -27484,81 +24600,75 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancel( /******************************************************************************* /* Protocol Message HandoverCancelAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancelacknowledge( - LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancelacknowledge(LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCancelAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27570,28 +24680,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercancelacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancelacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handovercancelacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCANCELACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCancelAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27600,27 +24707,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancelacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -27631,49 +24738,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercancelacknowledge( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemBearerSUReqExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitembearersureqext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemBearerSUReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 2; - if(!msg->Correlation_ID_present) + if (!msg->Correlation_ID_present) n_ie--; - if(!msg->SIPTO_Correlation_ID_present) + if (!msg->SIPTO_Correlation_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Correlation_ID - if(msg->Correlation_ID_present) { - + if (msg->Correlation_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_correlation_id(&msg->Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_correlation_id(&msg->Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CORRELATION_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CORRELATION_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27681,18 +24785,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureqext( } // ProtocolIE - SIPTO_Correlation_ID - if(msg->SIPTO_Correlation_ID_present) { - + if (msg->SIPTO_Correlation_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_correlation_id(&msg->SIPTO_Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_correlation_id(&msg->SIPTO_Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27704,29 +24807,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureqext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitembearersureqext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->Correlation_ID_present = false; + msg->Correlation_ID_present = false; msg->SIPTO_Correlation_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemBearerSUReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27735,23 +24836,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureqext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCorrelation_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CORRELATION_ID == ie_id) { + if (liblte_s1ap_unpack_correlation_id(ptr, &msg->Correlation_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Correlation_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID == ie_id) { - if(liblte_s1ap_unpack_correlation_id(ptr, &msg->SIPTO_Correlation_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID == ie_id) { + if (liblte_s1ap_unpack_correlation_id(ptr, &msg->SIPTO_Correlation_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SIPTO_Correlation_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -27762,20 +24863,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureqext( /******************************************************************************* /* Protocol Message E_RABSetupItemBearerSUResExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersuresext( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabsetupitembearersuresext(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemBearerSUResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -27786,34 +24885,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersuresext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersuresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitembearersuresext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURESEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemBearerSUResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27821,7 +24918,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersuresext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -27830,47 +24926,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersuresext( /******************************************************************************* /* Protocol Message E_RABToBeModifyItemBearerModReqExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeModifyItemBearerModReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->TransportInformation_present) + if (!msg->TransportInformation_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - TransportInformation - if(msg->TransportInformation_present) { - + if (msg->TransportInformation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportinformation(&msg->TransportInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportinformation(&msg->TransportInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRANSPORTINFORMATION, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TRANSPORTINFORMATION, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -27883,27 +24976,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifyitembearermodreqext( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFYITEMBEARERMODREQEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->TransportInformation_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeModifyItemBearerModReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27912,17 +25002,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iTransportInformation) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_TRANSPORTINFORMATION == ie_id) { + if (liblte_s1ap_unpack_transportinformation(ptr, &msg->TransportInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TransportInformation_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -27933,20 +25023,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifyitembearermodreqext( /******************************************************************************* /* Protocol Message E_RABModifyItemBearerModResExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodresext( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabmodifyitembearermodresext(LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyItemBearerModResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -27957,34 +25045,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodresext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabmodifyitembearermodresext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRESEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyItemBearerModResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -27992,7 +25078,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodresext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -28001,83 +25086,77 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodresext( /******************************************************************************* /* Protocol Message E_RABReleaseCommand STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand( - LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand(LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseCommandIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->uEaggregateMaximumBitrate_present) + if (!msg->uEaggregateMaximumBitrate_present) n_ie--; - if(!msg->NAS_PDU_present) + if (!msg->NAS_PDU_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - if(msg->uEaggregateMaximumBitrate_present) { - + if (msg->uEaggregateMaximumBitrate_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28085,35 +25164,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand( } // ProtocolIE - E_RABToBeReleasedList - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABToBeReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABToBeReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NAS_PDU - if(msg->NAS_PDU_present) { - + if (msg->NAS_PDU_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NAS_PDU, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NAS_PDU, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28125,29 +25201,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleasecommand( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASECOMMAND_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->uEaggregateMaximumBitrate_present = false; - msg->NAS_PDU_present = false; + msg->NAS_PDU_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseCommandIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28156,38 +25229,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->uEaggregateMaximumBitrate_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABToBeReleasedList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABToBeReleasedList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->NAS_PDU_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -28198,20 +25271,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleasecommand( /******************************************************************************* /* Protocol Message E_RABReleaseItemBearerRelCompExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcompext( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabreleaseitembearerrelcompext(LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseItemBearerRelCompExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -28222,34 +25293,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcompext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMPEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseItemBearerRelCompExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28257,7 +25326,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -28266,98 +25334,91 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcompext( /******************************************************************************* /* Protocol Message E_RABReleaseIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseindication( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseindication(LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->UserLocationInformation_present) + if (!msg->UserLocationInformation_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABReleasedList - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UserLocationInformation - if(msg->UserLocationInformation_present) { - + if (msg->UserLocationInformation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28369,28 +25430,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->UserLocationInformation_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28399,32 +25457,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABReleasedList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABRELEASEDLIST == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABReleasedList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { - if(liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { + if (liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UserLocationInformation_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -28435,49 +25493,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseindication( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemCtxtSUReqExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemCtxtSUReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 2; - if(!msg->Correlation_ID_present) + if (!msg->Correlation_ID_present) n_ie--; - if(!msg->SIPTO_Correlation_ID_present) + if (!msg->SIPTO_Correlation_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Correlation_ID - if(msg->Correlation_ID_present) { - + if (msg->Correlation_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_correlation_id(&msg->Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_correlation_id(&msg->Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CORRELATION_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CORRELATION_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28485,18 +25540,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext( } // ProtocolIE - SIPTO_Correlation_ID - if(msg->SIPTO_Correlation_ID_present) { - + if (msg->SIPTO_Correlation_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_correlation_id(&msg->SIPTO_Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_correlation_id(&msg->SIPTO_Correlation_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28508,29 +25562,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureqext( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->Correlation_ID_present = false; + msg->Correlation_ID_present = false; msg->SIPTO_Correlation_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemCtxtSUReqExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28539,23 +25591,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCorrelation_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CORRELATION_ID == ie_id) { + if (liblte_s1ap_unpack_correlation_id(ptr, &msg->Correlation_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Correlation_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID == ie_id) { - if(liblte_s1ap_unpack_correlation_id(ptr, &msg->SIPTO_Correlation_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SIPTO_CORRELATION_ID == ie_id) { + if (liblte_s1ap_unpack_correlation_id(ptr, &msg->SIPTO_Correlation_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SIPTO_Correlation_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -28566,20 +25618,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureqext( /******************************************************************************* /* Protocol Message E_RABSetupItemCtxtSUResExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsuresext( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabsetupitemctxtsuresext(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemCtxtSUResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -28590,34 +25639,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsuresext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsuresext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitemctxtsuresext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURESEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemCtxtSUResExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28625,7 +25671,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsuresext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -28634,98 +25679,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsuresext( /******************************************************************************* /* Protocol Message InitialContextSetupFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupfailure( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_initialcontextsetupfailure(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28737,28 +25774,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetupfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28767,32 +25801,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -28803,20 +25837,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupfailure( /******************************************************************************* /* Protocol Message TAIItemExt STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitemext( - LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitemext(LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -28827,34 +25857,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitemext( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIITEMEXT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIItemExtIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -28862,7 +25888,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -28871,98 +25896,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitemext( /******************************************************************************* /* Protocol Message UEContextReleaseRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleaserequest( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleaserequest(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseRequest-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->GWContextReleaseIndication_present) + if (!msg->GWContextReleaseIndication_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - GWContextReleaseIndication - if(msg->GWContextReleaseIndication_present) { - + if (msg->GWContextReleaseIndication_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gwcontextreleaseindication(&msg->GWContextReleaseIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gwcontextreleaseindication(&msg->GWContextReleaseIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -28974,28 +25991,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleaserequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASEREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->GWContextReleaseIndication_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseRequest-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29004,32 +26018,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION == ie_id) { - if(liblte_s1ap_unpack_gwcontextreleaseindication(ptr, &msg->GWContextReleaseIndication) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GWCONTEXTRELEASEINDICATION == ie_id) { + if (liblte_s1ap_unpack_gwcontextreleaseindication(ptr, &msg->GWContextReleaseIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GWContextReleaseIndication_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -29040,20 +26054,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleaserequest( /******************************************************************************* /* Protocol Message UEContextReleaseCommand STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseCommand-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -29064,37 +26075,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - UE_S1AP_IDs - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_s1ap_ids(&msg->UE_S1AP_IDs, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_s1ap_ids(&msg->UE_S1AP_IDs, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_S1AP_IDS, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UE_S1AP_IDS, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29105,27 +26112,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecommand( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMMAND_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseCommand-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29134,21 +26138,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iUE_S1AP_IDs) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_UE_S1AP_IDS == ie_id) { + if (liblte_s1ap_unpack_ue_s1ap_ids(ptr, &msg->UE_S1AP_IDs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -29159,83 +26163,77 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecommand( /******************************************************************************* /* Protocol Message UEContextReleaseComplete STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete( - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete(LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseComplete-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; - if(!msg->UserLocationInformation_present) + if (!msg->UserLocationInformation_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29243,18 +26241,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete( } // ProtocolIE - UserLocationInformation - if(msg->UserLocationInformation_present) { - + if (msg->UserLocationInformation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29266,29 +26263,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextreleasecomplete( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTRELEASECOMPLETE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; msg->UserLocationInformation_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextReleaseComplete-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29297,33 +26291,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } else if(LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { - if(liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { + if (liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UserLocationInformation_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -29334,95 +26328,90 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextreleasecomplete( /******************************************************************************* /* Protocol Message UEContextModificationRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationrequest(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 10; - if(!msg->SecurityKey_present) + if (!msg->SecurityKey_present) n_ie--; - if(!msg->SubscriberProfileIDforRFP_present) + if (!msg->SubscriberProfileIDforRFP_present) n_ie--; - if(!msg->uEaggregateMaximumBitrate_present) + if (!msg->uEaggregateMaximumBitrate_present) n_ie--; - if(!msg->CSFallbackIndicator_present) + if (!msg->CSFallbackIndicator_present) n_ie--; - if(!msg->UESecurityCapabilities_present) + if (!msg->UESecurityCapabilities_present) n_ie--; - if(!msg->CSGMembershipStatus_present) + if (!msg->CSGMembershipStatus_present) n_ie--; - if(!msg->RegisteredLAI_present) + if (!msg->RegisteredLAI_present) n_ie--; - if(!msg->AdditionalCSFallbackIndicator_present) + if (!msg->AdditionalCSFallbackIndicator_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SecurityKey - if(msg->SecurityKey_present) { - + if (msg->SecurityKey_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_securitykey(&msg->SecurityKey, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_securitykey(&msg->SecurityKey, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SECURITYKEY, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SECURITYKEY, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29430,18 +26419,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - SubscriberProfileIDforRFP - if(msg->SubscriberProfileIDforRFP_present) { - + if (msg->SubscriberProfileIDforRFP_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29449,18 +26437,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - uEaggregateMaximumBitrate - if(msg->uEaggregateMaximumBitrate_present) { - + if (msg->uEaggregateMaximumBitrate_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29468,18 +26455,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - CSFallbackIndicator - if(msg->CSFallbackIndicator_present) { - + if (msg->CSFallbackIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csfallbackindicator(&msg->CSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csfallbackindicator(&msg->CSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29487,18 +26473,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - UESecurityCapabilities - if(msg->UESecurityCapabilities_present) { - + if (msg->UESecurityCapabilities_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29506,18 +26491,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - CSGMembershipStatus - if(msg->CSGMembershipStatus_present) { - + if (msg->CSGMembershipStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29525,18 +26509,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - RegisteredLAI - if(msg->RegisteredLAI_present) { - + if (msg->RegisteredLAI_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lai(&msg->RegisteredLAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lai(&msg->RegisteredLAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REGISTEREDLAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REGISTEREDLAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29544,18 +26527,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( } // ProtocolIE - AdditionalCSFallbackIndicator - if(msg->AdditionalCSFallbackIndicator_present) { - + if (msg->AdditionalCSFallbackIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_additionalcsfallbackindicator(&msg->AdditionalCSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_additionalcsfallbackindicator(&msg->AdditionalCSFallbackIndicator, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29567,35 +26551,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->SecurityKey_present = false; - msg->SubscriberProfileIDforRFP_present = false; - msg->uEaggregateMaximumBitrate_present = false; - msg->CSFallbackIndicator_present = false; - msg->UESecurityCapabilities_present = false; - msg->CSGMembershipStatus_present = false; - msg->RegisteredLAI_present = false; + msg->SecurityKey_present = false; + msg->SubscriberProfileIDforRFP_present = false; + msg->uEaggregateMaximumBitrate_present = false; + msg->CSFallbackIndicator_present = false; + msg->UESecurityCapabilities_present = false; + msg->CSGMembershipStatus_present = false; + msg->RegisteredLAI_present = false; msg->AdditionalCSFallbackIndicator_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29604,68 +26586,69 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SECURITYKEY == ie_id) { - if(liblte_s1ap_unpack_securitykey(ptr, &msg->SecurityKey) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SECURITYKEY == ie_id) { + if (liblte_s1ap_unpack_securitykey(ptr, &msg->SecurityKey) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SecurityKey_present = true; - } else if(LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { - if(liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { + if (liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SubscriberProfileIDforRFP_present = true; - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->uEaggregateMaximumBitrate_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR == ie_id) { - if(liblte_s1ap_unpack_csfallbackindicator(ptr, &msg->CSFallbackIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR == ie_id) { + if (liblte_s1ap_unpack_csfallbackindicator(ptr, &msg->CSFallbackIndicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSFallbackIndicator_present = true; - } else if(LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { - if(liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { + if (liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UESecurityCapabilities_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { - if(liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { + if (liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSGMembershipStatus_present = true; - } else if(LIBLTE_S1AP_IE_ID_REGISTEREDLAI == ie_id) { - if(liblte_s1ap_unpack_lai(ptr, &msg->RegisteredLAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REGISTEREDLAI == ie_id) { + if (liblte_s1ap_unpack_lai(ptr, &msg->RegisteredLAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->RegisteredLAI_present = true; - } else if(LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR == ie_id) { - if(liblte_s1ap_unpack_additionalcsfallbackindicator(ptr, &msg->AdditionalCSFallbackIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR == ie_id) { + if (liblte_s1ap_unpack_additionalcsfallbackindicator(ptr, &msg->AdditionalCSFallbackIndicator) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -29676,81 +26659,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationrequest( /******************************************************************************* /* Protocol Message UEContextModificationResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationresponse( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationresponse(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29762,28 +26740,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29792,27 +26768,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -29823,98 +26799,91 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationresponse( /******************************************************************************* /* Protocol Message UEContextModificationFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationfailure( - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecontextmodificationfailure(LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -29926,28 +26895,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecontextmodificationfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecontextmodificationfailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UECONTEXTMODIFICATIONFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UEContextModificationFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -29956,32 +26923,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -29992,81 +26959,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecontextmodificationfailure( /******************************************************************************* /* Protocol Message UERadioCapabilityMatchRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchrequest( - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueradiocapabilitymatchrequest(LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UERadioCapabilityMatchRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->UERadioCapability_present) + if (!msg->UERadioCapability_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UERadioCapability - if(msg->UERadioCapability_present) { - + if (msg->UERadioCapability_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30078,28 +27040,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueradiocapabilitymatchrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->UERadioCapability_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UERadioCapabilityMatchRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -30108,27 +27068,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { - if(liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { + if (liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UERadioCapability_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -30139,98 +27099,92 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchrequest( /******************************************************************************* /* Protocol Message UERadioCapabilityMatchResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchresponse( - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_ueradiocapabilitymatchresponse(LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UERadioCapabilityMatchResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - VoiceSupportMatchIndicator - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_voicesupportmatchindicator(&msg->VoiceSupportMatchIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_voicesupportmatchindicator(&msg->VoiceSupportMatchIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30242,28 +27196,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ueradiocapabilitymatchresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_ueradiocapabilitymatchresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UERADIOCAPABILITYMATCHRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UERadioCapabilityMatchResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -30272,32 +27224,32 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR == ie_id) { - if(liblte_s1ap_unpack_voicesupportmatchindicator(ptr, &msg->VoiceSupportMatchIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_VOICESUPPORTMATCHINDICATOR == ie_id) { + if (liblte_s1ap_unpack_voicesupportmatchindicator(ptr, &msg->VoiceSupportMatchIndicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -30308,100 +27260,92 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ueradiocapabilitymatchresponse( /******************************************************************************* /* Protocol Message DownlinkNASTransport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport(LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkNASTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->HandoverRestrictionList_present) + if (!msg->HandoverRestrictionList_present) n_ie--; - if(!msg->SubscriberProfileIDforRFP_present) + if (!msg->SubscriberProfileIDforRFP_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NAS_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NAS_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NAS_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - HandoverRestrictionList - if(msg->HandoverRestrictionList_present) { - + if (msg->HandoverRestrictionList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30409,18 +27353,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport( } // ProtocolIE - SubscriberProfileIDforRFP - if(msg->SubscriberProfileIDforRFP_present) { - + if (msg->SubscriberProfileIDforRFP_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30432,29 +27375,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknastransport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->HandoverRestrictionList_present = false; + msg->HandoverRestrictionList_present = false; msg->SubscriberProfileIDforRFP_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkNASTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -30463,38 +27403,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { - if(liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { + if (liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->HandoverRestrictionList_present = true; - } else if(LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { - if(liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { + if (liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SubscriberProfileIDforRFP_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -30505,150 +27445,136 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknastransport( /******************************************************************************* /* Protocol Message InitialUEMessage STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( - LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialUEMessage-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 15; - if(!msg->S_TMSI_present) + if (!msg->S_TMSI_present) n_ie--; - if(!msg->CSG_Id_present) + if (!msg->CSG_Id_present) n_ie--; - if(!msg->GUMMEI_ID_present) + if (!msg->GUMMEI_ID_present) n_ie--; - if(!msg->CellAccessMode_present) + if (!msg->CellAccessMode_present) n_ie--; - if(!msg->GW_TransportLayerAddress_present) + if (!msg->GW_TransportLayerAddress_present) n_ie--; - if(!msg->RelayNode_Indicator_present) + if (!msg->RelayNode_Indicator_present) n_ie--; - if(!msg->GUMMEIType_present) + if (!msg->GUMMEIType_present) n_ie--; - if(!msg->Tunnel_Information_for_BBF_present) + if (!msg->Tunnel_Information_for_BBF_present) n_ie--; - if(!msg->SIPTO_L_GW_TransportLayerAddress_present) + if (!msg->SIPTO_L_GW_TransportLayerAddress_present) n_ie--; - if(!msg->LHN_ID_present) + if (!msg->LHN_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NAS_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NAS_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NAS_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAI, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAI, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - RRC_Establishment_Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_rrc_establishment_cause(&msg->RRC_Establishment_Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_rrc_establishment_cause(&msg->RRC_Establishment_Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - S_TMSI - if(msg->S_TMSI_present) { - + if (msg->S_TMSI_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_s_tmsi(&msg->S_TMSI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_s_tmsi(&msg->S_TMSI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_S_TMSI, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_S_TMSI, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30656,18 +27582,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - CSG_Id - if(msg->CSG_Id_present) { - + if (msg->CSG_Id_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30675,18 +27599,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - GUMMEI_ID - if(msg->GUMMEI_ID_present) { - + if (msg->GUMMEI_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEI_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEI_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30694,18 +27616,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - CellAccessMode - if(msg->CellAccessMode_present) { - + if (msg->CellAccessMode_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CELLACCESSMODE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CELLACCESSMODE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30713,18 +27634,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - GW_TransportLayerAddress - if(msg->GW_TransportLayerAddress_present) { - + if (msg->GW_TransportLayerAddress_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportlayeraddress(&msg->GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&msg->GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30732,18 +27652,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - RelayNode_Indicator - if(msg->RelayNode_Indicator_present) { - + if (msg->RelayNode_Indicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_relaynode_indicator(&msg->RelayNode_Indicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_relaynode_indicator(&msg->RelayNode_Indicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30751,18 +27670,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - GUMMEIType - if(msg->GUMMEIType_present) { - + if (msg->GUMMEIType_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummeitype(&msg->GUMMEIType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummeitype(&msg->GUMMEIType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEITYPE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEITYPE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30770,18 +27688,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - Tunnel_Information_for_BBF - if(msg->Tunnel_Information_for_BBF_present) { - + if (msg->Tunnel_Information_for_BBF_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30789,18 +27706,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - SIPTO_L_GW_TransportLayerAddress - if(msg->SIPTO_L_GW_TransportLayerAddress_present) { - + if (msg->SIPTO_L_GW_TransportLayerAddress_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportlayeraddress(&msg->SIPTO_L_GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&msg->SIPTO_L_GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30808,18 +27725,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( } // ProtocolIE - LHN_ID - if(msg->LHN_ID_present) { - + if (msg->LHN_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LHN_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LHN_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -30831,37 +27746,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialuemessage( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->S_TMSI_present = false; - msg->CSG_Id_present = false; - msg->GUMMEI_ID_present = false; - msg->CellAccessMode_present = false; - msg->GW_TransportLayerAddress_present = false; - msg->RelayNode_Indicator_present = false; - msg->GUMMEIType_present = false; - msg->Tunnel_Information_for_BBF_present = false; + msg->S_TMSI_present = false; + msg->CSG_Id_present = false; + msg->GUMMEI_ID_present = false; + msg->CellAccessMode_present = false; + msg->GW_TransportLayerAddress_present = false; + msg->RelayNode_Indicator_present = false; + msg->GUMMEIType_present = false; + msg->Tunnel_Information_for_BBF_present = false; msg->SIPTO_L_GW_TransportLayerAddress_present = false; - msg->LHN_ID_present = false; + msg->LHN_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialUEMessage-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -30870,96 +27781,96 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;ieNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAI == ie_id) { - if(liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAI == ie_id) { + if (liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE == ie_id) { - if(liblte_s1ap_unpack_rrc_establishment_cause(ptr, &msg->RRC_Establishment_Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RRC_ESTABLISHMENT_CAUSE == ie_id) { + if (liblte_s1ap_unpack_rrc_establishment_cause(ptr, &msg->RRC_Establishment_Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_S_TMSI == ie_id) { - if(liblte_s1ap_unpack_s_tmsi(ptr, &msg->S_TMSI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_S_TMSI == ie_id) { + if (liblte_s1ap_unpack_s_tmsi(ptr, &msg->S_TMSI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->S_TMSI_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { - if(liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { + if (liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_Id_present = true; - } else if(LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { - if(liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { + if (liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEI_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { - if(liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { + if (liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CellAccessMode_present = true; - } else if(LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS == ie_id) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->GW_TransportLayerAddress) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS == ie_id) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->GW_TransportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GW_TransportLayerAddress_present = true; - } else if(LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR == ie_id) { - if(liblte_s1ap_unpack_relaynode_indicator(ptr, &msg->RelayNode_Indicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RELAYNODE_INDICATOR == ie_id) { + if (liblte_s1ap_unpack_relaynode_indicator(ptr, &msg->RelayNode_Indicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->RelayNode_Indicator_present = true; - } else if(LIBLTE_S1AP_IE_ID_GUMMEITYPE == ie_id) { - if(liblte_s1ap_unpack_gummeitype(ptr, &msg->GUMMEIType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GUMMEITYPE == ie_id) { + if (liblte_s1ap_unpack_gummeitype(ptr, &msg->GUMMEIType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEIType_present = true; - } else if(LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { - if(liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { + if (liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Tunnel_Information_for_BBF_present = true; - } else if(LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS == ie_id) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->SIPTO_L_GW_TransportLayerAddress) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS == ie_id) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->SIPTO_L_GW_TransportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SIPTO_L_GW_TransportLayerAddress_present = true; - } else if(LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { - if(liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { + if (liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->LHN_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -30970,136 +27881,123 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialuemessage( /******************************************************************************* /* Protocol Message UplinkNASTransport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport( - LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkNASTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 8; - if(!msg->GW_TransportLayerAddress_present) + if (!msg->GW_TransportLayerAddress_present) n_ie--; - if(!msg->SIPTO_L_GW_TransportLayerAddress_present) + if (!msg->SIPTO_L_GW_TransportLayerAddress_present) n_ie--; - if(!msg->LHN_ID_present) + if (!msg->LHN_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NAS_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NAS_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NAS_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - GW_TransportLayerAddress - if(msg->GW_TransportLayerAddress_present) { - + if (msg->GW_TransportLayerAddress_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportlayeraddress(&msg->GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&msg->GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31107,18 +28005,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport( } // ProtocolIE - SIPTO_L_GW_TransportLayerAddress - if(msg->SIPTO_L_GW_TransportLayerAddress_present) { - + if (msg->SIPTO_L_GW_TransportLayerAddress_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportlayeraddress(&msg->SIPTO_L_GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&msg->SIPTO_L_GW_TransportLayerAddress, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31126,18 +28024,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport( } // ProtocolIE - LHN_ID - if(msg->LHN_ID_present) { - + if (msg->LHN_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LHN_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LHN_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31149,30 +28045,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknastransport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->GW_TransportLayerAddress_present = false; + msg->GW_TransportLayerAddress_present = false; msg->SIPTO_L_GW_TransportLayerAddress_present = false; - msg->LHN_ID_present = false; + msg->LHN_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkNASTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31181,54 +28074,54 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAI == ie_id) { - if(liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAI == ie_id) { + if (liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS == ie_id) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->GW_TransportLayerAddress) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GW_TRANSPORTLAYERADDRESS == ie_id) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->GW_TransportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GW_TransportLayerAddress_present = true; - } else if(LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS == ie_id) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->SIPTO_L_GW_TransportLayerAddress) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SIPTO_L_GW_TRANSPORTLAYERADDRESS == ie_id) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->SIPTO_L_GW_TransportLayerAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SIPTO_L_GW_TransportLayerAddress_present = true; - } else if(LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { - if(liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { + if (liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->LHN_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -31239,20 +28132,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknastransport( /******************************************************************************* /* Protocol Message NASNonDeliveryIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication( - LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication(LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("NASNonDeliveryIndication-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -31263,71 +28153,65 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NAS_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nas_pdu(&msg->NAS_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NAS_PDU, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NAS_PDU, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31338,27 +28222,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_nasnondeliveryindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_NASNONDELIVERYINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("NASNonDeliveryIndication-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31367,31 +28248,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { - if(liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NAS_PDU == ie_id) { + if (liblte_s1ap_unpack_nas_pdu(ptr, &msg->NAS_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -31403,19 +28284,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_nasnondeliveryindication( /* Protocol Message UE_associatedLogicalS1_ConnectionItem STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UE-associatedLogicalS1-ConnectionItemRes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -31426,20 +28304,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - UE_associatedLogicalS1_ConnectionItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&msg->UE_associatedLogicalS1_ConnectionItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&msg->UE_associatedLogicalS1_ConnectionItem, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31451,26 +28330,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitem( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UE-associatedLogicalS1-ConnectionItemRes error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31479,16 +28355,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iUE_associatedLogicalS1_ConnectionItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM == ie_id) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( + ptr, &msg->UE_associatedLogicalS1_ConnectionItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -31500,20 +28377,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( /* Protocol Message UE_associatedLogicalS1_ConnectionItemRes STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres( - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { - liblte_log_print("UE-associatedLogicalS1-ConnectionItemResAck error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "UE-associatedLogicalS1-ConnectionItemResAck error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -31523,20 +28398,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - UE_associatedLogicalS1_ConnectionItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&msg->UE_associatedLogicalS1_ConnectionItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionitem(&msg->UE_associatedLogicalS1_ConnectionItem, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31548,27 +28424,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_ue_associatedlogicals1_connectionitemres( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEMRES_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { - liblte_log_print("UE-associatedLogicalS1-ConnectionItemResAck error: S1AP ASN extensions not currently supported\n"); + if (msg->ext) { + liblte_log_print( + "UE-associatedLogicalS1-ConnectionItemResAck error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31576,16 +28450,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iUE_associatedLogicalS1_ConnectionItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONITEM == ie_id) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionitem( + ptr, &msg->UE_associatedLogicalS1_ConnectionItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -31596,53 +28471,48 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_ue_associatedlogicals1_connectionitemres( /******************************************************************************* /* Protocol Message ErrorIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( - LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication(LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ErrorIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->MME_UE_S1AP_ID_present) + if (!msg->MME_UE_S1AP_ID_present) n_ie--; - if(!msg->eNB_UE_S1AP_ID_present) + if (!msg->eNB_UE_S1AP_ID_present) n_ie--; - if(!msg->Cause_present) + if (!msg->Cause_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - if(msg->MME_UE_S1AP_ID_present) { - + if (msg->MME_UE_S1AP_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31650,18 +28520,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( } // ProtocolIE - eNB_UE_S1AP_ID - if(msg->eNB_UE_S1AP_ID_present) { - + if (msg->eNB_UE_S1AP_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31669,18 +28538,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( } // ProtocolIE - Cause - if(msg->Cause_present) { - + if (msg->Cause_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31688,18 +28555,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31711,31 +28577,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_errorindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ERRORINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->MME_UE_S1AP_ID_present = false; - msg->eNB_UE_S1AP_ID_present = false; - msg->Cause_present = false; + msg->MME_UE_S1AP_ID_present = false; + msg->eNB_UE_S1AP_ID_present = false; + msg->Cause_present = false; msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ErrorIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31744,35 +28606,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MME_UE_S1AP_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->eNB_UE_S1AP_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Cause_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -31783,66 +28645,59 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_errorindication( /******************************************************************************* /* Protocol Message S1SetupRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest( - LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->eNBname_present) + if (!msg->eNBname_present) n_ie--; - if(!msg->CSG_IdList_present) + if (!msg->CSG_IdList_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Global_ENB_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_global_enb_id(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_global_enb_id(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNBname - if(msg->eNBname_present) { - + if (msg->eNBname_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENBNAME, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENBNAME, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31850,52 +28705,49 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest( } // ProtocolIE - SupportedTAs - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_supportedtas(&msg->SupportedTAs, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_supportedtas(&msg->SupportedTAs, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SUPPORTEDTAS, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SUPPORTEDTAS, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - DefaultPagingDRX - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_pagingdrx(&msg->DefaultPagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pagingdrx(&msg->DefaultPagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CSG_IdList - if(msg->CSG_IdList_present) { - + if (msg->CSG_IdList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_IDLIST, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_IDLIST, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -31907,29 +28759,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setuprequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->eNBname_present = false; + msg->eNBname_present = false; msg->CSG_IdList_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -31938,38 +28786,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iGlobal_ENB_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID == ie_id) { + if (liblte_s1ap_unpack_global_enb_id(ptr, &msg->Global_ENB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENBNAME == ie_id) { - if(liblte_s1ap_unpack_enbname(ptr, &msg->eNBname) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENBNAME == ie_id) { + if (liblte_s1ap_unpack_enbname(ptr, &msg->eNBname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->eNBname_present = true; - } else if(LIBLTE_S1AP_IE_ID_SUPPORTEDTAS == ie_id) { - if(liblte_s1ap_unpack_supportedtas(ptr, &msg->SupportedTAs) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SUPPORTEDTAS == ie_id) { + if (liblte_s1ap_unpack_supportedtas(ptr, &msg->SupportedTAs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX == ie_id) { - if(liblte_s1ap_unpack_pagingdrx(ptr, &msg->DefaultPagingDRX) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX == ie_id) { + if (liblte_s1ap_unpack_pagingdrx(ptr, &msg->DefaultPagingDRX) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { - if(liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { + if (liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_IdList_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -31980,51 +28828,45 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setuprequest( /******************************************************************************* /* Protocol Message S1SetupResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse( - LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse(LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->MMEname_present) + if (!msg->MMEname_present) n_ie--; - if(!msg->MMERelaySupportIndicator_present) + if (!msg->MMERelaySupportIndicator_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MMEname - if(msg->MMEname_present) { - + if (msg->MMEname_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mmename(&msg->MMEname, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mmename(&msg->MMEname, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MMENAME, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MMENAME, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32032,52 +28874,49 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse( } // ProtocolIE - ServedGUMMEIs - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_servedgummeis(&msg->ServedGUMMEIs, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_servedgummeis(&msg->ServedGUMMEIs, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - RelativeMMECapacity - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_relativemmecapacity(&msg->RelativeMMECapacity, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_relativemmecapacity(&msg->RelativeMMECapacity, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - MMERelaySupportIndicator - if(msg->MMERelaySupportIndicator_present) { - + if (msg->MMERelaySupportIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mmerelaysupportindicator(&msg->MMERelaySupportIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mmerelaysupportindicator(&msg->MMERelaySupportIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32085,18 +28924,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32108,30 +28946,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->MMEname_present = false; + msg->MMEname_present = false; msg->MMERelaySupportIndicator_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32140,39 +28974,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMMEname) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MMENAME == ie_id) { + if (liblte_s1ap_unpack_mmename(ptr, &msg->MMEname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MMEname_present = true; - } else if(LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS == ie_id) { - if(liblte_s1ap_unpack_servedgummeis(ptr, &msg->ServedGUMMEIs) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS == ie_id) { + if (liblte_s1ap_unpack_servedgummeis(ptr, &msg->ServedGUMMEIs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY == ie_id) { - if(liblte_s1ap_unpack_relativemmecapacity(ptr, &msg->RelativeMMECapacity) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY == ie_id) { + if (liblte_s1ap_unpack_relativemmecapacity(ptr, &msg->RelativeMMECapacity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR == ie_id) { - if(liblte_s1ap_unpack_mmerelaysupportindicator(ptr, &msg->MMERelaySupportIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MMERELAYSUPPORTINDICATOR == ie_id) { + if (liblte_s1ap_unpack_mmerelaysupportindicator(ptr, &msg->MMERelaySupportIndicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MMERelaySupportIndicator_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32183,66 +29017,59 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupresponse( /******************************************************************************* /* Protocol Message S1SetupFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure( - LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure(LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->TimeToWait_present) + if (!msg->TimeToWait_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TimeToWait - if(msg->TimeToWait_present) { - + if (msg->TimeToWait_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TIMETOWAIT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TIMETOWAIT, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32250,18 +29077,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32273,29 +29099,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1setupfailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->TimeToWait_present = false; + msg->TimeToWait_present = false; msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("S1SetupFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32304,28 +29126,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCause) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { - if(liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { + if (liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TimeToWait_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32336,53 +29158,48 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1setupfailure( /******************************************************************************* /* Protocol Message ENBConfigurationUpdate STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->eNBname_present) + if (!msg->eNBname_present) n_ie--; - if(!msg->SupportedTAs_present) + if (!msg->SupportedTAs_present) n_ie--; - if(!msg->CSG_IdList_present) + if (!msg->CSG_IdList_present) n_ie--; - if(!msg->DefaultPagingDRX_present) + if (!msg->DefaultPagingDRX_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - eNBname - if(msg->eNBname_present) { - + if (msg->eNBname_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enbname(&msg->eNBname, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENBNAME, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENBNAME, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32390,18 +29207,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( } // ProtocolIE - SupportedTAs - if(msg->SupportedTAs_present) { - + if (msg->SupportedTAs_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_supportedtas(&msg->SupportedTAs, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_supportedtas(&msg->SupportedTAs, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SUPPORTEDTAS, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SUPPORTEDTAS, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32409,18 +29225,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( } // ProtocolIE - CSG_IdList - if(msg->CSG_IdList_present) { - + if (msg->CSG_IdList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_IDLIST, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_IDLIST, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32428,18 +29243,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( } // ProtocolIE - DefaultPagingDRX - if(msg->DefaultPagingDRX_present) { - + if (msg->DefaultPagingDRX_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_pagingdrx(&msg->DefaultPagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pagingdrx(&msg->DefaultPagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32451,31 +29265,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdate( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->eNBname_present = false; - msg->SupportedTAs_present = false; - msg->CSG_IdList_present = false; + msg->eNBname_present = false; + msg->SupportedTAs_present = false; + msg->CSG_IdList_present = false; msg->DefaultPagingDRX_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32484,35 +29295,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;ieNBname) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ENBNAME == ie_id) { + if (liblte_s1ap_unpack_enbname(ptr, &msg->eNBname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->eNBname_present = true; - } else if(LIBLTE_S1AP_IE_ID_SUPPORTEDTAS == ie_id) { - if(liblte_s1ap_unpack_supportedtas(ptr, &msg->SupportedTAs) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SUPPORTEDTAS == ie_id) { + if (liblte_s1ap_unpack_supportedtas(ptr, &msg->SupportedTAs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SupportedTAs_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { - if(liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { + if (liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_IdList_present = true; - } else if(LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX == ie_id) { - if(liblte_s1ap_unpack_pagingdrx(ptr, &msg->DefaultPagingDRX) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_DEFAULTPAGINGDRX == ie_id) { + if (liblte_s1ap_unpack_pagingdrx(ptr, &msg->DefaultPagingDRX) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->DefaultPagingDRX_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32523,47 +29334,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdate( /******************************************************************************* /* Protocol Message ENBConfigurationUpdateAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdateacknowledge( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbconfigurationupdateacknowledge(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32575,28 +29383,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdateacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdateacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbconfigurationupdateacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32605,17 +29411,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdateacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCriticalityDiagnostics) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32626,66 +29432,61 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdateacknowledge( /******************************************************************************* /* Protocol Message ENBConfigurationUpdateFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdatefailure( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbconfigurationupdatefailure(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->TimeToWait_present) + if (!msg->TimeToWait_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TimeToWait - if(msg->TimeToWait_present) { - + if (msg->TimeToWait_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TIMETOWAIT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TIMETOWAIT, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32693,18 +29494,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdatefailure( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32716,29 +29516,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationupdatefailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdatefailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbconfigurationupdatefailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONUPDATEFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->TimeToWait_present = false; + msg->TimeToWait_present = false; msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationUpdateFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32747,28 +29545,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdatefailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCause) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { - if(liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { + if (liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TimeToWait_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32779,51 +29577,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationupdatefailure( /******************************************************************************* /* Protocol Message MMEConfigurationUpdate STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->MMEname_present) + if (!msg->MMEname_present) n_ie--; - if(!msg->ServedGUMMEIs_present) + if (!msg->ServedGUMMEIs_present) n_ie--; - if(!msg->RelativeMMECapacity_present) + if (!msg->RelativeMMECapacity_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MMEname - if(msg->MMEname_present) { - + if (msg->MMEname_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mmename(&msg->MMEname, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mmename(&msg->MMEname, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MMENAME, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MMENAME, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32831,18 +29624,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate( } // ProtocolIE - ServedGUMMEIs - if(msg->ServedGUMMEIs_present) { - + if (msg->ServedGUMMEIs_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_servedgummeis(&msg->ServedGUMMEIs, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_servedgummeis(&msg->ServedGUMMEIs, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32850,18 +29642,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate( } // ProtocolIE - RelativeMMECapacity - if(msg->RelativeMMECapacity_present) { - + if (msg->RelativeMMECapacity_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_relativemmecapacity(&msg->RelativeMMECapacity, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_relativemmecapacity(&msg->RelativeMMECapacity, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32873,30 +29664,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdate( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->MMEname_present = false; - msg->ServedGUMMEIs_present = false; + msg->MMEname_present = false; + msg->ServedGUMMEIs_present = false; msg->RelativeMMECapacity_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -32905,29 +29693,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMMEname) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MMENAME == ie_id) { + if (liblte_s1ap_unpack_mmename(ptr, &msg->MMEname) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MMEname_present = true; - } else if(LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS == ie_id) { - if(liblte_s1ap_unpack_servedgummeis(ptr, &msg->ServedGUMMEIs) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERVEDGUMMEIS == ie_id) { + if (liblte_s1ap_unpack_servedgummeis(ptr, &msg->ServedGUMMEIs) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ServedGUMMEIs_present = true; - } else if(LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY == ie_id) { - if(liblte_s1ap_unpack_relativemmecapacity(ptr, &msg->RelativeMMECapacity) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RELATIVEMMECAPACITY == ie_id) { + if (liblte_s1ap_unpack_relativemmecapacity(ptr, &msg->RelativeMMECapacity) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->RelativeMMECapacity_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -32938,47 +29726,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdate( /******************************************************************************* /* Protocol Message MMEConfigurationUpdateAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdateacknowledge( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmeconfigurationupdateacknowledge(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -32990,28 +29775,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdateacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdateacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmeconfigurationupdateacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33020,17 +29803,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdateacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCriticalityDiagnostics) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -33041,66 +29824,61 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdateacknowledge( /******************************************************************************* /* Protocol Message MMEConfigurationUpdateFailure STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdatefailure( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmeconfigurationupdatefailure(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->TimeToWait_present) + if (!msg->TimeToWait_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TimeToWait - if(msg->TimeToWait_present) { - + if (msg->TimeToWait_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_timetowait(&msg->TimeToWait, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TIMETOWAIT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TIMETOWAIT, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33108,18 +29886,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdatefailure( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33131,29 +29908,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationupdatefailure( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdatefailure( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmeconfigurationupdatefailure(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONUPDATEFAILURE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->TimeToWait_present = false; + msg->TimeToWait_present = false; msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationUpdateFailureIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33162,28 +29937,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdatefailure( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCause) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { - if(liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TIMETOWAIT == ie_id) { + if (liblte_s1ap_unpack_timetowait(ptr, &msg->TimeToWait) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TimeToWait_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -33194,121 +29969,115 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationupdatefailure( /******************************************************************************* /* Protocol Message UplinkS1cdma2000tunneling STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( - LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling(LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkS1cdma2000tunnelingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 9; - if(!msg->cdma2000HORequiredIndication_present) + if (!msg->cdma2000HORequiredIndication_present) n_ie--; - if(!msg->cdma2000OneXSRVCCInfo_present) + if (!msg->cdma2000OneXSRVCCInfo_present) n_ie--; - if(!msg->cdma2000OneXRAND_present) + if (!msg->cdma2000OneXRAND_present) n_ie--; - if(!msg->EUTRANRoundTripDelayEstimationInfo_present) + if (!msg->EUTRANRoundTripDelayEstimationInfo_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - cdma2000RATType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000rattype(&msg->cdma2000RATType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000rattype(&msg->cdma2000RATType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - cdma2000SectorID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000sectorid(&msg->cdma2000SectorID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000sectorid(&msg->cdma2000SectorID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000SECTORID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000SECTORID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - cdma2000HORequiredIndication - if(msg->cdma2000HORequiredIndication_present) { - + if (msg->cdma2000HORequiredIndication_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000horequiredindication(&msg->cdma2000HORequiredIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000horequiredindication(&msg->cdma2000HORequiredIndication, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33316,18 +30085,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( } // ProtocolIE - cdma2000OneXSRVCCInfo - if(msg->cdma2000OneXSRVCCInfo_present) { - + if (msg->cdma2000OneXSRVCCInfo_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000onexsrvccinfo(&msg->cdma2000OneXSRVCCInfo, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000onexsrvccinfo(&msg->cdma2000OneXSRVCCInfo, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33335,18 +30103,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( } // ProtocolIE - cdma2000OneXRAND - if(msg->cdma2000OneXRAND_present) { - + if (msg->cdma2000OneXRAND_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000onexrand(&msg->cdma2000OneXRAND, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000onexrand(&msg->cdma2000OneXRAND, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33354,35 +30121,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( } // ProtocolIE - cdma2000PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000pdu(&msg->cdma2000PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000pdu(&msg->cdma2000PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRANRoundTripDelayEstimationInfo - if(msg->EUTRANRoundTripDelayEstimationInfo_present) { - + if (msg->EUTRANRoundTripDelayEstimationInfo_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutranroundtripdelayestimationinfo(&msg->EUTRANRoundTripDelayEstimationInfo, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutranroundtripdelayestimationinfo(&msg->EUTRANRoundTripDelayEstimationInfo, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33394,31 +30160,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinks1cdma2000tunneling( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinks1cdma2000tunneling( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uplinks1cdma2000tunneling(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UPLINKS1CDMA2000TUNNELING_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->cdma2000HORequiredIndication_present = false; - msg->cdma2000OneXSRVCCInfo_present = false; - msg->cdma2000OneXRAND_present = false; + msg->cdma2000HORequiredIndication_present = false; + msg->cdma2000OneXSRVCCInfo_present = false; + msg->cdma2000OneXRAND_present = false; msg->EUTRANRoundTripDelayEstimationInfo_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkS1cdma2000tunnelingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33427,60 +30190,62 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinks1cdma2000tunneling( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE == ie_id) { - if(liblte_s1ap_unpack_cdma2000rattype(ptr, &msg->cdma2000RATType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE == ie_id) { + if (liblte_s1ap_unpack_cdma2000rattype(ptr, &msg->cdma2000RATType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CDMA2000SECTORID == ie_id) { - if(liblte_s1ap_unpack_cdma2000sectorid(ptr, &msg->cdma2000SectorID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000SECTORID == ie_id) { + if (liblte_s1ap_unpack_cdma2000sectorid(ptr, &msg->cdma2000SectorID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION == ie_id) { - if(liblte_s1ap_unpack_cdma2000horequiredindication(ptr, &msg->cdma2000HORequiredIndication) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000HOREQUIREDINDICATION == ie_id) { + if (liblte_s1ap_unpack_cdma2000horequiredindication(ptr, &msg->cdma2000HORequiredIndication) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->cdma2000HORequiredIndication_present = true; - } else if(LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO == ie_id) { - if(liblte_s1ap_unpack_cdma2000onexsrvccinfo(ptr, &msg->cdma2000OneXSRVCCInfo) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000ONEXSRVCCINFO == ie_id) { + if (liblte_s1ap_unpack_cdma2000onexsrvccinfo(ptr, &msg->cdma2000OneXSRVCCInfo) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->cdma2000OneXSRVCCInfo_present = true; - } else if(LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND == ie_id) { - if(liblte_s1ap_unpack_cdma2000onexrand(ptr, &msg->cdma2000OneXRAND) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000ONEXRAND == ie_id) { + if (liblte_s1ap_unpack_cdma2000onexrand(ptr, &msg->cdma2000OneXRAND) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->cdma2000OneXRAND_present = true; - } else if(LIBLTE_S1AP_IE_ID_CDMA2000PDU == ie_id) { - if(liblte_s1ap_unpack_cdma2000pdu(ptr, &msg->cdma2000PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000PDU == ie_id) { + if (liblte_s1ap_unpack_cdma2000pdu(ptr, &msg->cdma2000PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO == ie_id) { - if(liblte_s1ap_unpack_eutranroundtripdelayestimationinfo(ptr, &msg->EUTRANRoundTripDelayEstimationInfo) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRANROUNDTRIPDELAYESTIMATIONINFO == ie_id) { + if (liblte_s1ap_unpack_eutranroundtripdelayestimationinfo(ptr, &msg->EUTRANRoundTripDelayEstimationInfo) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->EUTRANRoundTripDelayEstimationInfo_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -33491,20 +30256,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinks1cdma2000tunneling( /******************************************************************************* /* Protocol Message UECapabilityInfoIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecapabilityinfoindication( - LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uecapabilityinfoindication(LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UECapabilityInfoIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -33515,54 +30277,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecapabilityinfoindication( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UERadioCapability - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33573,27 +30332,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uecapabilityinfoindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecapabilityinfoindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uecapabilityinfoindication(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UECAPABILITYINFOINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UECapabilityInfoIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33602,26 +30358,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecapabilityinfoindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { - if(liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { + if (liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -33632,20 +30388,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uecapabilityinfoindication( /******************************************************************************* /* Protocol Message ENBStatusTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer( - LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer(LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBStatusTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -33656,54 +30408,53 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_StatusTransfer_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_statustransfer_transparentcontainer(&msg->eNB_StatusTransfer_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_statustransfer_transparentcontainer(&msg->eNB_StatusTransfer_TransparentContainer, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33714,27 +30465,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbstatustransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_ENBSTATUSTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBStatusTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33743,26 +30490,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_enb_statustransfer_transparentcontainer(ptr, &msg->eNB_StatusTransfer_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( + ptr, &msg->eNB_StatusTransfer_TransparentContainer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -33773,20 +30521,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbstatustransfer( /******************************************************************************* /* Protocol Message MMEStatusTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer( - LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer(LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEStatusTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -33797,54 +30541,53 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_StatusTransfer_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_statustransfer_transparentcontainer(&msg->eNB_StatusTransfer_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_statustransfer_transparentcontainer(&msg->eNB_StatusTransfer_TransparentContainer, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33855,27 +30598,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmestatustransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_MMESTATUSTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEStatusTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -33884,26 +30623,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_enb_statustransfer_transparentcontainer(ptr, &msg->eNB_StatusTransfer_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_STATUSTRANSFER_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_enb_statustransfer_transparentcontainer( + ptr, &msg->eNB_StatusTransfer_TransparentContainer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -33914,20 +30654,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmestatustransfer( /******************************************************************************* /* Protocol Message TraceStart STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart( - LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart(LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceStartIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -33938,54 +30674,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TraceActivation - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRACEACTIVATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TRACEACTIVATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -33996,27 +30729,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracestart( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TRACESTART_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceStartIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34025,26 +30754,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { - if(liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { + if (liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -34055,20 +30784,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracestart( /******************************************************************************* /* Protocol Message TraceFailureIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication( - LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication(LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceFailureIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -34079,71 +30805,66 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_UTRAN_Trace_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34154,27 +30875,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_tracefailureindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_TRACEFAILUREINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TraceFailureIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34183,31 +30901,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { - if(liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { + if (liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -34218,20 +30936,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_tracefailureindication( /******************************************************************************* /* Protocol Message DeactivateTrace STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace( - LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace(LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DeactivateTraceIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -34242,54 +30956,51 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_UTRAN_Trace_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34300,27 +31011,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_deactivatetrace( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_DEACTIVATETRACE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DeactivateTraceIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34329,26 +31036,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { - if(liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { + if (liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -34359,132 +31066,122 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_deactivatetrace( /******************************************************************************* /* Protocol Message CellTrafficTrace STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltraffictrace( - LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltraffictrace(LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellTrafficTraceIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 6; - if(!msg->PrivacyIndicator_present) + if (!msg->PrivacyIndicator_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_UTRAN_Trace_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_utran_trace_id(&msg->E_UTRAN_Trace_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TraceCollectionEntityIPAddress - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_transportlayeraddress(&msg->TraceCollectionEntityIPAddress, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_transportlayeraddress(&msg->TraceCollectionEntityIPAddress, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - PrivacyIndicator - if(msg->PrivacyIndicator_present) { - + if (msg->PrivacyIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_privacyindicator(&msg->PrivacyIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_privacyindicator(&msg->PrivacyIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34496,28 +31193,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_celltraffictrace( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_CELLTRAFFICTRACE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->PrivacyIndicator_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("CellTrafficTraceIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34526,42 +31219,42 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { - if(liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_UTRAN_TRACE_ID == ie_id) { + if (liblte_s1ap_unpack_e_utran_trace_id(ptr, &msg->E_UTRAN_Trace_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS == ie_id) { - if(liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->TraceCollectionEntityIPAddress) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TRACECOLLECTIONENTITYIPADDRESS == ie_id) { + if (liblte_s1ap_unpack_transportlayeraddress(ptr, &msg->TraceCollectionEntityIPAddress) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR == ie_id) { - if(liblte_s1ap_unpack_privacyindicator(ptr, &msg->PrivacyIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_PRIVACYINDICATOR == ie_id) { + if (liblte_s1ap_unpack_privacyindicator(ptr, &msg->PrivacyIndicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->PrivacyIndicator_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -34572,20 +31265,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_celltraffictrace( /******************************************************************************* /* Protocol Message LocationReportingControl STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportingControlIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -34596,54 +31286,50 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - RequestType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REQUESTTYPE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REQUESTTYPE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34654,27 +31340,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingcontrol( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGCONTROL_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportingControlIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34683,26 +31366,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { - if(liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { + if (liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -34713,20 +31396,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingcontrol( /******************************************************************************* /* Protocol Message LocationReportingFailureIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingfailureindication( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_locationreportingfailureindication(LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportingFailureIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -34737,54 +31418,50 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingfailureindication( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34796,26 +31473,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreportingfailureindication( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOCATIONREPORTINGFAILUREINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportingFailureIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34824,26 +31498,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -34854,20 +31528,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreportingfailureindication( /******************************************************************************* /* Protocol Message LocationReport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport( - LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport(LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -34878,88 +31548,80 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - RequestType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REQUESTTYPE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REQUESTTYPE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -34970,27 +31632,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_locationreport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_LOCATIONREPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("LocationReportIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -34999,36 +31657,36 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAI == ie_id) { - if(liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAI == ie_id) { + if (liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { - if(liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { + if (liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -35039,66 +31697,60 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_locationreport( /******************************************************************************* /* Protocol Message OverloadStart STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart( - LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart(LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("OverloadStartIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 3; - if(!msg->GUMMEIList_present) + if (!msg->GUMMEIList_present) n_ie--; - if(!msg->TrafficLoadReductionIndication_present) + if (!msg->TrafficLoadReductionIndication_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - OverloadResponse - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_overloadresponse(&msg->OverloadResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_overloadresponse(&msg->OverloadResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_OVERLOADRESPONSE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_OVERLOADRESPONSE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - GUMMEIList - if(msg->GUMMEIList_present) { - + if (msg->GUMMEIList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummeilist(&msg->GUMMEIList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummeilist(&msg->GUMMEIList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEILIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEILIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35106,18 +31758,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart( } // ProtocolIE - TrafficLoadReductionIndication - if(msg->TrafficLoadReductionIndication_present) { - + if (msg->TrafficLoadReductionIndication_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_trafficloadreductionindication(&msg->TrafficLoadReductionIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_trafficloadreductionindication(&msg->TrafficLoadReductionIndication, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35129,29 +31782,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstart( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_OVERLOADSTART_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->GUMMEIList_present = false; + msg->GUMMEIList_present = false; msg->TrafficLoadReductionIndication_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("OverloadStartIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -35160,28 +31809,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iOverloadResponse) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_OVERLOADRESPONSE == ie_id) { + if (liblte_s1ap_unpack_overloadresponse(ptr, &msg->OverloadResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_GUMMEILIST == ie_id) { - if(liblte_s1ap_unpack_gummeilist(ptr, &msg->GUMMEIList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GUMMEILIST == ie_id) { + if (liblte_s1ap_unpack_gummeilist(ptr, &msg->GUMMEIList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEIList_present = true; - } else if(LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION == ie_id) { - if(liblte_s1ap_unpack_trafficloadreductionindication(ptr, &msg->TrafficLoadReductionIndication) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TRAFFICLOADREDUCTIONINDICATION == ie_id) { + if (liblte_s1ap_unpack_trafficloadreductionindication(ptr, &msg->TrafficLoadReductionIndication) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TrafficLoadReductionIndication_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -35192,47 +31842,42 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstart( /******************************************************************************* /* Protocol Message OverloadStop STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstop( - LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstop(LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("OverloadStopIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->GUMMEIList_present) + if (!msg->GUMMEIList_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - GUMMEIList - if(msg->GUMMEIList_present) { - + if (msg->GUMMEIList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummeilist(&msg->GUMMEIList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummeilist(&msg->GUMMEIList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEILIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEILIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35244,28 +31889,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_overloadstop( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_OVERLOADSTOP_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->GUMMEIList_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("OverloadStopIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -35274,17 +31915,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iGUMMEIList) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_GUMMEILIST == ie_id) { + if (liblte_s1ap_unpack_gummeilist(ptr, &msg->GUMMEIList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEIList_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -35295,93 +31936,87 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_overloadstop( /******************************************************************************* /* Protocol Message WriteReplaceWarningRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_writereplacewarningrequest(LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("WriteReplaceWarningRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 11; - if(!msg->WarningAreaList_present) + if (!msg->WarningAreaList_present) n_ie--; - if(!msg->ExtendedRepetitionPeriod_present) + if (!msg->ExtendedRepetitionPeriod_present) n_ie--; - if(!msg->WarningType_present) + if (!msg->WarningType_present) n_ie--; - if(!msg->WarningSecurityInfo_present) + if (!msg->WarningSecurityInfo_present) n_ie--; - if(!msg->DataCodingScheme_present) + if (!msg->DataCodingScheme_present) n_ie--; - if(!msg->WarningMessageContents_present) + if (!msg->WarningMessageContents_present) n_ie--; - if(!msg->ConcurrentWarningMessageIndicator_present) + if (!msg->ConcurrentWarningMessageIndicator_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MessageIdentifier - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SerialNumber - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERIALNUMBER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERIALNUMBER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - WarningAreaList - if(msg->WarningAreaList_present) { - + if (msg->WarningAreaList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_warningarealist(&msg->WarningAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_warningarealist(&msg->WarningAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_WARNINGAREALIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_WARNINGAREALIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35389,35 +32024,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - RepetitionPeriod - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_repetitionperiod(&msg->RepetitionPeriod, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_repetitionperiod(&msg->RepetitionPeriod, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REPETITIONPERIOD, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REPETITIONPERIOD, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - ExtendedRepetitionPeriod - if(msg->ExtendedRepetitionPeriod_present) { - + if (msg->ExtendedRepetitionPeriod_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_extendedrepetitionperiod(&msg->ExtendedRepetitionPeriod, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_extendedrepetitionperiod(&msg->ExtendedRepetitionPeriod, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35425,35 +32058,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - NumberofBroadcastRequest - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_numberofbroadcastrequest(&msg->NumberofBroadcastRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_numberofbroadcastrequest(&msg->NumberofBroadcastRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - WarningType - if(msg->WarningType_present) { - + if (msg->WarningType_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_warningtype(&msg->WarningType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_warningtype(&msg->WarningType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_WARNINGTYPE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_WARNINGTYPE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35461,18 +32092,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - WarningSecurityInfo - if(msg->WarningSecurityInfo_present) { - + if (msg->WarningSecurityInfo_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_warningsecurityinfo(&msg->WarningSecurityInfo, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_warningsecurityinfo(&msg->WarningSecurityInfo, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35480,18 +32110,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - DataCodingScheme - if(msg->DataCodingScheme_present) { - + if (msg->DataCodingScheme_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_datacodingscheme(&msg->DataCodingScheme, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_datacodingscheme(&msg->DataCodingScheme, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_DATACODINGSCHEME, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_DATACODINGSCHEME, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35499,18 +32128,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - WarningMessageContents - if(msg->WarningMessageContents_present) { - + if (msg->WarningMessageContents_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_warningmessagecontents(&msg->WarningMessageContents, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_warningmessagecontents(&msg->WarningMessageContents, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35518,18 +32146,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( } // ProtocolIE - ConcurrentWarningMessageIndicator - if(msg->ConcurrentWarningMessageIndicator_present) { - + if (msg->ConcurrentWarningMessageIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_concurrentwarningmessageindicator(&msg->ConcurrentWarningMessageIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_concurrentwarningmessageindicator(&msg->ConcurrentWarningMessageIndicator, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35541,34 +32170,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_writereplacewarningrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->WarningAreaList_present = false; - msg->ExtendedRepetitionPeriod_present = false; - msg->WarningType_present = false; - msg->WarningSecurityInfo_present = false; - msg->DataCodingScheme_present = false; - msg->WarningMessageContents_present = false; + msg->WarningAreaList_present = false; + msg->ExtendedRepetitionPeriod_present = false; + msg->WarningType_present = false; + msg->WarningSecurityInfo_present = false; + msg->DataCodingScheme_present = false; + msg->WarningMessageContents_present = false; msg->ConcurrentWarningMessageIndicator_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("WriteReplaceWarningRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -35577,73 +32203,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMessageIdentifier) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER == ie_id) { + if (liblte_s1ap_unpack_messageidentifier(ptr, &msg->MessageIdentifier) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { - if(liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { + if (liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_WARNINGAREALIST == ie_id) { - if(liblte_s1ap_unpack_warningarealist(ptr, &msg->WarningAreaList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_WARNINGAREALIST == ie_id) { + if (liblte_s1ap_unpack_warningarealist(ptr, &msg->WarningAreaList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->WarningAreaList_present = true; - } else if(LIBLTE_S1AP_IE_ID_REPETITIONPERIOD == ie_id) { - if(liblte_s1ap_unpack_repetitionperiod(ptr, &msg->RepetitionPeriod) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REPETITIONPERIOD == ie_id) { + if (liblte_s1ap_unpack_repetitionperiod(ptr, &msg->RepetitionPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD == ie_id) { - if(liblte_s1ap_unpack_extendedrepetitionperiod(ptr, &msg->ExtendedRepetitionPeriod) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EXTENDEDREPETITIONPERIOD == ie_id) { + if (liblte_s1ap_unpack_extendedrepetitionperiod(ptr, &msg->ExtendedRepetitionPeriod) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ExtendedRepetitionPeriod_present = true; - } else if(LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST == ie_id) { - if(liblte_s1ap_unpack_numberofbroadcastrequest(ptr, &msg->NumberofBroadcastRequest) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NUMBEROFBROADCASTREQUEST == ie_id) { + if (liblte_s1ap_unpack_numberofbroadcastrequest(ptr, &msg->NumberofBroadcastRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_WARNINGTYPE == ie_id) { - if(liblte_s1ap_unpack_warningtype(ptr, &msg->WarningType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_WARNINGTYPE == ie_id) { + if (liblte_s1ap_unpack_warningtype(ptr, &msg->WarningType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->WarningType_present = true; - } else if(LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO == ie_id) { - if(liblte_s1ap_unpack_warningsecurityinfo(ptr, &msg->WarningSecurityInfo) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_WARNINGSECURITYINFO == ie_id) { + if (liblte_s1ap_unpack_warningsecurityinfo(ptr, &msg->WarningSecurityInfo) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->WarningSecurityInfo_present = true; - } else if(LIBLTE_S1AP_IE_ID_DATACODINGSCHEME == ie_id) { - if(liblte_s1ap_unpack_datacodingscheme(ptr, &msg->DataCodingScheme) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_DATACODINGSCHEME == ie_id) { + if (liblte_s1ap_unpack_datacodingscheme(ptr, &msg->DataCodingScheme) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->DataCodingScheme_present = true; - } else if(LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS == ie_id) { - if(liblte_s1ap_unpack_warningmessagecontents(ptr, &msg->WarningMessageContents) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_WARNINGMESSAGECONTENTS == ie_id) { + if (liblte_s1ap_unpack_warningmessagecontents(ptr, &msg->WarningMessageContents) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->WarningMessageContents_present = true; - } else if(LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR == ie_id) { - if(liblte_s1ap_unpack_concurrentwarningmessageindicator(ptr, &msg->ConcurrentWarningMessageIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CONCURRENTWARNINGMESSAGEINDICATOR == ie_id) { + if (liblte_s1ap_unpack_concurrentwarningmessageindicator(ptr, &msg->ConcurrentWarningMessageIndicator) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ConcurrentWarningMessageIndicator_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -35654,83 +32281,77 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningrequest( /******************************************************************************* /* Protocol Message WriteReplaceWarningResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningresponse( - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_writereplacewarningresponse(LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("WriteReplaceWarningResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->BroadcastCompletedAreaList_present) + if (!msg->BroadcastCompletedAreaList_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MessageIdentifier - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SerialNumber - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERIALNUMBER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERIALNUMBER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - BroadcastCompletedAreaList - if(msg->BroadcastCompletedAreaList_present) { - + if (msg->BroadcastCompletedAreaList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_broadcastcompletedarealist(&msg->BroadcastCompletedAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_broadcastcompletedarealist(&msg->BroadcastCompletedAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35738,18 +32359,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35761,29 +32381,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_writereplacewarningresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_writereplacewarningresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_WRITEREPLACEWARNINGRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->BroadcastCompletedAreaList_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("WriteReplaceWarningResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -35792,33 +32410,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMessageIdentifier) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER == ie_id) { + if (liblte_s1ap_unpack_messageidentifier(ptr, &msg->MessageIdentifier) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { - if(liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { + if (liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST == ie_id) { - if(liblte_s1ap_unpack_broadcastcompletedarealist(ptr, &msg->BroadcastCompletedAreaList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_BROADCASTCOMPLETEDAREALIST == ie_id) { + if (liblte_s1ap_unpack_broadcastcompletedarealist(ptr, &msg->BroadcastCompletedAreaList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->BroadcastCompletedAreaList_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -35829,20 +32447,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_writereplacewarningresponse( /******************************************************************************* /* Protocol Message MMEDirectInformationTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmedirectinformationtransfer( - LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_mmedirectinformationtransfer(LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEDirectInformationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -35853,20 +32469,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmedirectinformationtransfer( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Inter_SystemInformationTransferTypeMDT - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_inter_systeminformationtransfertype(&msg->Inter_SystemInformationTransferTypeMDT, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_inter_systeminformationtransfertype(&msg->Inter_SystemInformationTransferTypeMDT, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEMDT, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEMDT, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35877,27 +32494,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmedirectinformationtransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmedirectinformationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_mmedirectinformationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMEDIRECTINFORMATIONTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEDirectInformationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -35906,16 +32521,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmedirectinformationtransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iInter_SystemInformationTransferTypeMDT) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEMDT == ie_id) { + if (liblte_s1ap_unpack_inter_systeminformationtransfertype(ptr, &msg->Inter_SystemInformationTransferTypeMDT) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -35926,47 +32542,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmedirectinformationtransfer( /******************************************************************************* /* Protocol Message ENBConfigurationTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationtransfer( - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationtransfer(LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->SONConfigurationTransferECT_present) + if (!msg->SONConfigurationTransferECT_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - SONConfigurationTransferECT - if(msg->SONConfigurationTransferECT_present) { - + if (msg->SONConfigurationTransferECT_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_sonconfigurationtransfer(&msg->SONConfigurationTransferECT, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_sonconfigurationtransfer(&msg->SONConfigurationTransferECT, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERECT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERECT, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -35978,28 +32590,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbconfigurationtransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBCONFIGURATIONTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->SONConfigurationTransferECT_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBConfigurationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36008,17 +32617,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iSONConfigurationTransferECT) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERECT == ie_id) { + if (liblte_s1ap_unpack_sonconfigurationtransfer(ptr, &msg->SONConfigurationTransferECT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SONConfigurationTransferECT_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -36029,47 +32638,43 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbconfigurationtransfer( /******************************************************************************* /* Protocol Message MMEConfigurationTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationtransfer( - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationtransfer(LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 1; - if(!msg->SONConfigurationTransferMCT_present) + if (!msg->SONConfigurationTransferMCT_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - SONConfigurationTransferMCT - if(msg->SONConfigurationTransferMCT_present) { - + if (msg->SONConfigurationTransferMCT_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_sonconfigurationtransfer(&msg->SONConfigurationTransferMCT, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_sonconfigurationtransfer(&msg->SONConfigurationTransferMCT, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERMCT, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERMCT, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36081,28 +32686,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_mmeconfigurationtransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_MMECONFIGURATIONTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->SONConfigurationTransferMCT_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("MMEConfigurationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36111,17 +32713,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iSONConfigurationTransferMCT) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_SONCONFIGURATIONTRANSFERMCT == ie_id) { + if (liblte_s1ap_unpack_sonconfigurationtransfer(ptr, &msg->SONConfigurationTransferMCT) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SONConfigurationTransferMCT_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -36132,20 +32734,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_mmeconfigurationtransfer( /******************************************************************************* /* Protocol Message PrivateMessage STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( - LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage(LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PrivateMessageIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -36156,34 +32754,30 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_privatemessage( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; err = LIBLTE_SUCCESS; } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PRIVATEMESSAGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PrivateMessageIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36191,7 +32785,6 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( // No. of ProtocolIE-Container n_ie = liblte_bits_2_value(ptr, 16); - err = LIBLTE_SUCCESS; } return err; @@ -36200,83 +32793,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_privatemessage( /******************************************************************************* /* Protocol Message KillRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest( - LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest(LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("KillRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->WarningAreaList_present) + if (!msg->WarningAreaList_present) n_ie--; - if(!msg->KillAllWarningMessages_present) + if (!msg->KillAllWarningMessages_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MessageIdentifier - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SerialNumber - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERIALNUMBER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERIALNUMBER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - WarningAreaList - if(msg->WarningAreaList_present) { - + if (msg->WarningAreaList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_warningarealist(&msg->WarningAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_warningarealist(&msg->WarningAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_WARNINGAREALIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_WARNINGAREALIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36284,18 +32870,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest( } // ProtocolIE - KillAllWarningMessages - if(msg->KillAllWarningMessages_present) { - + if (msg->KillAllWarningMessages_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_killallwarningmessages(&msg->KillAllWarningMessages, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_killallwarningmessages(&msg->KillAllWarningMessages, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36307,29 +32892,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_killrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_KILLREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->WarningAreaList_present = false; + msg->WarningAreaList_present = false; msg->KillAllWarningMessages_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("KillRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36338,33 +32919,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMessageIdentifier) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER == ie_id) { + if (liblte_s1ap_unpack_messageidentifier(ptr, &msg->MessageIdentifier) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { - if(liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { + if (liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_WARNINGAREALIST == ie_id) { - if(liblte_s1ap_unpack_warningarealist(ptr, &msg->WarningAreaList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_WARNINGAREALIST == ie_id) { + if (liblte_s1ap_unpack_warningarealist(ptr, &msg->WarningAreaList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->WarningAreaList_present = true; - } else if(LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES == ie_id) { - if(liblte_s1ap_unpack_killallwarningmessages(ptr, &msg->KillAllWarningMessages) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_KILLALLWARNINGMESSAGES == ie_id) { + if (liblte_s1ap_unpack_killallwarningmessages(ptr, &msg->KillAllWarningMessages) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->KillAllWarningMessages_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -36375,83 +32956,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killrequest( /******************************************************************************* /* Protocol Message KillResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse( - LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse(LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("KillResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->BroadcastCancelledAreaList_present) + if (!msg->BroadcastCancelledAreaList_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MessageIdentifier - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_messageidentifier(&msg->MessageIdentifier, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SerialNumber - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_serialnumber(&msg->SerialNumber, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SERIALNUMBER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SERIALNUMBER, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - BroadcastCancelledAreaList - if(msg->BroadcastCancelledAreaList_present) { - + if (msg->BroadcastCancelledAreaList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_broadcastcancelledarealist(&msg->BroadcastCancelledAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_broadcastcancelledarealist(&msg->BroadcastCancelledAreaList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36459,18 +33033,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36482,29 +33055,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_killresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_KILLRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->BroadcastCancelledAreaList_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("KillResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36513,33 +33082,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMessageIdentifier) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MESSAGEIDENTIFIER == ie_id) { + if (liblte_s1ap_unpack_messageidentifier(ptr, &msg->MessageIdentifier) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { - if(liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SERIALNUMBER == ie_id) { + if (liblte_s1ap_unpack_serialnumber(ptr, &msg->SerialNumber) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST == ie_id) { - if(liblte_s1ap_unpack_broadcastcancelledarealist(ptr, &msg->BroadcastCancelledAreaList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_BROADCASTCANCELLEDAREALIST == ie_id) { + if (liblte_s1ap_unpack_broadcastcancelledarealist(ptr, &msg->BroadcastCancelledAreaList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->BroadcastCancelledAreaList_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -36550,98 +33119,93 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_killresponse( /******************************************************************************* /* Protocol Message PWSRestartIndication STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pwsrestartindication( - LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pwsrestartindication(LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PWSRestartIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->EmergencyAreaIDListForRestart_present) + if (!msg->EmergencyAreaIDListForRestart_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - ECGIListForRestart - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ecgilistforrestart(&msg->ECGIListForRestart, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ecgilistforrestart(&msg->ECGIListForRestart, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ECGILISTFORRESTART, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ECGILISTFORRESTART, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Global_ENB_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_global_enb_id(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_global_enb_id(&msg->Global_ENB_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAIListForRestart - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tailistforrestart(&msg->TAIListForRestart, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tailistforrestart(&msg->TAIListForRestart, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAILISTFORRESTART, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAILISTFORRESTART, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EmergencyAreaIDListForRestart - if(msg->EmergencyAreaIDListForRestart_present) { - + if (msg->EmergencyAreaIDListForRestart_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_emergencyareaidlistforrestart(&msg->EmergencyAreaIDListForRestart, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_emergencyareaidlistforrestart(&msg->EmergencyAreaIDListForRestart, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36653,28 +33217,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pwsrestartindication( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PWSRESTARTINDICATION_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->EmergencyAreaIDListForRestart_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PWSRestartIndicationIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36683,32 +33244,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iECGIListForRestart) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ECGILISTFORRESTART == ie_id) { + if (liblte_s1ap_unpack_ecgilistforrestart(ptr, &msg->ECGIListForRestart) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID == ie_id) { - if(liblte_s1ap_unpack_global_enb_id(ptr, &msg->Global_ENB_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GLOBAL_ENB_ID == ie_id) { + if (liblte_s1ap_unpack_global_enb_id(ptr, &msg->Global_ENB_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAILISTFORRESTART == ie_id) { - if(liblte_s1ap_unpack_tailistforrestart(ptr, &msg->TAIListForRestart) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAILISTFORRESTART == ie_id) { + if (liblte_s1ap_unpack_tailistforrestart(ptr, &msg->TAIListForRestart) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART == ie_id) { - if(liblte_s1ap_unpack_emergencyareaidlistforrestart(ptr, &msg->EmergencyAreaIDListForRestart) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EMERGENCYAREAIDLISTFORRESTART == ie_id) { + if (liblte_s1ap_unpack_emergencyareaidlistforrestart(ptr, &msg->EmergencyAreaIDListForRestart) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->EmergencyAreaIDListForRestart_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -36719,20 +33281,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pwsrestartindication( /******************************************************************************* /* Protocol Message DownlinkUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinkueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_downlinkueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -36743,71 +33303,65 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinkueassociatedlppatransport( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Routing_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ROUTING_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ROUTING_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - LPPa_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LPPA_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LPPA_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36818,27 +33372,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinkueassociatedlppatransport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinkueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_downlinkueassociatedlppatransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -36847,31 +33399,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinkueassociatedlppatransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { - if(liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { + if (liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { - if(liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { + if (liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -36882,20 +33434,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinkueassociatedlppatransport( /******************************************************************************* /* Protocol Message UplinkUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinkueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uplinkueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -36906,71 +33456,65 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinkueassociatedlppatransport( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Routing_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ROUTING_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ROUTING_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - LPPa_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LPPA_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LPPA_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -36981,27 +33525,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinkueassociatedlppatransport( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinkueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_uplinkueassociatedlppatransport(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_UPLINKUEASSOCIATEDLPPATRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37010,31 +33552,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinkueassociatedlppatransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { - if(liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { + if (liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { - if(liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { + if (liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37046,19 +33588,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinkueassociatedlppatransport( /* Protocol Message DownlinkNonUEAssociatedLPPaTransport STRUCT ********************************************************************************/ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *msg, - uint8_t **ptr) + LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkNonUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37069,37 +33608,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Routing_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ROUTING_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ROUTING_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - LPPa_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LPPA_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LPPA_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37111,26 +33646,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinknonueassociatedlppatransport( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkNonUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37139,21 +33671,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iRouting_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { + if (liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { - if(liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { + if (liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37164,20 +33696,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinknonueassociatedlppatransport( /******************************************************************************* /* Protocol Message UplinkNonUEAssociatedLPPaTransport STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknonueassociatedlppatransport( - LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_uplinknonueassociatedlppatransport(LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkNonUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37188,37 +33718,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknonueassociatedlppatransport( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Routing_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_routing_id(&msg->Routing_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ROUTING_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ROUTING_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - LPPa_PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lppa_pdu(&msg->LPPa_PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LPPA_PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LPPA_PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37230,26 +33756,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_uplinknonueassociatedlppatransport( } LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT *msg) + uint8_t** ptr, LIBLTE_S1AP_MESSAGE_UPLINKNONUEASSOCIATEDLPPATRANSPORT_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("UplinkNonUEAssociatedLPPaTransport-IEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37258,21 +33781,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iRouting_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ROUTING_ID == ie_id) { + if (liblte_s1ap_unpack_routing_id(ptr, &msg->Routing_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { - if(liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LPPA_PDU == ie_id) { + if (liblte_s1ap_unpack_lppa_pdu(ptr, &msg->LPPa_PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37283,20 +33806,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_uplinknonueassociatedlppatransport( /******************************************************************************* /* Protocol Message ENBDirectInformationTransfer STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbdirectinformationtransfer( - LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_enbdirectinformationtransfer(LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBDirectInformationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37307,20 +33828,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbdirectinformationtransfer( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Inter_SystemInformationTransferTypeEDT - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_inter_systeminformationtransfertype(&msg->Inter_SystemInformationTransferTypeEDT, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_inter_systeminformationtransfertype(&msg->Inter_SystemInformationTransferTypeEDT, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEEDT, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEEDT, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37331,27 +33853,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_enbdirectinformationtransfer( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbdirectinformationtransfer( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_enbdirectinformationtransfer(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_ENBDIRECTINFORMATIONTRANSFER_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ENBDirectInformationTransferIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37360,16 +33880,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbdirectinformationtransfer( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iInter_SystemInformationTransferTypeEDT) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_INTER_SYSTEMINFORMATIONTRANSFERTYPEEDT == ie_id) { + if (liblte_s1ap_unpack_inter_systeminformationtransfertype(ptr, &msg->Inter_SystemInformationTransferTypeEDT) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37380,20 +33901,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_enbdirectinformationtransfer( /******************************************************************************* /* Protocol Message E_RABDataForwardingItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem(LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABDataForwardingItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37404,20 +33922,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABDataForwardingItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabdataforwardingitem(&msg->E_RABDataForwardingItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabdataforwardingitem(&msg->E_RABDataForwardingItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37428,27 +33945,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabdataforwardingitem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABDATAFORWARDINGITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABDataForwardingItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37457,16 +33971,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABDataForwardingItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABDATAFORWARDINGITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabdataforwardingitem(ptr, &msg->E_RABDataForwardingItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37477,20 +33991,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabdataforwardingitem( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemHOReq STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemHOReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37501,20 +34012,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeSetupItemHOReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitemhoreq(&msg->E_RABToBeSetupItemHOReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitemhoreq(&msg->E_RABToBeSetupItemHOReq, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37525,27 +34035,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemhoreq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMHOREQ_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemHOReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37554,16 +34061,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeSetupItemHOReq) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMHOREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetupitemhoreq(ptr, &msg->E_RABToBeSetupItemHOReq) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37574,20 +34081,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemhoreq( /******************************************************************************* /* Protocol Message E_RABAdmittedItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem(LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABAdmittedItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37598,20 +34101,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABAdmittedItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabadmitteditem(&msg->E_RABAdmittedItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabadmitteditem(&msg->E_RABAdmittedItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37622,27 +34124,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabadmitteditem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABADMITTEDITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABAdmittedItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37651,16 +34149,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABAdmittedItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABADMITTEDITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabadmitteditem(ptr, &msg->E_RABAdmittedItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37671,20 +34169,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabadmitteditem( /******************************************************************************* /* Protocol Message E_RABFailedtoSetupItemHOReqAck STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABFailedtoSetupItemHOReqAckIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37695,20 +34191,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABFailedtoSetupItemHOReqAck - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(&msg->E_RABFailedtoSetupItemHOReqAck, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack(&msg->E_RABFailedtoSetupItemHOReqAck, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37719,27 +34216,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabfailedtosetupitemhoreqack( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABFAILEDTOSETUPITEMHOREQACK_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABFailedtoSetupItemHOReqAckIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37748,16 +34243,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABFailedtoSetupItemHOReqAck) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPITEMHOREQACK == ie_id) { + if (liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack(ptr, &msg->E_RABFailedtoSetupItemHOReqAck) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37768,20 +34264,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabfailedtosetupitemhoreqack( /******************************************************************************* /* Protocol Message E_RABToBeSwitchedDLItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedDLItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37792,20 +34285,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeSwitchedDLItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitcheddlitem(&msg->E_RABToBeSwitchedDLItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitcheddlitem(&msg->E_RABToBeSwitchedDLItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37816,27 +34308,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitcheddlitem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDDLITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedDLItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37845,16 +34334,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeSwitchedDLItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabtobeswitcheddlitem(ptr, &msg->E_RABToBeSwitchedDLItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37865,20 +34354,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitcheddlitem( /******************************************************************************* /* Protocol Message E_RABToBeSwitchedULItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem(LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedULItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37889,20 +34375,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeSwitchedULItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitchedulitem(&msg->E_RABToBeSwitchedULItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitchedulitem(&msg->E_RABToBeSwitchedULItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -37913,27 +34398,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobeswitchedulitem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESWITCHEDULITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSwitchedULItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -37942,16 +34424,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeSwitchedULItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULITEM == ie_id) { + if (liblte_s1ap_unpack_e_rabtobeswitchedulitem(ptr, &msg->E_RABToBeSwitchedULItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -37962,20 +34444,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobeswitchedulitem( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemBearerSUReq STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitembearersureq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemBearerSUReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -37986,20 +34466,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeSetupItemBearerSUReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitembearersureq(&msg->E_RABToBeSetupItemBearerSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitembearersureq(&msg->E_RABToBeSetupItemBearerSUReq, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38010,27 +34490,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitembearersureq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitembearersureq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMBEARERSUREQ_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemBearerSUReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38039,16 +34517,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeSetupItemBearerSUReq) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMBEARERSUREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetupitembearersureq(ptr, &msg->E_RABToBeSetupItemBearerSUReq) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38059,20 +34538,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitembearersureq( /******************************************************************************* /* Protocol Message E_RABSetupItemBearerSURes STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemBearerSUResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38083,20 +34559,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABSetupItemBearerSURes - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetupitembearersures(&msg->E_RABSetupItemBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetupitembearersures(&msg->E_RABSetupItemBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38107,27 +34582,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitembearersures( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabsetupitembearersures(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMBEARERSURES_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemBearerSUResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38136,16 +34608,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABSetupItemBearerSURes) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABSETUPITEMBEARERSURES == ie_id) { + if (liblte_s1ap_unpack_e_rabsetupitembearersures(ptr, &msg->E_RABSetupItemBearerSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38156,20 +34628,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitembearersures( /******************************************************************************* /* Protocol Message E_RABToBeModifiedItemBearerModReq STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeModifiedItemBearerModReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38180,20 +34650,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeModifiedItemBearerModReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(&msg->E_RABToBeModifiedItemBearerModReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobemodifieditembearermodreq(&msg->E_RABToBeModifiedItemBearerModReq, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38204,27 +34675,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobemodifieditembearermodreq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBEMODIFIEDITEMBEARERMODREQ_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeModifiedItemBearerModReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38233,16 +34702,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeModifiedItemBearerModReq) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDITEMBEARERMODREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq(ptr, &msg->E_RABToBeModifiedItemBearerModReq) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38253,20 +34723,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobemodifieditembearermodreq( /******************************************************************************* /* Protocol Message E_RABModifyItemBearerModRes STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabmodifyitembearermodres(LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyItemBearerModResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38277,20 +34744,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABModifyItemBearerModRes - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabmodifyitembearermodres(&msg->E_RABModifyItemBearerModRes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabmodifyitembearermodres(&msg->E_RABModifyItemBearerModRes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38301,27 +34767,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyitembearermodres( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabmodifyitembearermodres(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYITEMBEARERMODRES_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyItemBearerModResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38330,16 +34794,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABModifyItemBearerModRes) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABMODIFYITEMBEARERMODRES == ie_id) { + if (liblte_s1ap_unpack_e_rabmodifyitembearermodres(ptr, &msg->E_RABModifyItemBearerModRes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38350,20 +34814,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyitembearermodres( /******************************************************************************* /* Protocol Message E_RABReleaseItemBearerRelComp STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseItemBearerRelCompIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38374,20 +34836,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABReleaseItemBearerRelComp - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(&msg->E_RABReleaseItemBearerRelComp, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabreleaseitembearerrelcomp(&msg->E_RABReleaseItemBearerRelComp, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38398,27 +34860,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseitembearerrelcomp( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASEITEMBEARERRELCOMP_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseItemBearerRelCompIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38427,16 +34887,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABReleaseItemBearerRelComp) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABRELEASEITEMBEARERRELCOMP == ie_id) { + if (liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp(ptr, &msg->E_RABReleaseItemBearerRelComp) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38447,20 +34908,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseitembearerrelcomp( /******************************************************************************* /* Protocol Message E_RABToBeSetupItemCtxtSUReq STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemCtxtSUReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38471,20 +34929,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABToBeSetupItemCtxtSUReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(&msg->E_RABToBeSetupItemCtxtSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetupitemctxtsureq(&msg->E_RABToBeSetupItemCtxtSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38495,27 +34952,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabtobesetupitemctxtsureq( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABTOBESETUPITEMCTXTSUREQ_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABToBeSetupItemCtxtSUReqIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38524,16 +34979,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABToBeSetupItemCtxtSUReq) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPITEMCTXTSUREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq(ptr, &msg->E_RABToBeSetupItemCtxtSUReq) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38544,20 +34999,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabtobesetupitemctxtsureq( /******************************************************************************* /* Protocol Message E_RABSetupItemCtxtSURes STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures(LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemCtxtSUResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38568,20 +35020,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - E_RABSetupItemCtxtSURes - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetupitemctxtsures(&msg->E_RABSetupItemCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetupitemctxtsures(&msg->E_RABSetupItemCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38592,27 +35043,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupitemctxtsures( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPITEMCTXTSURES_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupItemCtxtSUResIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38621,16 +35069,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iE_RABSetupItemCtxtSURes) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_E_RABSETUPITEMCTXTSURES == ie_id) { + if (liblte_s1ap_unpack_e_rabsetupitemctxtsures(ptr, &msg->E_RABSetupItemCtxtSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38641,20 +35089,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupitemctxtsures( /******************************************************************************* /* Protocol Message TAIItem STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( - LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem(LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38665,20 +35109,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - TAIItem - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_taiitem(&msg->TAIItem, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_taiitem(&msg->TAIItem, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAIITEM, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAIITEM, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38689,27 +35131,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_taiitem( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_TAIITEM_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("TAIItemIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38718,16 +35156,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iTAIItem) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_TAIITEM == ie_id) { + if (liblte_s1ap_unpack_taiitem(ptr, &msg->TAIItem) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38738,49 +35176,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_taiitem( /******************************************************************************* /* Protocol Message ResetAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge( - LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge(LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ResetAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 2; - if(!msg->UE_associatedLogicalS1_ConnectionListResAck_present) + if (!msg->UE_associatedLogicalS1_ConnectionListResAck_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - UE_associatedLogicalS1_ConnectionListResAck - if(msg->UE_associatedLogicalS1_ConnectionListResAck_present) { - + if (msg->UE_associatedLogicalS1_ConnectionListResAck_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack(&msg->UE_associatedLogicalS1_ConnectionListResAck, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ue_associatedlogicals1_connectionlistresack( + &msg->UE_associatedLogicalS1_ConnectionListResAck, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38788,18 +35223,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38811,29 +35245,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_resetacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RESETACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->UE_associatedLogicalS1_ConnectionListResAck_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ResetAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38842,23 +35272,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iUE_associatedLogicalS1_ConnectionListResAck) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_UE_ASSOCIATEDLOGICALS1_CONNECTIONLISTRESACK == ie_id) { + if (liblte_s1ap_unpack_ue_associatedlogicals1_connectionlistresack( + ptr, &msg->UE_associatedLogicalS1_ConnectionListResAck) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UE_associatedLogicalS1_ConnectionListResAck_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -38869,20 +35300,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_resetacknowledge( /******************************************************************************* /* Protocol Message Reset STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset( - LIBLTE_S1AP_MESSAGE_RESET_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset(LIBLTE_S1AP_MESSAGE_RESET_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ResetIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } @@ -38893,37 +35320,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset( // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - ResetType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_resettype(&msg->ResetType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_resettype(&msg->ResetType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_RESETTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_RESETTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -38934,27 +35357,23 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_reset( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_RESET_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_RESET_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("ResetIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -38963,21 +35382,21 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iCause) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_RESETTYPE == ie_id) { - if(liblte_s1ap_unpack_resettype(ptr, &msg->ResetType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_RESETTYPE == ie_id) { + if (liblte_s1ap_unpack_resettype(ptr, &msg->ResetType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -38988,83 +35407,79 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_reset( /******************************************************************************* /* Protocol Message DownlinkS1cdma2000tunneling STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinks1cdma2000tunneling( - LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_downlinks1cdma2000tunneling(LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkS1cdma2000tunnelingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 6; - if(!msg->E_RABSubjecttoDataForwardingList_present) + if (!msg->E_RABSubjecttoDataForwardingList_present) n_ie--; - if(!msg->cdma2000HOStatus_present) + if (!msg->cdma2000HOStatus_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABSubjecttoDataForwardingList - if(msg->E_RABSubjecttoDataForwardingList_present) { - + if (msg->E_RABSubjecttoDataForwardingList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(&msg->E_RABSubjecttoDataForwardingList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(&msg->E_RABSubjecttoDataForwardingList, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39072,18 +35487,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinks1cdma2000tunneling( } // ProtocolIE - cdma2000HOStatus - if(msg->cdma2000HOStatus_present) { - + if (msg->cdma2000HOStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000hostatus(&msg->cdma2000HOStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000hostatus(&msg->cdma2000HOStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39091,34 +35505,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinks1cdma2000tunneling( } // ProtocolIE - cdma2000RATType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000rattype(&msg->cdma2000RATType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000rattype(&msg->cdma2000RATType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - cdma2000PDU - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cdma2000pdu(&msg->cdma2000PDU, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cdma2000pdu(&msg->cdma2000PDU, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CDMA2000PDU, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CDMA2000PDU, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39129,29 +35540,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_downlinks1cdma2000tunneling( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinks1cdma2000tunneling( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_downlinks1cdma2000tunneling(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_DOWNLINKS1CDMA2000TUNNELING_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->E_RABSubjecttoDataForwardingList_present = false; - msg->cdma2000HOStatus_present = false; + msg->cdma2000HOStatus_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("DownlinkS1cdma2000tunnelingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -39160,43 +35569,44 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinks1cdma2000tunneling( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST == ie_id) { - if(liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(ptr, &msg->E_RABSubjecttoDataForwardingList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST == ie_id) { + if (liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(ptr, &msg->E_RABSubjecttoDataForwardingList) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABSubjecttoDataForwardingList_present = true; - } else if(LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS == ie_id) { - if(liblte_s1ap_unpack_cdma2000hostatus(ptr, &msg->cdma2000HOStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000HOSTATUS == ie_id) { + if (liblte_s1ap_unpack_cdma2000hostatus(ptr, &msg->cdma2000HOStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->cdma2000HOStatus_present = true; - } else if(LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE == ie_id) { - if(liblte_s1ap_unpack_cdma2000rattype(ptr, &msg->cdma2000RATType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000RATTYPE == ie_id) { + if (liblte_s1ap_unpack_cdma2000rattype(ptr, &msg->cdma2000RATType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CDMA2000PDU == ie_id) { - if(liblte_s1ap_unpack_cdma2000pdu(ptr, &msg->cdma2000PDU) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CDMA2000PDU == ie_id) { + if (liblte_s1ap_unpack_cdma2000pdu(ptr, &msg->cdma2000PDU) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -39207,106 +35617,100 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_downlinks1cdma2000tunneling( /******************************************************************************* /* Protocol Message HandoverCommand STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( - LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand(LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCommandIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 9; - if(!msg->NASSecurityParametersfromE_UTRAN_present) + if (!msg->NASSecurityParametersfromE_UTRAN_present) n_ie--; - if(!msg->E_RABSubjecttoDataForwardingList_present) + if (!msg->E_RABSubjecttoDataForwardingList_present) n_ie--; - if(!msg->E_RABtoReleaseListHOCmd_present) + if (!msg->E_RABtoReleaseListHOCmd_present) n_ie--; - if(!msg->Target_ToSource_TransparentContainer_Secondary_present) + if (!msg->Target_ToSource_TransparentContainer_Secondary_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - HandoverType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NASSecurityParametersfromE_UTRAN - if(msg->NASSecurityParametersfromE_UTRAN_present) { - + if (msg->NASSecurityParametersfromE_UTRAN_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nassecurityparametersfrome_utran(&msg->NASSecurityParametersfromE_UTRAN, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nassecurityparametersfrome_utran(&msg->NASSecurityParametersfromE_UTRAN, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39314,18 +35718,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( } // ProtocolIE - E_RABSubjecttoDataForwardingList - if(msg->E_RABSubjecttoDataForwardingList_present) { - + if (msg->E_RABSubjecttoDataForwardingList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(&msg->E_RABSubjecttoDataForwardingList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsubjecttodataforwardinglist(&msg->E_RABSubjecttoDataForwardingList, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39333,18 +35738,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( } // ProtocolIE - E_RABtoReleaseListHOCmd - if(msg->E_RABtoReleaseListHOCmd_present) { - + if (msg->E_RABtoReleaseListHOCmd_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABtoReleaseListHOCmd, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABtoReleaseListHOCmd, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39352,35 +35756,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( } // ProtocolIE - Target_ToSource_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Target_ToSource_TransparentContainer_Secondary - if(msg->Target_ToSource_TransparentContainer_Secondary_present) { - + if (msg->Target_ToSource_TransparentContainer_Secondary_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer_Secondary, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer_Secondary, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39388,18 +35794,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39411,32 +35816,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handovercommand( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERCOMMAND_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->NASSecurityParametersfromE_UTRAN_present = false; - msg->E_RABSubjecttoDataForwardingList_present = false; - msg->E_RABtoReleaseListHOCmd_present = false; + msg->NASSecurityParametersfromE_UTRAN_present = false; + msg->E_RABSubjecttoDataForwardingList_present = false; + msg->E_RABtoReleaseListHOCmd_present = false; msg->Target_ToSource_TransparentContainer_Secondary_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverCommandIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -39445,60 +35846,64 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { - if(liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { + if (liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN == ie_id) { - if(liblte_s1ap_unpack_nassecurityparametersfrome_utran(ptr, &msg->NASSecurityParametersfromE_UTRAN) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSFROME_UTRAN == ie_id) { + if (liblte_s1ap_unpack_nassecurityparametersfrome_utran(ptr, &msg->NASSecurityParametersfromE_UTRAN) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST == ie_id) { - if(liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(ptr, &msg->E_RABSubjecttoDataForwardingList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABSUBJECTTODATAFORWARDINGLIST == ie_id) { + if (liblte_s1ap_unpack_e_rabsubjecttodataforwardinglist(ptr, &msg->E_RABSubjecttoDataForwardingList) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABSubjecttoDataForwardingList_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABtoReleaseListHOCmd) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTORELEASELISTHOCMD == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABtoReleaseListHOCmd) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABtoReleaseListHOCmd_present = true; - } else if(LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_target_tosource_transparentcontainer(ptr, &msg->Target_ToSource_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_target_tosource_transparentcontainer(ptr, &msg->Target_ToSource_TransparentContainer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY == ie_id) { - if(liblte_s1ap_unpack_target_tosource_transparentcontainer(ptr, &msg->Target_ToSource_TransparentContainer_Secondary) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER_SECONDARY == ie_id) { + if (liblte_s1ap_unpack_target_tosource_transparentcontainer( + ptr, &msg->Target_ToSource_TransparentContainer_Secondary) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Target_ToSource_TransparentContainer_Secondary_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -39509,186 +35914,175 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handovercommand( /******************************************************************************* /* Protocol Message HandoverRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest(LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 19; - if(!msg->HandoverRestrictionList_present) + if (!msg->HandoverRestrictionList_present) n_ie--; - if(!msg->TraceActivation_present) + if (!msg->TraceActivation_present) n_ie--; - if(!msg->RequestType_present) + if (!msg->RequestType_present) n_ie--; - if(!msg->SRVCCOperationPossible_present) + if (!msg->SRVCCOperationPossible_present) n_ie--; - if(!msg->NASSecurityParameterstoE_UTRAN_present) + if (!msg->NASSecurityParameterstoE_UTRAN_present) n_ie--; - if(!msg->CSG_Id_present) + if (!msg->CSG_Id_present) n_ie--; - if(!msg->CSGMembershipStatus_present) + if (!msg->CSGMembershipStatus_present) n_ie--; - if(!msg->GUMMEI_ID_present) + if (!msg->GUMMEI_ID_present) n_ie--; - if(!msg->MME_UE_S1AP_ID_2_present) + if (!msg->MME_UE_S1AP_ID_2_present) n_ie--; - if(!msg->ManagementBasedMDTAllowed_present) + if (!msg->ManagementBasedMDTAllowed_present) n_ie--; - if(!msg->ManagementBasedMDTPLMNList_present) + if (!msg->ManagementBasedMDTPLMNList_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - HandoverType - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handovertype(&msg->HandoverType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERTYPE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERTYPE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Cause - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cause(&msg->Cause, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CAUSE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CAUSE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABToBeSetupListHOReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetuplisthoreq(&msg->E_RABToBeSetupListHOReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetuplisthoreq(&msg->E_RABToBeSetupListHOReq, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - Source_ToTarget_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_source_totarget_transparentcontainer(&msg->Source_ToTarget_TransparentContainer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UESecurityCapabilities - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - HandoverRestrictionList - if(msg->HandoverRestrictionList_present) { - + if (msg->HandoverRestrictionList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39696,18 +36090,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - TraceActivation - if(msg->TraceActivation_present) { - + if (msg->TraceActivation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRACEACTIVATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TRACEACTIVATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39715,18 +36108,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - RequestType - if(msg->RequestType_present) { - + if (msg->RequestType_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_requesttype(&msg->RequestType, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REQUESTTYPE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REQUESTTYPE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39734,18 +36126,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - SRVCCOperationPossible - if(msg->SRVCCOperationPossible_present) { - + if (msg->SRVCCOperationPossible_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_srvccoperationpossible(&msg->SRVCCOperationPossible, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_srvccoperationpossible(&msg->SRVCCOperationPossible, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39753,35 +36144,35 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - SecurityContext - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_securitycontext(&msg->SecurityContext, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_securitycontext(&msg->SecurityContext, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SECURITYCONTEXT, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SECURITYCONTEXT, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - NASSecurityParameterstoE_UTRAN - if(msg->NASSecurityParameterstoE_UTRAN_present) { - + if (msg->NASSecurityParameterstoE_UTRAN_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_nassecurityparameterstoe_utran(&msg->NASSecurityParameterstoE_UTRAN, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_nassecurityparameterstoe_utran(&msg->NASSecurityParameterstoE_UTRAN, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39789,18 +36180,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - CSG_Id - if(msg->CSG_Id_present) { - + if (msg->CSG_Id_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39808,18 +36197,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - CSGMembershipStatus - if(msg->CSGMembershipStatus_present) { - + if (msg->CSGMembershipStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39827,18 +36215,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - GUMMEI_ID - if(msg->GUMMEI_ID_present) { - + if (msg->GUMMEI_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEI_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEI_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39846,18 +36232,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - MME_UE_S1AP_ID_2 - if(msg->MME_UE_S1AP_ID_2_present) { - + if (msg->MME_UE_S1AP_ID_2_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39865,18 +36250,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - ManagementBasedMDTAllowed - if(msg->ManagementBasedMDTAllowed_present) { - + if (msg->ManagementBasedMDTAllowed_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_managementbasedmdtallowed(&msg->ManagementBasedMDTAllowed, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_managementbasedmdtallowed(&msg->ManagementBasedMDTAllowed, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39884,18 +36268,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( } // ProtocolIE - ManagementBasedMDTPLMNList - if(msg->ManagementBasedMDTPLMNList_present) { - + if (msg->ManagementBasedMDTPLMNList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mdtplmnlist(&msg->ManagementBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdtplmnlist(&msg->ManagementBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -39907,38 +36290,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->HandoverRestrictionList_present = false; - msg->TraceActivation_present = false; - msg->RequestType_present = false; - msg->SRVCCOperationPossible_present = false; + msg->HandoverRestrictionList_present = false; + msg->TraceActivation_present = false; + msg->RequestType_present = false; + msg->SRVCCOperationPossible_present = false; msg->NASSecurityParameterstoE_UTRAN_present = false; - msg->CSG_Id_present = false; - msg->CSGMembershipStatus_present = false; - msg->GUMMEI_ID_present = false; - msg->MME_UE_S1AP_ID_2_present = false; - msg->ManagementBasedMDTAllowed_present = false; - msg->ManagementBasedMDTPLMNList_present = false; + msg->CSG_Id_present = false; + msg->CSGMembershipStatus_present = false; + msg->GUMMEI_ID_present = false; + msg->MME_UE_S1AP_ID_2_present = false; + msg->ManagementBasedMDTAllowed_present = false; + msg->ManagementBasedMDTPLMNList_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -39947,116 +36326,118 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { - if(liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERTYPE == ie_id) { + if (liblte_s1ap_unpack_handovertype(ptr, &msg->HandoverType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { - if(liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CAUSE == ie_id) { + if (liblte_s1ap_unpack_cause(ptr, &msg->Cause) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ == ie_id) { - if(liblte_s1ap_unpack_e_rabtobesetuplisthoreq(ptr, &msg->E_RABToBeSetupListHOReq) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTHOREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetuplisthoreq(ptr, &msg->E_RABToBeSetupListHOReq) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_source_totarget_transparentcontainer(ptr, &msg->Source_ToTarget_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SOURCE_TOTARGET_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_source_totarget_transparentcontainer(ptr, &msg->Source_ToTarget_TransparentContainer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { - if(liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { + if (liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { - if(liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { + if (liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->HandoverRestrictionList_present = true; - } else if(LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { - if(liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { + if (liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TraceActivation_present = true; - } else if(LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { - if(liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REQUESTTYPE == ie_id) { + if (liblte_s1ap_unpack_requesttype(ptr, &msg->RequestType) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->RequestType_present = true; - } else if(LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE == ie_id) { - if(liblte_s1ap_unpack_srvccoperationpossible(ptr, &msg->SRVCCOperationPossible) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE == ie_id) { + if (liblte_s1ap_unpack_srvccoperationpossible(ptr, &msg->SRVCCOperationPossible) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SRVCCOperationPossible_present = true; - } else if(LIBLTE_S1AP_IE_ID_SECURITYCONTEXT == ie_id) { - if(liblte_s1ap_unpack_securitycontext(ptr, &msg->SecurityContext) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SECURITYCONTEXT == ie_id) { + if (liblte_s1ap_unpack_securitycontext(ptr, &msg->SecurityContext) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN == ie_id) { - if(liblte_s1ap_unpack_nassecurityparameterstoe_utran(ptr, &msg->NASSecurityParameterstoE_UTRAN) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_NASSECURITYPARAMETERSTOE_UTRAN == ie_id) { + if (liblte_s1ap_unpack_nassecurityparameterstoe_utran(ptr, &msg->NASSecurityParameterstoE_UTRAN) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { - if(liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { + if (liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_Id_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { - if(liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { + if (liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSGMembershipStatus_present = true; - } else if(LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { - if(liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { + if (liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEI_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MME_UE_S1AP_ID_2_present = true; - } else if(LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED == ie_id) { - if(liblte_s1ap_unpack_managementbasedmdtallowed(ptr, &msg->ManagementBasedMDTAllowed) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED == ie_id) { + if (liblte_s1ap_unpack_managementbasedmdtallowed(ptr, &msg->ManagementBasedMDTAllowed) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ManagementBasedMDTAllowed_present = true; - } else if(LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST == ie_id) { - if(liblte_s1ap_unpack_mdtplmnlist(ptr, &msg->ManagementBasedMDTPLMNList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST == ie_id) { + if (liblte_s1ap_unpack_mdtplmnlist(ptr, &msg->ManagementBasedMDTPLMNList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ManagementBasedMDTPLMNList_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -40067,159 +36448,145 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequest( /******************************************************************************* /* Protocol Message PathSwitchRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 12; - if(!msg->CSG_Id_present) + if (!msg->CSG_Id_present) n_ie--; - if(!msg->CellAccessMode_present) + if (!msg->CellAccessMode_present) n_ie--; - if(!msg->SourceMME_GUMMEI_present) + if (!msg->SourceMME_GUMMEI_present) n_ie--; - if(!msg->CSGMembershipStatus_present) + if (!msg->CSGMembershipStatus_present) n_ie--; - if(!msg->Tunnel_Information_for_BBF_present) + if (!msg->Tunnel_Information_for_BBF_present) n_ie--; - if(!msg->LHN_ID_present) + if (!msg->LHN_ID_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABToBeSwitchedDLList - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitcheddllist(&msg->E_RABToBeSwitchedDLList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitcheddllist(&msg->E_RABToBeSwitchedDLList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SourceMME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->SourceMME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->SourceMME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - EUTRAN_CGI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_eutran_cgi(&msg->EUTRAN_CGI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_EUTRAN_CGI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_EUTRAN_CGI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAI - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tai(&msg->TAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UESecurityCapabilities - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CSG_Id - if(msg->CSG_Id_present) { - + if (msg->CSG_Id_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40227,18 +36594,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( } // ProtocolIE - CellAccessMode - if(msg->CellAccessMode_present) { - + if (msg->CellAccessMode_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CELLACCESSMODE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CELLACCESSMODE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40246,18 +36612,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( } // ProtocolIE - SourceMME_GUMMEI - if(msg->SourceMME_GUMMEI_present) { - + if (msg->SourceMME_GUMMEI_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummei(&msg->SourceMME_GUMMEI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummei(&msg->SourceMME_GUMMEI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40265,18 +36630,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( } // ProtocolIE - CSGMembershipStatus - if(msg->CSGMembershipStatus_present) { - + if (msg->CSGMembershipStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40284,18 +36648,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( } // ProtocolIE - Tunnel_Information_for_BBF - if(msg->Tunnel_Information_for_BBF_present) { - + if (msg->Tunnel_Information_for_BBF_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tunnelinformation(&msg->Tunnel_Information_for_BBF, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40303,18 +36666,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( } // ProtocolIE - LHN_ID - if(msg->LHN_ID_present) { - + if (msg->LHN_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lhn_id(&msg->LHN_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_LHN_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_LHN_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40326,33 +36687,29 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->CSG_Id_present = false; - msg->CellAccessMode_present = false; - msg->SourceMME_GUMMEI_present = false; - msg->CSGMembershipStatus_present = false; + msg->CSG_Id_present = false; + msg->CellAccessMode_present = false; + msg->SourceMME_GUMMEI_present = false; + msg->CSGMembershipStatus_present = false; msg->Tunnel_Information_for_BBF_present = false; - msg->LHN_ID_present = false; + msg->LHN_ID_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -40361,77 +36718,77 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;ieNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST == ie_id) { - if(liblte_s1ap_unpack_e_rabtobeswitcheddllist(ptr, &msg->E_RABToBeSwitchedDLList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDDLLIST == ie_id) { + if (liblte_s1ap_unpack_e_rabtobeswitcheddllist(ptr, &msg->E_RABToBeSwitchedDLList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->SourceMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SOURCEMME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->SourceMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { - if(liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_EUTRAN_CGI == ie_id) { + if (liblte_s1ap_unpack_eutran_cgi(ptr, &msg->EUTRAN_CGI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAI == ie_id) { - if(liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAI == ie_id) { + if (liblte_s1ap_unpack_tai(ptr, &msg->TAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { - if(liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { + if (liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { - if(liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { + if (liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_Id_present = true; - } else if(LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { - if(liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { + if (liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CellAccessMode_present = true; - } else if(LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI == ie_id) { - if(liblte_s1ap_unpack_gummei(ptr, &msg->SourceMME_GUMMEI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SOURCEMME_GUMMEI == ie_id) { + if (liblte_s1ap_unpack_gummei(ptr, &msg->SourceMME_GUMMEI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SourceMME_GUMMEI_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { - if(liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { + if (liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSGMembershipStatus_present = true; - } else if(LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { - if(liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TUNNEL_INFORMATION_FOR_BBF == ie_id) { + if (liblte_s1ap_unpack_tunnelinformation(ptr, &msg->Tunnel_Information_for_BBF) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->Tunnel_Information_for_BBF_present = true; - } else if(LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { - if(liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_LHN_ID == ie_id) { + if (liblte_s1ap_unpack_lhn_id(ptr, &msg->LHN_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->LHN_ID_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -40442,91 +36799,86 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequest( /******************************************************************************* /* Protocol Message PathSwitchRequestAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_pathswitchrequestacknowledge(LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 9; - if(!msg->uEaggregateMaximumBitrate_present) + if (!msg->uEaggregateMaximumBitrate_present) n_ie--; - if(!msg->E_RABToBeSwitchedULList_present) + if (!msg->E_RABToBeSwitchedULList_present) n_ie--; - if(!msg->E_RABToBeReleasedList_present) + if (!msg->E_RABToBeReleasedList_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; - if(!msg->MME_UE_S1AP_ID_2_present) + if (!msg->MME_UE_S1AP_ID_2_present) n_ie--; - if(!msg->CSGMembershipStatus_present) + if (!msg->CSGMembershipStatus_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - if(msg->uEaggregateMaximumBitrate_present) { - + if (msg->uEaggregateMaximumBitrate_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40534,18 +36886,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( } // ProtocolIE - E_RABToBeSwitchedULList - if(msg->E_RABToBeSwitchedULList_present) { - + if (msg->E_RABToBeSwitchedULList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobeswitchedullist(&msg->E_RABToBeSwitchedULList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobeswitchedullist(&msg->E_RABToBeSwitchedULList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40553,18 +36904,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( } // ProtocolIE - E_RABToBeReleasedList - if(msg->E_RABToBeReleasedList_present) { - + if (msg->E_RABToBeReleasedList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABToBeReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABToBeReleasedList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40572,35 +36922,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( } // ProtocolIE - SecurityContext - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_securitycontext(&msg->SecurityContext, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_securitycontext(&msg->SecurityContext, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SECURITYCONTEXT, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SECURITYCONTEXT, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40608,18 +36956,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( } // ProtocolIE - MME_UE_S1AP_ID_2 - if(msg->MME_UE_S1AP_ID_2_present) { - + if (msg->MME_UE_S1AP_ID_2_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40627,18 +36974,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( } // ProtocolIE - CSGMembershipStatus - if(msg->CSGMembershipStatus_present) { - + if (msg->CSGMembershipStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40650,33 +36996,31 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_pathswitchrequestacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_pathswitchrequestacknowledge(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_PATHSWITCHREQUESTACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->uEaggregateMaximumBitrate_present = false; - msg->E_RABToBeSwitchedULList_present = false; - msg->E_RABToBeReleasedList_present = false; - msg->CriticalityDiagnostics_present = false; - msg->MME_UE_S1AP_ID_2_present = false; - msg->CSGMembershipStatus_present = false; + msg->E_RABToBeSwitchedULList_present = false; + msg->E_RABToBeReleasedList_present = false; + msg->CriticalityDiagnostics_present = false; + msg->MME_UE_S1AP_ID_2_present = false; + msg->CSGMembershipStatus_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PathSwitchRequestAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -40685,62 +37029,62 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->uEaggregateMaximumBitrate_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST == ie_id) { - if(liblte_s1ap_unpack_e_rabtobeswitchedullist(ptr, &msg->E_RABToBeSwitchedULList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBESWITCHEDULLIST == ie_id) { + if (liblte_s1ap_unpack_e_rabtobeswitchedullist(ptr, &msg->E_RABToBeSwitchedULList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABToBeSwitchedULList_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABToBeReleasedList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBERELEASEDLIST == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABToBeReleasedList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABToBeReleasedList_present = true; - } else if(LIBLTE_S1AP_IE_ID_SECURITYCONTEXT == ie_id) { - if(liblte_s1ap_unpack_securitycontext(ptr, &msg->SecurityContext) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SECURITYCONTEXT == ie_id) { + if (liblte_s1ap_unpack_securitycontext(ptr, &msg->SecurityContext) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } else if(LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MME_UE_S1AP_ID_2_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { - if(liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { + if (liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSGMembershipStatus_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -40751,81 +37095,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_pathswitchrequestacknowledge( /******************************************************************************* /* Protocol Message E_RABSetupRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest( - LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest(LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->uEaggregateMaximumBitrate_present) + if (!msg->uEaggregateMaximumBitrate_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - if(msg->uEaggregateMaximumBitrate_present) { - + if (msg->uEaggregateMaximumBitrate_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40833,17 +37170,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest( } // ProtocolIE - E_RABToBeSetupListBearerSUReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetuplistbearersureq(&msg->E_RABToBeSetupListBearerSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetuplistbearersureq(&msg->E_RABToBeSetupListBearerSUReq, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -40854,28 +37191,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetuprequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->uEaggregateMaximumBitrate_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -40884,32 +37217,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->uEaggregateMaximumBitrate_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ == ie_id) { - if(liblte_s1ap_unpack_e_rabtobesetuplistbearersureq(ptr, &msg->E_RABToBeSetupListBearerSUReq) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTBEARERSUREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetuplistbearersureq(ptr, &msg->E_RABToBeSetupListBearerSUReq) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -40920,85 +37254,78 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetuprequest( /******************************************************************************* /* Protocol Message E_RABSetupResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse( - LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse(LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->E_RABSetupListBearerSURes_present) + if (!msg->E_RABSetupListBearerSURes_present) n_ie--; - if(!msg->E_RABFailedToSetupListBearerSURes_present) + if (!msg->E_RABFailedToSetupListBearerSURes_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABSetupListBearerSURes - if(msg->E_RABSetupListBearerSURes_present) { - + if (msg->E_RABSetupListBearerSURes_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetuplistbearersures(&msg->E_RABSetupListBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetuplistbearersures(&msg->E_RABSetupListBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41006,18 +37333,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse( } // ProtocolIE - E_RABFailedToSetupListBearerSURes - if(msg->E_RABFailedToSetupListBearerSURes_present) { - + if (msg->E_RABFailedToSetupListBearerSURes_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToSetupListBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToSetupListBearerSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41025,18 +37352,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41048,30 +37374,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabsetupresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABSETUPRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->E_RABSetupListBearerSURes_present = false; + msg->E_RABSetupListBearerSURes_present = false; msg->E_RABFailedToSetupListBearerSURes_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABSetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -41080,39 +37403,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES == ie_id) { - if(liblte_s1ap_unpack_e_rabsetuplistbearersures(ptr, &msg->E_RABSetupListBearerSURes) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABSETUPLISTBEARERSURES == ie_id) { + if (liblte_s1ap_unpack_e_rabsetuplistbearersures(ptr, &msg->E_RABSetupListBearerSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABSetupListBearerSURes_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToSetupListBearerSURes) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTBEARERSURES == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToSetupListBearerSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABFailedToSetupListBearerSURes_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -41123,81 +37446,74 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabsetupresponse( /******************************************************************************* /* Protocol Message E_RABModifyRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest(LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 4; - if(!msg->uEaggregateMaximumBitrate_present) + if (!msg->uEaggregateMaximumBitrate_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - if(msg->uEaggregateMaximumBitrate_present) { - + if (msg->uEaggregateMaximumBitrate_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41205,17 +37521,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest( } // ProtocolIE - E_RABToBeModifiedListBearerModReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq(&msg->E_RABToBeModifiedListBearerModReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobemodifiedlistbearermodreq(&msg->E_RABToBeModifiedListBearerModReq, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41226,28 +37543,25 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyrequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->uEaggregateMaximumBitrate_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -41256,32 +37570,33 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->uEaggregateMaximumBitrate_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ == ie_id) { - if(liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq(ptr, &msg->E_RABToBeModifiedListBearerModReq) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBEMODIFIEDLISTBEARERMODREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobemodifiedlistbearermodreq(ptr, &msg->E_RABToBeModifiedListBearerModReq) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -41292,85 +37607,79 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyrequest( /******************************************************************************* /* Protocol Message E_RABModifyResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse( - LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse(LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->E_RABModifyListBearerModRes_present) + if (!msg->E_RABModifyListBearerModRes_present) n_ie--; - if(!msg->E_RABFailedToModifyList_present) + if (!msg->E_RABFailedToModifyList_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABModifyListBearerModRes - if(msg->E_RABModifyListBearerModRes_present) { - + if (msg->E_RABModifyListBearerModRes_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabmodifylistbearermodres(&msg->E_RABModifyListBearerModRes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabmodifylistbearermodres(&msg->E_RABModifyListBearerModRes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41378,18 +37687,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse( } // ProtocolIE - E_RABFailedToModifyList - if(msg->E_RABFailedToModifyList_present) { - + if (msg->E_RABFailedToModifyList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToModifyList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToModifyList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41397,18 +37705,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41420,30 +37727,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabmodifyresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABMODIFYRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->E_RABModifyListBearerModRes_present = false; - msg->E_RABFailedToModifyList_present = false; - msg->CriticalityDiagnostics_present = false; + msg->E_RABFailedToModifyList_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABModifyResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -41452,39 +37756,39 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES == ie_id) { - if(liblte_s1ap_unpack_e_rabmodifylistbearermodres(ptr, &msg->E_RABModifyListBearerModRes) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABMODIFYLISTBEARERMODRES == ie_id) { + if (liblte_s1ap_unpack_e_rabmodifylistbearermodres(ptr, &msg->E_RABModifyListBearerModRes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABModifyListBearerModRes_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToModifyList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOMODIFYLIST == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToModifyList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABFailedToModifyList_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -41495,87 +37799,83 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabmodifyresponse( /******************************************************************************* /* Protocol Message E_RABReleaseResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( - LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse(LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT* msg, + uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 6; - if(!msg->E_RABReleaseListBearerRelComp_present) + if (!msg->E_RABReleaseListBearerRelComp_present) n_ie--; - if(!msg->E_RABFailedToReleaseList_present) + if (!msg->E_RABFailedToReleaseList_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; - if(!msg->UserLocationInformation_present) + if (!msg->UserLocationInformation_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABReleaseListBearerRelComp - if(msg->E_RABReleaseListBearerRelComp_present) { - + if (msg->E_RABReleaseListBearerRelComp_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabreleaselistbearerrelcomp(&msg->E_RABReleaseListBearerRelComp, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabreleaselistbearerrelcomp(&msg->E_RABReleaseListBearerRelComp, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41583,18 +37883,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( } // ProtocolIE - E_RABFailedToReleaseList - if(msg->E_RABFailedToReleaseList_present) { - + if (msg->E_RABFailedToReleaseList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToReleaseList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToReleaseList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41602,18 +37901,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41621,18 +37919,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( } // ProtocolIE - UserLocationInformation - if(msg->UserLocationInformation_present) { - + if (msg->UserLocationInformation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_userlocationinformation(&msg->UserLocationInformation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41644,31 +37941,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_e_rabreleaseresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_E_RABRELEASERESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->E_RABReleaseListBearerRelComp_present = false; - msg->E_RABFailedToReleaseList_present = false; - msg->CriticalityDiagnostics_present = false; - msg->UserLocationInformation_present = false; + msg->E_RABFailedToReleaseList_present = false; + msg->CriticalityDiagnostics_present = false; + msg->UserLocationInformation_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("E-RABReleaseResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -41677,45 +37971,46 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP == ie_id) { - if(liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp(ptr, &msg->E_RABReleaseListBearerRelComp) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABRELEASELISTBEARERRELCOMP == ie_id) { + if (liblte_s1ap_unpack_e_rabreleaselistbearerrelcomp(ptr, &msg->E_RABReleaseListBearerRelComp) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABReleaseListBearerRelComp_present = true; - } else if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToReleaseList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTORELEASELIST == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToReleaseList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABFailedToReleaseList_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } else if(LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { - if(liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_USERLOCATIONINFORMATION == ie_id) { + if (liblte_s1ap_unpack_userlocationinformation(ptr, &msg->UserLocationInformation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UserLocationInformation_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -41726,173 +38021,162 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_e_rabreleaseresponse( /******************************************************************************* /* Protocol Message InitialContextSetupRequest STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_initialcontextsetuprequest(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 19; - if(!msg->TraceActivation_present) + if (!msg->TraceActivation_present) n_ie--; - if(!msg->HandoverRestrictionList_present) + if (!msg->HandoverRestrictionList_present) n_ie--; - if(!msg->UERadioCapability_present) + if (!msg->UERadioCapability_present) n_ie--; - if(!msg->SubscriberProfileIDforRFP_present) + if (!msg->SubscriberProfileIDforRFP_present) n_ie--; - if(!msg->CSFallbackIndicator_present) + if (!msg->CSFallbackIndicator_present) n_ie--; - if(!msg->SRVCCOperationPossible_present) + if (!msg->SRVCCOperationPossible_present) n_ie--; - if(!msg->CSGMembershipStatus_present) + if (!msg->CSGMembershipStatus_present) n_ie--; - if(!msg->RegisteredLAI_present) + if (!msg->RegisteredLAI_present) n_ie--; - if(!msg->GUMMEI_ID_present) + if (!msg->GUMMEI_ID_present) n_ie--; - if(!msg->MME_UE_S1AP_ID_2_present) + if (!msg->MME_UE_S1AP_ID_2_present) n_ie--; - if(!msg->ManagementBasedMDTAllowed_present) + if (!msg->ManagementBasedMDTAllowed_present) n_ie--; - if(!msg->ManagementBasedMDTPLMNList_present) + if (!msg->ManagementBasedMDTPLMNList_present) n_ie--; - if(!msg->AdditionalCSFallbackIndicator_present) + if (!msg->AdditionalCSFallbackIndicator_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - uEaggregateMaximumBitrate - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueaggregatemaximumbitrate(&msg->uEaggregateMaximumBitrate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABToBeSetupListCtxtSUReq - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabtobesetuplistctxtsureq(&msg->E_RABToBeSetupListCtxtSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabtobesetuplistctxtsureq(&msg->E_RABToBeSetupListCtxtSUReq, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UESecurityCapabilities - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_uesecuritycapabilities(&msg->UESecurityCapabilities, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - SecurityKey - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_securitykey(&msg->SecurityKey, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_securitykey(&msg->SecurityKey, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SECURITYKEY, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SECURITYKEY, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TraceActivation - if(msg->TraceActivation_present) { - + if (msg->TraceActivation_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_traceactivation(&msg->TraceActivation, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TRACEACTIVATION, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TRACEACTIVATION, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41900,18 +38184,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - HandoverRestrictionList - if(msg->HandoverRestrictionList_present) { - + if (msg->HandoverRestrictionList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_handoverrestrictionlist(&msg->HandoverRestrictionList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41919,18 +38202,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - UERadioCapability - if(msg->UERadioCapability_present) { - + if (msg->UERadioCapability_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueradiocapability(&msg->UERadioCapability, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41938,18 +38220,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - SubscriberProfileIDforRFP - if(msg->SubscriberProfileIDforRFP_present) { - + if (msg->SubscriberProfileIDforRFP_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_subscriberprofileidforrfp(&msg->SubscriberProfileIDforRFP, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41957,18 +38238,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - CSFallbackIndicator - if(msg->CSFallbackIndicator_present) { - + if (msg->CSFallbackIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csfallbackindicator(&msg->CSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csfallbackindicator(&msg->CSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR, LIBLTE_S1AP_CRITICALITY_REJECT, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41976,18 +38256,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - SRVCCOperationPossible - if(msg->SRVCCOperationPossible_present) { - + if (msg->SRVCCOperationPossible_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_srvccoperationpossible(&msg->SRVCCOperationPossible, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_srvccoperationpossible(&msg->SRVCCOperationPossible, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -41995,18 +38274,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - CSGMembershipStatus - if(msg->CSGMembershipStatus_present) { - + if (msg->CSGMembershipStatus_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csgmembershipstatus(&msg->CSGMembershipStatus, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42014,18 +38292,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - RegisteredLAI - if(msg->RegisteredLAI_present) { - + if (msg->RegisteredLAI_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_lai(&msg->RegisteredLAI, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_lai(&msg->RegisteredLAI, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_REGISTEREDLAI, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_REGISTEREDLAI, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42033,18 +38310,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - GUMMEI_ID - if(msg->GUMMEI_ID_present) { - + if (msg->GUMMEI_ID_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_gummei(&msg->GUMMEI_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_GUMMEI_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_GUMMEI_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42052,18 +38327,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - MME_UE_S1AP_ID_2 - if(msg->MME_UE_S1AP_ID_2_present) { - + if (msg->MME_UE_S1AP_ID_2_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID_2, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42071,18 +38345,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - ManagementBasedMDTAllowed - if(msg->ManagementBasedMDTAllowed_present) { - + if (msg->ManagementBasedMDTAllowed_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_managementbasedmdtallowed(&msg->ManagementBasedMDTAllowed, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_managementbasedmdtallowed(&msg->ManagementBasedMDTAllowed, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42090,18 +38363,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - ManagementBasedMDTPLMNList - if(msg->ManagementBasedMDTPLMNList_present) { - + if (msg->ManagementBasedMDTPLMNList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mdtplmnlist(&msg->ManagementBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mdtplmnlist(&msg->ManagementBasedMDTPLMNList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42109,18 +38381,19 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( } // ProtocolIE - AdditionalCSFallbackIndicator - if(msg->AdditionalCSFallbackIndicator_present) { - + if (msg->AdditionalCSFallbackIndicator_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_additionalcsfallbackindicator(&msg->AdditionalCSFallbackIndicator, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_additionalcsfallbackindicator(&msg->AdditionalCSFallbackIndicator, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42132,40 +38405,37 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetuprequest( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetuprequest( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetuprequest(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->TraceActivation_present = false; - msg->HandoverRestrictionList_present = false; - msg->UERadioCapability_present = false; - msg->SubscriberProfileIDforRFP_present = false; - msg->CSFallbackIndicator_present = false; - msg->SRVCCOperationPossible_present = false; - msg->CSGMembershipStatus_present = false; - msg->RegisteredLAI_present = false; - msg->GUMMEI_ID_present = false; - msg->MME_UE_S1AP_ID_2_present = false; - msg->ManagementBasedMDTAllowed_present = false; - msg->ManagementBasedMDTPLMNList_present = false; + msg->TraceActivation_present = false; + msg->HandoverRestrictionList_present = false; + msg->UERadioCapability_present = false; + msg->SubscriberProfileIDforRFP_present = false; + msg->CSFallbackIndicator_present = false; + msg->SRVCCOperationPossible_present = false; + msg->CSGMembershipStatus_present = false; + msg->RegisteredLAI_present = false; + msg->GUMMEI_ID_present = false; + msg->MME_UE_S1AP_ID_2_present = false; + msg->ManagementBasedMDTAllowed_present = false; + msg->ManagementBasedMDTPLMNList_present = false; msg->AdditionalCSFallbackIndicator_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupRequestIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -42174,118 +38444,119 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetuprequest( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { - if(liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEAGGREGATEMAXIMUMBITRATE == ie_id) { + if (liblte_s1ap_unpack_ueaggregatemaximumbitrate(ptr, &msg->uEaggregateMaximumBitrate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ == ie_id) { - if(liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq(ptr, &msg->E_RABToBeSetupListCtxtSUReq) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABTOBESETUPLISTCTXTSUREQ == ie_id) { + if (liblte_s1ap_unpack_e_rabtobesetuplistctxtsureq(ptr, &msg->E_RABToBeSetupListCtxtSUReq) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { - if(liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UESECURITYCAPABILITIES == ie_id) { + if (liblte_s1ap_unpack_uesecuritycapabilities(ptr, &msg->UESecurityCapabilities) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_SECURITYKEY == ie_id) { - if(liblte_s1ap_unpack_securitykey(ptr, &msg->SecurityKey) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SECURITYKEY == ie_id) { + if (liblte_s1ap_unpack_securitykey(ptr, &msg->SecurityKey) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { - if(liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TRACEACTIVATION == ie_id) { + if (liblte_s1ap_unpack_traceactivation(ptr, &msg->TraceActivation) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->TraceActivation_present = true; - } else if(LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { - if(liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_HANDOVERRESTRICTIONLIST == ie_id) { + if (liblte_s1ap_unpack_handoverrestrictionlist(ptr, &msg->HandoverRestrictionList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->HandoverRestrictionList_present = true; - } else if(LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { - if(liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UERADIOCAPABILITY == ie_id) { + if (liblte_s1ap_unpack_ueradiocapability(ptr, &msg->UERadioCapability) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->UERadioCapability_present = true; - } else if(LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { - if(liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SUBSCRIBERPROFILEIDFORRFP == ie_id) { + if (liblte_s1ap_unpack_subscriberprofileidforrfp(ptr, &msg->SubscriberProfileIDforRFP) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SubscriberProfileIDforRFP_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR == ie_id) { - if(liblte_s1ap_unpack_csfallbackindicator(ptr, &msg->CSFallbackIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSFALLBACKINDICATOR == ie_id) { + if (liblte_s1ap_unpack_csfallbackindicator(ptr, &msg->CSFallbackIndicator) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSFallbackIndicator_present = true; - } else if(LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE == ie_id) { - if(liblte_s1ap_unpack_srvccoperationpossible(ptr, &msg->SRVCCOperationPossible) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_SRVCCOPERATIONPOSSIBLE == ie_id) { + if (liblte_s1ap_unpack_srvccoperationpossible(ptr, &msg->SRVCCOperationPossible) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->SRVCCOperationPossible_present = true; - } else if(LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { - if(liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSGMEMBERSHIPSTATUS == ie_id) { + if (liblte_s1ap_unpack_csgmembershipstatus(ptr, &msg->CSGMembershipStatus) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSGMembershipStatus_present = true; - } else if(LIBLTE_S1AP_IE_ID_REGISTEREDLAI == ie_id) { - if(liblte_s1ap_unpack_lai(ptr, &msg->RegisteredLAI) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_REGISTEREDLAI == ie_id) { + if (liblte_s1ap_unpack_lai(ptr, &msg->RegisteredLAI) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->RegisteredLAI_present = true; - } else if(LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { - if(liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_GUMMEI_ID == ie_id) { + if (liblte_s1ap_unpack_gummei(ptr, &msg->GUMMEI_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->GUMMEI_ID_present = true; - } else if(LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { - if(liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID_2 == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID_2) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->MME_UE_S1AP_ID_2_present = true; - } else if(LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED == ie_id) { - if(liblte_s1ap_unpack_managementbasedmdtallowed(ptr, &msg->ManagementBasedMDTAllowed) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTALLOWED == ie_id) { + if (liblte_s1ap_unpack_managementbasedmdtallowed(ptr, &msg->ManagementBasedMDTAllowed) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ManagementBasedMDTAllowed_present = true; - } else if(LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST == ie_id) { - if(liblte_s1ap_unpack_mdtplmnlist(ptr, &msg->ManagementBasedMDTPLMNList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_MANAGEMENTBASEDMDTPLMNLIST == ie_id) { + if (liblte_s1ap_unpack_mdtplmnlist(ptr, &msg->ManagementBasedMDTPLMNList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->ManagementBasedMDTPLMNList_present = true; - } else if(LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR == ie_id) { - if(liblte_s1ap_unpack_additionalcsfallbackindicator(ptr, &msg->AdditionalCSFallbackIndicator) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ADDITIONALCSFALLBACKINDICATOR == ie_id) { + if (liblte_s1ap_unpack_additionalcsfallbackindicator(ptr, &msg->AdditionalCSFallbackIndicator) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } + } } err = LIBLTE_SUCCESS; @@ -42296,100 +38567,94 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetuprequest( /******************************************************************************* /* Protocol Message InitialContextSetupResponse STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupresponse( - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_initialcontextsetupresponse(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 5; - if(!msg->E_RABFailedToSetupListCtxtSURes_present) + if (!msg->E_RABFailedToSetupListCtxtSURes_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABSetupListCtxtSURes - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabsetuplistctxtsures(&msg->E_RABSetupListCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabsetuplistctxtsures(&msg->E_RABSetupListCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABFailedToSetupListCtxtSURes - if(msg->E_RABFailedToSetupListCtxtSURes_present) { - + if (msg->E_RABFailedToSetupListCtxtSURes_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToSetupListCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rablist(&msg->E_RABFailedToSetupListCtxtSURes, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42397,18 +38662,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupresponse( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42420,29 +38684,27 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initialcontextsetupresponse( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupresponse( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_initialcontextsetupresponse(uint8_t** ptr, + LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->E_RABFailedToSetupListCtxtSURes_present = false; - msg->CriticalityDiagnostics_present = false; + msg->CriticalityDiagnostics_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("InitialContextSetupResponseIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -42451,38 +38713,38 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupresponse( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES == ie_id) { - if(liblte_s1ap_unpack_e_rabsetuplistctxtsures(ptr, &msg->E_RABSetupListCtxtSURes) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABSETUPLISTCTXTSURES == ie_id) { + if (liblte_s1ap_unpack_e_rabsetuplistctxtsures(ptr, &msg->E_RABSetupListCtxtSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES == ie_id) { - if(liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToSetupListCtxtSURes) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTCTXTSURES == ie_id) { + if (liblte_s1ap_unpack_e_rablist(ptr, &msg->E_RABFailedToSetupListCtxtSURes) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABFailedToSetupListCtxtSURes_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -42493,85 +38755,76 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initialcontextsetupresponse( /******************************************************************************* /* Protocol Message Paging STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging( - LIBLTE_S1AP_MESSAGE_PAGING_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging(LIBLTE_S1AP_MESSAGE_PAGING_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PagingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 7; - if(!msg->pagingDRX_present) + if (!msg->pagingDRX_present) n_ie--; - if(!msg->CSG_IdList_present) + if (!msg->CSG_IdList_present) n_ie--; - if(!msg->PagingPriority_present) + if (!msg->PagingPriority_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - UEIdentityIndexValue - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_ueidentityindexvalue(&msg->UEIdentityIndexValue, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_ueidentityindexvalue(&msg->UEIdentityIndexValue, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEIDENTITYINDEXVALUE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEIDENTITYINDEXVALUE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - UEPagingID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_uepagingid(&msg->UEPagingID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_uepagingid(&msg->UEPagingID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_UEPAGINGID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_UEPAGINGID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - pagingDRX - if(msg->pagingDRX_present) { - + if (msg->pagingDRX_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_pagingdrx(&msg->pagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pagingdrx(&msg->pagingDRX, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_PAGINGDRX, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_PAGINGDRX, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42579,52 +38832,47 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging( } // ProtocolIE - CNDomain - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cndomain(&msg->CNDomain, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cndomain(&msg->CNDomain, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CNDOMAIN, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CNDOMAIN, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - TAIList - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_tailist(&msg->TAIList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_tailist(&msg->TAIList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TAILIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_TAILIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CSG_IdList - if(msg->CSG_IdList_present) { - + if (msg->CSG_IdList_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_idlist(&msg->CSG_IdList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_IDLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_IDLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42632,18 +38880,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging( } // ProtocolIE - PagingPriority - if(msg->PagingPriority_present) { - + if (msg->PagingPriority_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_pagingpriority(&msg->PagingPriority, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_pagingpriority(&msg->PagingPriority, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_PAGINGPRIORITY, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_PAGINGPRIORITY, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42655,30 +38902,26 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_paging( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_PAGING_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_PAGING_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans - msg->pagingDRX_present = false; - msg->CSG_IdList_present = false; + msg->pagingDRX_present = false; + msg->CSG_IdList_present = false; msg->PagingPriority_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("PagingIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -42687,49 +38930,49 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iUEIdentityIndexValue) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_UEIDENTITYINDEXVALUE == ie_id) { + if (liblte_s1ap_unpack_ueidentityindexvalue(ptr, &msg->UEIdentityIndexValue) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_UEPAGINGID == ie_id) { - if(liblte_s1ap_unpack_uepagingid(ptr, &msg->UEPagingID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_UEPAGINGID == ie_id) { + if (liblte_s1ap_unpack_uepagingid(ptr, &msg->UEPagingID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_PAGINGDRX == ie_id) { - if(liblte_s1ap_unpack_pagingdrx(ptr, &msg->pagingDRX) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_PAGINGDRX == ie_id) { + if (liblte_s1ap_unpack_pagingdrx(ptr, &msg->pagingDRX) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->pagingDRX_present = true; - } else if(LIBLTE_S1AP_IE_ID_CNDOMAIN == ie_id) { - if(liblte_s1ap_unpack_cndomain(ptr, &msg->CNDomain) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CNDOMAIN == ie_id) { + if (liblte_s1ap_unpack_cndomain(ptr, &msg->CNDomain) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_TAILIST == ie_id) { - if(liblte_s1ap_unpack_tailist(ptr, &msg->TAIList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TAILIST == ie_id) { + if (liblte_s1ap_unpack_tailist(ptr, &msg->TAIList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { - if(liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_IDLIST == ie_id) { + if (liblte_s1ap_unpack_csg_idlist(ptr, &msg->CSG_IdList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_IdList_present = true; - } else if(LIBLTE_S1AP_IE_ID_PAGINGPRIORITY == ie_id) { - if(liblte_s1ap_unpack_pagingpriority(ptr, &msg->PagingPriority) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_PAGINGPRIORITY == ie_id) { + if (liblte_s1ap_unpack_pagingpriority(ptr, &msg->PagingPriority) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->PagingPriority_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -42740,104 +38983,99 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_paging( /******************************************************************************* /* Protocol Message HandoverRequestAcknowledge STRUCT ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( - LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_handoverrequestacknowledge(LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Extension - liblte_value_2_bits(msg->ext?1:0, ptr, 1); + liblte_value_2_bits(msg->ext ? 1 : 0, ptr, 1); liblte_align_up_zero(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequestAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_ENCODE_FAIL; } // No. of ProtocolIE uint32_t n_ie = 8; - if(!msg->E_RABFailedToSetupListHOReqAck_present) + if (!msg->E_RABFailedToSetupListHOReqAck_present) n_ie--; - if(!msg->CSG_Id_present) + if (!msg->CSG_Id_present) n_ie--; - if(!msg->CriticalityDiagnostics_present) + if (!msg->CriticalityDiagnostics_present) n_ie--; - if(!msg->CellAccessMode_present) + if (!msg->CellAccessMode_present) n_ie--; liblte_value_2_bits(n_ie, ptr, 16); // Temp container for IEs LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr; + uint8_t* tmp_ptr; // ProtocolIE - MME_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_mme_ue_s1ap_id(&msg->MME_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - eNB_UE_S1AP_ID - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_enb_ue_s1ap_id(&msg->eNB_UE_S1AP_ID, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABAdmittedList - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabadmittedlist(&msg->E_RABAdmittedList, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabadmittedlist(&msg->E_RABAdmittedList, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - E_RABFailedToSetupListHOReqAck - if(msg->E_RABFailedToSetupListHOReqAck_present) { - + if (msg->E_RABFailedToSetupListHOReqAck_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack(&msg->E_RABFailedToSetupListHOReqAck, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_e_rabfailedtosetuplisthoreqack(&msg->E_RABFailedToSetupListHOReqAck, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK, + LIBLTE_S1AP_CRITICALITY_IGNORE, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42845,35 +39083,34 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( } // ProtocolIE - Target_ToSource_TransparentContainer - + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_target_tosource_transparentcontainer(&msg->Target_ToSource_TransparentContainer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER, - LIBLTE_S1AP_CRITICALITY_REJECT, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, + LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER, + LIBLTE_S1AP_CRITICALITY_REJECT, + ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); *ptr += tmp_msg.N_bits; // ProtocolIE - CSG_Id - if(msg->CSG_Id_present) { - + if (msg->CSG_Id_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_csg_id(&msg->CSG_Id, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CSG_ID, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CSG_ID, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42881,18 +39118,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( } // ProtocolIE - CriticalityDiagnostics - if(msg->CriticalityDiagnostics_present) { - + if (msg->CriticalityDiagnostics_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_criticalitydiagnostics(&msg->CriticalityDiagnostics, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42900,18 +39136,17 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( } // ProtocolIE - CellAccessMode - if(msg->CellAccessMode_present) { - + if (msg->CellAccessMode_present) { + tmp_ptr = tmp_msg.msg; - if(liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_cellaccessmode(&msg->CellAccessMode, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } liblte_align_up_zero(&tmp_ptr, 8); tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; - if(liblte_s1ap_pack_protocolie_header(tmp_msg.N_bits / 8, - LIBLTE_S1AP_IE_ID_CELLACCESSMODE, - LIBLTE_S1AP_CRITICALITY_IGNORE, - ptr) != LIBLTE_SUCCESS) { + if (liblte_s1ap_pack_protocolie_header( + tmp_msg.N_bits / 8, LIBLTE_S1AP_IE_ID_CELLACCESSMODE, LIBLTE_S1AP_CRITICALITY_IGNORE, ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } memcpy(*ptr, tmp_msg.msg, tmp_msg.N_bits); @@ -42923,31 +39158,28 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_handoverrequestacknowledge( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequestacknowledge( - uint8_t **ptr, - LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT *msg) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_handoverrequestacknowledge(uint8_t** ptr, LIBLTE_S1AP_MESSAGE_HANDOVERREQUESTACKNOWLEDGE_STRUCT* msg) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_S1AP_CRITICALITY_ENUM crit; - uint32_t ie_id; - uint32_t len; - uint32_t n_ie; - uint32_t i; + uint32_t ie_id; + uint32_t len; + uint32_t n_ie; + uint32_t i; // Set booleans msg->E_RABFailedToSetupListHOReqAck_present = false; - msg->CSG_Id_present = false; - msg->CriticalityDiagnostics_present = false; - msg->CellAccessMode_present = false; + msg->CSG_Id_present = false; + msg->CriticalityDiagnostics_present = false; + msg->CellAccessMode_present = false; // Extension - msg->ext = liblte_bits_2_value(ptr, 1); + msg->ext = liblte_bits_2_value(ptr, 1); liblte_align_up(ptr, 8); - if(msg->ext) { + if (msg->ext) { liblte_log_print("HandoverRequestAcknowledgeIEs error: S1AP ASN extensions not currently supported\n"); return LIBLTE_ERROR_DECODE_FAIL; } @@ -42956,55 +39188,57 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequestacknowledge( n_ie = liblte_bits_2_value(ptr, 16); // Unpack ProtocolIE Fields - for(i=0;iMME_UE_S1AP_ID) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_IE_ID_MME_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_mme_ue_s1ap_id(ptr, &msg->MME_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { - if(liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_ENB_UE_S1AP_ID == ie_id) { + if (liblte_s1ap_unpack_enb_ue_s1ap_id(ptr, &msg->eNB_UE_S1AP_ID) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST == ie_id) { - if(liblte_s1ap_unpack_e_rabadmittedlist(ptr, &msg->E_RABAdmittedList) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABADMITTEDLIST == ie_id) { + if (liblte_s1ap_unpack_e_rabadmittedlist(ptr, &msg->E_RABAdmittedList) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK == ie_id) { - if(liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack(ptr, &msg->E_RABFailedToSetupListHOReqAck) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_E_RABFAILEDTOSETUPLISTHOREQACK == ie_id) { + if (liblte_s1ap_unpack_e_rabfailedtosetuplisthoreqack(ptr, &msg->E_RABFailedToSetupListHOReqAck) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->E_RABFailedToSetupListHOReqAck_present = true; - } else if(LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER == ie_id) { - if(liblte_s1ap_unpack_target_tosource_transparentcontainer(ptr, &msg->Target_ToSource_TransparentContainer) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_TARGET_TOSOURCE_TRANSPARENTCONTAINER == ie_id) { + if (liblte_s1ap_unpack_target_tosource_transparentcontainer(ptr, &msg->Target_ToSource_TransparentContainer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); - } else if(LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { - if(liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CSG_ID == ie_id) { + if (liblte_s1ap_unpack_csg_id(ptr, &msg->CSG_Id) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CSG_Id_present = true; - } else if(LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { - if(liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CRITICALITYDIAGNOSTICS == ie_id) { + if (liblte_s1ap_unpack_criticalitydiagnostics(ptr, &msg->CriticalityDiagnostics) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CriticalityDiagnostics_present = true; - } else if(LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { - if(liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_IE_ID_CELLACCESSMODE == ie_id) { + if (liblte_s1ap_unpack_cellaccessmode(ptr, &msg->CellAccessMode) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } liblte_align_up(ptr, 8); msg->CellAccessMode_present = true; - } + } } err = LIBLTE_SUCCESS; @@ -43015,21 +39249,18 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_handoverrequestacknowledge( /******************************************************************************* /* ProtocolIE-Field ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_header( - uint32_t len, - uint32_t ie_id, - LIBLTE_S1AP_CRITICALITY_ENUM crit, - uint8_t **ptr) +LIBLTE_ERROR_ENUM +liblte_s1ap_pack_protocolie_header(uint32_t len, uint32_t ie_id, LIBLTE_S1AP_CRITICALITY_ENUM crit, uint8_t** ptr) { liblte_value_2_bits(ie_id, ptr, 16); // ProtocolIE-ID - liblte_value_2_bits(crit, ptr, 2); // Criticality + liblte_value_2_bits(crit, ptr, 2); // Criticality liblte_align_up_zero(ptr, 8); - if(len < 128) { // Length - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { // Length + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43038,19 +39269,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_protocolie_header( return LIBLTE_SUCCESS; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_header( - uint8_t **ptr, - uint32_t *ie_id, - LIBLTE_S1AP_CRITICALITY_ENUM *crit, - uint32_t *len) +LIBLTE_ERROR_ENUM +liblte_s1ap_unpack_protocolie_header(uint8_t** ptr, uint32_t* ie_id, LIBLTE_S1AP_CRITICALITY_ENUM* crit, uint32_t* len) { - *ie_id = liblte_bits_2_value(ptr, 16); // ProtocolIE-ID - *crit = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); // Criticality + *ie_id = liblte_bits_2_value(ptr, 16); // ProtocolIE-ID + *crit = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); // Criticality liblte_align_up(ptr, 8); - if(0 == liblte_bits_2_value(ptr, 1)) { // Length + if (0 == liblte_bits_2_value(ptr, 1)) { // Length *len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { *len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43063,220 +39291,234 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_protocolie_header( /******************************************************************************* /* InitiatingMessage CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage( - LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage(LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr = tmp_msg.msg; + uint8_t* tmp_ptr = tmp_msg.msg; // Message - if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGCONTROL) { - if(liblte_s1ap_pack_locationreportingcontrol(&msg->choice.LocationReportingControl, &tmp_ptr) != LIBLTE_SUCCESS) { + if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGCONTROL) { + if (liblte_s1ap_pack_locationreportingcontrol(&msg->choice.LocationReportingControl, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKS1CDMA2000TUNNELING) { - if(liblte_s1ap_pack_downlinks1cdma2000tunneling(&msg->choice.DownlinkS1cdma2000tunneling, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKS1CDMA2000TUNNELING) { + if (liblte_s1ap_pack_downlinks1cdma2000tunneling(&msg->choice.DownlinkS1cdma2000tunneling, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_S1SETUPREQUEST) { - if(liblte_s1ap_pack_s1setuprequest(&msg->choice.S1SetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_S1SETUPREQUEST) { + if (liblte_s1ap_pack_s1setuprequest(&msg->choice.S1SetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECAPABILITYINFOINDICATION) { - if(liblte_s1ap_pack_uecapabilityinfoindication(&msg->choice.UECapabilityInfoIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECAPABILITYINFOINDICATION) { + if (liblte_s1ap_pack_uecapabilityinfoindication(&msg->choice.UECapabilityInfoIndication, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORT) { - if(liblte_s1ap_pack_locationreport(&msg->choice.LocationReport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORT) { + if (liblte_s1ap_pack_locationreport(&msg->choice.LocationReport, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNONUEASSOCIATEDLPPATRANSPORT) { - if(liblte_s1ap_pack_uplinknonueassociatedlppatransport(&msg->choice.UplinkNonUEAssociatedLPPaTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNONUEASSOCIATEDLPPATRANSPORT) { + if (liblte_s1ap_pack_uplinknonueassociatedlppatransport(&msg->choice.UplinkNonUEAssociatedLPPaTransport, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKS1CDMA2000TUNNELING) { - if(liblte_s1ap_pack_uplinks1cdma2000tunneling(&msg->choice.UplinkS1cdma2000tunneling, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKS1CDMA2000TUNNELING) { + if (liblte_s1ap_pack_uplinks1cdma2000tunneling(&msg->choice.UplinkS1cdma2000tunneling, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONTRANSFER) { - if(liblte_s1ap_pack_mmeconfigurationtransfer(&msg->choice.MMEConfigurationTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONTRANSFER) { + if (liblte_s1ap_pack_mmeconfigurationtransfer(&msg->choice.MMEConfigurationTransfer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACESTART) { - if(liblte_s1ap_pack_tracestart(&msg->choice.TraceStart, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACESTART) { + if (liblte_s1ap_pack_tracestart(&msg->choice.TraceStart, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERCANCEL) { - if(liblte_s1ap_pack_handovercancel(&msg->choice.HandoverCancel, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERCANCEL) { + if (liblte_s1ap_pack_handovercancel(&msg->choice.HandoverCancel, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UERADIOCAPABILITYMATCHREQUEST) { - if(liblte_s1ap_pack_ueradiocapabilitymatchrequest(&msg->choice.UERadioCapabilityMatchRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UERADIOCAPABILITYMATCHREQUEST) { + if (liblte_s1ap_pack_ueradiocapabilitymatchrequest(&msg->choice.UERadioCapabilityMatchRequest, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNASTRANSPORT) { - if(liblte_s1ap_pack_downlinknastransport(&msg->choice.DownlinkNASTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNASTRANSPORT) { + if (liblte_s1ap_pack_downlinknastransport(&msg->choice.DownlinkNASTransport, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALCONTEXTSETUPREQUEST) { - if(liblte_s1ap_pack_initialcontextsetuprequest(&msg->choice.InitialContextSetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALCONTEXTSETUPREQUEST) { + if (liblte_s1ap_pack_initialcontextsetuprequest(&msg->choice.InitialContextSetupRequest, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUIRED) { - if(liblte_s1ap_pack_handoverrequired(&msg->choice.HandoverRequired, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUIRED) { + if (liblte_s1ap_pack_handoverrequired(&msg->choice.HandoverRequired, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMEDIRECTINFORMATIONTRANSFER) { - if(liblte_s1ap_pack_mmedirectinformationtransfer(&msg->choice.MMEDirectInformationTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMEDIRECTINFORMATIONTRANSFER) { + if (liblte_s1ap_pack_mmedirectinformationtransfer(&msg->choice.MMEDirectInformationTransfer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACEFAILUREINDICATION) { - if(liblte_s1ap_pack_tracefailureindication(&msg->choice.TraceFailureIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACEFAILUREINDICATION) { + if (liblte_s1ap_pack_tracefailureindication(&msg->choice.TraceFailureIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONUPDATE) { - if(liblte_s1ap_pack_mmeconfigurationupdate(&msg->choice.MMEConfigurationUpdate, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONUPDATE) { + if (liblte_s1ap_pack_mmeconfigurationupdate(&msg->choice.MMEConfigurationUpdate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_WRITEREPLACEWARNINGREQUEST) { - if(liblte_s1ap_pack_writereplacewarningrequest(&msg->choice.WriteReplaceWarningRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_WRITEREPLACEWARNINGREQUEST) { + if (liblte_s1ap_pack_writereplacewarningrequest(&msg->choice.WriteReplaceWarningRequest, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBDIRECTINFORMATIONTRANSFER) { - if(liblte_s1ap_pack_enbdirectinformationtransfer(&msg->choice.ENBDirectInformationTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBDIRECTINFORMATIONTRANSFER) { + if (liblte_s1ap_pack_enbdirectinformationtransfer(&msg->choice.ENBDirectInformationTransfer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKUEASSOCIATEDLPPATRANSPORT) { - if(liblte_s1ap_pack_downlinkueassociatedlppatransport(&msg->choice.DownlinkUEAssociatedLPPaTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKUEASSOCIATEDLPPATRANSPORT) { + if (liblte_s1ap_pack_downlinkueassociatedlppatransport(&msg->choice.DownlinkUEAssociatedLPPaTransport, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASECOMMAND) { - if(liblte_s1ap_pack_e_rabreleasecommand(&msg->choice.E_RABReleaseCommand, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASECOMMAND) { + if (liblte_s1ap_pack_e_rabreleasecommand(&msg->choice.E_RABReleaseCommand, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_NASNONDELIVERYINDICATION) { - if(liblte_s1ap_pack_nasnondeliveryindication(&msg->choice.NASNonDeliveryIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_NASNONDELIVERYINDICATION) { + if (liblte_s1ap_pack_nasnondeliveryindication(&msg->choice.NASNonDeliveryIndication, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONUPDATE) { - if(liblte_s1ap_pack_enbconfigurationupdate(&msg->choice.ENBConfigurationUpdate, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONUPDATE) { + if (liblte_s1ap_pack_enbconfigurationupdate(&msg->choice.ENBConfigurationUpdate, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKUEASSOCIATEDLPPATRANSPORT) { - if(liblte_s1ap_pack_uplinkueassociatedlppatransport(&msg->choice.UplinkUEAssociatedLPPaTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKUEASSOCIATEDLPPATRANSPORT) { + if (liblte_s1ap_pack_uplinkueassociatedlppatransport(&msg->choice.UplinkUEAssociatedLPPaTransport, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALUEMESSAGE) { - if(liblte_s1ap_pack_initialuemessage(&msg->choice.InitialUEMessage, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALUEMESSAGE) { + if (liblte_s1ap_pack_initialuemessage(&msg->choice.InitialUEMessage, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABMODIFYREQUEST) { - if(liblte_s1ap_pack_e_rabmodifyrequest(&msg->choice.E_RABModifyRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABMODIFYREQUEST) { + if (liblte_s1ap_pack_e_rabmodifyrequest(&msg->choice.E_RABModifyRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTMODIFICATIONREQUEST) { - if(liblte_s1ap_pack_uecontextmodificationrequest(&msg->choice.UEContextModificationRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTMODIFICATIONREQUEST) { + if (liblte_s1ap_pack_uecontextmodificationrequest(&msg->choice.UEContextModificationRequest, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABSETUPREQUEST) { - if(liblte_s1ap_pack_e_rabsetuprequest(&msg->choice.E_RABSetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABSETUPREQUEST) { + if (liblte_s1ap_pack_e_rabsetuprequest(&msg->choice.E_RABSetupRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_RESET) { - if(liblte_s1ap_pack_reset(&msg->choice.Reset, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_RESET) { + if (liblte_s1ap_pack_reset(&msg->choice.Reset, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTART) { - if(liblte_s1ap_pack_overloadstart(&msg->choice.OverloadStart, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTART) { + if (liblte_s1ap_pack_overloadstart(&msg->choice.OverloadStart, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASEINDICATION) { - if(liblte_s1ap_pack_e_rabreleaseindication(&msg->choice.E_RABReleaseIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASEINDICATION) { + if (liblte_s1ap_pack_e_rabreleaseindication(&msg->choice.E_RABReleaseIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGFAILUREINDICATION) { - if(liblte_s1ap_pack_locationreportingfailureindication(&msg->choice.LocationReportingFailureIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGFAILUREINDICATION) { + if (liblte_s1ap_pack_locationreportingfailureindication(&msg->choice.LocationReportingFailureIndication, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DEACTIVATETRACE) { - if(liblte_s1ap_pack_deactivatetrace(&msg->choice.DeactivateTrace, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DEACTIVATETRACE) { + if (liblte_s1ap_pack_deactivatetrace(&msg->choice.DeactivateTrace, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PATHSWITCHREQUEST) { - if(liblte_s1ap_pack_pathswitchrequest(&msg->choice.PathSwitchRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PATHSWITCHREQUEST) { + if (liblte_s1ap_pack_pathswitchrequest(&msg->choice.PathSwitchRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUEST) { - if(liblte_s1ap_pack_handoverrequest(&msg->choice.HandoverRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUEST) { + if (liblte_s1ap_pack_handoverrequest(&msg->choice.HandoverRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT) { - if(liblte_s1ap_pack_downlinknonueassociatedlppatransport(&msg->choice.DownlinkNonUEAssociatedLPPaTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT) { + if (liblte_s1ap_pack_downlinknonueassociatedlppatransport(&msg->choice.DownlinkNonUEAssociatedLPPaTransport, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTOP) { - if(liblte_s1ap_pack_overloadstop(&msg->choice.OverloadStop, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTOP) { + if (liblte_s1ap_pack_overloadstop(&msg->choice.OverloadStop, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PAGING) { - if(liblte_s1ap_pack_paging(&msg->choice.Paging, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PAGING) { + if (liblte_s1ap_pack_paging(&msg->choice.Paging, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERNOTIFY) { - if(liblte_s1ap_pack_handovernotify(&msg->choice.HandoverNotify, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERNOTIFY) { + if (liblte_s1ap_pack_handovernotify(&msg->choice.HandoverNotify, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PWSRESTARTINDICATION) { - if(liblte_s1ap_pack_pwsrestartindication(&msg->choice.PWSRestartIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PWSRESTARTINDICATION) { + if (liblte_s1ap_pack_pwsrestartindication(&msg->choice.PWSRestartIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASEREQUEST) { - if(liblte_s1ap_pack_uecontextreleaserequest(&msg->choice.UEContextReleaseRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASEREQUEST) { + if (liblte_s1ap_pack_uecontextreleaserequest(&msg->choice.UEContextReleaseRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNASTRANSPORT) { - if(liblte_s1ap_pack_uplinknastransport(&msg->choice.UplinkNASTransport, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNASTRANSPORT) { + if (liblte_s1ap_pack_uplinknastransport(&msg->choice.UplinkNASTransport, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONTRANSFER) { - if(liblte_s1ap_pack_enbconfigurationtransfer(&msg->choice.ENBConfigurationTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONTRANSFER) { + if (liblte_s1ap_pack_enbconfigurationtransfer(&msg->choice.ENBConfigurationTransfer, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMESTATUSTRANSFER) { - if(liblte_s1ap_pack_mmestatustransfer(&msg->choice.MMEStatusTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMESTATUSTRANSFER) { + if (liblte_s1ap_pack_mmestatustransfer(&msg->choice.MMEStatusTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_CELLTRAFFICTRACE) { - if(liblte_s1ap_pack_celltraffictrace(&msg->choice.CellTrafficTrace, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_CELLTRAFFICTRACE) { + if (liblte_s1ap_pack_celltraffictrace(&msg->choice.CellTrafficTrace, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASECOMMAND) { - if(liblte_s1ap_pack_uecontextreleasecommand(&msg->choice.UEContextReleaseCommand, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASECOMMAND) { + if (liblte_s1ap_pack_uecontextreleasecommand(&msg->choice.UEContextReleaseCommand, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_KILLREQUEST) { - if(liblte_s1ap_pack_killrequest(&msg->choice.KillRequest, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_KILLREQUEST) { + if (liblte_s1ap_pack_killrequest(&msg->choice.KillRequest, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PRIVATEMESSAGE) { - if(liblte_s1ap_pack_privatemessage(&msg->choice.PrivateMessage, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PRIVATEMESSAGE) { + if (liblte_s1ap_pack_privatemessage(&msg->choice.PrivateMessage, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBSTATUSTRANSFER) { - if(liblte_s1ap_pack_enbstatustransfer(&msg->choice.ENBStatusTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBSTATUSTRANSFER) { + if (liblte_s1ap_pack_enbstatustransfer(&msg->choice.ENBStatusTransfer, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ERRORINDICATION) { - if(liblte_s1ap_pack_errorindication(&msg->choice.ErrorIndication, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ERRORINDICATION) { + if (liblte_s1ap_pack_errorindication(&msg->choice.ErrorIndication, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } + } tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; // Procedure code @@ -43289,12 +39531,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage( // Length uint32_t len = (tmp_msg.N_bits + 7) / 8; - if(len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43308,27 +39550,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_initiatingmessage( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage( - uint8_t **ptr, - LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *msg) -{ LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage(uint8_t** ptr, LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Procedure code - msg->procedureCode = liblte_bits_2_value(ptr, 8); + msg->procedureCode = liblte_bits_2_value(ptr, 8); // Criticality - msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); // Length uint32_t len = 0; - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43336,257 +39575,270 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage( } // Message - if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGCONTROL) { + if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGCONTROL) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGCONTROL; - if(liblte_s1ap_unpack_locationreportingcontrol(ptr, &msg->choice.LocationReportingControl) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_locationreportingcontrol(ptr, &msg->choice.LocationReportingControl) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKS1CDMA2000TUNNELING) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKS1CDMA2000TUNNELING) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKS1CDMA2000TUNNELING; - if(liblte_s1ap_unpack_downlinks1cdma2000tunneling(ptr, &msg->choice.DownlinkS1cdma2000tunneling) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_downlinks1cdma2000tunneling(ptr, &msg->choice.DownlinkS1cdma2000tunneling) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_S1SETUPREQUEST; - if(liblte_s1ap_unpack_s1setuprequest(ptr, &msg->choice.S1SetupRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_s1setuprequest(ptr, &msg->choice.S1SetupRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECAPABILITYINFOINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECAPABILITYINFOINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECAPABILITYINFOINDICATION; - if(liblte_s1ap_unpack_uecapabilityinfoindication(ptr, &msg->choice.UECapabilityInfoIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecapabilityinfoindication(ptr, &msg->choice.UECapabilityInfoIndication) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORT; - if(liblte_s1ap_unpack_locationreport(ptr, &msg->choice.LocationReport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_locationreport(ptr, &msg->choice.LocationReport) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKNONUEASSOCIATEDLPPATRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKNONUEASSOCIATEDLPPATRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNONUEASSOCIATEDLPPATRANSPORT; - if(liblte_s1ap_unpack_uplinknonueassociatedlppatransport(ptr, &msg->choice.UplinkNonUEAssociatedLPPaTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uplinknonueassociatedlppatransport(ptr, &msg->choice.UplinkNonUEAssociatedLPPaTransport) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKS1CDMA2000TUNNELING) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKS1CDMA2000TUNNELING) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKS1CDMA2000TUNNELING; - if(liblte_s1ap_unpack_uplinks1cdma2000tunneling(ptr, &msg->choice.UplinkS1cdma2000tunneling) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uplinks1cdma2000tunneling(ptr, &msg->choice.UplinkS1cdma2000tunneling) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONTRANSFER; - if(liblte_s1ap_unpack_mmeconfigurationtransfer(ptr, &msg->choice.MMEConfigurationTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmeconfigurationtransfer(ptr, &msg->choice.MMEConfigurationTransfer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_TRACESTART) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_TRACESTART) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACESTART; - if(liblte_s1ap_unpack_tracestart(ptr, &msg->choice.TraceStart) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tracestart(ptr, &msg->choice.TraceStart) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERCANCEL; - if(liblte_s1ap_unpack_handovercancel(ptr, &msg->choice.HandoverCancel) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handovercancel(ptr, &msg->choice.HandoverCancel) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UERADIOCAPABILITYMATCHREQUEST; - if(liblte_s1ap_unpack_ueradiocapabilitymatchrequest(ptr, &msg->choice.UERadioCapabilityMatchRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ueradiocapabilitymatchrequest(ptr, &msg->choice.UERadioCapabilityMatchRequest) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKNASTRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKNASTRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNASTRANSPORT; - if(liblte_s1ap_unpack_downlinknastransport(ptr, &msg->choice.DownlinkNASTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_downlinknastransport(ptr, &msg->choice.DownlinkNASTransport) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALCONTEXTSETUPREQUEST; - if(liblte_s1ap_unpack_initialcontextsetuprequest(ptr, &msg->choice.InitialContextSetupRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_initialcontextsetuprequest(ptr, &msg->choice.InitialContextSetupRequest) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUIRED; - if(liblte_s1ap_unpack_handoverrequired(ptr, &msg->choice.HandoverRequired) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handoverrequired(ptr, &msg->choice.HandoverRequired) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMEDIRECTINFORMATIONTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMEDIRECTINFORMATIONTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMEDIRECTINFORMATIONTRANSFER; - if(liblte_s1ap_unpack_mmedirectinformationtransfer(ptr, &msg->choice.MMEDirectInformationTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmedirectinformationtransfer(ptr, &msg->choice.MMEDirectInformationTransfer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_TRACEFAILUREINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_TRACEFAILUREINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_TRACEFAILUREINDICATION; - if(liblte_s1ap_unpack_tracefailureindication(ptr, &msg->choice.TraceFailureIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_tracefailureindication(ptr, &msg->choice.TraceFailureIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMECONFIGURATIONUPDATE; - if(liblte_s1ap_unpack_mmeconfigurationupdate(ptr, &msg->choice.MMEConfigurationUpdate) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmeconfigurationupdate(ptr, &msg->choice.MMEConfigurationUpdate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_WRITEREPLACEWARNINGREQUEST; - if(liblte_s1ap_unpack_writereplacewarningrequest(ptr, &msg->choice.WriteReplaceWarningRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_writereplacewarningrequest(ptr, &msg->choice.WriteReplaceWarningRequest) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBDIRECTINFORMATIONTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBDIRECTINFORMATIONTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBDIRECTINFORMATIONTRANSFER; - if(liblte_s1ap_unpack_enbdirectinformationtransfer(ptr, &msg->choice.ENBDirectInformationTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbdirectinformationtransfer(ptr, &msg->choice.ENBDirectInformationTransfer) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKUEASSOCIATEDLPPATRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKUEASSOCIATEDLPPATRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKUEASSOCIATEDLPPATRANSPORT; - if(liblte_s1ap_unpack_downlinkueassociatedlppatransport(ptr, &msg->choice.DownlinkUEAssociatedLPPaTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_downlinkueassociatedlppatransport(ptr, &msg->choice.DownlinkUEAssociatedLPPaTransport) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASECOMMAND; - if(liblte_s1ap_unpack_e_rabreleasecommand(ptr, &msg->choice.E_RABReleaseCommand) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabreleasecommand(ptr, &msg->choice.E_RABReleaseCommand) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_NASNONDELIVERYINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_NASNONDELIVERYINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_NASNONDELIVERYINDICATION; - if(liblte_s1ap_unpack_nasnondeliveryindication(ptr, &msg->choice.NASNonDeliveryIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_nasnondeliveryindication(ptr, &msg->choice.NASNonDeliveryIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONUPDATE; - if(liblte_s1ap_unpack_enbconfigurationupdate(ptr, &msg->choice.ENBConfigurationUpdate) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbconfigurationupdate(ptr, &msg->choice.ENBConfigurationUpdate) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKUEASSOCIATEDLPPATRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKUEASSOCIATEDLPPATRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKUEASSOCIATEDLPPATRANSPORT; - if(liblte_s1ap_unpack_uplinkueassociatedlppatransport(ptr, &msg->choice.UplinkUEAssociatedLPPaTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uplinkueassociatedlppatransport(ptr, &msg->choice.UplinkUEAssociatedLPPaTransport) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALUEMESSAGE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALUEMESSAGE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_INITIALUEMESSAGE; - if(liblte_s1ap_unpack_initialuemessage(ptr, &msg->choice.InitialUEMessage) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_initialuemessage(ptr, &msg->choice.InitialUEMessage) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABMODIFY) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABMODIFY) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABMODIFYREQUEST; - if(liblte_s1ap_unpack_e_rabmodifyrequest(ptr, &msg->choice.E_RABModifyRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabmodifyrequest(ptr, &msg->choice.E_RABModifyRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTMODIFICATIONREQUEST; - if(liblte_s1ap_unpack_uecontextmodificationrequest(ptr, &msg->choice.UEContextModificationRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextmodificationrequest(ptr, &msg->choice.UEContextModificationRequest) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABSETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABSETUP) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABSETUPREQUEST; - if(liblte_s1ap_unpack_e_rabsetuprequest(ptr, &msg->choice.E_RABSetupRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabsetuprequest(ptr, &msg->choice.E_RABSetupRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_RESET) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_RESET) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_RESET; - if(liblte_s1ap_unpack_reset(ptr, &msg->choice.Reset) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_reset(ptr, &msg->choice.Reset) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_OVERLOADSTART) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_OVERLOADSTART) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTART; - if(liblte_s1ap_unpack_overloadstart(ptr, &msg->choice.OverloadStart) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_overloadstart(ptr, &msg->choice.OverloadStart) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASEINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASEINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_E_RABRELEASEINDICATION; - if(liblte_s1ap_unpack_e_rabreleaseindication(ptr, &msg->choice.E_RABReleaseIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabreleaseindication(ptr, &msg->choice.E_RABReleaseIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGFAILUREINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_LOCATIONREPORTINGFAILUREINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_LOCATIONREPORTINGFAILUREINDICATION; - if(liblte_s1ap_unpack_locationreportingfailureindication(ptr, &msg->choice.LocationReportingFailureIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_locationreportingfailureindication(ptr, &msg->choice.LocationReportingFailureIndication) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_DEACTIVATETRACE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_DEACTIVATETRACE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DEACTIVATETRACE; - if(liblte_s1ap_unpack_deactivatetrace(ptr, &msg->choice.DeactivateTrace) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_deactivatetrace(ptr, &msg->choice.DeactivateTrace) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PATHSWITCHREQUEST; - if(liblte_s1ap_unpack_pathswitchrequest(ptr, &msg->choice.PathSwitchRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pathswitchrequest(ptr, &msg->choice.PathSwitchRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERREQUEST; - if(liblte_s1ap_unpack_handoverrequest(ptr, &msg->choice.HandoverRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handoverrequest(ptr, &msg->choice.HandoverRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNONUEASSOCIATEDLPPATRANSPORT; - if(liblte_s1ap_unpack_downlinknonueassociatedlppatransport(ptr, &msg->choice.DownlinkNonUEAssociatedLPPaTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_downlinknonueassociatedlppatransport( + ptr, &msg->choice.DownlinkNonUEAssociatedLPPaTransport) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_OVERLOADSTOP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_OVERLOADSTOP) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_OVERLOADSTOP; - if(liblte_s1ap_unpack_overloadstop(ptr, &msg->choice.OverloadStop) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_overloadstop(ptr, &msg->choice.OverloadStop) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PAGING) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PAGING) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PAGING; - if(liblte_s1ap_unpack_paging(ptr, &msg->choice.Paging) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_paging(ptr, &msg->choice.Paging) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERNOTIFICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERNOTIFICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_HANDOVERNOTIFY; - if(liblte_s1ap_unpack_handovernotify(ptr, &msg->choice.HandoverNotify) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handovernotify(ptr, &msg->choice.HandoverNotify) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PWSRESTARTINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PWSRESTARTINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PWSRESTARTINDICATION; - if(liblte_s1ap_unpack_pwsrestartindication(ptr, &msg->choice.PWSRestartIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pwsrestartindication(ptr, &msg->choice.PWSRestartIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASEREQUEST) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASEREQUEST) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASEREQUEST; - if(liblte_s1ap_unpack_uecontextreleaserequest(ptr, &msg->choice.UEContextReleaseRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextreleaserequest(ptr, &msg->choice.UEContextReleaseRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKNASTRANSPORT) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UPLINKNASTRANSPORT) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UPLINKNASTRANSPORT; - if(liblte_s1ap_unpack_uplinknastransport(ptr, &msg->choice.UplinkNASTransport) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uplinknastransport(ptr, &msg->choice.UplinkNASTransport) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBCONFIGURATIONTRANSFER; - if(liblte_s1ap_unpack_enbconfigurationtransfer(ptr, &msg->choice.ENBConfigurationTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbconfigurationtransfer(ptr, &msg->choice.ENBConfigurationTransfer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMESTATUSTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMESTATUSTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_MMESTATUSTRANSFER; - if(liblte_s1ap_unpack_mmestatustransfer(ptr, &msg->choice.MMEStatusTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmestatustransfer(ptr, &msg->choice.MMEStatusTransfer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_CELLTRAFFICTRACE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_CELLTRAFFICTRACE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_CELLTRAFFICTRACE; - if(liblte_s1ap_unpack_celltraffictrace(ptr, &msg->choice.CellTrafficTrace) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_celltraffictrace(ptr, &msg->choice.CellTrafficTrace) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_UECONTEXTRELEASECOMMAND; - if(liblte_s1ap_unpack_uecontextreleasecommand(ptr, &msg->choice.UEContextReleaseCommand) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextreleasecommand(ptr, &msg->choice.UEContextReleaseCommand) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_KILL) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_KILL) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_KILLREQUEST; - if(liblte_s1ap_unpack_killrequest(ptr, &msg->choice.KillRequest) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_killrequest(ptr, &msg->choice.KillRequest) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PRIVATEMESSAGE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PRIVATEMESSAGE) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_PRIVATEMESSAGE; - if(liblte_s1ap_unpack_privatemessage(ptr, &msg->choice.PrivateMessage) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_privatemessage(ptr, &msg->choice.PrivateMessage) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBSTATUSTRANSFER) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBSTATUSTRANSFER) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ENBSTATUSTRANSFER; - if(liblte_s1ap_unpack_enbstatustransfer(ptr, &msg->choice.ENBStatusTransfer) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbstatustransfer(ptr, &msg->choice.ENBStatusTransfer) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ERRORINDICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ERRORINDICATION) { msg->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_ERRORINDICATION; - if(liblte_s1ap_unpack_errorindication(ptr, &msg->choice.ErrorIndication) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_errorindication(ptr, &msg->choice.ErrorIndication) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } + } err = LIBLTE_SUCCESS; } return err; @@ -43595,52 +39847,54 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_initiatingmessage( /******************************************************************************* /* UnsuccessfulOutcome CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome( - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome(LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr = tmp_msg.msg; + uint8_t* tmp_ptr = tmp_msg.msg; // Message - if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_S1SETUPFAILURE) { - if(liblte_s1ap_pack_s1setupfailure(&msg->choice.S1SetupFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_S1SETUPFAILURE) { + if (liblte_s1ap_pack_s1setupfailure(&msg->choice.S1SetupFailure, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTFAILURE) { - if(liblte_s1ap_pack_pathswitchrequestfailure(&msg->choice.PathSwitchRequestFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTFAILURE) { + if (liblte_s1ap_pack_pathswitchrequestfailure(&msg->choice.PathSwitchRequestFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONFAILURE) { - if(liblte_s1ap_pack_uecontextmodificationfailure(&msg->choice.UEContextModificationFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONFAILURE) { + if (liblte_s1ap_pack_uecontextmodificationfailure(&msg->choice.UEContextModificationFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPFAILURE) { - if(liblte_s1ap_pack_initialcontextsetupfailure(&msg->choice.InitialContextSetupFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPFAILURE) { + if (liblte_s1ap_pack_initialcontextsetupfailure(&msg->choice.InitialContextSetupFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEFAILURE) { - if(liblte_s1ap_pack_enbconfigurationupdatefailure(&msg->choice.ENBConfigurationUpdateFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEFAILURE) { + if (liblte_s1ap_pack_enbconfigurationupdatefailure(&msg->choice.ENBConfigurationUpdateFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERPREPARATIONFAILURE) { - if(liblte_s1ap_pack_handoverpreparationfailure(&msg->choice.HandoverPreparationFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERPREPARATIONFAILURE) { + if (liblte_s1ap_pack_handoverpreparationfailure(&msg->choice.HandoverPreparationFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERFAILURE) { - if(liblte_s1ap_pack_handoverfailure(&msg->choice.HandoverFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERFAILURE) { + if (liblte_s1ap_pack_handoverfailure(&msg->choice.HandoverFailure, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEFAILURE) { - if(liblte_s1ap_pack_mmeconfigurationupdatefailure(&msg->choice.MMEConfigurationUpdateFailure, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEFAILURE) { + if (liblte_s1ap_pack_mmeconfigurationupdatefailure(&msg->choice.MMEConfigurationUpdateFailure, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } + } tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; // Procedure code @@ -43653,12 +39907,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome( // Length uint32_t len = (tmp_msg.N_bits + 7) / 8; - if(len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43672,27 +39926,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_unsuccessfuloutcome( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome( - uint8_t **ptr, - LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT *msg) -{ LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome(uint8_t** ptr, LIBLTE_S1AP_UNSUCCESSFULOUTCOME_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Procedure code - msg->procedureCode = liblte_bits_2_value(ptr, 8); + msg->procedureCode = liblte_bits_2_value(ptr, 8); // Criticality - msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); // Length uint32_t len = 0; - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43700,47 +39951,52 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome( } // Message - if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { + if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_S1SETUPFAILURE; - if(liblte_s1ap_unpack_s1setupfailure(ptr, &msg->choice.S1SetupFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_s1setupfailure(ptr, &msg->choice.S1SetupFailure) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTFAILURE; - if(liblte_s1ap_unpack_pathswitchrequestfailure(ptr, &msg->choice.PathSwitchRequestFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pathswitchrequestfailure(ptr, &msg->choice.PathSwitchRequestFailure) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONFAILURE; - if(liblte_s1ap_unpack_uecontextmodificationfailure(ptr, &msg->choice.UEContextModificationFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextmodificationfailure(ptr, &msg->choice.UEContextModificationFailure) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPFAILURE; - if(liblte_s1ap_unpack_initialcontextsetupfailure(ptr, &msg->choice.InitialContextSetupFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_initialcontextsetupfailure(ptr, &msg->choice.InitialContextSetupFailure) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEFAILURE; - if(liblte_s1ap_unpack_enbconfigurationupdatefailure(ptr, &msg->choice.ENBConfigurationUpdateFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbconfigurationupdatefailure(ptr, &msg->choice.ENBConfigurationUpdateFailure) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERPREPARATIONFAILURE; - if(liblte_s1ap_unpack_handoverpreparationfailure(ptr, &msg->choice.HandoverPreparationFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handoverpreparationfailure(ptr, &msg->choice.HandoverPreparationFailure) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_HANDOVERFAILURE; - if(liblte_s1ap_unpack_handoverfailure(ptr, &msg->choice.HandoverFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handoverfailure(ptr, &msg->choice.HandoverFailure) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_UNSUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEFAILURE; - if(liblte_s1ap_unpack_mmeconfigurationupdatefailure(ptr, &msg->choice.MMEConfigurationUpdateFailure) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmeconfigurationupdatefailure(ptr, &msg->choice.MMEConfigurationUpdateFailure) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } + } err = LIBLTE_SUCCESS; } return err; @@ -43749,88 +40005,94 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_unsuccessfuloutcome( /******************************************************************************* /* SuccessfulOutcome CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome( - LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg, - uint8_t **ptr) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome(LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT* msg, uint8_t** ptr) { LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { LIBLTE_BIT_MSG_STRUCT tmp_msg; - uint8_t *tmp_ptr = tmp_msg.msg; + uint8_t* tmp_ptr = tmp_msg.msg; // Message - if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERREQUESTACKNOWLEDGE) { - if(liblte_s1ap_pack_handoverrequestacknowledge(&msg->choice.HandoverRequestAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERREQUESTACKNOWLEDGE) { + if (liblte_s1ap_pack_handoverrequestacknowledge(&msg->choice.HandoverRequestAcknowledge, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTRELEASECOMPLETE) { - if(liblte_s1ap_pack_uecontextreleasecomplete(&msg->choice.UEContextReleaseComplete, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTRELEASECOMPLETE) { + if (liblte_s1ap_pack_uecontextreleasecomplete(&msg->choice.UEContextReleaseComplete, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UERADIOCAPABILITYMATCHRESPONSE) { - if(liblte_s1ap_pack_ueradiocapabilitymatchresponse(&msg->choice.UERadioCapabilityMatchResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UERADIOCAPABILITYMATCHRESPONSE) { + if (liblte_s1ap_pack_ueradiocapabilitymatchresponse(&msg->choice.UERadioCapabilityMatchResponse, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPRESPONSE) { - if(liblte_s1ap_pack_initialcontextsetupresponse(&msg->choice.InitialContextSetupResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPRESPONSE) { + if (liblte_s1ap_pack_initialcontextsetupresponse(&msg->choice.InitialContextSetupResponse, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABSETUPRESPONSE) { - if(liblte_s1ap_pack_e_rabsetupresponse(&msg->choice.E_RABSetupResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABSETUPRESPONSE) { + if (liblte_s1ap_pack_e_rabsetupresponse(&msg->choice.E_RABSetupResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTACKNOWLEDGE) { - if(liblte_s1ap_pack_pathswitchrequestacknowledge(&msg->choice.PathSwitchRequestAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTACKNOWLEDGE) { + if (liblte_s1ap_pack_pathswitchrequestacknowledge(&msg->choice.PathSwitchRequestAcknowledge, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEACKNOWLEDGE) { - if(liblte_s1ap_pack_mmeconfigurationupdateacknowledge(&msg->choice.MMEConfigurationUpdateAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEACKNOWLEDGE) { + if (liblte_s1ap_pack_mmeconfigurationupdateacknowledge(&msg->choice.MMEConfigurationUpdateAcknowledge, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_RESETACKNOWLEDGE) { - if(liblte_s1ap_pack_resetacknowledge(&msg->choice.ResetAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_RESETACKNOWLEDGE) { + if (liblte_s1ap_pack_resetacknowledge(&msg->choice.ResetAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEACKNOWLEDGE) { - if(liblte_s1ap_pack_enbconfigurationupdateacknowledge(&msg->choice.ENBConfigurationUpdateAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEACKNOWLEDGE) { + if (liblte_s1ap_pack_enbconfigurationupdateacknowledge(&msg->choice.ENBConfigurationUpdateAcknowledge, + &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABMODIFYRESPONSE) { - if(liblte_s1ap_pack_e_rabmodifyresponse(&msg->choice.E_RABModifyResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABMODIFYRESPONSE) { + if (liblte_s1ap_pack_e_rabmodifyresponse(&msg->choice.E_RABModifyResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_WRITEREPLACEWARNINGRESPONSE) { - if(liblte_s1ap_pack_writereplacewarningresponse(&msg->choice.WriteReplaceWarningResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_WRITEREPLACEWARNINGRESPONSE) { + if (liblte_s1ap_pack_writereplacewarningresponse(&msg->choice.WriteReplaceWarningResponse, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_S1SETUPRESPONSE) { - if(liblte_s1ap_pack_s1setupresponse(&msg->choice.S1SetupResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_S1SETUPRESPONSE) { + if (liblte_s1ap_pack_s1setupresponse(&msg->choice.S1SetupResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_KILLRESPONSE) { - if(liblte_s1ap_pack_killresponse(&msg->choice.KillResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_KILLRESPONSE) { + if (liblte_s1ap_pack_killresponse(&msg->choice.KillResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONRESPONSE) { - if(liblte_s1ap_pack_uecontextmodificationresponse(&msg->choice.UEContextModificationResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONRESPONSE) { + if (liblte_s1ap_pack_uecontextmodificationresponse(&msg->choice.UEContextModificationResponse, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCOMMAND) { - if(liblte_s1ap_pack_handovercommand(&msg->choice.HandoverCommand, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCOMMAND) { + if (liblte_s1ap_pack_handovercommand(&msg->choice.HandoverCommand, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCANCELACKNOWLEDGE) { - if(liblte_s1ap_pack_handovercancelacknowledge(&msg->choice.HandoverCancelAcknowledge, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCANCELACKNOWLEDGE) { + if (liblte_s1ap_pack_handovercancelacknowledge(&msg->choice.HandoverCancelAcknowledge, &tmp_ptr) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABRELEASERESPONSE) { - if(liblte_s1ap_pack_e_rabreleaseresponse(&msg->choice.E_RABReleaseResponse, &tmp_ptr) != LIBLTE_SUCCESS) { + } else if (msg->choice_type == LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABRELEASERESPONSE) { + if (liblte_s1ap_pack_e_rabreleaseresponse(&msg->choice.E_RABReleaseResponse, &tmp_ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } + } tmp_msg.N_bits = tmp_ptr - tmp_msg.msg; // Procedure code @@ -43843,12 +40105,12 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome( // Length uint32_t len = (tmp_msg.N_bits + 7) / 8; - if(len < 128) { - liblte_value_2_bits(0, ptr, 1); + if (len < 128) { + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 7); - } else if(len < 16383) { - liblte_value_2_bits(1, ptr, 1); - liblte_value_2_bits(0, ptr, 1); + } else if (len < 16383) { + liblte_value_2_bits(1, ptr, 1); + liblte_value_2_bits(0, ptr, 1); liblte_value_2_bits(len, ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43862,27 +40124,24 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_successfuloutcome( return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_successfuloutcome( - uint8_t **ptr, - LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT *msg) -{ LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_successfuloutcome(uint8_t** ptr, LIBLTE_S1AP_SUCCESSFULOUTCOME_STRUCT* msg) +{ + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(msg != NULL && - ptr != NULL) - { + if (msg != NULL && ptr != NULL) { // Procedure code - msg->procedureCode = liblte_bits_2_value(ptr, 8); + msg->procedureCode = liblte_bits_2_value(ptr, 8); // Criticality - msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); + msg->criticality = (LIBLTE_S1AP_CRITICALITY_ENUM)liblte_bits_2_value(ptr, 2); liblte_align_up(ptr, 8); // Length uint32_t len = 0; - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 7); } else { - if(0 == liblte_bits_2_value(ptr, 1)) { + if (0 == liblte_bits_2_value(ptr, 1)) { len = liblte_bits_2_value(ptr, 14); } else { // FIXME: Unlikely to have more than 16K of octets @@ -43890,132 +40149,135 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_successfuloutcome( } // Message - if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { + if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERRESOURCEALLOCATION) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERREQUESTACKNOWLEDGE; - if(liblte_s1ap_unpack_handoverrequestacknowledge(ptr, &msg->choice.HandoverRequestAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handoverrequestacknowledge(ptr, &msg->choice.HandoverRequestAcknowledge) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTRELEASE) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTRELEASECOMPLETE; - if(liblte_s1ap_unpack_uecontextreleasecomplete(ptr, &msg->choice.UEContextReleaseComplete) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextreleasecomplete(ptr, &msg->choice.UEContextReleaseComplete) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UERADIOCAPABILITYMATCH) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UERADIOCAPABILITYMATCHRESPONSE; - if(liblte_s1ap_unpack_ueradiocapabilitymatchresponse(ptr, &msg->choice.UERadioCapabilityMatchResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_ueradiocapabilitymatchresponse(ptr, &msg->choice.UERadioCapabilityMatchResponse) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_INITIALCONTEXTSETUP) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_INITIALCONTEXTSETUPRESPONSE; - if(liblte_s1ap_unpack_initialcontextsetupresponse(ptr, &msg->choice.InitialContextSetupResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_initialcontextsetupresponse(ptr, &msg->choice.InitialContextSetupResponse) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABSETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABSETUP) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABSETUPRESPONSE; - if(liblte_s1ap_unpack_e_rabsetupresponse(ptr, &msg->choice.E_RABSetupResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabsetupresponse(ptr, &msg->choice.E_RABSetupResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_PATHSWITCHREQUEST) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_PATHSWITCHREQUESTACKNOWLEDGE; - if(liblte_s1ap_unpack_pathswitchrequestacknowledge(ptr, &msg->choice.PathSwitchRequestAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_pathswitchrequestacknowledge(ptr, &msg->choice.PathSwitchRequestAcknowledge) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_MMECONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_MMECONFIGURATIONUPDATEACKNOWLEDGE; - if(liblte_s1ap_unpack_mmeconfigurationupdateacknowledge(ptr, &msg->choice.MMEConfigurationUpdateAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_mmeconfigurationupdateacknowledge(ptr, &msg->choice.MMEConfigurationUpdateAcknowledge) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_RESET) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_RESET) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_RESETACKNOWLEDGE; - if(liblte_s1ap_unpack_resetacknowledge(ptr, &msg->choice.ResetAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_resetacknowledge(ptr, &msg->choice.ResetAcknowledge) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_ENBCONFIGURATIONUPDATE) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_ENBCONFIGURATIONUPDATEACKNOWLEDGE; - if(liblte_s1ap_unpack_enbconfigurationupdateacknowledge(ptr, &msg->choice.ENBConfigurationUpdateAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_enbconfigurationupdateacknowledge(ptr, &msg->choice.ENBConfigurationUpdateAcknowledge) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABMODIFY) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABMODIFY) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABMODIFYRESPONSE; - if(liblte_s1ap_unpack_e_rabmodifyresponse(ptr, &msg->choice.E_RABModifyResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabmodifyresponse(ptr, &msg->choice.E_RABModifyResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_WRITEREPLACEWARNING) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_WRITEREPLACEWARNINGRESPONSE; - if(liblte_s1ap_unpack_writereplacewarningresponse(ptr, &msg->choice.WriteReplaceWarningResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_writereplacewarningresponse(ptr, &msg->choice.WriteReplaceWarningResponse) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_S1SETUP) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_S1SETUPRESPONSE; - if(liblte_s1ap_unpack_s1setupresponse(ptr, &msg->choice.S1SetupResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_s1setupresponse(ptr, &msg->choice.S1SetupResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_KILL) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_KILL) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_KILLRESPONSE; - if(liblte_s1ap_unpack_killresponse(ptr, &msg->choice.KillResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_killresponse(ptr, &msg->choice.KillResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_UECONTEXTMODIFICATION) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_UECONTEXTMODIFICATIONRESPONSE; - if(liblte_s1ap_unpack_uecontextmodificationresponse(ptr, &msg->choice.UEContextModificationResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_uecontextmodificationresponse(ptr, &msg->choice.UEContextModificationResponse) != + LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERPREPARATION) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCOMMAND; - if(liblte_s1ap_unpack_handovercommand(ptr, &msg->choice.HandoverCommand) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handovercommand(ptr, &msg->choice.HandoverCommand) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_HANDOVERCANCEL) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_HANDOVERCANCELACKNOWLEDGE; - if(liblte_s1ap_unpack_handovercancelacknowledge(ptr, &msg->choice.HandoverCancelAcknowledge) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_handovercancelacknowledge(ptr, &msg->choice.HandoverCancelAcknowledge) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } else if(msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASE) { + } else if (msg->procedureCode == LIBLTE_S1AP_PROC_ID_E_RABRELEASE) { msg->choice_type = LIBLTE_S1AP_SUCCESSFULOUTCOME_CHOICE_E_RABRELEASERESPONSE; - if(liblte_s1ap_unpack_e_rabreleaseresponse(ptr, &msg->choice.E_RABReleaseResponse) != LIBLTE_SUCCESS) { + if (liblte_s1ap_unpack_e_rabreleaseresponse(ptr, &msg->choice.E_RABReleaseResponse) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - } + } err = LIBLTE_SUCCESS; } return err; } - /******************************************************************************* /* S1AP_PDU CHOICE ********************************************************************************/ -LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1ap_pdu( - LIBLTE_S1AP_S1AP_PDU_STRUCT *s1ap_pdu, - LIBLTE_BYTE_MSG_STRUCT *msg) +LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1ap_pdu(LIBLTE_S1AP_S1AP_PDU_STRUCT* s1ap_pdu, LIBLTE_BYTE_MSG_STRUCT* msg) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_BIT_MSG_STRUCT bit_msg; - if(s1ap_pdu != NULL && - msg != NULL) - { - uint8_t *p = bit_msg.msg; - uint8_t **ptr = &p; + if (s1ap_pdu != NULL && msg != NULL) { + uint8_t* p = bit_msg.msg; + uint8_t** ptr = &p; // Extension - liblte_value_2_bits(s1ap_pdu->ext?1:0, ptr, 1); + liblte_value_2_bits(s1ap_pdu->ext ? 1 : 0, ptr, 1); // Message choice liblte_value_2_bits(s1ap_pdu->choice_type, ptr, 2); liblte_align_up_zero(ptr, 8); // Message - if(LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE == s1ap_pdu->choice_type) { - if(liblte_s1ap_pack_initiatingmessage(&s1ap_pdu->choice.initiatingMessage, ptr) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE == s1ap_pdu->choice_type) { + if (liblte_s1ap_pack_initiatingmessage(&s1ap_pdu->choice.initiatingMessage, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - } else if(LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME == s1ap_pdu->choice_type) { - if(liblte_s1ap_pack_successfuloutcome(&s1ap_pdu->choice.successfulOutcome, ptr) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME == s1ap_pdu->choice_type) { + if (liblte_s1ap_pack_successfuloutcome(&s1ap_pdu->choice.successfulOutcome, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } - }else if(LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == s1ap_pdu->choice_type) { - if(liblte_s1ap_pack_unsuccessfuloutcome(&s1ap_pdu->choice.unsuccessfulOutcome, ptr) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == s1ap_pdu->choice_type) { + if (liblte_s1ap_pack_unsuccessfuloutcome(&s1ap_pdu->choice.unsuccessfulOutcome, ptr) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_ENCODE_FAIL; } } @@ -44025,25 +40287,20 @@ LIBLTE_ERROR_ENUM liblte_s1ap_pack_s1ap_pdu( liblte_pack(&bit_msg, msg); err = LIBLTE_SUCCESS; - } return err; } -LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1ap_pdu( - LIBLTE_BYTE_MSG_STRUCT *msg, - LIBLTE_S1AP_S1AP_PDU_STRUCT *s1ap_pdu) +LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1ap_pdu(LIBLTE_BYTE_MSG_STRUCT* msg, LIBLTE_S1AP_S1AP_PDU_STRUCT* s1ap_pdu) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_BIT_MSG_STRUCT bit_msg; - if(s1ap_pdu != NULL && - msg != NULL) - { + if (s1ap_pdu != NULL && msg != NULL) { liblte_unpack(msg, &bit_msg); - uint8_t *p = bit_msg.msg; - uint8_t **ptr = &p; + uint8_t* p = bit_msg.msg; + uint8_t** ptr = &p; // Extension s1ap_pdu->ext = liblte_bits_2_value(ptr, 1); @@ -44053,16 +40310,16 @@ LIBLTE_ERROR_ENUM liblte_s1ap_unpack_s1ap_pdu( liblte_align_up(ptr, 8); // Message - if(LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE == s1ap_pdu->choice_type) { - if(liblte_s1ap_unpack_initiatingmessage(ptr, &s1ap_pdu->choice.initiatingMessage) != LIBLTE_SUCCESS) { + if (LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE == s1ap_pdu->choice_type) { + if (liblte_s1ap_unpack_initiatingmessage(ptr, &s1ap_pdu->choice.initiatingMessage) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - }else if(LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME == s1ap_pdu->choice_type) { - if(liblte_s1ap_unpack_successfuloutcome(ptr, &s1ap_pdu->choice.successfulOutcome) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_S1AP_PDU_CHOICE_SUCCESSFULOUTCOME == s1ap_pdu->choice_type) { + if (liblte_s1ap_unpack_successfuloutcome(ptr, &s1ap_pdu->choice.successfulOutcome) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } - }else if(LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == s1ap_pdu->choice_type) { - if(liblte_s1ap_unpack_unsuccessfuloutcome(ptr, &s1ap_pdu->choice.unsuccessfulOutcome) != LIBLTE_SUCCESS) { + } else if (LIBLTE_S1AP_S1AP_PDU_CHOICE_UNSUCCESSFULOUTCOME == s1ap_pdu->choice_type) { + if (liblte_s1ap_unpack_unsuccessfuloutcome(ptr, &s1ap_pdu->choice.unsuccessfulOutcome) != LIBLTE_SUCCESS) { return LIBLTE_ERROR_DECODE_FAIL; } } diff --git a/lib/src/common/liblte_security.cc b/lib/src/common/liblte_security.cc index 09e79fb5a..0038bbf03 100644 --- a/lib/src/common/liblte_security.cc +++ b/lib/src/common/liblte_security.cc @@ -35,97 +35,78 @@ *******************************************************************************/ #include "srslte/common/liblte_security.h" -#include "srslte/common/liblte_ssl.h" #include "math.h" +#include "srslte/common/liblte_ssl.h" /******************************************************************************* DEFINES *******************************************************************************/ - /******************************************************************************* TYPEDEFS *******************************************************************************/ -typedef struct{ - uint8 rk[11][4][4]; -}ROUND_KEY_STRUCT; +typedef struct { + uint8 rk[11][4][4]; +} ROUND_KEY_STRUCT; -typedef struct{ - uint8 state[4][4]; -}STATE_STRUCT; +typedef struct { + uint8 state[4][4]; +} STATE_STRUCT; -typedef struct{ - uint32 * lfsr; - uint32 * fsm; -}S3G_STATE; +typedef struct { + uint32* lfsr; + uint32* fsm; +} S3G_STATE; /******************************************************************************* GLOBAL VARIABLES *******************************************************************************/ -static const uint8 S[256] = { 99,124,119,123,242,107,111,197, 48, 1,103, 43,254,215,171,118, - 202,130,201,125,250, 89, 71,240,173,212,162,175,156,164,114,192, - 183,253,147, 38, 54, 63,247,204, 52,165,229,241,113,216, 49, 21, - 4,199, 35,195, 24,150, 5,154, 7, 18,128,226,235, 39,178,117, - 9,131, 44, 26, 27,110, 90,160, 82, 59,214,179, 41,227, 47,132, - 83,209, 0,237, 32,252,177, 91,106,203,190, 57, 74, 76, 88,207, - 208,239,170,251, 67, 77, 51,133, 69,249, 2,127, 80, 60,159,168, - 81,163, 64,143,146,157, 56,245,188,182,218, 33, 16,255,243,210, - 205, 12, 19,236, 95,151, 68, 23,196,167,126, 61,100, 93, 25,115, - 96,129, 79,220, 34, 42,144,136, 70,238,184, 20,222, 94, 11,219, - 224, 50, 58, 10, 73, 6, 36, 92,194,211,172, 98,145,149,228,121, - 231,200, 55,109,141,213, 78,169,108, 86,244,234,101,122,174, 8, - 186,120, 37, 46, 28,166,180,198,232,221,116, 31, 75,189,139,138, - 112, 62,181,102, 72, 3,246, 14, 97, 53, 87,185,134,193, 29,158, - 225,248,152, 17,105,217,142,148,155, 30,135,233,206, 85, 40,223, - 140,161,137, 13,191,230, 66,104, 65,153, 45, 15,176, 84,187, 22}; +static const uint8 S[256] = { + 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, + 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, + 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, + 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, + 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, + 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, + 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, + 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, + 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, + 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, + 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22}; /* S-box SQ */ -static const uint8 SQ[256] = { 0x25, 0x24, 0x73, 0x67, 0xD7, 0xAE, - 0x5C, 0x30, 0xA4, 0xEE, 0x6E, 0xCB, 0x7D, 0xB5, 0x82, 0xDB, - 0xE4, 0x8E, 0x48, 0x49, 0x4F, 0x5D, 0x6A, 0x78, 0x70, 0x88, - 0xE8, 0x5F, 0x5E, 0x84, 0x65, 0xE2, 0xD8, 0xE9, 0xCC, 0xED, - 0x40, 0x2F, 0x11, 0x28, 0x57, 0xD2, 0xAC, 0xE3, 0x4A, 0x15, - 0x1B, 0xB9, 0xB2, 0x80, 0x85, 0xA6, 0x2E, 0x02, 0x47, 0x29, - 0x07, 0x4B, 0x0E, 0xC1, 0x51, 0xAA, 0x89, 0xD4, 0xCA, 0x01, - 0x46, 0xB3, 0xEF, 0xDD, 0x44, 0x7B, 0xC2, 0x7F, 0xBE, 0xC3, - 0x9F, 0x20, 0x4C, 0x64, 0x83, 0xA2, 0x68, 0x42, 0x13, 0xB4, - 0x41, 0xCD, 0xBA, 0xC6, 0xBB, 0x6D, 0x4D, 0x71, 0x21, 0xF4, - 0x8D, 0xB0, 0xE5, 0x93, 0xFE, 0x8F, 0xE6, 0xCF, 0x43, 0x45, - 0x31, 0x22, 0x37, 0x36, 0x96, 0xFA, 0xBC, 0x0F, 0x08, 0x52, - 0x1D, 0x55, 0x1A, 0xC5, 0x4E, 0x23, 0x69, 0x7A, 0x92, 0xFF, - 0x5B, 0x5A, 0xEB, 0x9A, 0x1C, 0xA9, 0xD1, 0x7E, 0x0D, 0xFC, - 0x50, 0x8A, 0xB6, 0x62, 0xF5, 0x0A, 0xF8, 0xDC, 0x03, 0x3C, - 0x0C, 0x39, 0xF1, 0xB8, 0xF3, 0x3D, 0xF2, 0xD5, 0x97, 0x66, - 0x81, 0x32, 0xA0, 0x00, 0x06, 0xCE, 0xF6, 0xEA, 0xB7, 0x17, - 0xF7, 0x8C, 0x79, 0xD6, 0xA7, 0xBF, 0x8B, 0x3F, 0x1F, 0x53, - 0x63, 0x75, 0x35, 0x2C, 0x60, 0xFD, 0x27, 0xD3, 0x94, 0xA5, - 0x7C, 0xA1, 0x05, 0x58, 0x2D, 0xBD, 0xD9, 0xC7, 0xAF, 0x6B, - 0x54, 0x0B, 0xE0, 0x38, 0x04, 0xC8, 0x9D, 0xE7, 0x14, 0xB1, - 0x87, 0x9C, 0xDF, 0x6F, 0xF9, 0xDA, 0x2A, 0xC4, 0x59, 0x16, - 0x74, 0x91, 0xAB, 0x26, 0x61, 0x76, 0x34, 0x2B, 0xAD, 0x99, - 0xFB, 0x72, 0xEC, 0x33, 0x12, 0xDE, 0x98, 0x3B, 0xC0, 0x9B, - 0x3E, 0x18, 0x10, 0x3A, 0x56, 0xE1, 0x77, 0xC9, 0x1E, 0x9E, - 0x95, 0xA3, 0x90, 0x19, 0xA8, 0x6C, 0x09, 0xD0, 0xF0, 0x86 }; - - -static const uint8 X_TIME[256] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, - 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, - 96, 98,100,102,104,106,108,110,112,114,116,118,120,122,124,126, - 128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158, - 160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190, - 192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222, - 224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254, - 27, 25, 31, 29, 19, 17, 23, 21, 11, 9, 15, 13, 3, 1, 7, 5, - 59, 57, 63, 61, 51, 49, 55, 53, 43, 41, 47, 45, 35, 33, 39, 37, - 91, 89, 95, 93, 83, 81, 87, 85, 75, 73, 79, 77, 67, 65, 71, 69, - 123,121,127,125,115,113,119,117,107,105,111,109, 99, 97,103,101, - 155,153,159,157,147,145,151,149,139,137,143,141,131,129,135,133, - 187,185,191,189,179,177,183,181,171,169,175,173,163,161,167,165, - 219,217,223,221,211,209,215,213,203,201,207,205,195,193,199,197, - 251,249,255,253,243,241,247,245,235,233,239,237,227,225,231,229}; +static const uint8 SQ[256] = { + 0x25, 0x24, 0x73, 0x67, 0xD7, 0xAE, 0x5C, 0x30, 0xA4, 0xEE, 0x6E, 0xCB, 0x7D, 0xB5, 0x82, 0xDB, 0xE4, 0x8E, 0x48, + 0x49, 0x4F, 0x5D, 0x6A, 0x78, 0x70, 0x88, 0xE8, 0x5F, 0x5E, 0x84, 0x65, 0xE2, 0xD8, 0xE9, 0xCC, 0xED, 0x40, 0x2F, + 0x11, 0x28, 0x57, 0xD2, 0xAC, 0xE3, 0x4A, 0x15, 0x1B, 0xB9, 0xB2, 0x80, 0x85, 0xA6, 0x2E, 0x02, 0x47, 0x29, 0x07, + 0x4B, 0x0E, 0xC1, 0x51, 0xAA, 0x89, 0xD4, 0xCA, 0x01, 0x46, 0xB3, 0xEF, 0xDD, 0x44, 0x7B, 0xC2, 0x7F, 0xBE, 0xC3, + 0x9F, 0x20, 0x4C, 0x64, 0x83, 0xA2, 0x68, 0x42, 0x13, 0xB4, 0x41, 0xCD, 0xBA, 0xC6, 0xBB, 0x6D, 0x4D, 0x71, 0x21, + 0xF4, 0x8D, 0xB0, 0xE5, 0x93, 0xFE, 0x8F, 0xE6, 0xCF, 0x43, 0x45, 0x31, 0x22, 0x37, 0x36, 0x96, 0xFA, 0xBC, 0x0F, + 0x08, 0x52, 0x1D, 0x55, 0x1A, 0xC5, 0x4E, 0x23, 0x69, 0x7A, 0x92, 0xFF, 0x5B, 0x5A, 0xEB, 0x9A, 0x1C, 0xA9, 0xD1, + 0x7E, 0x0D, 0xFC, 0x50, 0x8A, 0xB6, 0x62, 0xF5, 0x0A, 0xF8, 0xDC, 0x03, 0x3C, 0x0C, 0x39, 0xF1, 0xB8, 0xF3, 0x3D, + 0xF2, 0xD5, 0x97, 0x66, 0x81, 0x32, 0xA0, 0x00, 0x06, 0xCE, 0xF6, 0xEA, 0xB7, 0x17, 0xF7, 0x8C, 0x79, 0xD6, 0xA7, + 0xBF, 0x8B, 0x3F, 0x1F, 0x53, 0x63, 0x75, 0x35, 0x2C, 0x60, 0xFD, 0x27, 0xD3, 0x94, 0xA5, 0x7C, 0xA1, 0x05, 0x58, + 0x2D, 0xBD, 0xD9, 0xC7, 0xAF, 0x6B, 0x54, 0x0B, 0xE0, 0x38, 0x04, 0xC8, 0x9D, 0xE7, 0x14, 0xB1, 0x87, 0x9C, 0xDF, + 0x6F, 0xF9, 0xDA, 0x2A, 0xC4, 0x59, 0x16, 0x74, 0x91, 0xAB, 0x26, 0x61, 0x76, 0x34, 0x2B, 0xAD, 0x99, 0xFB, 0x72, + 0xEC, 0x33, 0x12, 0xDE, 0x98, 0x3B, 0xC0, 0x9B, 0x3E, 0x18, 0x10, 0x3A, 0x56, 0xE1, 0x77, 0xC9, 0x1E, 0x9E, 0x95, + 0xA3, 0x90, 0x19, 0xA8, 0x6C, 0x09, 0xD0, 0xF0, 0x86}; + +static const uint8 X_TIME[256] = { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, + 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, + 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, + 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, + 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, + 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 27, 25, 31, 29, + 19, 17, 23, 21, 11, 9, 15, 13, 3, 1, 7, 5, 59, 57, 63, 61, 51, 49, 55, 53, 43, 41, + 47, 45, 35, 33, 39, 37, 91, 89, 95, 93, 83, 81, 87, 85, 75, 73, 79, 77, 67, 65, 71, 69, + 123, 121, 127, 125, 115, 113, 119, 117, 107, 105, 111, 109, 99, 97, 103, 101, 155, 153, 159, 157, 147, 145, + 151, 149, 139, 137, 143, 141, 131, 129, 135, 133, 187, 185, 191, 189, 179, 177, 183, 181, 171, 169, 175, 173, + 163, 161, 167, 165, 219, 217, 223, 221, 211, 209, 215, 213, 203, 201, 207, 205, 195, 193, 199, 197, 251, 249, + 255, 253, 243, 241, 247, 245, 235, 233, 239, 237, 227, 225, 231, 229}; /******************************************************************************* LOCAL FUNCTION PROTOTYPES @@ -142,9 +123,7 @@ static const uint8 X_TIME[256] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 2 // Enums // Structs // Functions -void compute_OPc(ROUND_KEY_STRUCT *rk, - uint8 *op, - uint8 *op_c); +void compute_OPc(ROUND_KEY_STRUCT* rk, uint8* op, uint8* op_c); /********************************************************************* Name: rijndael_key_schedule @@ -157,8 +136,7 @@ void compute_OPc(ROUND_KEY_STRUCT *rk, // Enums // Structs // Functions -void rijndael_key_schedule(uint8 *key, - ROUND_KEY_STRUCT *rk); +void rijndael_key_schedule(uint8* key, ROUND_KEY_STRUCT* rk); /********************************************************************* Name: rijndael_encrypt @@ -171,9 +149,7 @@ void rijndael_key_schedule(uint8 *key, // Enums // Structs // Functions -void rijndael_encrypt(uint8 *input, - ROUND_KEY_STRUCT *rk, - uint8 *output); +void rijndael_encrypt(uint8* input, ROUND_KEY_STRUCT* rk, uint8* output); /********************************************************************* Name: key_add @@ -186,9 +162,7 @@ void rijndael_encrypt(uint8 *input, // Enums // Structs // Functions -void key_add(STATE_STRUCT *state, - ROUND_KEY_STRUCT *rk, - uint32 round); +void key_add(STATE_STRUCT* state, ROUND_KEY_STRUCT* rk, uint32 round); /********************************************************************* Name: byte_sub @@ -201,7 +175,7 @@ void key_add(STATE_STRUCT *state, // Enums // Structs // Functions -void byte_sub(STATE_STRUCT *state); +void byte_sub(STATE_STRUCT* state); /********************************************************************* Name: shift_row @@ -214,7 +188,7 @@ void byte_sub(STATE_STRUCT *state); // Enums // Structs // Functions -void shift_row(STATE_STRUCT *state); +void shift_row(STATE_STRUCT* state); /********************************************************************* Name: mix_column @@ -227,7 +201,7 @@ void shift_row(STATE_STRUCT *state); // Enums // Structs // Functions -void mix_column(STATE_STRUCT *state); +void mix_column(STATE_STRUCT* state); /********************************************************************* Name: zero_tailing_bits @@ -236,7 +210,7 @@ void mix_column(STATE_STRUCT *state); Document Reference: - *********************************************************************/ -void zero_tailing_bits(uint8 * data, uint32 length_bits); +void zero_tailing_bits(uint8* data, uint32 length_bits); /********************************************************************* Name: s3g_mul_x @@ -313,7 +287,7 @@ uint32 s3g_s2(uint32 w); Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.4 and Section 3.4.5 *********************************************************************/ -void s3g_clock_lfsr(S3G_STATE * state, uint32 f); +void s3g_clock_lfsr(S3G_STATE* state, uint32 f); /********************************************************************* Name: s3g_clock_fsm @@ -324,7 +298,7 @@ void s3g_clock_lfsr(S3G_STATE * state, uint32 f); Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.6 *********************************************************************/ -uint32 s3g_clock_fsm(S3G_STATE * state); +uint32 s3g_clock_fsm(S3G_STATE* state); /********************************************************************* Name: s3g_initialize @@ -335,7 +309,7 @@ uint32 s3g_clock_fsm(S3G_STATE * state); Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 4.1 *********************************************************************/ -void s3g_initialize(S3G_STATE * state, uint32 k[4], uint32 iv[4]); +void s3g_initialize(S3G_STATE* state, uint32 k[4], uint32 iv[4]); /********************************************************************* Name: s3g_deinitialize @@ -345,7 +319,7 @@ void s3g_initialize(S3G_STATE * state, uint32 k[4], uint32 iv[4]); Document Reference: Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D2 v1.1 *********************************************************************/ -void s3g_deinitialize(S3G_STATE * state); +void s3g_deinitialize(S3G_STATE* state); /********************************************************************* Name: s3g_generate_keystream @@ -356,8 +330,7 @@ void s3g_deinitialize(S3G_STATE * state); Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 4.2 *********************************************************************/ -void s3g_generate_keystream(S3G_STATE * state, uint32 n, uint32 *ks); - +void s3g_generate_keystream(S3G_STATE* state, uint32 n, uint32* ks); /******************************************************************************* FUNCTIONS @@ -370,61 +343,48 @@ void s3g_generate_keystream(S3G_STATE * state, uint32 n, uint32 *ks); Document Reference: 33.401 v10.0.0 Annex A.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck, - uint8 *ik, - uint8 *ak, - uint8 *sqn, - uint16 mcc, - uint16 mnc, - uint8 *k_asme) +LIBLTE_ERROR_ENUM +liblte_security_generate_k_asme(uint8* ck, uint8* ik, uint8* ak, uint8* sqn, uint16 mcc, uint16 mnc, uint8* k_asme) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint32 i; - uint8 s[14]; - uint8 key[32]; - - if(ck != NULL && - ik != NULL && - ak != NULL && - sqn != NULL && - k_asme != NULL) - { - // Construct S - s[0] = 0x10; // FC - s[1] = (mcc & 0x00F0) | ((mcc & 0x0F00) >> 8); // First byte of P0 - if((mnc & 0xFF00) == 0xFF00) - { - // 2-digit MNC - s[2] = 0xF0 | (mcc & 0x000F); // Second byte of P0 - s[3] = ((mnc & 0x000F) << 4) | ((mnc & 0x00F0) >> 4); // Third byte of P0 - }else{ - // 3-digit MNC - s[2] = ((mnc & 0x000F) << 4) | (mcc & 0x000F); // Second byte of P0 - s[3] = ((mnc & 0x00F0)) | ((mnc & 0x0F00) >> 8); // Third byte of P0 - } - s[4] = 0x00; // First byte of L0 - s[5] = 0x03; // Second byte of L0 - for(i=0; i<6; i++) - { - s[6+i] = sqn[i] ^ ak[i]; // P1 - } - s[12] = 0x00; // First byte of L1 - s[13] = 0x06; // Second byte of L1 - - // Construct Key - for(i=0; i<16; i++) - { - key[i] = ck[i]; - key[16+i] = ik[i]; - } - - // Derive Kasme - sha256(key, 32, s, 14, k_asme, 0); - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint32 i; + uint8 s[14]; + uint8 key[32]; + + if (ck != NULL && ik != NULL && ak != NULL && sqn != NULL && k_asme != NULL) { + // Construct S + s[0] = 0x10; // FC + s[1] = (mcc & 0x00F0) | ((mcc & 0x0F00) >> 8); // First byte of P0 + if ((mnc & 0xFF00) == 0xFF00) { + // 2-digit MNC + s[2] = 0xF0 | (mcc & 0x000F); // Second byte of P0 + s[3] = ((mnc & 0x000F) << 4) | ((mnc & 0x00F0) >> 4); // Third byte of P0 + } else { + // 3-digit MNC + s[2] = ((mnc & 0x000F) << 4) | (mcc & 0x000F); // Second byte of P0 + s[3] = ((mnc & 0x00F0)) | ((mnc & 0x0F00) >> 8); // Third byte of P0 + } + s[4] = 0x00; // First byte of L0 + s[5] = 0x03; // Second byte of L0 + for (i = 0; i < 6; i++) { + s[6 + i] = sqn[i] ^ ak[i]; // P1 + } + s[12] = 0x00; // First byte of L1 + s[13] = 0x06; // Second byte of L1 + + // Construct Key + for (i = 0; i < 16; i++) { + key[i] = ck[i]; + key[16 + i] = ik[i]; } - return(err); + // Derive Kasme + sha256(key, 32, s, 14, k_asme, 0); + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -434,32 +394,28 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_asme(uint8 *ck, Document Reference: 33.401 v10.0.0 Annex A.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8 *k_asme, - uint32 nas_count, - uint8 *k_enb) +LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8* k_asme, uint32 nas_count, uint8* k_enb) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[7]; - - if(k_asme != NULL && - k_enb != NULL) - { - // Construct S - s[0] = 0x11; // FC - s[1] = (nas_count >> 24) & 0xFF; // First byte of P0 - s[2] = (nas_count >> 16) & 0xFF; // Second byte of P0 - s[3] = (nas_count >> 8) & 0xFF; // Third byte of P0 - s[4] = nas_count & 0xFF; // Fourth byte of P0 - s[5] = 0x00; // First byte of L0 - s[6] = 0x04; // Second byte of L0 - - // Derive Kenb - sha256(k_asme, 32, s, 7, k_enb, 0); - - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; - return(err); + if (k_asme != NULL && k_enb != NULL) { + // Construct S + s[0] = 0x11; // FC + s[1] = (nas_count >> 24) & 0xFF; // First byte of P0 + s[2] = (nas_count >> 16) & 0xFF; // Second byte of P0 + s[3] = (nas_count >> 8) & 0xFF; // Third byte of P0 + s[4] = nas_count & 0xFF; // Fourth byte of P0 + s[5] = 0x00; // First byte of L0 + s[6] = 0x04; // Second byte of L0 + + // Derive Kenb + sha256(k_asme, 32, s, 7, k_enb, 0); + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -469,62 +425,53 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_enb(uint8 *k_asme, Document Reference: 33.401 v10.0.0 Annex A.5 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8 *k_enb, - uint32 pci, - uint32_t earfcn, - uint8 *k_enb_star) +LIBLTE_ERROR_ENUM liblte_security_generate_k_enb_star(uint8* k_enb, uint32 pci, uint32_t earfcn, uint8* k_enb_star) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[9]; - - if (k_enb_star != NULL && - k_enb != NULL) { - // Construct S - s[0] = 0x13; // FC - s[1] = (pci >> 8) & 0xFF; // First byte of P0 - s[2] = pci & 0xFF; // Second byte of P0 - s[3] = 0x00; // First byte of L0 - s[4] = 0x02; // Second byte of L0 - s[5] = (earfcn >> 8) & 0xFF; // First byte of P0 - s[6] = earfcn & 0xFF; // Second byte of P0 - s[7] = 0x00; // First byte of L0 - s[8] = 0x02; // Second byte of L0 - - // Derive Kenb - sha256(k_enb, 32, s, 9, k_enb_star, 0); - - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[9]; + + if (k_enb_star != NULL && k_enb != NULL) { + // Construct S + s[0] = 0x13; // FC + s[1] = (pci >> 8) & 0xFF; // First byte of P0 + s[2] = pci & 0xFF; // Second byte of P0 + s[3] = 0x00; // First byte of L0 + s[4] = 0x02; // Second byte of L0 + s[5] = (earfcn >> 8) & 0xFF; // First byte of P0 + s[6] = earfcn & 0xFF; // Second byte of P0 + s[7] = 0x00; // First byte of L0 + s[8] = 0x02; // Second byte of L0 + + // Derive Kenb + sha256(k_enb, 32, s, 9, k_enb_star, 0); - return (err); + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_security_generate_nh( uint8_t *k_asme, - uint8_t *sync, - uint8_t *nh) +LIBLTE_ERROR_ENUM liblte_security_generate_nh(uint8_t* k_asme, uint8_t* sync, uint8_t* nh) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[35]; - - if (k_asme != NULL && - sync != NULL && - nh != NULL) - { - // Construct S - s[0] = 0x12; // FC - for (int i=0;i<32;i++) { - s[1+i] = sync[i]; - } - s[33] = 0x00; // First byte of L0 - s[34] = 0x20, // Second byte of L0 + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[35]; + + if (k_asme != NULL && sync != NULL && nh != NULL) { + // Construct S + s[0] = 0x12; // FC + for (int i = 0; i < 32; i++) { + s[1 + i] = sync[i]; + } + s[33] = 0x00; // First byte of L0 + s[34] = 0x20, // Second byte of L0 // Derive NH sha256(k_asme, 32, s, 35, nh, 0); - err = LIBLTE_SUCCESS; - } + err = LIBLTE_SUCCESS; + } - return (err); + return (err); } /********************************************************************* @@ -534,47 +481,44 @@ LIBLTE_ERROR_ENUM liblte_security_generate_nh( uint8_t *k_asme, Document Reference: 33.401 v10.0.0 Annex A.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8 *k_asme, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_nas_enc, - uint8 *k_nas_int) +LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8* k_asme, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_nas_enc, + uint8* k_nas_int) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[7]; - - if(k_asme != NULL && - k_nas_enc != NULL && - k_nas_int != NULL) - { - // Construct S for KNASenc - s[0] = 0x15; // FC - s[1] = 0x01; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = enc_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KNASenc - sha256(k_asme, 32, s, 7, k_nas_enc, 0); - - // Construct S for KNASint - s[0] = 0x15; // FC - s[1] = 0x02; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = int_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KNASint - sha256(k_asme, 32, s, 7, k_nas_int, 0); - - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; + + if (k_asme != NULL && k_nas_enc != NULL && k_nas_int != NULL) { + // Construct S for KNASenc + s[0] = 0x15; // FC + s[1] = 0x01; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = enc_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KNASenc + sha256(k_asme, 32, s, 7, k_nas_enc, 0); + + // Construct S for KNASint + s[0] = 0x15; // FC + s[1] = 0x02; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = int_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KNASint + sha256(k_asme, 32, s, 7, k_nas_int, 0); + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -584,47 +528,44 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_nas(uint8 Document Reference: 33.401 v10.0.0 Annex A.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8 *k_enb, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_rrc_enc, - uint8 *k_rrc_int) +LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8* k_enb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_rrc_enc, + uint8* k_rrc_int) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[7]; - - if(k_enb != NULL && - k_rrc_enc != NULL && - k_rrc_int != NULL) - { - // Construct S for KRRCenc - s[0] = 0x15; // FC - s[1] = 0x03; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = enc_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KRRCenc - sha256(k_enb, 32, s, 7, k_rrc_enc, 0); - - // Construct S for KRRCint - s[0] = 0x15; // FC - s[1] = 0x04; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = int_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KRRCint - sha256(k_enb, 32, s, 7, k_rrc_int, 0); - - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; + + if (k_enb != NULL && k_rrc_enc != NULL && k_rrc_int != NULL) { + // Construct S for KRRCenc + s[0] = 0x15; // FC + s[1] = 0x03; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = enc_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KRRCenc + sha256(k_enb, 32, s, 7, k_rrc_enc, 0); + + // Construct S for KRRCint + s[0] = 0x15; // FC + s[1] = 0x04; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = int_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KRRCint + sha256(k_enb, 32, s, 7, k_rrc_int, 0); - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -635,47 +576,44 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_rrc(uint8 Document Reference: 33.401 v10.0.0 Annex A.2 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8 *k_enb, - LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, - LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, - uint8 *k_up_enc, - uint8 *k_up_int) +LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8* k_enb, + LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_ENUM enc_alg_id, + LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_ENUM int_alg_id, + uint8* k_up_enc, + uint8* k_up_int) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 s[7]; - - if(k_enb != NULL && - k_up_enc != NULL && - k_up_int != NULL) - { - // Construct S for KUPenc - s[0] = 0x15; // FC - s[1] = 0x05; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = enc_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KUPenc - sha256(k_enb, 32, s, 7, k_up_enc, 0); - - // Construct S for KUPint - s[0] = 0x15; // FC - s[1] = 0x06; // P0 - s[2] = 0x00; // First byte of L0 - s[3] = 0x01; // Second byte of L0 - s[4] = int_alg_id; // P1 - s[5] = 0x00; // First byte of L1 - s[6] = 0x01; // Second byte of L1 - - // Derive KUPint - sha256(k_enb, 32, s, 7, k_up_int, 0); - - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 s[7]; + + if (k_enb != NULL && k_up_enc != NULL && k_up_int != NULL) { + // Construct S for KUPenc + s[0] = 0x15; // FC + s[1] = 0x05; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = enc_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KUPenc + sha256(k_enb, 32, s, 7, k_up_enc, 0); + + // Construct S for KUPint + s[0] = 0x15; // FC + s[1] = 0x06; // P0 + s[2] = 0x00; // First byte of L0 + s[3] = 0x01; // Second byte of L0 + s[4] = int_alg_id; // P1 + s[5] = 0x00; // First byte of L1 + s[6] = 0x01; // Second byte of L1 + + // Derive KUPint + sha256(k_enb, 32, s, 7, k_up_int, 0); - return(err); + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -687,228 +625,186 @@ LIBLTE_ERROR_ENUM liblte_security_generate_k_up(uint8 33.102 v10.0.0 Section 6.5.4 RFC4493 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *mac) +LIBLTE_ERROR_ENUM liblte_security_128_eia2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* mac) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 M[msg_len+8+16]; - aes_context ctx; - uint32 i; - uint32 j; - uint32 n; - uint32 pad_bits; - uint8 const_zero[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - uint8 L[16]; - uint8 K1[16]; - uint8 K2[16]; - uint8 T[16]; - uint8 tmp[16]; - - if(key != NULL && - msg != NULL && - mac != NULL) - { - // Subkey L generation - aes_setkey_enc(&ctx, key, 128); - aes_crypt_ecb(&ctx, AES_ENCRYPT, const_zero, L); - - // Subkey K1 generation - for(i=0; i<15; i++) - { - K1[i] = (L[i] << 1) | ((L[i+1] >> 7) & 0x01); - } - K1[15] = L[15] << 1; - if(L[0] & 0x80) - { - K1[15] ^= 0x87; - } - - // Subkey K2 generation - for(i=0; i<15; i++) - { - K2[i] = (K1[i] << 1) | ((K1[i+1] >> 7) & 0x01); - } - K2[15] = K1[15] << 1; - if(K1[0] & 0x80) - { - K2[15] ^= 0x87; - } - - // Construct M - memset(M, 0, msg_len+8+16); - M[0] = (count >> 24) & 0xFF; - M[1] = (count >> 16) & 0xFF; - M[2] = (count >> 8) & 0xFF; - M[3] = count & 0xFF; - M[4] = (bearer << 3) | (direction << 2); - for(i=0; i> 7) & 0x01); + } + K1[15] = L[15] << 1; + if (L[0] & 0x80) { + K1[15] ^= 0x87; + } + + // Subkey K2 generation + for (i = 0; i < 15; i++) { + K2[i] = (K1[i] << 1) | ((K1[i + 1] >> 7) & 0x01); + } + K2[15] = K1[15] << 1; + if (K1[0] & 0x80) { + K2[15] ^= 0x87; } - return(err); + // Construct M + memset(M, 0, msg_len + 8 + 16); + M[0] = (count >> 24) & 0xFF; + M[1] = (count >> 16) & 0xFF; + M[2] = (count >> 8) & 0xFF; + M[3] = count & 0xFF; + M[4] = (bearer << 3) | (direction << 2); + for (i = 0; i < msg_len; i++) { + M[8 + i] = msg[i]; + } + + // MAC generation + n = (uint32)(ceilf((float)(msg_len + 8) / (float)(16))); + for (i = 0; i < 16; i++) { + T[i] = 0; + } + for (i = 0; i < n - 1; i++) { + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } + pad_bits = ((msg_len * 8) + 64) % 128; + if (pad_bits == 0) { + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ K1[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } else { + pad_bits = (128 - pad_bits) - 1; + M[i * 16 + (15 - (pad_bits / 8))] |= 0x1 << (pad_bits % 8); + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ K2[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } + + for (i = 0; i < 4; i++) { + mac[i] = T[i]; + } + + err = LIBLTE_SUCCESS; + } + + return (err); } -LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - LIBLTE_BIT_MSG_STRUCT *msg, - uint8 *mac) +LIBLTE_ERROR_ENUM liblte_security_128_eia2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, LIBLTE_BIT_MSG_STRUCT* msg, uint8* mac) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - uint8 M[msg->N_bits*8+8+16]; - aes_context ctx; - uint32 i; - uint32 j; - uint32 n; - uint32 pad_bits; - uint8 const_zero[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - uint8 L[16]; - uint8 K1[16]; - uint8 K2[16]; - uint8 T[16]; - uint8 tmp[16]; - - if(key != NULL && - msg != NULL && - mac != NULL) - { - // Subkey L generation - aes_setkey_enc(&ctx, key, 128); - aes_crypt_ecb(&ctx, AES_ENCRYPT, const_zero, L); - - // Subkey K1 generation - for(i=0; i<15; i++) - { - K1[i] = (L[i] << 1) | ((L[i+1] >> 7) & 0x01); - } - K1[15] = L[15] << 1; - if(L[0] & 0x80) - { - K1[15] ^= 0x87; - } - - // Subkey K2 generation - for(i=0; i<15; i++) - { - K2[i] = (K1[i] << 1) | ((K1[i+1] >> 7) & 0x01); - } - K2[15] = K1[15] << 1; - if(K1[0] & 0x80) - { - K2[15] ^= 0x87; - } - - // Construct M - memset(M, 0, msg->N_bits*8+8+16); - M[0] = (count >> 24) & 0xFF; - M[1] = (count >> 16) & 0xFF; - M[2] = (count >> 8) & 0xFF; - M[3] = count & 0xFF; - M[4] = (bearer << 3) | (direction << 2); - for(i=0; iN_bits/8; i++) - { - M[8+i] = 0; - for(j=0; j<8; j++) - { - M[8+i] |= msg->msg[i*8+j] << (7-j); - } - } - if((msg->N_bits % 8) != 0) - { - M[8+i] = 0; - for(j=0; jN_bits % 8; j++) - { - M[8+i] |= msg->msg[i*8+j] << (7-j); - } - } - - // MAC generation - n = (uint32)(ceilf((float)(msg->N_bits+64)/(float)(128))); - for(i=0; i<16; i++) - { - T[i] = 0; - } - for(i=0; iN_bits + 64) % 128; - if(pad_bits == 0) - { - for(j=0; j<16; j++) - { - tmp[j] = T[j] ^ K1[j] ^ M[i*16 + j]; - } - aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); - }else{ - pad_bits = (128 - pad_bits) - 1; - M[i*16 + (15 - (pad_bits/8))] |= 0x1 << (pad_bits % 8); - for(j=0; j<16; j++) - { - tmp[j] = T[j] ^ K2[j] ^ M[i*16 + j]; - } - aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); - } - - for(i=0; i<4; i++) - { - mac[i] = T[i]; - } - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + uint8 M[msg->N_bits * 8 + 8 + 16]; + aes_context ctx; + uint32 i; + uint32 j; + uint32 n; + uint32 pad_bits; + uint8 const_zero[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + uint8 L[16]; + uint8 K1[16]; + uint8 K2[16]; + uint8 T[16]; + uint8 tmp[16]; + + if (key != NULL && msg != NULL && mac != NULL) { + // Subkey L generation + aes_setkey_enc(&ctx, key, 128); + aes_crypt_ecb(&ctx, AES_ENCRYPT, const_zero, L); + + // Subkey K1 generation + for (i = 0; i < 15; i++) { + K1[i] = (L[i] << 1) | ((L[i + 1] >> 7) & 0x01); + } + K1[15] = L[15] << 1; + if (L[0] & 0x80) { + K1[15] ^= 0x87; + } + + // Subkey K2 generation + for (i = 0; i < 15; i++) { + K2[i] = (K1[i] << 1) | ((K1[i + 1] >> 7) & 0x01); + } + K2[15] = K1[15] << 1; + if (K1[0] & 0x80) { + K2[15] ^= 0x87; } - return(err); + // Construct M + memset(M, 0, msg->N_bits * 8 + 8 + 16); + M[0] = (count >> 24) & 0xFF; + M[1] = (count >> 16) & 0xFF; + M[2] = (count >> 8) & 0xFF; + M[3] = count & 0xFF; + M[4] = (bearer << 3) | (direction << 2); + for (i = 0; i < msg->N_bits / 8; i++) { + M[8 + i] = 0; + for (j = 0; j < 8; j++) { + M[8 + i] |= msg->msg[i * 8 + j] << (7 - j); + } + } + if ((msg->N_bits % 8) != 0) { + M[8 + i] = 0; + for (j = 0; j < msg->N_bits % 8; j++) { + M[8 + i] |= msg->msg[i * 8 + j] << (7 - j); + } + } + + // MAC generation + n = (uint32)(ceilf((float)(msg->N_bits + 64) / (float)(128))); + for (i = 0; i < 16; i++) { + T[i] = 0; + } + for (i = 0; i < n - 1; i++) { + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } + pad_bits = (msg->N_bits + 64) % 128; + if (pad_bits == 0) { + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ K1[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } else { + pad_bits = (128 - pad_bits) - 1; + M[i * 16 + (15 - (pad_bits / 8))] |= 0x1 << (pad_bits % 8); + for (j = 0; j < 16; j++) { + tmp[j] = T[j] ^ K2[j] ^ M[i * 16 + j]; + } + aes_crypt_ecb(&ctx, AES_ENCRYPT, tmp, T); + } + + for (i = 0; i < 4; i++) { + mac[i] = T[i]; + } + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -921,76 +817,66 @@ LIBLTE_ERROR_ENUM liblte_security_128_eia2(uint8 *key, Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D1 v2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *out) +LIBLTE_ERROR_ENUM liblte_security_encryption_eea1( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - S3G_STATE state, *state_ptr; - uint32 k[] = {0,0,0,0}; - uint32 iv[] = {0,0,0,0}; - uint32 *ks; - int32 i; - uint32 msg_len_block_8, msg_len_block_32, m; - - if (key != NULL && - msg != NULL && - out != NULL) - { - state_ptr = &state; - msg_len_block_8 = (msg_len + 7) / 8; - msg_len_block_32 = (msg_len + 31) / 32; - - // Transform key - for (i = 3; i >= 0; i--) { - k[i] = (key[4 * (3 - i) + 0] << 24) | - (key[4 * (3 - i) + 1] << 16) | - (key[4 * (3 - i) + 2] << 8) | - (key[4 * (3 - i) + 3]); - } - - // Construct iv - iv[3] = count; - iv[2] = ((bearer & 0x1F) << 27) | ((direction & 0x01) << 26); - iv[1] = iv[3]; - iv[0] = iv[2]; - - // Initialize keystream - s3g_initialize(state_ptr, k, iv); - - // Generate keystream - - ks = (uint32 *) calloc(msg_len_block_32, sizeof(uint32)); - s3g_generate_keystream(state_ptr, msg_len_block_32, ks); - - // Generate output except last block - for (i = 0; i < (int32_t)msg_len_block_32 - 1; i++) { - out[4 * i + 0] = msg[4 * i + 0] ^ ((ks[i] >> 24) & 0xFF); - out[4 * i + 1] = msg[4 * i + 1] ^ ((ks[i] >> 16) & 0xFF); - out[4 * i + 2] = msg[4 * i + 2] ^ ((ks[i] >> 8) & 0xFF); - out[4 * i + 3] = msg[4 * i + 3] ^ ((ks[i] & 0xFF)); - } - - // Process last bytes - for (i = (msg_len_block_32 - 1) * 4; i < (int32_t)msg_len_block_8; i++) { - out[i] = msg[i] ^ ((ks[i / 4] >> ((3 - (i % 4)) * 8)) & 0xFF); - } - - // Zero tailing bits - zero_tailing_bits(out, msg_len); - - // Clean up - free(ks); - s3g_deinitialize(state_ptr); - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + S3G_STATE state, *state_ptr; + uint32 k[] = {0, 0, 0, 0}; + uint32 iv[] = {0, 0, 0, 0}; + uint32* ks; + int32 i; + uint32 msg_len_block_8, msg_len_block_32, m; + + if (key != NULL && msg != NULL && out != NULL) { + state_ptr = &state; + msg_len_block_8 = (msg_len + 7) / 8; + msg_len_block_32 = (msg_len + 31) / 32; + + // Transform key + for (i = 3; i >= 0; i--) { + k[i] = (key[4 * (3 - i) + 0] << 24) | (key[4 * (3 - i) + 1] << 16) | (key[4 * (3 - i) + 2] << 8) | + (key[4 * (3 - i) + 3]); } - return(err); + // Construct iv + iv[3] = count; + iv[2] = ((bearer & 0x1F) << 27) | ((direction & 0x01) << 26); + iv[1] = iv[3]; + iv[0] = iv[2]; + + // Initialize keystream + s3g_initialize(state_ptr, k, iv); + + // Generate keystream + + ks = (uint32*)calloc(msg_len_block_32, sizeof(uint32)); + s3g_generate_keystream(state_ptr, msg_len_block_32, ks); + + // Generate output except last block + for (i = 0; i < (int32_t)msg_len_block_32 - 1; i++) { + out[4 * i + 0] = msg[4 * i + 0] ^ ((ks[i] >> 24) & 0xFF); + out[4 * i + 1] = msg[4 * i + 1] ^ ((ks[i] >> 16) & 0xFF); + out[4 * i + 2] = msg[4 * i + 2] ^ ((ks[i] >> 8) & 0xFF); + out[4 * i + 3] = msg[4 * i + 3] ^ ((ks[i] & 0xFF)); + } + + // Process last bytes + for (i = (msg_len_block_32 - 1) * 4; i < (int32_t)msg_len_block_8; i++) { + out[i] = msg[i] ^ ((ks[i / 4] >> ((3 - (i % 4)) * 8)) & 0xFF); + } + + // Zero tailing bits + zero_tailing_bits(out, msg_len); + + // Clean up + free(ks); + s3g_deinitialize(state_ptr); + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -1003,15 +889,10 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea1(uint8 *key, Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D1 v2.1 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *ct, - uint32 ct_len, - uint8 *out) { - return liblte_security_encryption_eea1(key, count, bearer, - direction, ct, ct_len, out); +LIBLTE_ERROR_ENUM liblte_security_decryption_eea1( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out) +{ + return liblte_security_encryption_eea1(key, count, bearer, direction, ct, ct_len, out); } /********************************************************************* @@ -1021,50 +902,40 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea1(uint8 *key, Document Reference: 33.401 v13.1.0 Annex B.1.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *msg, - uint32 msg_len, - uint8 *out) +LIBLTE_ERROR_ENUM liblte_security_encryption_eea2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* msg, uint32 msg_len, uint8* out) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - aes_context ctx; - unsigned char stream_blk[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - unsigned char nonce_cnt[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - int32 i; - int ret; - size_t nc_off = 0; - - if(key != NULL && - msg != NULL && - out != NULL) - { - ret = aes_setkey_enc(&ctx, key, 128); - - if (ret == 0) { - // Construct nonce - nonce_cnt[0] = (count >> 24) & 0xFF; - nonce_cnt[1] = (count >> 16) & 0xFF; - nonce_cnt[2] = (count >> 8) & 0xFF; - nonce_cnt[3] = (count) & 0xFF; - nonce_cnt[4] = ((bearer & 0x1F) << 3) | - ((direction & 0x01) << 2); - - // Encryption - ret = aes_crypt_ctr(&ctx, (msg_len + 7) / 8, &nc_off, nonce_cnt, - stream_blk, msg, out); - } - - if (ret == 0) { - // Zero tailing bits - zero_tailing_bits(out, msg_len); - err = LIBLTE_SUCCESS; - } + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + aes_context ctx; + unsigned char stream_blk[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + unsigned char nonce_cnt[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + int32 i; + int ret; + size_t nc_off = 0; + + if (key != NULL && msg != NULL && out != NULL) { + ret = aes_setkey_enc(&ctx, key, 128); + + if (ret == 0) { + // Construct nonce + nonce_cnt[0] = (count >> 24) & 0xFF; + nonce_cnt[1] = (count >> 16) & 0xFF; + nonce_cnt[2] = (count >> 8) & 0xFF; + nonce_cnt[3] = (count)&0xFF; + nonce_cnt[4] = ((bearer & 0x1F) << 3) | ((direction & 0x01) << 2); + + // Encryption + ret = aes_crypt_ctr(&ctx, (msg_len + 7) / 8, &nc_off, nonce_cnt, stream_blk, msg, out); } - return(err); + if (ret == 0) { + // Zero tailing bits + zero_tailing_bits(out, msg_len); + err = LIBLTE_SUCCESS; + } + } + + return (err); } /********************************************************************* @@ -1074,20 +945,12 @@ LIBLTE_ERROR_ENUM liblte_security_encryption_eea2(uint8 *key, Document Reference: 33.401 v13.1.0 Annex B.1.3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key, - uint32 count, - uint8 bearer, - uint8 direction, - uint8 *ct, - uint32 ct_len, - uint8 *out) +LIBLTE_ERROR_ENUM liblte_security_decryption_eea2( + uint8* key, uint32 count, uint8 bearer, uint8 direction, uint8* ct, uint32 ct_len, uint8* out) { - return liblte_security_encryption_eea2(key, count, bearer, - direction, ct, ct_len, out); + return liblte_security_encryption_eea2(key, count, bearer, direction, ct, ct_len, out); } - - /********************************************************************* Name: liblte_security_milenage_f1 @@ -1098,75 +961,57 @@ LIBLTE_ERROR_ENUM liblte_security_decryption_eea2(uint8 *key, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k, - uint8 *op_c, - uint8 *rand, - uint8 *sqn, - uint8 *amf, - uint8 *mac_a) +LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8* k, uint8* op_c, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_a) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - ROUND_KEY_STRUCT round_keys; - uint32 i; - uint8 temp[16]; - uint8 in1[16]; - uint8 out1[16]; - uint8 rijndael_input[16]; - - if(k != NULL && - op_c != NULL && - rand != NULL && - sqn != NULL && - amf != NULL && - mac_a != NULL) - { - // Initialize the round keys - rijndael_key_schedule(k, &round_keys); - - // Compute temp - for(i=0; i<16; i++) - { - rijndael_input[i] = rand[i] ^ op_c[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, temp); - - // Construct in1 - for(i=0; i<6; i++) - { - in1[i] = sqn[i]; - in1[i+8] = sqn[i]; - } - for(i=0; i<2; i++) - { - in1[i+6] = amf[i]; - in1[i+14] = amf[i]; - } - - // Compute out1 - for(i=0; i<16; i++) - { - rijndael_input[(i+8) % 16] = in1[i] ^ op_c[i]; - } - for(i=0; i<16; i++) - { - rijndael_input[i] ^= temp[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, out1); - for(i=0; i<16; i++) - { - out1[i] ^= op_c[i]; - } - - // Return MAC-A - for(i=0; i<8; i++) - { - mac_a[i] = out1[i]; - } - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + ROUND_KEY_STRUCT round_keys; + uint32 i; + uint8 temp[16]; + uint8 in1[16]; + uint8 out1[16]; + uint8 rijndael_input[16]; + + if (k != NULL && op_c != NULL && rand != NULL && sqn != NULL && amf != NULL && mac_a != NULL) { + // Initialize the round keys + rijndael_key_schedule(k, &round_keys); + + // Compute temp + for (i = 0; i < 16; i++) { + rijndael_input[i] = rand[i] ^ op_c[i]; + } + rijndael_encrypt(rijndael_input, &round_keys, temp); + + // Construct in1 + for (i = 0; i < 6; i++) { + in1[i] = sqn[i]; + in1[i + 8] = sqn[i]; + } + for (i = 0; i < 2; i++) { + in1[i + 6] = amf[i]; + in1[i + 14] = amf[i]; } - return(err); + // Compute out1 + for (i = 0; i < 16; i++) { + rijndael_input[(i + 8) % 16] = in1[i] ^ op_c[i]; + } + for (i = 0; i < 16; i++) { + rijndael_input[i] ^= temp[i]; + } + rijndael_encrypt(rijndael_input, &round_keys, out1); + for (i = 0; i < 16; i++) { + out1[i] ^= op_c[i]; + } + + // Return MAC-A + for (i = 0; i < 8; i++) { + mac_a[i] = out1[i]; + } + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -1179,75 +1024,58 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1(uint8 *k, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k, - uint8 *op_c, - uint8 *rand, - uint8 *sqn, - uint8 *amf, - uint8 *mac_s) +LIBLTE_ERROR_ENUM +liblte_security_milenage_f1_star(uint8* k, uint8* op_c, uint8* rand, uint8* sqn, uint8* amf, uint8* mac_s) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - ROUND_KEY_STRUCT round_keys; - uint32 i; - uint8 temp[16]; - uint8 in1[16]; - uint8 out1[16]; - uint8 rijndael_input[16]; - - if(k != NULL && - op_c != NULL && - rand != NULL && - sqn != NULL && - amf != NULL && - mac_s != NULL) - { - // Initialize the round keys - rijndael_key_schedule(k, &round_keys); - - // Compute temp - for(i=0; i<16; i++) - { - rijndael_input[i] = rand[i] ^ op_c[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, temp); - - // Construct in1 - for(i=0; i<6; i++) - { - in1[i] = sqn[i]; - in1[i+8] = sqn[i]; - } - for(i=0; i<2; i++) - { - in1[i+6] = amf[i]; - in1[i+14] = amf[i]; - } - - // Compute out1 - for(i=0; i<16; i++) - { - rijndael_input[(i+8) % 16] = in1[i] ^ op_c[i]; - } - for(i=0; i<16; i++) - { - rijndael_input[i] ^= temp[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, out1); - for(i=0; i<16; i++) - { - out1[i] ^= op_c[i]; - } - - // Return MAC-S - for(i=0; i<8; i++) - { - mac_s[i] = out1[i+8]; - } - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + ROUND_KEY_STRUCT round_keys; + uint32 i; + uint8 temp[16]; + uint8 in1[16]; + uint8 out1[16]; + uint8 rijndael_input[16]; + + if (k != NULL && op_c != NULL && rand != NULL && sqn != NULL && amf != NULL && mac_s != NULL) { + // Initialize the round keys + rijndael_key_schedule(k, &round_keys); + + // Compute temp + for (i = 0; i < 16; i++) { + rijndael_input[i] = rand[i] ^ op_c[i]; + } + rijndael_encrypt(rijndael_input, &round_keys, temp); + + // Construct in1 + for (i = 0; i < 6; i++) { + in1[i] = sqn[i]; + in1[i + 8] = sqn[i]; + } + for (i = 0; i < 2; i++) { + in1[i + 6] = amf[i]; + in1[i + 14] = amf[i]; + } + + // Compute out1 + for (i = 0; i < 16; i++) { + rijndael_input[(i + 8) % 16] = in1[i] ^ op_c[i]; + } + for (i = 0; i < 16; i++) { + rijndael_input[i] ^= temp[i]; } + rijndael_encrypt(rijndael_input, &round_keys, out1); + for (i = 0; i < 16; i++) { + out1[i] ^= op_c[i]; + } + + // Return MAC-S + for (i = 0; i < 8; i++) { + mac_s[i] = out1[i + 8]; + } + + err = LIBLTE_SUCCESS; + } - return(err); + return (err); } /********************************************************************* @@ -1260,103 +1088,80 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f1_star(uint8 *k, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k, - uint8 *op_c, - uint8 *rand, - uint8 *res, - uint8 *ck, - uint8 *ik, - uint8 *ak) +LIBLTE_ERROR_ENUM +liblte_security_milenage_f2345(uint8* k, uint8* op_c, uint8* rand, uint8* res, uint8* ck, uint8* ik, uint8* ak) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - ROUND_KEY_STRUCT round_keys; - uint32 i; - uint8 temp[16]; - uint8 out[16]; - uint8 rijndael_input[16]; - - if(k != NULL && - op_c != NULL && - rand != NULL && - res != NULL && - ck != NULL && - ik != NULL && - ak != NULL) - { - // Initialize the round keys - rijndael_key_schedule(k, &round_keys); - - // Compute temp - for(i=0; i<16; i++) - { - rijndael_input[i] = rand[i] ^ op_c[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, temp); - - // Compute out for RES and AK - for(i=0; i<16; i++) - { - rijndael_input[i] = temp[i] ^ op_c[i]; - } - rijndael_input[15] ^= 1; - rijndael_encrypt(rijndael_input, &round_keys, out); - for(i=0; i<16; i++) - { - out[i] ^= op_c[i]; - } - - // Return RES - for(i=0; i<8; i++) - { - res[i] = out[i+8]; - } - - // Return AK - for(i=0; i<6; i++) - { - ak[i] = out[i]; - } - - // Compute out for CK - for(i=0; i<16; i++) - { - rijndael_input[(i+12) % 16] = temp[i] ^ op_c[i]; - } - rijndael_input[15] ^= 2; - rijndael_encrypt(rijndael_input, &round_keys, out); - for(i=0; i<16; i++) - { - out[i] ^= op_c[i]; - } - - // Return CK - for(i=0; i<16; i++) - { - ck[i] = out[i]; - } - - // Compute out for IK - for(i=0; i<16; i++) - { - rijndael_input[(i+8) % 16] = temp[i] ^ op_c[i]; - } - rijndael_input[15] ^= 4; - rijndael_encrypt(rijndael_input, &round_keys, out); - for(i=0; i<16; i++) - { - out[i] ^= op_c[i]; - } - - // Return IK - for(i=0; i<16; i++) - { - ik[i] = out[i]; - } - - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + ROUND_KEY_STRUCT round_keys; + uint32 i; + uint8 temp[16]; + uint8 out[16]; + uint8 rijndael_input[16]; + + if (k != NULL && op_c != NULL && rand != NULL && res != NULL && ck != NULL && ik != NULL && ak != NULL) { + // Initialize the round keys + rijndael_key_schedule(k, &round_keys); + + // Compute temp + for (i = 0; i < 16; i++) { + rijndael_input[i] = rand[i] ^ op_c[i]; + } + rijndael_encrypt(rijndael_input, &round_keys, temp); + + // Compute out for RES and AK + for (i = 0; i < 16; i++) { + rijndael_input[i] = temp[i] ^ op_c[i]; + } + rijndael_input[15] ^= 1; + rijndael_encrypt(rijndael_input, &round_keys, out); + for (i = 0; i < 16; i++) { + out[i] ^= op_c[i]; } - return(err); + // Return RES + for (i = 0; i < 8; i++) { + res[i] = out[i + 8]; + } + + // Return AK + for (i = 0; i < 6; i++) { + ak[i] = out[i]; + } + + // Compute out for CK + for (i = 0; i < 16; i++) { + rijndael_input[(i + 12) % 16] = temp[i] ^ op_c[i]; + } + rijndael_input[15] ^= 2; + rijndael_encrypt(rijndael_input, &round_keys, out); + for (i = 0; i < 16; i++) { + out[i] ^= op_c[i]; + } + + // Return CK + for (i = 0; i < 16; i++) { + ck[i] = out[i]; + } + + // Compute out for IK + for (i = 0; i < 16; i++) { + rijndael_input[(i + 8) % 16] = temp[i] ^ op_c[i]; + } + rijndael_input[15] ^= 4; + rijndael_encrypt(rijndael_input, &round_keys, out); + for (i = 0; i < 16; i++) { + out[i] ^= op_c[i]; + } + + // Return IK + for (i = 0; i < 16; i++) { + ik[i] = out[i]; + } + + err = LIBLTE_SUCCESS; + } + + return (err); } /********************************************************************* @@ -1368,53 +1173,42 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f2345(uint8 *k, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8 *k, - uint8 *op_c, - uint8 *rand, - uint8 *ak) +LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8* k, uint8* op_c, uint8* rand, uint8* ak) { - LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - ROUND_KEY_STRUCT round_keys; - uint32 i; - uint8 temp[16]; - uint8 out[16]; - uint8 rijndael_input[16]; - - if(k != NULL && - op_c != NULL && - rand != NULL && - ak != NULL) - { - // Initialize the round keys - rijndael_key_schedule(k, &round_keys); - - // Compute temp - for(i=0; i<16; i++) - { - rijndael_input[i] = rand[i] ^ op_c[i]; - } - rijndael_encrypt(rijndael_input, &round_keys, temp); - - // Compute out - for(i=0; i<16; i++) - { - rijndael_input[(i+4) % 16] = temp[i] ^ op_c[i]; - } - rijndael_input[15] ^= 8; - rijndael_encrypt(rijndael_input, &round_keys, out); - for(i=0; i<16; i++) - { - out[i] ^= op_c[i]; - } - - // Return AK - for(i=0; i<6; i++) - { - ak[i] = out[i]; - } - err = LIBLTE_SUCCESS; + LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; + ROUND_KEY_STRUCT round_keys; + uint32 i; + uint8 temp[16]; + uint8 out[16]; + uint8 rijndael_input[16]; + + if (k != NULL && op_c != NULL && rand != NULL && ak != NULL) { + // Initialize the round keys + rijndael_key_schedule(k, &round_keys); + + // Compute temp + for (i = 0; i < 16; i++) { + rijndael_input[i] = rand[i] ^ op_c[i]; } - return(err); + rijndael_encrypt(rijndael_input, &round_keys, temp); + + // Compute out + for (i = 0; i < 16; i++) { + rijndael_input[(i + 4) % 16] = temp[i] ^ op_c[i]; + } + rijndael_input[15] ^= 8; + rijndael_encrypt(rijndael_input, &round_keys, out); + for (i = 0; i < 16; i++) { + out[i] ^= op_c[i]; + } + + // Return AK + for (i = 0; i < 6; i++) { + ak[i] = out[i]; + } + err = LIBLTE_SUCCESS; + } + return (err); } /********************************************************************* @@ -1425,23 +1219,17 @@ LIBLTE_ERROR_ENUM liblte_security_milenage_f5_star(uint8 *k, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k, - uint8 *op, - uint8 *op_c) +LIBLTE_ERROR_ENUM liblte_compute_opc(uint8* k, uint8* op, uint8* op_c) { - uint32 i; - ROUND_KEY_STRUCT round_keys; + uint32 i; + ROUND_KEY_STRUCT round_keys; LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; - if(k != NULL && - op != NULL && - op_c != NULL) - { + if (k != NULL && op != NULL && op_c != NULL) { rijndael_key_schedule(k, &round_keys); rijndael_encrypt(op, &round_keys, op_c); - for(i=0; i<16; i++) - { + for (i = 0; i < 16; i++) { op_c[i] ^= op[i]; } err = LIBLTE_SUCCESS; @@ -1453,7 +1241,6 @@ LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k, LOCAL FUNCTIONS *******************************************************************************/ - /********************************************************************* Name: rijndael_key_schedule @@ -1461,38 +1248,34 @@ LIBLTE_ERROR_ENUM liblte_compute_opc(uint8 *k, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void rijndael_key_schedule(uint8 *key, - ROUND_KEY_STRUCT *rk) +void rijndael_key_schedule(uint8* key, ROUND_KEY_STRUCT* rk) { - uint32 i; - uint32 j; - uint8 round_const; - - // Set first round key to key - for(i=0; i<16; i++) - { - rk->rk[0][i & 0x03][i >> 2] = key[i]; - } + uint32 i; + uint32 j; + uint8 round_const; - round_const = 1; + // Set first round key to key + for (i = 0; i < 16; i++) { + rk->rk[0][i & 0x03][i >> 2] = key[i]; + } - // Compute the remaining round keys - for(i=1; i<11; i++) - { - rk->rk[i][0][0] = S[rk->rk[i-1][1][3]] ^ rk->rk[i-1][0][0] ^ round_const; - rk->rk[i][1][0] = S[rk->rk[i-1][2][3]] ^ rk->rk[i-1][1][0]; - rk->rk[i][2][0] = S[rk->rk[i-1][3][3]] ^ rk->rk[i-1][2][0]; - rk->rk[i][3][0] = S[rk->rk[i-1][0][3]] ^ rk->rk[i-1][3][0]; + round_const = 1; - for(j=0; j<4; j++) - { - rk->rk[i][j][1] = rk->rk[i-1][j][1] ^ rk->rk[i][j][0]; - rk->rk[i][j][2] = rk->rk[i-1][j][2] ^ rk->rk[i][j][1]; - rk->rk[i][j][3] = rk->rk[i-1][j][3] ^ rk->rk[i][j][2]; - } + // Compute the remaining round keys + for (i = 1; i < 11; i++) { + rk->rk[i][0][0] = S[rk->rk[i - 1][1][3]] ^ rk->rk[i - 1][0][0] ^ round_const; + rk->rk[i][1][0] = S[rk->rk[i - 1][2][3]] ^ rk->rk[i - 1][1][0]; + rk->rk[i][2][0] = S[rk->rk[i - 1][3][3]] ^ rk->rk[i - 1][2][0]; + rk->rk[i][3][0] = S[rk->rk[i - 1][0][3]] ^ rk->rk[i - 1][3][0]; - round_const = X_TIME[round_const]; + for (j = 0; j < 4; j++) { + rk->rk[i][j][1] = rk->rk[i - 1][j][1] ^ rk->rk[i][j][0]; + rk->rk[i][j][2] = rk->rk[i - 1][j][2] ^ rk->rk[i][j][1]; + rk->rk[i][j][3] = rk->rk[i - 1][j][3] ^ rk->rk[i][j][2]; } + + round_const = X_TIME[round_const]; + } } /********************************************************************* @@ -1502,40 +1285,35 @@ void rijndael_key_schedule(uint8 *key, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void rijndael_encrypt(uint8 *input, - ROUND_KEY_STRUCT *rk, - uint8 *output) +void rijndael_encrypt(uint8* input, ROUND_KEY_STRUCT* rk, uint8* output) { - STATE_STRUCT state; - uint32 i; - uint32 r; - - // Initialize and perform round 0 - for(i=0; i<16; i++) - { - state.state[i & 0x03][i >> 2] = input[i]; - } - key_add(&state, rk, 0); - - // Perform rounds 1 through 9 - for(r=1; r<=9; r++) - { - byte_sub(&state); - shift_row(&state); - mix_column(&state); - key_add(&state, rk, r); - } + STATE_STRUCT state; + uint32 i; + uint32 r; + + // Initialize and perform round 0 + for (i = 0; i < 16; i++) { + state.state[i & 0x03][i >> 2] = input[i]; + } + key_add(&state, rk, 0); - // Perform round 10 + // Perform rounds 1 through 9 + for (r = 1; r <= 9; r++) { byte_sub(&state); shift_row(&state); + mix_column(&state); key_add(&state, rk, r); + } - // Return output - for(i=0; i<16; i++) - { - output[i] = state.state[i & 0x03][i >> 2]; - } + // Perform round 10 + byte_sub(&state); + shift_row(&state); + key_add(&state, rk, r); + + // Return output + for (i = 0; i < 16; i++) { + output[i] = state.state[i & 0x03][i >> 2]; + } } /********************************************************************* @@ -1545,20 +1323,16 @@ void rijndael_encrypt(uint8 *input, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void key_add(STATE_STRUCT *state, - ROUND_KEY_STRUCT *rk, - uint32 round) +void key_add(STATE_STRUCT* state, ROUND_KEY_STRUCT* rk, uint32 round) { - uint32 i; - uint32 j; - - for(i=0; i<4; i++) - { - for(j=0; j<4; j++) - { - state->state[i][j] ^= rk->rk[round][i][j]; - } + uint32 i; + uint32 j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + state->state[i][j] ^= rk->rk[round][i][j]; } + } } /********************************************************************* @@ -1568,18 +1342,16 @@ void key_add(STATE_STRUCT *state, Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void byte_sub(STATE_STRUCT *state) +void byte_sub(STATE_STRUCT* state) { - uint32 i; - uint32 j; - - for(i=0; i<4; i++) - { - for(j=0; j<4; j++) - { - state->state[i][j] = S[state->state[i][j]]; - } + uint32 i; + uint32 j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + state->state[i][j] = S[state->state[i][j]]; } + } } /********************************************************************* @@ -1589,31 +1361,31 @@ void byte_sub(STATE_STRUCT *state) Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void shift_row(STATE_STRUCT *state) +void shift_row(STATE_STRUCT* state) { - uint8 temp; - - // Left rotate row 1 by 1 - temp = state->state[1][0]; - state->state[1][0] = state->state[1][1]; - state->state[1][1] = state->state[1][2]; - state->state[1][2] = state->state[1][3]; - state->state[1][3] = temp; - - // Left rotate row 2 by 2 - temp = state->state[2][0]; - state->state[2][0] = state->state[2][2]; - state->state[2][2] = temp; - temp = state->state[2][1]; - state->state[2][1] = state->state[2][3]; - state->state[2][3] = temp; - - // Left rotate row 3 by 3 - temp = state->state[3][0]; - state->state[3][0] = state->state[3][3]; - state->state[3][3] = state->state[3][2]; - state->state[3][2] = state->state[3][1]; - state->state[3][1] = temp; + uint8 temp; + + // Left rotate row 1 by 1 + temp = state->state[1][0]; + state->state[1][0] = state->state[1][1]; + state->state[1][1] = state->state[1][2]; + state->state[1][2] = state->state[1][3]; + state->state[1][3] = temp; + + // Left rotate row 2 by 2 + temp = state->state[2][0]; + state->state[2][0] = state->state[2][2]; + state->state[2][2] = temp; + temp = state->state[2][1]; + state->state[2][1] = state->state[2][3]; + state->state[2][3] = temp; + + // Left rotate row 3 by 3 + temp = state->state[3][0]; + state->state[3][0] = state->state[3][3]; + state->state[3][3] = state->state[3][2]; + state->state[3][2] = state->state[3][1]; + state->state[3][1] = temp; } /********************************************************************* @@ -1623,30 +1395,29 @@ void shift_row(STATE_STRUCT *state) Document Reference: 35.206 v10.0.0 Annex 3 *********************************************************************/ -void mix_column(STATE_STRUCT *state) +void mix_column(STATE_STRUCT* state) { - uint32 i; - uint8 temp; - uint8 tmp0; - uint8 tmp; + uint32 i; + uint8 temp; + uint8 tmp0; + uint8 tmp; - for(i=0; i<4; i++) - { - temp = state->state[0][i] ^ state->state[1][i] ^ state->state[2][i] ^ state->state[3][i]; - tmp0 = state->state[0][i]; + for (i = 0; i < 4; i++) { + temp = state->state[0][i] ^ state->state[1][i] ^ state->state[2][i] ^ state->state[3][i]; + tmp0 = state->state[0][i]; - tmp = X_TIME[state->state[0][i] ^ state->state[1][i]]; - state->state[0][i] ^= temp ^ tmp; + tmp = X_TIME[state->state[0][i] ^ state->state[1][i]]; + state->state[0][i] ^= temp ^ tmp; - tmp = X_TIME[state->state[1][i] ^ state->state[2][i]]; - state->state[1][i] ^= temp ^ tmp; + tmp = X_TIME[state->state[1][i] ^ state->state[2][i]]; + state->state[1][i] ^= temp ^ tmp; - tmp = X_TIME[state->state[2][i] ^ state->state[3][i]]; - state->state[2][i] ^= temp ^ tmp; + tmp = X_TIME[state->state[2][i] ^ state->state[3][i]]; + state->state[2][i] ^= temp ^ tmp; - tmp = X_TIME[state->state[3][i] ^ tmp0]; - state->state[3][i] ^= temp ^ tmp; - } + tmp = X_TIME[state->state[3][i] ^ tmp0]; + state->state[3][i] ^= temp ^ tmp; + } } /********************************************************************* @@ -1656,9 +1427,10 @@ void mix_column(STATE_STRUCT *state) Document Reference: - *********************************************************************/ -void zero_tailing_bits(uint8 * data, uint32 length_bits) { - uint8 bits = (8 - (length_bits & 0x07)) & 0x07; - data[(length_bits + 7) / 8 - 1] &= (uint8) (0xFF << bits); +void zero_tailing_bits(uint8* data, uint32 length_bits) +{ + uint8 bits = (8 - (length_bits & 0x07)) & 0x07; + data[(length_bits + 7) / 8 - 1] &= (uint8)(0xFF << bits); } /********************************************************************* @@ -1670,11 +1442,12 @@ void zero_tailing_bits(uint8 * data, uint32 length_bits) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.1.1 *********************************************************************/ -uint8 s3g_mul_x(uint8 v, uint8 c) { - if (v & 0x80) - return ((v << 1) ^ c); - else - return (v << 1); +uint8 s3g_mul_x(uint8 v, uint8 c) +{ + if (v & 0x80) + return ((v << 1) ^ c); + else + return (v << 1); } /********************************************************************* @@ -1686,11 +1459,12 @@ uint8 s3g_mul_x(uint8 v, uint8 c) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.1.2 *********************************************************************/ -uint8 s3g_mul_x_pow(uint8 v, uint8 i, uint8 c) { - if (i == 0) - return v; - else - return s3g_mul_x(s3g_mul_x_pow(v, i - 1, c), c); +uint8 s3g_mul_x_pow(uint8 v, uint8 i, uint8 c) +{ + if (i == 0) + return v; + else + return s3g_mul_x(s3g_mul_x_pow(v, i - 1, c), c); } /********************************************************************* @@ -1702,11 +1476,10 @@ uint8 s3g_mul_x_pow(uint8 v, uint8 i, uint8 c) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.2 *********************************************************************/ -uint32 s3g_mul_alpha(uint8 c) { - return ((((uint32) s3g_mul_x_pow(c, 23, 0xa9)) << 24) | - (((uint32) s3g_mul_x_pow(c, 245, 0xa9)) << 16) | - (((uint32) s3g_mul_x_pow(c, 48, 0xa9)) << 8) | - (((uint32) s3g_mul_x_pow(c, 239, 0xa9)))); +uint32 s3g_mul_alpha(uint8 c) +{ + return ((((uint32)s3g_mul_x_pow(c, 23, 0xa9)) << 24) | (((uint32)s3g_mul_x_pow(c, 245, 0xa9)) << 16) | + (((uint32)s3g_mul_x_pow(c, 48, 0xa9)) << 8) | (((uint32)s3g_mul_x_pow(c, 239, 0xa9)))); } /********************************************************************* @@ -1718,11 +1491,10 @@ uint32 s3g_mul_alpha(uint8 c) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.3 *********************************************************************/ -uint32 s3g_div_alpha(uint8 c) { - return ((((uint32) s3g_mul_x_pow(c, 16, 0xa9)) << 24) | - (((uint32) s3g_mul_x_pow(c, 39, 0xa9)) << 16) | - (((uint32) s3g_mul_x_pow(c, 6, 0xa9)) << 8) | - (((uint32) s3g_mul_x_pow(c, 64, 0xa9)))); +uint32 s3g_div_alpha(uint8 c) +{ + return ((((uint32)s3g_mul_x_pow(c, 16, 0xa9)) << 24) | (((uint32)s3g_mul_x_pow(c, 39, 0xa9)) << 16) | + (((uint32)s3g_mul_x_pow(c, 6, 0xa9)) << 8) | (((uint32)s3g_mul_x_pow(c, 64, 0xa9)))); } /********************************************************************* @@ -1734,37 +1506,23 @@ uint32 s3g_div_alpha(uint8 c) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.3.1 *********************************************************************/ -uint32 s3g_s1(uint32 w) { - uint8 r0 = 0, r1 = 0, r2 = 0, r3 = 0; - uint8 srw0 = S[(uint8) ((w >> 24) & 0xff)]; - uint8 srw1 = S[(uint8) ((w >> 16) & 0xff)]; - uint8 srw2 = S[(uint8) ((w >> 8) & 0xff)]; - uint8 srw3 = S[(uint8) ((w) & 0xff)]; - - r0 = ((s3g_mul_x(srw0, 0x1b)) ^ - (srw1) ^ - (srw2) ^ - ((s3g_mul_x(srw3, 0x1b)) ^ srw3)); - - r1 = (((s3g_mul_x(srw0, 0x1b)) ^ srw0) ^ - (s3g_mul_x(srw1, 0x1b)) ^ - (srw2) ^ - (srw3)); - - r2 = ((srw0) ^ - ((s3g_mul_x(srw1, 0x1b)) ^ srw1) ^ - (s3g_mul_x(srw2, 0x1b)) ^ - (srw3)); - - r3 = ((srw0) ^ - (srw1) ^ - ((s3g_mul_x(srw2, 0x1b)) ^ srw2) ^ - (s3g_mul_x(srw3, 0x1b))); - - return ((((uint32) r0) << 24) | - (((uint32) r1) << 16) | - (((uint32) r2) << 8) | - (((uint32) r3))); +uint32 s3g_s1(uint32 w) +{ + uint8 r0 = 0, r1 = 0, r2 = 0, r3 = 0; + uint8 srw0 = S[(uint8)((w >> 24) & 0xff)]; + uint8 srw1 = S[(uint8)((w >> 16) & 0xff)]; + uint8 srw2 = S[(uint8)((w >> 8) & 0xff)]; + uint8 srw3 = S[(uint8)((w)&0xff)]; + + r0 = ((s3g_mul_x(srw0, 0x1b)) ^ (srw1) ^ (srw2) ^ ((s3g_mul_x(srw3, 0x1b)) ^ srw3)); + + r1 = (((s3g_mul_x(srw0, 0x1b)) ^ srw0) ^ (s3g_mul_x(srw1, 0x1b)) ^ (srw2) ^ (srw3)); + + r2 = ((srw0) ^ ((s3g_mul_x(srw1, 0x1b)) ^ srw1) ^ (s3g_mul_x(srw2, 0x1b)) ^ (srw3)); + + r3 = ((srw0) ^ (srw1) ^ ((s3g_mul_x(srw2, 0x1b)) ^ srw2) ^ (s3g_mul_x(srw3, 0x1b))); + + return ((((uint32)r0) << 24) | (((uint32)r1) << 16) | (((uint32)r2) << 8) | (((uint32)r3))); } /********************************************************************* @@ -1776,37 +1534,23 @@ uint32 s3g_s1(uint32 w) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.3.2 *********************************************************************/ -uint32 s3g_s2(uint32 w) { - uint8 r0 = 0, r1 = 0, r2 = 0, r3 = 0; - uint8 sqw0 = SQ[(uint8) ((w >> 24) & 0xff)]; - uint8 sqw1 = SQ[(uint8) ((w >> 16) & 0xff)]; - uint8 sqw2 = SQ[(uint8) ((w >> 8) & 0xff)]; - uint8 sqw3 = SQ[(uint8) ((w) & 0xff)]; - - r0 = ((s3g_mul_x(sqw0, 0x69)) ^ - (sqw1) ^ - (sqw2) ^ - ((s3g_mul_x(sqw3, 0x69)) ^ sqw3)); - - r1 = (((s3g_mul_x(sqw0, 0x69)) ^ sqw0) ^ - (s3g_mul_x(sqw1, 0x69)) ^ - (sqw2) ^ - (sqw3)); - - r2 = ((sqw0) ^ - ((s3g_mul_x(sqw1, 0x69)) ^ sqw1) ^ - (s3g_mul_x(sqw2, 0x69)) ^ - (sqw3)); - - r3 = ((sqw0) ^ - (sqw1) ^ - ((s3g_mul_x(sqw2, 0x69)) ^ sqw2) ^ - (s3g_mul_x(sqw3, 0x69))); - - return ((((uint32) r0) << 24) | - (((uint32) r1) << 16) | - (((uint32) r2) << 8) | - (((uint32) r3))); +uint32 s3g_s2(uint32 w) +{ + uint8 r0 = 0, r1 = 0, r2 = 0, r3 = 0; + uint8 sqw0 = SQ[(uint8)((w >> 24) & 0xff)]; + uint8 sqw1 = SQ[(uint8)((w >> 16) & 0xff)]; + uint8 sqw2 = SQ[(uint8)((w >> 8) & 0xff)]; + uint8 sqw3 = SQ[(uint8)((w)&0xff)]; + + r0 = ((s3g_mul_x(sqw0, 0x69)) ^ (sqw1) ^ (sqw2) ^ ((s3g_mul_x(sqw3, 0x69)) ^ sqw3)); + + r1 = (((s3g_mul_x(sqw0, 0x69)) ^ sqw0) ^ (s3g_mul_x(sqw1, 0x69)) ^ (sqw2) ^ (sqw3)); + + r2 = ((sqw0) ^ ((s3g_mul_x(sqw1, 0x69)) ^ sqw1) ^ (s3g_mul_x(sqw2, 0x69)) ^ (sqw3)); + + r3 = ((sqw0) ^ (sqw1) ^ ((s3g_mul_x(sqw2, 0x69)) ^ sqw2) ^ (s3g_mul_x(sqw3, 0x69))); + + return ((((uint32)r0) << 24) | (((uint32)r1) << 16) | (((uint32)r2) << 8) | (((uint32)r3))); } /********************************************************************* @@ -1818,21 +1562,17 @@ uint32 s3g_s2(uint32 w) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.4 and Section 3.4.5 *********************************************************************/ -void s3g_clock_lfsr(S3G_STATE * state, uint32 f) { - uint32 v = ( - ((state->lfsr[0] << 8) & 0xffffff00) ^ - (s3g_mul_alpha((uint8) ((state->lfsr[0] >> 24) & 0xff))) ^ - (state->lfsr[2]) ^ - ((state->lfsr[11] >> 8) & 0x00ffffff) ^ - (s3g_div_alpha((uint8) ((state->lfsr[11]) & 0xff))) ^ - (f) - ); - uint8 i; +void s3g_clock_lfsr(S3G_STATE* state, uint32 f) +{ + uint32 v = (((state->lfsr[0] << 8) & 0xffffff00) ^ (s3g_mul_alpha((uint8)((state->lfsr[0] >> 24) & 0xff))) ^ + (state->lfsr[2]) ^ ((state->lfsr[11] >> 8) & 0x00ffffff) ^ + (s3g_div_alpha((uint8)((state->lfsr[11]) & 0xff))) ^ (f)); + uint8 i; - for (i = 0; i < 15; i++) { - state->lfsr[i] = state->lfsr[i + 1]; - } - state->lfsr[15] = v; + for (i = 0; i < 15; i++) { + state->lfsr[i] = state->lfsr[i + 1]; + } + state->lfsr[15] = v; } /********************************************************************* @@ -1844,17 +1584,16 @@ void s3g_clock_lfsr(S3G_STATE * state, uint32 f) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 3.4.6 *********************************************************************/ -uint32 s3g_clock_fsm(S3G_STATE * state) { - uint32 f = ((state->lfsr[15] + state->fsm[0]) & 0xffffffff) ^ - state->fsm[1]; - uint32 r = (state->fsm[1] + (state->fsm[2] ^ state->lfsr[5])) & - 0xffffffff; +uint32 s3g_clock_fsm(S3G_STATE* state) +{ + uint32 f = ((state->lfsr[15] + state->fsm[0]) & 0xffffffff) ^ state->fsm[1]; + uint32 r = (state->fsm[1] + (state->fsm[2] ^ state->lfsr[5])) & 0xffffffff; - state->fsm[2] = s3g_s2(state->fsm[1]); - state->fsm[1] = s3g_s1(state->fsm[0]); - state->fsm[0] = r; + state->fsm[2] = s3g_s2(state->fsm[1]); + state->fsm[1] = s3g_s1(state->fsm[0]); + state->fsm[0] = r; - return f; + return f; } /********************************************************************* @@ -1866,38 +1605,39 @@ uint32 s3g_clock_fsm(S3G_STATE * state) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 4.1 *********************************************************************/ -void s3g_initialize(S3G_STATE * state, uint32 k[4], uint32 iv[4]) { - uint8 i = 0; - uint32 f = 0x0; - - state->lfsr = (uint32 *) calloc(16, sizeof(uint32)); - state->fsm = (uint32 *) calloc( 3, sizeof(uint32)); - - state->lfsr[15] = k[3] ^ iv[0]; - state->lfsr[14] = k[2]; - state->lfsr[13] = k[1]; - state->lfsr[12] = k[0] ^ iv[1]; - - state->lfsr[11] = k[3] ^ 0xffffffff; - state->lfsr[10] = k[2] ^ 0xffffffff ^ iv[2]; - state->lfsr[ 9] = k[1] ^ 0xffffffff ^ iv[3]; - state->lfsr[ 8] = k[0] ^ 0xffffffff; - state->lfsr[ 7] = k[3]; - state->lfsr[ 6] = k[2]; - state->lfsr[ 5] = k[1]; - state->lfsr[ 4] = k[0]; - state->lfsr[ 3] = k[3] ^ 0xffffffff; - state->lfsr[ 2] = k[2] ^ 0xffffffff; - state->lfsr[ 1] = k[1] ^ 0xffffffff; - state->lfsr[ 0] = k[0] ^ 0xffffffff; - - state->fsm[0] = 0x0; - state->fsm[1] = 0x0; - state->fsm[2] = 0x0; - for (i = 0; i < 32; i++) { - f = s3g_clock_fsm(state); - s3g_clock_lfsr(state, f); - } +void s3g_initialize(S3G_STATE* state, uint32 k[4], uint32 iv[4]) +{ + uint8 i = 0; + uint32 f = 0x0; + + state->lfsr = (uint32*)calloc(16, sizeof(uint32)); + state->fsm = (uint32*)calloc(3, sizeof(uint32)); + + state->lfsr[15] = k[3] ^ iv[0]; + state->lfsr[14] = k[2]; + state->lfsr[13] = k[1]; + state->lfsr[12] = k[0] ^ iv[1]; + + state->lfsr[11] = k[3] ^ 0xffffffff; + state->lfsr[10] = k[2] ^ 0xffffffff ^ iv[2]; + state->lfsr[9] = k[1] ^ 0xffffffff ^ iv[3]; + state->lfsr[8] = k[0] ^ 0xffffffff; + state->lfsr[7] = k[3]; + state->lfsr[6] = k[2]; + state->lfsr[5] = k[1]; + state->lfsr[4] = k[0]; + state->lfsr[3] = k[3] ^ 0xffffffff; + state->lfsr[2] = k[2] ^ 0xffffffff; + state->lfsr[1] = k[1] ^ 0xffffffff; + state->lfsr[0] = k[0] ^ 0xffffffff; + + state->fsm[0] = 0x0; + state->fsm[1] = 0x0; + state->fsm[2] = 0x0; + for (i = 0; i < 32; i++) { + f = s3g_clock_fsm(state); + s3g_clock_lfsr(state, f); + } } /********************************************************************* @@ -1908,9 +1648,10 @@ void s3g_initialize(S3G_STATE * state, uint32 k[4], uint32 iv[4]) { Document Reference: Specification of the 3GPP Confidentiality and Integrity Algorithms UEA2 & UIA2 D2 v1.1 *********************************************************************/ -void s3g_deinitialize(S3G_STATE * state) { - free(state->lfsr); - free(state->fsm); +void s3g_deinitialize(S3G_STATE* state) +{ + free(state->lfsr); + free(state->fsm); } /********************************************************************* @@ -1922,19 +1663,20 @@ void s3g_deinitialize(S3G_STATE * state) { Integrity Algorithms UEA2 & UIA2 D2 v1.1 Section 4.2 *********************************************************************/ -void s3g_generate_keystream(S3G_STATE * state, uint32 n, uint32 *ks) { - uint32 t = 0; - uint32 f = 0x0; - - // Clock FSM once. Discard the output. - s3g_clock_fsm(state); - // Clock LFSR in keystream mode once. +void s3g_generate_keystream(S3G_STATE* state, uint32 n, uint32* ks) +{ + uint32 t = 0; + uint32 f = 0x0; + + // Clock FSM once. Discard the output. + s3g_clock_fsm(state); + // Clock LFSR in keystream mode once. + s3g_clock_lfsr(state, 0x0); + + for (t = 0; t < n; t++) { + f = s3g_clock_fsm(state); + // Note that ks[t] corresponds to z_{t+1} in section 4.2 + ks[t] = f ^ state->lfsr[0]; s3g_clock_lfsr(state, 0x0); - - for (t = 0; t < n; t++) { - f = s3g_clock_fsm(state); - // Note that ks[t] corresponds to z_{t+1} in section 4.2 - ks[t] = f ^ state->lfsr[0]; - s3g_clock_lfsr(state, 0x0); - } + } }