Commit c4d68ea3 authored by Cedric Roux's avatar Cedric Roux
Browse files

- Fix build issues

- Fix name in conversions macro

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4615 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent cf4eac2e
......@@ -86,67 +86,67 @@ do { \
((buf)[3]); \
} while(0)
/* Convert an integer on 32 bits to an octet string from asn1c tool */
#define INT32_TO_OCTET_STRING(x, asn) \
/* Convert an integer on 32 bits to an octet string from aSN1c tool */
#define INT32_TO_OCTET_STRING(x, aSN) \
do { \
(asn)->buf = calloc(4, sizeof(uint8_t)); \
INT32_TO_BUFFER(x, ((asn)->buf)); \
(asn)->size = 4; \
(aSN)->buf = calloc(4, sizeof(uint8_t)); \
INT32_TO_BUFFER(x, ((aSN)->buf)); \
(aSN)->size = 4; \
} while(0)
#define INT32_TO_BIT_STRING(x, asn) \
#define INT32_TO_BIT_STRING(x, aSN) \
do { \
INT32_TO_OCTET_STRING(x, asn); \
(asn)->bits_unused = 0; \
INT32_TO_OCTET_STRING(x, aSN); \
(aSN)->bits_unused = 0; \
} while(0)
#define INT16_TO_OCTET_STRING(x, asn) \
#define INT16_TO_OCTET_STRING(x, aSN) \
do { \
(asn)->buf = calloc(2, sizeof(uint8_t)); \
(asn)->size = 2; \
INT16_TO_BUFFER(x, (asn)->buf); \
(aSN)->buf = calloc(2, sizeof(uint8_t)); \
(aSN)->size = 2; \
INT16_TO_BUFFER(x, (aSN)->buf); \
} while(0)
#define INT8_TO_OCTET_STRING(x, asn) \
#define INT8_TO_OCTET_STRING(x, aSN) \
do { \
(asn)->buf = calloc(1, sizeof(uint8_t)); \
(asn)->size = 1; \
INT8_TO_BUFFER(x, (asn)->buf); \
(aSN)->buf = calloc(1, sizeof(uint8_t)); \
(aSN)->size = 1; \
INT8_TO_BUFFER(x, (aSN)->buf); \
} while(0)
#define MME_CODE_TO_OCTET_STRING INT8_TO_OCTET_STRING
#define M_TMSI_TO_OCTET_STRING INT32_TO_OCTET_STRING
#define MME_GID_TO_OCTET_STRING INT16_TO_OCTET_STRING
#define OCTET_STRING_TO_INT8(asn, x) \
#define OCTET_STRING_TO_INT8(aSN, x) \
do { \
DevCheck((asn)->size == 1, (asn)->size, 0, 0); \
BUFFER_TO_INT8((asn)->buf, x); \
DevCheck((aSN)->size == 1, (aSN)->size, 0, 0); \
BUFFER_TO_INT8((aSN)->buf, x); \
} while(0)
#define OCTET_STRING_TO_INT16(asn, x) \
#define OCTET_STRING_TO_INT16(aSN, x) \
do { \
DevCheck((asn)->size == 2, (asn)->size, 0, 0); \
BUFFER_TO_INT16((asn)->buf, x); \
DevCheck((aSN)->size == 2, (aSN)->size, 0, 0); \
BUFFER_TO_INT16((aSN)->buf, x); \
} while(0)
#define OCTET_STRING_TO_INT32(asn, x) \
#define OCTET_STRING_TO_INT32(aSN, x) \
do { \
DevCheck((asn)->size == 4, (asn)->size, 0, 0); \
BUFFER_TO_INT32((asn)->buf, x); \
DevCheck((aSN)->size == 4, (aSN)->size, 0, 0); \
BUFFER_TO_INT32((aSN)->buf, x); \
} while(0)
#define BIT_STRING_TO_INT32(asn, x) \
#define BIT_STRING_TO_INT32(aSN, x) \
do { \
DevCheck((asn)->bits_unused == 0, (asn)->bits_unused, 0, 0); \
OCTET_STRING_TO_INT32(asn, x); \
DevCheck((aSN)->bits_unused == 0, (aSN)->bits_unused, 0, 0); \
OCTET_STRING_TO_INT32(aSN, x); \
} while(0)
#define BIT_STRING_TO_CELL_IDENTITY(asn, x) \
#define BIT_STRING_TO_CELL_IDENTITY(aSN, vALUE) \
do { \
DevCheck((asn)->bits_unused == 4, (asn)->bits_unused, 4, 0); \
x = ((asn)->buf[0] << 20) | ((asn)->buf[1] << 12) | \
((asn)->buf[2] << 4) | (asn)->buf[3]; \
DevCheck((aSN)->bits_unused == 4, (aSN)->bits_unused, 4, 0); \
vALUE = ((aSN)->buf[0] << 20) | ((aSN)->buf[1] << 12) | \
((aSN)->buf[2] << 4) | (aSN)->buf[3]; \
} while(0)
#define MCC_HUNDREDS(vALUE) \
......
......@@ -107,6 +107,18 @@ Description Defines the messages supported by the Access Stratum sublayer
#define NETWORK_FAILURE (17)
#define ESM_FAILURE (19)
typedef enum nas_cause_s {
NAS_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED,
NAS_CAUSE_EPS_SERVICES_NOT_ALLOWED = EPS_SERVICES_NOT_ALLOWED,
NAS_CAUSE_PLMN_NOT_ALLOWED = PLMN_NOT_ALLOWED,
NAS_CAUSE_TRACKING_AREA_NOT_ALLOWED = TRACKING_AREA_NOT_ALLOWED,
NAS_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA = ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA,
NAS_CAUSE_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,
NAS_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA = NO_SUITABLE_CELLS_IN_TRACKING_AREA,
NAS_CAUSE_NETWORK_FAILURE = NETWORK_FAILURE,
NAS_CAUSE_ESM_FAILURE = ESM_FAILURE
} nas_cause_t;
/*
* --------------------------------------------------------------------------
* Access Stratum message global parameters
......@@ -253,6 +265,7 @@ typedef struct paging_ind_s {
/* Cause of RRC connection establishment */
typedef enum as_cause_s {
AS_CAUSE_UNKNOWN = 0,
AS_CAUSE_EMERGENCY = NET_ESTABLISH_CAUSE_EMERGENCY,
AS_CAUSE_HIGH_PRIO = NET_ESTABLISH_CAUSE_HIGH_PRIO,
AS_CAUSE_MT_ACCESS = NET_ESTABLISH_CAUSE_MT_ACCESS,
......@@ -288,10 +301,11 @@ typedef struct nas_establish_req_s {
* AS transfers the initial NAS message to the NAS.
*/
typedef struct nas_establish_ind_s {
UInt32_t UEid; /* UE lower layer identifier */
tac_t tac; /* Code of the tracking area the initiating
* UE belongs to */
as_nas_info_t initialNasMsg; /* Initial NAS message to transfer */
UInt32_t UEid; /* UE lower layer identifier */
tac_t tac; /* Code of the tracking area the initiating
* UE belongs to */
as_cause_t asCause; /* Establishment cause */
as_nas_info_t initialNasMsg; /* Initial NAS message to transfer */
} nas_establish_ind_t;
/*
......
......@@ -86,24 +86,24 @@ typedef struct {
Byte_t length;
union {
struct {
Byte_t digit15:4;
Byte_t digit14:4;
Byte_t digit13:4;
Byte_t digit12:4;
Byte_t digit11:4;
Byte_t digit10:4;
Byte_t digit9:4;
Byte_t digit8:4;
Byte_t digit7:4;
Byte_t digit6:4;
Byte_t digit5:4;
Byte_t digit4:4;
Byte_t digit3:4;
Byte_t digit2:4;
Byte_t digit1:4;
Byte_t digit4:4;
Byte_t digit3:4;
Byte_t digit6:4;
Byte_t digit5:4;
Byte_t digit8:4;
Byte_t digit7:4;
Byte_t digit10:4;
Byte_t digit9:4;
Byte_t digit12:4;
Byte_t digit11:4;
Byte_t digit14:4;
Byte_t digit13:4;
#define EVEN_PARITY 0
#define ODD_PARITY 1
Byte_t parity:4;
Byte_t digit15:4;
} num;
#define IMSI_SIZE 8
Byte_t value[IMSI_SIZE];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment