Commit faa51ec4 authored by Cedric Roux's avatar Cedric Roux

- Use typedef for enums/structs

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4562 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0aec555a
...@@ -114,29 +114,29 @@ Description Defines the messages supported by the Access Stratum sublayer ...@@ -114,29 +114,29 @@ Description Defines the messages supported by the Access Stratum sublayer
*/ */
/* Error code */ /* Error code */
enum { typedef enum nas_error_code_s {
AS_SUCCESS = 1, /* Success code, transaction is going on */ AS_SUCCESS = 1, /* Success code, transaction is going on */
AS_TERMINATED_NAS, /* Transaction terminated by NAS */ AS_TERMINATED_NAS, /* Transaction terminated by NAS */
AS_TERMINATED_AS, /* Transaction terminated by AS */ AS_TERMINATED_AS, /* Transaction terminated by AS */
AS_FAILURE /* Failure code */ AS_FAILURE /* Failure code */
}; } nas_error_code_t;
/* Core network domain */ /* Core network domain */
enum { typedef enum core_network_s {
AS_PS = 1, /* Packet-Switched */ AS_PS = 1, /* Packet-Switched */
AS_CS /* Circuit-Switched */ AS_CS /* Circuit-Switched */
}; } core_network_t;
/* SAE Temporary Mobile Subscriber Identity */ /* SAE Temporary Mobile Subscriber Identity */
typedef struct { typedef struct as_stmsi_s {
UInt8_t MMEcode; /* MME code that allocated the GUTI */ UInt8_t MMEcode; /* MME code that allocated the GUTI */
UInt32_t m_tmsi; /* M-Temporary Mobile Subscriber Identity */ UInt32_t m_tmsi; /* M-Temporary Mobile Subscriber Identity */
} as_stmsi_t; } as_stmsi_t;
/* Dedicated NAS information */ /* Dedicated NAS information */
typedef struct { typedef struct as_nas_info_s {
UInt32_t length; /* Length of the NAS information data */ UInt32_t length; /* Length of the NAS information data */
Byte_t* data; /* Dedicated NAS information data container */ Byte_t *data; /* Dedicated NAS information data container */
} as_nas_info_t; } as_nas_info_t;
/* Radio Access Bearer identity */ /* Radio Access Bearer identity */
...@@ -157,7 +157,7 @@ typedef UInt8_t as_rab_id_t; ...@@ -157,7 +157,7 @@ typedef UInt8_t as_rab_id_t;
* AS may asynchronously report to NAS available PLMNs within specific * AS may asynchronously report to NAS available PLMNs within specific
* location area * location area
*/ */
typedef struct { typedef struct broadcast_info_ind_s {
#define PLMN_LIST_MAX_SIZE 6 #define PLMN_LIST_MAX_SIZE 6
PLMN_LIST_T(PLMN_LIST_MAX_SIZE) plmnIDs; /* List of PLMN identifiers */ PLMN_LIST_T(PLMN_LIST_MAX_SIZE) plmnIDs; /* List of PLMN identifiers */
ci_t cellID; /* Identity of the cell serving the listed PLMNs */ ci_t cellID; /* Identity of the cell serving the listed PLMNs */
...@@ -185,7 +185,7 @@ typedef struct { ...@@ -185,7 +185,7 @@ typedef struct {
* NAS request AS to search for a suitable cell belonging to the selected * NAS request AS to search for a suitable cell belonging to the selected
* PLMN to camp on. * PLMN to camp on.
*/ */
typedef struct { typedef struct cell_info_req_s {
plmn_t plmnID; /* Selected PLMN identity */ plmn_t plmnID; /* Selected PLMN identity */
Byte_t rat; /* Bitmap - set of radio access technologies */ Byte_t rat; /* Bitmap - set of radio access technologies */
} cell_info_req_t; } cell_info_req_t;
...@@ -195,7 +195,7 @@ typedef struct { ...@@ -195,7 +195,7 @@ typedef struct {
* AS search for a suitable cell and respond to NAS. If found, the cell * AS search for a suitable cell and respond to NAS. If found, the cell
* is selected to camp on. * is selected to camp on.
*/ */
typedef struct { typedef struct cell_info_cnf_s {
UInt8_t errCode; /* Error code */ UInt8_t errCode; /* Error code */
ci_t cellID; /* Identity of the cell serving the selected PLMN */ ci_t cellID; /* Identity of the cell serving the selected PLMN */
tac_t tac; /* Code of the tracking area the cell belongs to */ tac_t tac; /* Code of the tracking area the cell belongs to */
...@@ -208,7 +208,7 @@ typedef struct { ...@@ -208,7 +208,7 @@ typedef struct {
* AS->NAS - Cell Information indication * AS->NAS - Cell Information indication
* AS may change cell selection if a more suitable cell is found. * AS may change cell selection if a more suitable cell is found.
*/ */
typedef struct { typedef struct cell_info_ind_s {
ci_t cellID; /* Identity of the new serving cell */ ci_t cellID; /* Identity of the new serving cell */
tac_t tac; /* Code of the tracking area the cell belongs to */ tac_t tac; /* Code of the tracking area the cell belongs to */
} cell_info_ind_t; } cell_info_ind_t;
...@@ -220,19 +220,19 @@ typedef struct { ...@@ -220,19 +220,19 @@ typedef struct {
*/ */
/* Paging cause */ /* Paging cause */
enum { typedef enum paging_cause_s {
AS_CONNECTION_ESTABLISH, /* Establish NAS signalling connection */ AS_CONNECTION_ESTABLISH, /* Establish NAS signalling connection */
AS_EPS_ATTACH, /* Perform local detach and initiate EPS AS_EPS_ATTACH, /* Perform local detach and initiate EPS
* attach procedure */ * attach procedure */
AS_CS_FALLBACK /* Inititate CS fallback procedure */ AS_CS_FALLBACK /* Inititate CS fallback procedure */
}; } paging_cause_t;
/* /*
* NAS->AS - Paging Information request * NAS->AS - Paging Information request
* NAS requests the AS that NAS signalling messages or user data is pending * NAS requests the AS that NAS signalling messages or user data is pending
* to be sent. * to be sent.
*/ */
typedef struct { typedef struct paging_req_s {
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
UInt8_t CN_domain; /* Core network domain */ UInt8_t CN_domain; /* Core network domain */
} paging_req_t; } paging_req_t;
...@@ -241,7 +241,7 @@ typedef struct { ...@@ -241,7 +241,7 @@ typedef struct {
* AS->NAS - Paging Information indication * AS->NAS - Paging Information indication
* AS reports to the NAS that appropriate procedure has to be initiated. * AS reports to the NAS that appropriate procedure has to be initiated.
*/ */
typedef struct { typedef struct paging_ind_s {
UInt8_t cause; /* Paging cause */ UInt8_t cause; /* Paging cause */
} paging_ind_t; } paging_ind_t;
...@@ -272,7 +272,7 @@ typedef struct { ...@@ -272,7 +272,7 @@ typedef struct {
* NAS requests the AS to perform the RRC connection establishment procedure * NAS requests the AS to perform the RRC connection establishment procedure
* to transfer initial NAS message to the network while UE is in IDLE mode. * to transfer initial NAS message to the network while UE is in IDLE mode.
*/ */
typedef struct { typedef struct nas_establish_req_s {
UInt8_t cause; /* RRC connection establishment cause */ UInt8_t cause; /* RRC connection establishment cause */
UInt8_t type; /* RRC associated call type */ UInt8_t type; /* RRC associated call type */
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
...@@ -284,7 +284,7 @@ typedef struct { ...@@ -284,7 +284,7 @@ typedef struct {
* AS->NAS - NAS signalling connection establishment indication * AS->NAS - NAS signalling connection establishment indication
* AS transfers the initial NAS message to the NAS. * AS transfers the initial NAS message to the NAS.
*/ */
typedef struct { typedef struct nas_establish_ind_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
tac_t tac; /* Code of the tracking area the initiating tac_t tac; /* Code of the tracking area the initiating
* UE belongs to */ * UE belongs to */
...@@ -296,7 +296,7 @@ typedef struct { ...@@ -296,7 +296,7 @@ typedef struct {
* NAS responds to the AS that initial answer message has to be provided to * NAS responds to the AS that initial answer message has to be provided to
* the UE. * the UE.
*/ */
typedef struct { typedef struct nas_establish_rsp_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
UInt8_t errCode; /* Transaction status */ UInt8_t errCode; /* Transaction status */
...@@ -307,7 +307,7 @@ typedef struct { ...@@ -307,7 +307,7 @@ typedef struct {
* AS->NAS - NAS signalling connection establishment confirm * AS->NAS - NAS signalling connection establishment confirm
* AS transfers the initial answer message to the NAS. * AS transfers the initial answer message to the NAS.
*/ */
typedef struct { typedef struct nas_establish_cnf_s {
UInt8_t errCode; /* Transaction status */ UInt8_t errCode; /* Transaction status */
as_nas_info_t nasMsg; /* NAS message to transfer */ as_nas_info_t nasMsg; /* NAS message to transfer */
} nas_establish_cnf_t; } nas_establish_cnf_t;
...@@ -319,16 +319,16 @@ typedef struct { ...@@ -319,16 +319,16 @@ typedef struct {
*/ */
/* Release cause */ /* Release cause */
enum { typedef enum release_cause_s {
AS_AUTHENTICATION_FAILURE = 1, /* Authentication procedure failed */ AS_AUTHENTICATION_FAILURE = 1, /* Authentication procedure failed */
AS_DETACH /* Detach requested */ AS_DETACH /* Detach requested */
}; } release_cause_t;
/* /*
* NAS->AS - NAS signalling connection release request * NAS->AS - NAS signalling connection release request
* NAS requests the termination of the connection with the UE. * NAS requests the termination of the connection with the UE.
*/ */
typedef struct { typedef struct nas_release_req_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
UInt8_t cause; /* Release cause */ UInt8_t cause; /* Release cause */
...@@ -338,7 +338,7 @@ typedef struct { ...@@ -338,7 +338,7 @@ typedef struct {
* AS->NAS - NAS signalling connection release indication * AS->NAS - NAS signalling connection release indication
* AS reports that connection has been terminated by the network. * AS reports that connection has been terminated by the network.
*/ */
typedef struct { typedef struct nas_release_ind_s {
UInt8_t cause; /* Release cause */ UInt8_t cause; /* Release cause */
} nas_release_ind_t; } nas_release_ind_t;
...@@ -353,7 +353,7 @@ typedef struct { ...@@ -353,7 +353,7 @@ typedef struct {
* NAS requests the AS to transfer uplink information to the NAS that * NAS requests the AS to transfer uplink information to the NAS that
* operates at the network side. * operates at the network side.
*/ */
typedef struct { typedef struct ul_info_transfer_req_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
as_nas_info_t nasMsg; /* Uplink NAS message */ as_nas_info_t nasMsg; /* Uplink NAS message */
...@@ -364,7 +364,7 @@ typedef struct { ...@@ -364,7 +364,7 @@ typedef struct {
* AS immediately notifies the NAS whether uplink information has been * AS immediately notifies the NAS whether uplink information has been
* successfully sent to the network or not. * successfully sent to the network or not.
*/ */
typedef struct { typedef struct ul_info_transfer_cnf_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
UInt8_t errCode; /* Transaction status */ UInt8_t errCode; /* Transaction status */
} ul_info_transfer_cnf_t; } ul_info_transfer_cnf_t;
...@@ -374,7 +374,7 @@ typedef struct { ...@@ -374,7 +374,7 @@ typedef struct {
* AS delivers the uplink information message to the NAS that operates * AS delivers the uplink information message to the NAS that operates
* at the network side. * at the network side.
*/ */
typedef struct { typedef struct ul_info_transfer_ind_s {
UInt32_t UEid; /* UE lower layer identifier */ UInt32_t UEid; /* UE lower layer identifier */
as_nas_info_t nasMsg; /* Uplink NAS message */ as_nas_info_t nasMsg; /* Uplink NAS message */
} ul_info_transfer_ind_t; } ul_info_transfer_ind_t;
...@@ -414,7 +414,7 @@ typedef struct {} as_qos_t; ...@@ -414,7 +414,7 @@ typedef struct {} as_qos_t;
* NAS requests the AS to allocate transmission resources to radio access * NAS requests the AS to allocate transmission resources to radio access
* bearer initialized at the network side. * bearer initialized at the network side.
*/ */
typedef struct { typedef struct rab_establish_req_s {
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
as_qos_t QoS; /* Requested Quality of Service */ as_qos_t QoS; /* Requested Quality of Service */
...@@ -424,7 +424,7 @@ typedef struct { ...@@ -424,7 +424,7 @@ typedef struct {
* AS->NAS - Radio access bearer establishment indication * AS->NAS - Radio access bearer establishment indication
* AS notifies the NAS that specific radio access bearer has to be setup. * AS notifies the NAS that specific radio access bearer has to be setup.
*/ */
typedef struct { typedef struct rab_establish_ind_s {
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
} rab_establish_ind_t; } rab_establish_ind_t;
...@@ -433,7 +433,7 @@ typedef struct { ...@@ -433,7 +433,7 @@ typedef struct {
* NAS responds to AS whether the specified radio access bearer has been * NAS responds to AS whether the specified radio access bearer has been
* successfully setup or not. * successfully setup or not.
*/ */
typedef struct { typedef struct rab_establish_rsp_s {
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
UInt8_t errCode; /* Transaction status */ UInt8_t errCode; /* Transaction status */
...@@ -444,7 +444,7 @@ typedef struct { ...@@ -444,7 +444,7 @@ typedef struct {
* AS notifies NAS whether the specified radio access bearer has been * AS notifies NAS whether the specified radio access bearer has been
* successfully setup at the UE side or not. * successfully setup at the UE side or not.
*/ */
typedef struct { typedef struct rab_establish_cnf_s {
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
UInt8_t errCode; /* Transaction status */ UInt8_t errCode; /* Transaction status */
} rab_establish_cnf_t; } rab_establish_cnf_t;
...@@ -460,7 +460,7 @@ typedef struct { ...@@ -460,7 +460,7 @@ typedef struct {
* NAS requests the AS to release transmission resources previously allocated * NAS requests the AS to release transmission resources previously allocated
* to specific radio access bearer at the network side. * to specific radio access bearer at the network side.
*/ */
typedef struct { typedef struct rab_release_req_s {
as_stmsi_t s_tmsi; /* UE identity */ as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
} rab_release_req_t; } rab_release_req_t;
...@@ -469,7 +469,7 @@ typedef struct { ...@@ -469,7 +469,7 @@ typedef struct {
* AS->NAS - Radio access bearer release indication * AS->NAS - Radio access bearer release indication
* AS notifies NAS that specific radio access bearer has been released. * AS notifies NAS that specific radio access bearer has been released.
*/ */
typedef struct { typedef struct rab_release_ind_s {
as_rab_id_t rabID; /* Radio access bearer identity */ as_rab_id_t rabID; /* Radio access bearer identity */
} rab_release_ind_t; } rab_release_ind_t;
...@@ -478,7 +478,7 @@ typedef struct { ...@@ -478,7 +478,7 @@ typedef struct {
* Structure of the AS messages handled by the network sublayer * Structure of the AS messages handled by the network sublayer
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
typedef struct { typedef struct as_message_s {
UInt16_t msgID; UInt16_t msgID;
union { union {
broadcast_info_ind_t broadcast_info_ind; broadcast_info_ind_t broadcast_info_ind;
...@@ -516,11 +516,11 @@ typedef struct { ...@@ -516,11 +516,11 @@ typedef struct {
/****************** E X P O R T E D F U N C T I O N S ******************/ /****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/ /****************************************************************************/
int as_message_decode(const char* buffer, as_message_t* msg, int length); int as_message_decode(const char *buffer, as_message_t *msg, int length);
int as_message_encode(char* buffer, as_message_t* msg, int length); int as_message_encode(char *buffer, as_message_t *msg, int length);
/* Implemented in the network_api.c body file */ /* Implemented in the network_api.c body file */
int as_message_send(as_message_t* as_msg); int as_message_send(as_message_t *as_msg);
#endif /* __AS_MESSAGE_H__*/ #endif /* __AS_MESSAGE_H__*/
...@@ -236,7 +236,8 @@ typedef struct { ...@@ -236,7 +236,8 @@ typedef struct {
* location change, new PLMN becomes available) is notified by the * location change, new PLMN becomes available) is notified by the
* EPS Mobility Management sublayer * EPS Mobility Management sublayer
*/ */
typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t, const char*, size_t); typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t,
const char *, size_t);
/****************************************************************************/ /****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/ /******************** G L O B A L V A R I A B L E S ********************/
......
...@@ -37,24 +37,24 @@ Description Contains network's global definitions ...@@ -37,24 +37,24 @@ Description Contains network's global definitions
* Network registration status * Network registration status
* --------------------------- * ---------------------------
*/ */
/* not registered, not currently searching an operator to register to */ /* not registered, not currently searching an operator to register to */
#define NET_REG_STATE_OFF 0 #define NET_REG_STATE_OFF 0
/* registered, home network */ /* registered, home network */
#define NET_REG_STATE_HN 1 #define NET_REG_STATE_HN 1
/* not registered, currently trying to attach or searching an operator /* not registered, currently trying to attach or searching an operator
* to register to */ * to register to */
#define NET_REG_STATE_ON 2 #define NET_REG_STATE_ON 2
/* registration denied */ /* registration denied */
#define NET_REG_STATE_DENIED 3 #define NET_REG_STATE_DENIED 3
/* unknown (e.g. out of GERAN/UTRAN/E-UTRAN coverage) */ /* unknown (e.g. out of GERAN/UTRAN/E-UTRAN coverage) */
#define NET_REG_STATE_UNKNOWN 4 #define NET_REG_STATE_UNKNOWN 4
/* registered, roaming */ /* registered, roaming */
#define NET_REG_STATE_ROAMING 5 #define NET_REG_STATE_ROAMING 5
/* registered for "SMS only", home network */ /* registered for "SMS only", home network */
#define NET_REG_STATE_SMS_HN 6 #define NET_REG_STATE_SMS_HN 6
/* registered, for "SMS only", roaming */ /* registered, for "SMS only", roaming */
#define NET_REG_STATE_SMS_ROAMING 7 #define NET_REG_STATE_SMS_ROAMING 7
/* attached for emergency bearer services only (applicable to UTRAN) */ /* attached for emergency bearer services only (applicable to UTRAN) */
#define NET_REG_STATE_EMERGENCY 8 #define NET_REG_STATE_EMERGENCY 8
/* /*
...@@ -230,7 +230,7 @@ typedef struct { ...@@ -230,7 +230,7 @@ typedef struct {
typedef struct { typedef struct {
int n_pkfs; int n_pkfs;
#define NET_PACKET_FILTER_MAX 16 #define NET_PACKET_FILTER_MAX 16
network_pkf_t* pkf[NET_PACKET_FILTER_MAX]; network_pkf_t *pkf[NET_PACKET_FILTER_MAX];
} network_tft_t; } network_tft_t;
/* /*
......
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