- Use typedef for enums/structs
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4562 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
+100
-100
@@ -1,20 +1,20 @@
|
||||
/*****************************************************************************
|
||||
Eurecom OpenAirInterface 3
|
||||
Copyright(c) 2012 Eurecom
|
||||
Eurecom OpenAirInterface 3
|
||||
Copyright(c) 2012 Eurecom
|
||||
|
||||
Source networkDef.h
|
||||
Source networkDef.h
|
||||
|
||||
Version 0.1
|
||||
Version 0.1
|
||||
|
||||
Date 2012/09/21
|
||||
Date 2012/09/21
|
||||
|
||||
Product NAS stack
|
||||
Product NAS stack
|
||||
|
||||
Subsystem include
|
||||
Subsystem include
|
||||
|
||||
Author Frederic Maurel
|
||||
Author Frederic Maurel
|
||||
|
||||
Description Contains network's global definitions
|
||||
Description Contains network's global definitions
|
||||
|
||||
*****************************************************************************/
|
||||
#ifndef __NETWORKDEF_H__
|
||||
@@ -29,101 +29,101 @@ Description Contains network's global definitions
|
||||
* Network selection mode
|
||||
* ----------------------
|
||||
*/
|
||||
#define NET_PLMN_AUTO 0
|
||||
#define NET_PLMN_MANUAL 1
|
||||
#define NET_PLMN_AUTO 0
|
||||
#define NET_PLMN_MANUAL 1
|
||||
|
||||
/*
|
||||
* ---------------------------
|
||||
* Network registration status
|
||||
* ---------------------------
|
||||
*/
|
||||
/* not registered, not currently searching an operator to register to */
|
||||
#define NET_REG_STATE_OFF 0
|
||||
/* registered, home network */
|
||||
#define NET_REG_STATE_HN 1
|
||||
/* not registered, currently trying to attach or searching an operator
|
||||
* to register to */
|
||||
#define NET_REG_STATE_ON 2
|
||||
/* registration denied */
|
||||
#define NET_REG_STATE_DENIED 3
|
||||
/* unknown (e.g. out of GERAN/UTRAN/E-UTRAN coverage) */
|
||||
#define NET_REG_STATE_UNKNOWN 4
|
||||
/* registered, roaming */
|
||||
#define NET_REG_STATE_ROAMING 5
|
||||
/* registered for "SMS only", home network */
|
||||
#define NET_REG_STATE_SMS_HN 6
|
||||
/* registered, for "SMS only", roaming */
|
||||
#define NET_REG_STATE_SMS_ROAMING 7
|
||||
/* attached for emergency bearer services only (applicable to UTRAN) */
|
||||
#define NET_REG_STATE_EMERGENCY 8
|
||||
/* not registered, not currently searching an operator to register to */
|
||||
#define NET_REG_STATE_OFF 0
|
||||
/* registered, home network */
|
||||
#define NET_REG_STATE_HN 1
|
||||
/* not registered, currently trying to attach or searching an operator
|
||||
* to register to */
|
||||
#define NET_REG_STATE_ON 2
|
||||
/* registration denied */
|
||||
#define NET_REG_STATE_DENIED 3
|
||||
/* unknown (e.g. out of GERAN/UTRAN/E-UTRAN coverage) */
|
||||
#define NET_REG_STATE_UNKNOWN 4
|
||||
/* registered, roaming */
|
||||
#define NET_REG_STATE_ROAMING 5
|
||||
/* registered for "SMS only", home network */
|
||||
#define NET_REG_STATE_SMS_HN 6
|
||||
/* registered, for "SMS only", roaming */
|
||||
#define NET_REG_STATE_SMS_ROAMING 7
|
||||
/* attached for emergency bearer services only (applicable to UTRAN) */
|
||||
#define NET_REG_STATE_EMERGENCY 8
|
||||
|
||||
/*
|
||||
* ------------------------------------
|
||||
* Network access technology indicators
|
||||
* ------------------------------------
|
||||
*/
|
||||
#define NET_ACCESS_UNAVAILABLE (-1) /* Not available */
|
||||
#define NET_ACCESS_GSM 0 /* GSM */
|
||||
#define NET_ACCESS_COMPACT 1 /* GSM Compact */
|
||||
#define NET_ACCESS_UTRAN 2 /* UTRAN */
|
||||
#define NET_ACCESS_EGPRS 3 /* GSM w/EGPRS */
|
||||
#define NET_ACCESS_HSDPA 4 /* UTRAN w/HSDPA */
|
||||
#define NET_ACCESS_HSUPA 5 /* UTRAN w/HSUPA */
|
||||
#define NET_ACCESS_HSDUPA 6 /* UTRAN w/HSDPA and HSUPA */
|
||||
#define NET_ACCESS_EUTRAN 7 /* E-UTRAN */
|
||||
#define NET_ACCESS_UNAVAILABLE (-1) /* Not available */
|
||||
#define NET_ACCESS_GSM 0 /* GSM */
|
||||
#define NET_ACCESS_COMPACT 1 /* GSM Compact */
|
||||
#define NET_ACCESS_UTRAN 2 /* UTRAN */
|
||||
#define NET_ACCESS_EGPRS 3 /* GSM w/EGPRS */
|
||||
#define NET_ACCESS_HSDPA 4 /* UTRAN w/HSDPA */
|
||||
#define NET_ACCESS_HSUPA 5 /* UTRAN w/HSUPA */
|
||||
#define NET_ACCESS_HSDUPA 6 /* UTRAN w/HSDPA and HSUPA */
|
||||
#define NET_ACCESS_EUTRAN 7 /* E-UTRAN */
|
||||
|
||||
/*
|
||||
* ---------------------------------------
|
||||
* Network operator representation formats
|
||||
* ---------------------------------------
|
||||
*/
|
||||
#define NET_FORMAT_LONG 0 /* long format alphanumeric */
|
||||
#define NET_FORMAT_SHORT 1 /* short format alphanumeric */
|
||||
#define NET_FORMAT_NUM 2 /* numeric format */
|
||||
#define NET_FORMAT_LONG 0 /* long format alphanumeric */
|
||||
#define NET_FORMAT_SHORT 1 /* short format alphanumeric */
|
||||
#define NET_FORMAT_NUM 2 /* numeric format */
|
||||
|
||||
#define NET_FORMAT_MAX_SIZE NET_FORMAT_LONG_SIZE
|
||||
#define NET_FORMAT_MAX_SIZE NET_FORMAT_LONG_SIZE
|
||||
|
||||
/*
|
||||
* -----------------------------
|
||||
* Network operator availability
|
||||
* -----------------------------
|
||||
*/
|
||||
#define NET_OPER_UNKNOWN 0 /* unknown operator */
|
||||
#define NET_OPER_AVAILABLE 1 /* available operator */
|
||||
#define NET_OPER_CURRENT 2 /* currently selected operator */
|
||||
#define NET_OPER_FORBIDDEN 3 /* forbidden operator */
|
||||
#define NET_OPER_UNKNOWN 0 /* unknown operator */
|
||||
#define NET_OPER_AVAILABLE 1 /* available operator */
|
||||
#define NET_OPER_CURRENT 2 /* currently selected operator */
|
||||
#define NET_OPER_FORBIDDEN 3 /* forbidden operator */
|
||||
|
||||
/*
|
||||
* --------------------------------------
|
||||
* Network connection establishment cause
|
||||
* --------------------------------------
|
||||
*/
|
||||
#define NET_ESTABLISH_CAUSE_EMERGENCY 0x01
|
||||
#define NET_ESTABLISH_CAUSE_HIGH_PRIO 0x02
|
||||
#define NET_ESTABLISH_CAUSE_MT_ACCESS 0x03
|
||||
#define NET_ESTABLISH_CAUSE_MO_SIGNAL 0x04
|
||||
#define NET_ESTABLISH_CAUSE_MO_DATA 0x05
|
||||
#define NET_ESTABLISH_CAUSE_V1020 0x06
|
||||
#define NET_ESTABLISH_CAUSE_EMERGENCY 0x01
|
||||
#define NET_ESTABLISH_CAUSE_HIGH_PRIO 0x02
|
||||
#define NET_ESTABLISH_CAUSE_MT_ACCESS 0x03
|
||||
#define NET_ESTABLISH_CAUSE_MO_SIGNAL 0x04
|
||||
#define NET_ESTABLISH_CAUSE_MO_DATA 0x05
|
||||
#define NET_ESTABLISH_CAUSE_V1020 0x06
|
||||
|
||||
/*
|
||||
* --------------------------------------
|
||||
* Network connection establishment type
|
||||
* --------------------------------------
|
||||
*/
|
||||
#define NET_ESTABLISH_TYPE_ORIGINATING_SIGNAL 0x10
|
||||
#define NET_ESTABLISH_TYPE_EMERGENCY_CALLS 0x20
|
||||
#define NET_ESTABLISH_TYPE_ORIGINATING_CALLS 0x30
|
||||
#define NET_ESTABLISH_TYPE_TERMINATING_CALLS 0x40
|
||||
#define NET_ESTABLISH_TYPE_MO_CS_FALLBACK 0x50
|
||||
#define NET_ESTABLISH_TYPE_ORIGINATING_SIGNAL 0x10
|
||||
#define NET_ESTABLISH_TYPE_EMERGENCY_CALLS 0x20
|
||||
#define NET_ESTABLISH_TYPE_ORIGINATING_CALLS 0x30
|
||||
#define NET_ESTABLISH_TYPE_TERMINATING_CALLS 0x40
|
||||
#define NET_ESTABLISH_TYPE_MO_CS_FALLBACK 0x50
|
||||
|
||||
/*
|
||||
* -------------------
|
||||
* PDN connection type
|
||||
* -------------------
|
||||
*/
|
||||
#define NET_PDN_TYPE_IPV4 0
|
||||
#define NET_PDN_TYPE_IPV6 1
|
||||
#define NET_PDN_TYPE_IPV4V6 2
|
||||
#define NET_PDN_TYPE_IPV4 0
|
||||
#define NET_PDN_TYPE_IPV6 1
|
||||
#define NET_PDN_TYPE_IPV4V6 2
|
||||
|
||||
/****************************************************************************/
|
||||
/************************ G L O B A L T Y P E S ************************/
|
||||
@@ -135,14 +135,14 @@ Description Contains network's global definitions
|
||||
* ---------------------
|
||||
*/
|
||||
typedef enum {
|
||||
/* MT = The Mobile Terminal, NW = The Network */
|
||||
NET_PDN_MT_DEFAULT_ACT = 1, /* MT has activated a PDN connection */
|
||||
NET_PDN_NW_DEFAULT_DEACT, /* NW has deactivated a PDN connection */
|
||||
NET_PDN_MT_DEFAULT_DEACT, /* MT has deactivated a PDN connection */
|
||||
NET_PDN_NW_DEDICATED_ACT, /* NW has activated an EPS bearer context */
|
||||
NET_PDN_MT_DEDICATED_ACT, /* MT has activated an EPS bearer context */
|
||||
NET_PDN_NW_DEDICATED_DEACT, /* NW has deactivated an EPS bearer context */
|
||||
NET_PDN_MT_DEDICATED_DEACT, /* MT has deactivated an EPS bearer context */
|
||||
/* MT = The Mobile Terminal, NW = The Network */
|
||||
NET_PDN_MT_DEFAULT_ACT = 1, /* MT has activated a PDN connection */
|
||||
NET_PDN_NW_DEFAULT_DEACT, /* NW has deactivated a PDN connection */
|
||||
NET_PDN_MT_DEFAULT_DEACT, /* MT has deactivated a PDN connection */
|
||||
NET_PDN_NW_DEDICATED_ACT, /* NW has activated an EPS bearer context */
|
||||
NET_PDN_MT_DEDICATED_ACT, /* MT has activated an EPS bearer context */
|
||||
NET_PDN_NW_DEDICATED_DEACT, /* NW has deactivated an EPS bearer context */
|
||||
NET_PDN_MT_DEDICATED_DEACT, /* MT has deactivated an EPS bearer context */
|
||||
} network_pdn_state_t;
|
||||
|
||||
/*
|
||||
@@ -151,13 +151,13 @@ typedef enum {
|
||||
* ---------------------------
|
||||
*/
|
||||
typedef struct {
|
||||
#define NET_FORMAT_LONG_SIZE 16 /* Long alphanumeric format */
|
||||
#define NET_FORMAT_SHORT_SIZE 8 /* Short alphanumeric format */
|
||||
#define NET_FORMAT_NUM_SIZE 6 /* Numeric format (PLMN identifier */
|
||||
#define NET_FORMAT_LONG_SIZE 16 /* Long alphanumeric format */
|
||||
#define NET_FORMAT_SHORT_SIZE 8 /* Short alphanumeric format */
|
||||
#define NET_FORMAT_NUM_SIZE 6 /* Numeric format (PLMN identifier */
|
||||
union {
|
||||
unsigned char alpha_long[NET_FORMAT_LONG_SIZE+1];
|
||||
unsigned char alpha_short[NET_FORMAT_SHORT_SIZE+1];
|
||||
unsigned char num[NET_FORMAT_NUM_SIZE+1];
|
||||
unsigned char alpha_long[NET_FORMAT_LONG_SIZE+1];
|
||||
unsigned char alpha_short[NET_FORMAT_SHORT_SIZE+1];
|
||||
unsigned char num[NET_FORMAT_NUM_SIZE+1];
|
||||
} id;
|
||||
} network_plmn_t;
|
||||
|
||||
@@ -167,11 +167,11 @@ typedef struct {
|
||||
* -------------------------------
|
||||
*/
|
||||
typedef struct {
|
||||
int gbrUL; /* Guaranteed Bit Rate for uplink */
|
||||
int gbrDL; /* Guaranteed Bit Rate for downlink */
|
||||
int mbrUL; /* Maximum Bit Rate for uplink */
|
||||
int mbrDL; /* Maximum Bit Rate for downlink */
|
||||
int qci; /* QoS Class Identifier */
|
||||
int gbrUL; /* Guaranteed Bit Rate for uplink */
|
||||
int gbrDL; /* Guaranteed Bit Rate for downlink */
|
||||
int mbrUL; /* Maximum Bit Rate for uplink */
|
||||
int mbrDL; /* Maximum Bit Rate for downlink */
|
||||
int qci; /* QoS Class Identifier */
|
||||
} network_qos_t;
|
||||
|
||||
/*
|
||||
@@ -180,9 +180,9 @@ typedef struct {
|
||||
* -----------------------------
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char protocol; /* Protocol identifier */
|
||||
unsigned char tos; /* Type of service */
|
||||
#define NET_PACKET_FILTER_IPV4_ADDR_SIZE 4
|
||||
unsigned char protocol; /* Protocol identifier */
|
||||
unsigned char tos; /* Type of service */
|
||||
#define NET_PACKET_FILTER_IPV4_ADDR_SIZE 4
|
||||
unsigned char addr[NET_PACKET_FILTER_IPV4_ADDR_SIZE];
|
||||
unsigned char mask[NET_PACKET_FILTER_IPV4_ADDR_SIZE];
|
||||
} network_ipv4_data_t;
|
||||
@@ -193,13 +193,13 @@ typedef struct {
|
||||
* -----------------------------
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char nh; /* Next header type */
|
||||
unsigned char tf; /* Traffic class */
|
||||
#define NET_PACKET_FILTER_IPV6_ADDR_SIZE 16
|
||||
unsigned char nh; /* Next header type */
|
||||
unsigned char tf; /* Traffic class */
|
||||
#define NET_PACKET_FILTER_IPV6_ADDR_SIZE 16
|
||||
unsigned char addr[NET_PACKET_FILTER_IPV6_ADDR_SIZE];
|
||||
unsigned char mask[NET_PACKET_FILTER_IPV6_ADDR_SIZE];
|
||||
unsigned int ipsec; /* IPSec security parameter index */
|
||||
unsigned int fl; /* Flow label */
|
||||
unsigned int ipsec; /* IPSec security parameter index */
|
||||
unsigned int fl; /* Flow label */
|
||||
} network_ipv6_data_t;
|
||||
|
||||
/*
|
||||
@@ -208,18 +208,18 @@ typedef struct {
|
||||
* -------------
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char id; /* Packet filter identifier */
|
||||
#define NET_PACKET_FILTER_DOWNLINK 0x01
|
||||
#define NET_PACKET_FILTER_UPLINK 0x02
|
||||
#define NET_PACKET_FILTER_BIDIR 0x03
|
||||
unsigned char dir; /* Packet filter direction */
|
||||
unsigned char precedence; /* Evaluation precedence */
|
||||
unsigned char id; /* Packet filter identifier */
|
||||
#define NET_PACKET_FILTER_DOWNLINK 0x01
|
||||
#define NET_PACKET_FILTER_UPLINK 0x02
|
||||
#define NET_PACKET_FILTER_BIDIR 0x03
|
||||
unsigned char dir; /* Packet filter direction */
|
||||
unsigned char precedence; /* Evaluation precedence */
|
||||
union {
|
||||
network_ipv4_data_t ipv4;
|
||||
network_ipv6_data_t ipv6;
|
||||
network_ipv4_data_t ipv4;
|
||||
network_ipv6_data_t ipv6;
|
||||
} data;
|
||||
unsigned short lport; /* Local (UE) port number */
|
||||
unsigned short rport; /* Remote (network) port number */
|
||||
unsigned short lport; /* Local (UE) port number */
|
||||
unsigned short rport; /* Remote (network) port number */
|
||||
} network_pkf_t;
|
||||
|
||||
/*
|
||||
@@ -229,8 +229,8 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
int n_pkfs;
|
||||
#define NET_PACKET_FILTER_MAX 16
|
||||
network_pkf_t* pkf[NET_PACKET_FILTER_MAX];
|
||||
#define NET_PACKET_FILTER_MAX 16
|
||||
network_pkf_t *pkf[NET_PACKET_FILTER_MAX];
|
||||
} network_tft_t;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user