/********************************************************************
Copyright ?2007 LGC Wireless, Inc. All rights reserved
File Name: 		aifg_ie.h
Description:	Definition of information element structure of A-I/F messages
Version:		v9.0.0
Author:			Roy Jiang
Create Date:	2007-3-21

History:
2007-3-21		v9.0.0	Create
*********************************************************************/

#ifndef _WXC2_AIFG_IE_H
#define _WXC2_AIFG_IE_H

#include "aifg_public.h"

#define MAX_IE_LEN 256

#define aifg_set_field(x, y)		(x.flag = 1, x.value = y)
typedef struct _aifg_ie_field{
	BYTE flag;
	BYTE value;
}aifg_ie_field;

typedef enum{
	//For BSSMAP
	AIFG_IE_ID_BM_CIC 					= 0x00,	//CIC
	AIFG_IE_ID_BM_RESOURCEAVAIL 		= 0x01,	//Resource available
	AIFG_IE_ID_BM_CAUSE 				= 0x02,	//Cause
	AIFG_IE_ID_BM_CELLID 				= 0x03,	//Cell identifier
	AIFG_IE_ID_BM_PRIORITY 				= 0x04,	//Priority
	AIFG_IE_ID_BM_L3HEADERINFO			= 0x05,	//Layer 3 header information
	AIFG_IE_ID_BM_IMSI					= 0x06,	//IMSI
	AIFG_IE_ID_BM_TMSI					= 0x07,	//TMSI
	AIFG_IE_ID_BM_ENCRYPTINFO			= 0x08,	//Encrypt information
	AIFG_IE_ID_BM_CHANNELTYPE			= 0x09,	//Channel type
	AIFG_IE_ID_BM_PERIODICITY			= 0x0A,	//Periodicity
	AIFG_IE_ID_BM_EXTRESOURCEIND		= 0x0B,	//Extended resource indicator
	AIFG_IE_ID_BM_MSNUM					= 0x0C,	//Number of MSs
	AIFG_IE_ID_BM_CLASSMARKINFO2		= 0x0D,	//Classmark information type 2
	AIFG_IE_ID_BM_CLASSMARKINFO3		= 0x0E,	//Classmark information type 3
	AIFG_IE_ID_BM_BANDUSED				= 0x0F,	//Band to be used
	AIFG_IE_ID_BM_RRCAUSE				= 0x10,	//RR cause
	AIFG_IE_ID_BM_L3INFO				= 0x11,	//Layer 3 information
	AIFG_IE_ID_BM_DLCI					= 0x12,	//DLCI
	AIFG_IE_ID_BM_DTXFLAG				= 0x13,	//DTC flag
	AIFG_IE_ID_BM_CELLIDLIST			= 0x14,	//Cell identity list
	AIFG_IE_ID_BM_RESPREQ				= 0x15,	//Response request
	AIFG_IE_ID_BM_RESOURCEINDMEHTOD		= 0x16,	//Resource indication method
	AIFG_IE_ID_BM_CLASSMARKINFO1		= 0x17,	//Classmark information type 1
	AIFG_IE_ID_BM_CICLIST				= 0x18,	//CIC list
	AIFG_IE_ID_BM_DIGNOSTIC				= 0x19,	//Dignostic
	AIFG_IE_ID_BM_L3MSGCONTENT			= 0x1A,	//Layer 3 message content
	AIFG_IE_ID_BM_CHOSENCHANNEL			= 0x1B,	//Chosen channel
	AIFG_IE_ID_BM_TOTALRESOURCE			= 0x1C,	//Total resource accessiable
	AIFG_IE_ID_BM_CIPHERRESPMODE		= 0x1D,	//Cipher response mode
	AIFG_IE_ID_BM_CHANNELNEEDED			= 0x1E,	//Channel needed
	AIFG_IE_ID_BM_TRACETYPE				= 0x1F,	//Trace type
	AIFG_IE_ID_BM_TRIGGERID				= 0x20,	//Trigger ID
	AIFG_IE_ID_BM_TRACEREF				= 0x21,	//Trace reference
	AIFG_IE_ID_BM_TRANSACTIONID			= 0x22,	//Transaction ID
	AIFG_IE_ID_BM_MOBILEID				= 0x23,	//Mobile identity
	AIFG_IE_ID_BM_OMCID					= 0x24,	//OMC ID
	AIFG_IE_ID_BM_FORWARDIND			= 0x25,	//Forward indication
	AIFG_IE_ID_BM_CHOSENENCRYPT			= 0x26,	//Chosen encript algorithm
	AIFG_IE_ID_BM_CIRCUITPOOL			= 0x27,	//Circuit pool
	AIFG_IE_ID_BM_CIRCUITPOOLLIST		= 0x28,	//Circuit pool list
	AIFG_IE_ID_BM_TIMEIND				= 0x29,	//Time indicator
	AIFG_IE_ID_BM_RESOURCESITUATION		= 0x2A,	//Resource situation
	AIFG_IE_ID_BM_CURCHANNELTYPE1		= 0x2B,	//Current channel type 1
	AIFG_IE_ID_BM_QUEUEIND				= 0x2C,	//Queuing indicator
	AIFG_IE_ID_BM_SPEECHVER				= 0x2D,	//Speech version
	AIFG_IE_ID_BM_ASSIGNREQUIREMENT		= 0x2E,	//Assignment requirment
	AIFG_IE_ID_BM_TALKERFLAG			= 0x2F,	//Talker flag
	AIFG_IE_ID_BM_CONNRELREQ			= 0x30,	//Connection release request
	AIFG_IE_ID_BM_GROUPCALLREF			= 0x31,	//Group call reference
	AIFG_IE_ID_BM_EMLPP					= 0x32,	//eMLPP
	AIFG_IE_ID_BM_CFGEVOIND				= 0x33,	//Configuration evolution indication
	AIFG_IE_ID_BM_BSSOLDTONEW			= 0x34,	//Old BSS to new BSS
	AIFG_IE_ID_BM_LSAID					= 0x35,	//LSA identity
	AIFG_IE_ID_BM_LSAIDLIST				= 0x36,	//LSA identity list
	AIFG_IE_ID_BM_LSAINFO				= 0x37,	//LSA information
	AIFG_IE_ID_BM_LOCATIONINFO			= 0x38,	//Location information

	//For DTAP
	//The iei defined below is program specific, it is not the iei of DTAP defined in GSM 04.08
	//The first byte of these iei is the type of the ie.  01-04 = type1 - type4, see 11.2.1.1.4, GSM 04.07
	//common
	AIFG_IE_ID_DT_CELLID				= 0x39,	//Cell identity
	AIFG_IE_ID_DT_CIPHERKEY				= 0x3A,	//Ciphering key sequence number
	AIFG_IE_ID_DT_LAI					= 0x3B,	//location area identification
	AIFG_IE_ID_DT_MOBILEID				= 0x3C,	//mobile identity
	AIFG_IE_ID_DT_MSCM1					= 0x3D,	//mobile station classmark 1
	AIFG_IE_ID_DT_MSCM2					= 0x3E,	//mobile station classmark 2
	AIFG_IE_ID_DT_MSCM3					= 0x3F,	//mobile station classmark 3
	AIFG_IE_ID_DT_GROUPREF				= 0x40,	//Descriptive group or broadcast call reference
	AIFG_IE_ID_DT_GROUPCIPHERKEY		= 0x41,	//Group Cipher Key Number
	AIFG_IE_ID_DT_PRIORITYLEVEL			= 0x42,	//Priority level	
	//MM
	AIFG_IE_ID_DT_AUTHRAND				= 0x43,	//Authentication parameter RAND
	AIFG_IE_ID_DT_AUTHSRES				= 0x44,	//Authentication parameter SRES
	AIFG_IE_ID_DT_CMTYPE				= 0x45,	//CM service type
	AIFG_IE_ID_DT_IDTYPE				= 0x46,	//Identity type
	AIFG_IE_ID_DT_LUTYPE				= 0x47,	//Location update type
	AIFG_IE_ID_DT_FULL_NWNAME			= 0x48,	//Full Network name
	AIFG_IE_ID_DT_SHORT_NWNAME			= 0x99,	//Short Network name
	AIFG_IE_ID_DT_REJCAUSE				= 0x49,	//Reject cause
	AIFG_IE_ID_DT_FLONPROCEED			= 0x4A,	//Follow on proceed
	AIFG_IE_ID_DT_TIMEZONE				= 0x4B,	//Time zone
	AIFG_IE_ID_DT_TZTIME				= 0x4C,	//Time zone and time
	AIFG_IE_ID_DT_CTS					= 0x4D,	//CTS permission
	AIFG_IE_ID_DT_LSAID					= 0x4E,	//LSA identifier	
	//CC
//	AIFG_IE_ID_DT_CODESETEXT			= 0x4F,	//Extention of codesets
//	AIFG_IE_ID_DT_SHIFT					= 0x50,	//Locking and non-locking shift procedure
	AIFG_IE_ID_DT_AUXSTAT				= 0x51,	//Auxiliary states
	AIFG_IE_ID_DT_BEARERCAP				= 0x52,	//Bearer capability
	AIFG_IE_ID_DT_CCCAP					= 0x53,	//Call control capability
	AIFG_IE_ID_DT_CALLSTAT				= 0x54,	//Call state
	AIFG_IE_ID_DT_CALLEDBCD				= 0x55,	//Called party BCD
	AIFG_IE_ID_DT_CALLEDSUBADDR			= 0x56,	//Called party subaddress
	AIFG_IE_ID_DT_CALLERBCD				= 0x57,	//Calling party BCD
	AIFG_IE_ID_DT_CALLERSUBADDR			= 0x58,	//Calling party subaddress
	AIFG_IE_ID_DT_CAUSE					= 0x59,	//Cause
	AIFG_IE_ID_DT_CLIRSUP				= 0x5A,	//CLIR suppression
	AIFG_IE_ID_DT_CLIRIVO				= 0x5B,	//CLIR invocation
	AIFG_IE_ID_DT_CONGESTLEVEL			= 0x5C,	//Congestion level
	AIFG_IE_ID_DT_CONNNUM				= 0x5D,	//Connected number
	AIFG_IE_ID_DT_CONNSUBADDR			= 0x5E,	//Connected subaddress
	AIFG_IE_ID_DT_FACILITY				= 0x5F,	//Facility
	AIFG_IE_ID_DT_HIGHCOM				= 0x60,	//Higher layer compatibility
	AIFG_IE_ID_DT_KEYPAD				= 0x61,	//Keypad facility
	AIFG_IE_ID_DT_LOWCOM				= 0x62,	//Lower layer compatibility
	AIFG_IE_ID_DT_MOREDATA				= 0x63,	//More data
	AIFG_IE_ID_DT_NOTIIND				= 0x64,	//Notification indicator
	AIFG_IE_ID_DT_PROGIND				= 0x65,	//Progress indicator
	AIFG_IE_ID_DT_REDIRBCD				= 0x66,	//Redirecting party BCD
	AIFG_IE_ID_DT_REDIRSUBADDR			= 0x67,	//Redirecting party subaddress
	AIFG_IE_ID_DT_REPEATIND				= 0x68,	//Repeat indicator
	AIFG_IE_ID_DT_REVCALLDIR			= 0x69,	//Reverse call setup direction
	AIFG_IE_ID_DT_SIGNAL				= 0x6A,	//Signal
	AIFG_IE_ID_DT_SSVER					= 0x6B,	//SS version indicator
	AIFG_IE_ID_DT_USERUSER				= 0x6C,	//User-user
	AIFG_IE_ID_DT_ALERTPATTERN			= 0x6D,	//Alert parttern
	//SMS
	AIFG_IE_ID_DT_RP_MO_ADDR			= 0x6E,	//Originator address element
	AIFG_IE_ID_DT_RP_MT_ADDR			= 0x6F,	//Destination address element
	AIFG_IE_ID_DT_RP_UD					= 0x70,	//RP-User data element
	AIFG_IE_ID_DT_RP_CAUSE				= 0x71,	//RP-Cause element
}aifg_ie_id;

/*******************************************DTAP*******************************************/
//Broadcast Call Reference----------------------------------
typedef struct _aifg_ie_dt_broadcastRef{
	BYTE	flag;
	int		binary_code; //27 bit in total
	BYTE	sf;
	BYTE	af;
	BYTE	call_priority;
	BYTE	cipher_info;
}aifg_ie_dt_broadcastRef;
//----------------------------------------------------------

//Classmark Information Type 2------------------------------
typedef struct _aifg_ie_dt_cmInfo2{
	BYTE	flag;
	BYTE	rev_level;
	BYTE	es_ind;
	BYTE	a5_1;
	BYTE	rf_power_cap;
	BYTE	ps_cap;
	BYTE	ss_screen_ind;
	BYTE	sm_cap;
	BYTE	vbs;
	BYTE	vgcs;
	BYTE	fc;
	BYTE	cm3;
	BYTE	lcsva_cap;
	BYTE	so_lsa;
	BYTE	cmsp;
	BYTE	a5_3;
	BYTE	a5_2;
}aifg_ie_dt_cmInfo2;
//----------------------------------------------------------

//Classmark Information Type 2------------------------------
typedef struct _aifg_ie_dt_cmInfo1{
	BYTE	flag;
	BYTE	rev_level;
	BYTE	es_ind;
	BYTE	a5_1;
	BYTE	rf_power_cap;
}aifg_ie_dt_cmInfo1;
//----------------------------------------------------------

//Mobile ID-------------------------------------------------
typedef struct _aifg_ie_dt_mobileId{
	BYTE	flag;
	BYTE	type;
	BYTE	odd_even_flag;
	BYTE 	id[16];
	BYTE	id_len;
}aifg_ie_mobileId;
//----------------------------------------------------------

//Location area identification------------------------------
typedef struct _aifg_ie_dt_lai{
	BYTE	flag;
	BYTE	mcc[3];
	BYTE	mnc[3];
	int	 	LAC;
}aifg_ie_dt_lai;
//----------------------------------------------------------

//Location updating type------------------------------------
typedef struct _aifg_ie_dt_luType{
	BYTE	flag;
	BYTE	fo_req;
	BYTE	lut;
}aifg_ie_dt_luType;
//----------------------------------------------------------

//Network name----------------------------------------------
typedef struct _aifg_ie_dt_nwName{
	BYTE	flag;
	BYTE	code_scheme;
	BYTE	add_ci;
	BYTE	spare_num;
	BYTE	text[MAX_IE_LEN];
	BYTE	text_len;
}aifg_ie_dt_nwName;
//----------------------------------------------------------

//Time zone and time----------------------------------------
typedef struct _aifg_ie_dt_tzTime{
	BYTE	flag;
	BYTE	year;
	BYTE	month;
	BYTE	day;
	BYTE	hour;
	BYTE	minute;
	BYTE	second;
	BYTE	time_zone;
}aifg_ie_dt_tzTime;
//----------------------------------------------------------

//Progress indicator----------------------------------------
typedef struct _aifg_ie_dt_progInd{
	BYTE	flag;
	BYTE	coding_standard;
	BYTE	location;
	BYTE	desc;
}aifg_ie_dt_progInd;
//----------------------------------------------------------

//User-user-------------------------------------------------
typedef struct _aifg_ie_dt_uu{
	BYTE	flag;
	BYTE	pd;
	BYTE	info[131];
	BYTE	info_len;
}aifg_ie_dt_uu;
//----------------------------------------------------------

//Bearer capbility------------------------------------------
typedef struct _aifg_ie_dt_bc{
	BYTE			flag;
	BYTE			channel_require;
	BYTE			coding_std;
	BYTE			trans_mode;
	BYTE			info_trans_cap;
	aifg_ie_field	coding;
	aifg_ie_field	speech_ver;
	aifg_ie_field	compress;
	aifg_ie_field	structure;
	aifg_ie_field	dupl_mode;
	aifg_ie_field	confiure;
	aifg_ie_field	nirr;
	aifg_ie_field	establishment;
	aifg_ie_field	access_id;
	aifg_ie_field	rate_adaption;
	aifg_ie_field	signal_protocol;
	aifg_ie_field	o_itc;
	aifg_ie_field	o_rate_adaption;
	aifg_ie_field	hdr_nohdr;
	aifg_ie_field	multi_frame;
	aifg_ie_field	mode;
	aifg_ie_field	lli;
	aifg_ie_field	assign_or_e;
	aifg_ie_field	inb_neg;
	aifg_ie_field	layer1_id;
	aifg_ie_field	user_info1_protocol;
	aifg_ie_field	sync_async;
	aifg_ie_field	num_stop_bits;
	aifg_ie_field	negotiation;
	aifg_ie_field	num_data_bits;
	aifg_ie_field	user_rate;
	aifg_ie_field	intermed_rate;
	aifg_ie_field	nic_on_tx;
	aifg_ie_field	nic_on_rx;
	aifg_ie_field	parity;
	aifg_ie_field	connection_element;
	aifg_ie_field	modem_type;
	aifg_ie_field	o_modem_type;
	aifg_ie_field	fixed_nw_user_rate;
	aifg_ie_field	acceptable_chennel_code;
	aifg_ie_field	max_traffic_channel;
	aifg_ie_field	uimi;
	aifg_ie_field	wanted_air_if_user_rate;
	aifg_ie_field	layer2_id;
	aifg_ie_field	user_info2_protocol;
}aifg_ie_dt_bc;
//----------------------------------------------------------

//Facility--------------------------------------------------
typedef struct _aifg_ie_dt_facility
{
	BYTE flag;
	BYTE component[256];
	BYTE component_len;
/*	struct{
		struct{	
			BYTE tag;
			BYTE len;
			struct
				{
					BYTE flag;
					BYTE param;
				}param;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE id;
				}invoke_id;
			struct
				{	BYTE flag;
					BYTE tag;
					BYTE len;
					BYTE id;
				}linked_id;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE op[32];
				}opCode;
		}invoke;
		
		struct{	
			BYTE tag;
			BYTE len;
			struct
				{	BYTE flag;
					BYTE param[32];
				}param;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE id;
				}invoke_id;
			struct
				{	BYTE flag;
					BYTE tag;
					BYTE len;
				}sequence;
			struct
				{	BYTE flag;
					BYTE tag;
					BYTE len;
					BYTE op[32];
				}opCode;
		}return_result;
		
		struct{	
			BYTE tag;
			BYTE len;
			struct
				{
					BYTE flag;
					BYTE param;
				}param;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE id;
				}invoke_id;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE er[32];
				}error;
		}return_error;
		
		struct{	
			BYTE tag;
			BYTE len;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE id;
				}invoke_id;
			struct
				{
					BYTE tag;
					BYTE len;
					BYTE pro[32];
				}problem;
		}reject;
	}components;
*/
	
}aifg_ie_dt_facility;
//----------------------------------------------------------

//Cause-----------------------------------------------------
typedef struct _aifg_ie_dt_cause{
	BYTE			flag;
	BYTE			coding_std;
	BYTE			location;
	aifg_ie_field	recommendation;
	BYTE			cause_value;
	BYTE			diagnostic[32];
	BYTE			diag_len;
}aifg_ie_dt_cause;
//----------------------------------------------------------

//Call Control Capabilities---------------------------------
typedef struct _aifg_ie_dt_ccCap{
	BYTE	flag;
	BYTE	pcp;
	BYTE	dtmf;
}aifg_ie_dt_ccCap;
//----------------------------------------------------------

//Connected number------------------------------------------
typedef struct _aifg_ie_dt_connNum{
	BYTE			flag;
	BYTE			type;
	BYTE			num_plan;
	aifg_ie_field	presentation_ind;
	aifg_ie_field	screen_ind;
	BYTE			number[80];
	BYTE			num_len;
}aifg_ie_dt_connNum;
//----------------------------------------------------------

//Calling number--------------------------------------------
typedef aifg_ie_dt_connNum aifg_ie_dt_callingNum;
//----------------------------------------------------------

//Called number---------------------------------------------
typedef aifg_ie_dt_connNum aifg_ie_dt_calledNum;
//----------------------------------------------------------

//Redirecting number----------------------------------------
typedef aifg_ie_dt_connNum aifg_ie_dt_redirNum;
//----------------------------------------------------------

//Connected subaddress--------------------------------------
typedef struct _aifg_ie_dt_connSubAddr{
	BYTE	flag;
	BYTE	type;
	BYTE	odd_even_ind;
	BYTE	info[20];
	BYTE	info_len;
}aifg_ie_dt_connSubAddr;
//----------------------------------------------------------

//Calling subaddress----------------------------------------
typedef aifg_ie_dt_connSubAddr aifg_ie_dt_callingSubAddr;
//----------------------------------------------------------

//Called subaddress-----------------------------------------
typedef aifg_ie_dt_connSubAddr aifg_ie_dt_calledSubAddr;
//----------------------------------------------------------

//Redirecting subaddress------------------------------------
typedef aifg_ie_dt_connSubAddr aifg_ie_dt_redirSubAddr;
//----------------------------------------------------------

//SS Version Indicator--------------------------------------
typedef struct _aifg_ie_dt_ssVer{
	BYTE	flag;
	BYTE	info[MAX_IE_LEN];
	BYTE	info_len;
}aifg_ie_dt_ssVer;
//----------------------------------------------------------

//High layer compatibility----------------------------------
typedef struct _aifg_ie_dt_hiComp{
	BYTE			flag;
	aifg_ie_field	coding_std;
	aifg_ie_field	interpret;
	aifg_ie_field	presentat_method;
	aifg_ie_field	high_layer_id;
	aifg_ie_field	ext_high_layer_id;
}aifg_ie_dt_hiComp;
//----------------------------------------------------------

//low layer compatibility-----------------------------------
typedef struct _aifg_ie_dt_loComp{
	BYTE	flag;
	BYTE	data[13];
	BYTE	data_len;
}aifg_ie_dt_loComp;
//----------------------------------------------------------

//Auxiliary states------------------------------------------
typedef struct _aifg_ie_dt_auxStat{
	BYTE	flag;
	BYTE	hold_stat;
	BYTE	mpty_stat;
}aifg_ie_dt_auxStat;
//----------------------------------------------------------

//Call status-----------------------------------------------
typedef struct _aifg_ie_dt_callStat{
	BYTE	flag;
	BYTE	coding_std;
	BYTE	value;
}aifg_ie_dt_callStat;
//----------------------------------------------------------

//Authenticataion RAND--------------------------------------
typedef struct _aifg_ie_dt_authRAND{
	BYTE	flag;
	BYTE	value[16];
}aifg_ie_dt_authRAND;
//----------------------------------------------------------

//Authenticataion SRES--------------------------------------
typedef struct _aifg_ie_dt_authSRES{
	BYTE	flag;
	BYTE	value[4];
}aifg_ie_dt_authSRES;
//----------------------------------------------------------

//LSA Identifier--------------------------------------------
typedef struct _aifg_ie_dt_lsaId{
	BYTE	flag;
	BYTE	value[3];
}aifg_ie_dt_lsaId;
//----------------------------------------------------------

//Follow On Proceed-----------------------------------------
typedef struct _aifg_ie_dt_followOnProceed{
	BYTE	flag;
	BYTE	value;
}aifg_ie_dt_followOnProceed;
//----------------------------------------------------------

typedef aifg_ie_dt_followOnProceed aifg_ie_dt_CTSPermission;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_rejectCause;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_cmType;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_cipherKey;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_priority;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_idType;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_rpInd;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_congestLevel;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_notificationInd;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_signal;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_alertPattern;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_keypad;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_moreData;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_revCallDir;
typedef aifg_ie_dt_followOnProceed aifg_ie_dt_timeZone;

//SMS
typedef struct{
	BYTE	flag;
	BYTE	number_type;
	BYTE	number_plan;
	BYTE	number[18];
	BYTE	number_len;
}aifg_ie_dt_rpAddr;

typedef struct{
	BYTE	len;
	BYTE	content[234];
}aifg_ie_dt_rpUD;

typedef struct{
	BYTE	flag;
	int		cause;
	BYTE	diagnostic[234];
	BYTE	diag_len;
}aifg_ie_dt_rpCause;

/*******************************************BSSMAP*******************************************/
//CIC-------------------------------------------------------
typedef struct _aifg_ie_bm_cic{
	BYTE	flag;
	int		pcm;
	int		timeslot;
}aifg_ie_bm_cic;
//----------------------------------------------------------

//Resource available----------------------------------------
typedef struct _aifg_ie_bm_resrcAvail{
	BYTE	flag;
	int		full_rate_channel[5];
	int		half_rate_channel[5];
}aifg_ie_bm_resrcAvail;
//----------------------------------------------------------

//Cause-----------------------------------------------------
typedef struct _aifg_ie_bm_cause{
	BYTE	flag;
	BYTE	value;
	aifg_ie_field	ext_value;
}aifg_ie_bm_cause;
//----------------------------------------------------------

//Cell Id---------------------------------------------------
typedef struct _aifg_ie_bm_cellId{
	BYTE	flag;
	BYTE	discriminator;
	BYTE	mcc[3];
	BYTE	mnc[3];
	int	 	LAC;
	int		CI;
}aifg_ie_bm_cellId;
//----------------------------------------------------------

//Priority--------------------------------------------------
typedef struct _aifg_ie_bm_priority{
	BYTE	flag;
	BYTE 	pci;
	BYTE 	level;
	BYTE	qa;
	BYTE	pvi;
}aifg_ie_bm_priority;
//----------------------------------------------------------

//Layer 3 Header Information--------------------------------
typedef struct _aifg_ie_bm_L3HeaderInfo{
	BYTE	flag;
	BYTE 	pd;
	BYTE 	ti;
}aifg_ie_bm_L3HeaderInfo;
//----------------------------------------------------------

//IMSI------------------------------------------------------
typedef struct _aifg_ie_bm_imsi{
	BYTE	flag;
	BYTE	type;
	BYTE	odd_even_flag;
	BYTE 	imsi[16];
	BYTE	imsi_len;
}aifg_ie_bm_imsi;
//----------------------------------------------------------

//Encrypt Information---------------------------------------
typedef struct _aifg_ie_bm_encryptInfo{	
	BYTE	flag;
	BYTE	algorithm;
	BYTE	key[8];
}aifg_ie_bm_encryptInfo;
//----------------------------------------------------------

//channel type----------------------------------------------
typedef struct _aifg_ie_bm_channelType{
	BYTE	flag;
	BYTE	speech_data_ind;
	BYTE	channel_rate_type;
	union{
		struct {
			BYTE len;
			BYTE ver[6];
		}speech;
		struct{
			BYTE	t_nt;
			BYTE	rate;
			aifg_ie_field	allowed_data_rate;
		}data_cfg;
	}ext;
}aifg_ie_bm_channelType;
//----------------------------------------------------------

//Extended resource indicator-------------------------------
typedef struct _aifg_ie_bm_extResourceInd{
	BYTE	flag;
	BYTE	sm;
	BYTE	tarr;
}aifg_ie_bm_extResourceInd;
//----------------------------------------------------------

//Classmark Information Type 2------------------------------
typedef aifg_ie_dt_cmInfo2 aifg_ie_bm_cmInfo2;
//----------------------------------------------------------

//Layer 3 information and Layer 3 message content-----------
typedef struct _aifg_ie_bm_l3Info{
	void	*l3_msg;	//this void pointer should be converted to a pointer to aifg_msg after L3 message is decoded
	BYTE	len;
}aifg_ie_bm_l3Info;
//----------------------------------------------------------

//Cell identifier list--------------------------------------
typedef struct _aifg_ie_bm_cidList{
	BYTE	flag;
	BYTE	discriminator;
	struct{
		BYTE	mcc[3];
		BYTE	mnc[3];
		int	 	LAC;
		int		CI;
	}cell_id[32];
	BYTE	cid_num;
}aifg_ie_bm_cidList;
//----------------------------------------------------------

//Classmark Information Type 1------------------------------
typedef aifg_ie_dt_cmInfo1 aifg_ie_bm_cmInfo1;
//----------------------------------------------------------

//CIC list--------------------------------------------------
typedef struct _aifg_ie_bm_cicList{
	BYTE	flag;
	BYTE	range;
	struct{
		BYTE	len;
		BYTE 	content[32];
	}status;
}aifg_ie_bm_cicList;
//----------------------------------------------------------

//Diagnostics-----------------------------------------------
typedef struct _aifg_ie_bm_diagnostics{
	BYTE	flag;
	BYTE	err_pointer;
	BYTE	bit_pointer;
	struct{
		BYTE 	len;
		BYTE	msg[MAX_IE_LEN];
	}err_msg;
}aifg_ie_bm_diagnostics;
//----------------------------------------------------------

//Chosen channel--------------------------------------------
typedef struct _aifg_ie_bm_chosenChannel{
	BYTE	flag;
	BYTE	mode;
	BYTE	channel;
}aifg_ie_bm_chosenChannel;
//----------------------------------------------------------

//Total resource accessiable--------------------------------
typedef struct _aifg_ie_bm_totalResrc{
	BYTE	flag;
	int		full_rate_channel;
	int		half_rate_channel;
}aifg_ie_bm_totalResrc;
//----------------------------------------------------------

//Trigger ID------------------------------------------------
typedef struct _aifg_ie_bm_triggerId{
	BYTE	flag;
	BYTE	len;
	BYTE	content[20];
}aifg_ie_bm_triggerId;
//----------------------------------------------------------

//Circuit pool list-----------------------------------------
typedef struct _aifg_ie_bm_circuitPoolList{
	BYTE	flag;
	BYTE	circuit[MAX_IE_LEN];
	BYTE	num;
}aifg_ie_bm_circuitPoolList;
//----------------------------------------------------------

//Resource situation----------------------------------------
typedef struct _aifg_ie_bm_resrcSit{
	BYTE	flag;
	struct{
		BYTE	band_ind;
		BYTE	channel_type;
		int		channel_num;
	}band[7];
	BYTE	band_num;
}aifg_ie_bm_resrcSit;
//----------------------------------------------------------

//Current channel type 1------------------------------------
typedef struct _aifg_ie_bm_curChannelType1{
	BYTE	flag;
	BYTE	channel_mode;
	BYTE	channel;
}aifg_ie_bm_curChannelType1;
//----------------------------------------------------------

//Group Call Reference--------------------------------------
typedef aifg_ie_dt_broadcastRef aifg_ie_bm_groupRef;
//----------------------------------------------------------

//LSA identifier list---------------------------------------
typedef struct _aifg_ie_bm_lsaIdList{
	BYTE			flag;
	BYTE			ep;
	struct{
		BYTE		id[3];
	}list[64];
	BYTE			lsa_num;
}aifg_ie_bm_lsaIdList;
//----------------------------------------------------------

//LSA information-------------------------------------------
typedef struct _aifg_ie_bm_lsaInfo{
	BYTE	flag;
	BYTE	lsa_only;
	BYTE	lsa_num;
	struct{
		BYTE 	priority;
		BYTE	id[3];	
	}info[50];
}aifg_ie_bm_lsaInfo;
//----------------------------------------------------------

//Location information--------------------------------------
typedef struct _aifg_ie_bm_locInfo{
	BYTE	flag;
	BYTE	info[MAX_IE_LEN];
	BYTE	len;
}aifg_ie_bm_locInfo;
//----------------------------------------------------------

//OMC ID----------------------------------------------------
typedef struct _aifg_ie_bm_omcId{
	BYTE	flag;
	BYTE	id[20];
	BYTE	len;
}aifg_ie_bm_omcId;
//----------------------------------------------------------

//Old BSS to New BSS information----------------------------
typedef struct _aifg_ie_bm_bssOldtoNew{
	BYTE	flag;
	BYTE	content[MAX_IE_LEN];
	BYTE	len;
}aifg_ie_bm_bssOldtoNew;
//----------------------------------------------------------

//Trace reference-------------------------------------------
typedef struct _aifg_ie_bm_traceRef{
	BYTE	flag;
	int		value;
}aifg_ie_bm_traceRef;
//----------------------------------------------------------

typedef aifg_ie_bm_traceRef aifg_ie_bm_transId;

//TMSI-----------------------------------------------------
typedef struct _aifg_ie_bm_tmsi{
	BYTE	flag;
	BYTE	value[4];
}aifg_ie_bm_tmsi;
//----------------------------------------------------------

typedef aifg_ie_dt_lsaId aifg_ie_bm_lsaId;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_periodicity;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_msNum;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_bandUsed;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_rrCause;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_dlci;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_dtx;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_respReq;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_resrcIndMethod;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_cipherRespMode;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_channelNeeded;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_traceType;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_fowardInd;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_chosenEncrypt;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_circuitPool;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_timeId;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_speechVer;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_queuingInd;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_assignReq;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_talkerFlag;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_connRelReq;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_eMLPP;
typedef aifg_ie_dt_followOnProceed aifg_ie_bm_cfgEvoInd;


typedef union{
	//Common
	aifg_ie_mobileId			mobileId;
	
	//DTAP
	aifg_ie_dt_broadcastRef		dt_broadcastRef;
	aifg_ie_dt_cmInfo1			dt_cmInfo1;
	aifg_ie_dt_cmInfo2			dt_cmInfo2;
	aifg_ie_dt_lai				dt_lai;
	aifg_ie_dt_luType			dt_luType;
	aifg_ie_dt_nwName			dt_nwName;
	aifg_ie_dt_tzTime			dt_tzTime;
	aifg_ie_dt_progInd			dt_progInd;
	aifg_ie_dt_uu				dt_uu;
	aifg_ie_dt_bc				dt_bc;
	aifg_ie_dt_cause			dt_cause;
	aifg_ie_dt_ccCap			dt_ccCap;
	aifg_ie_dt_connNum			dt_connNum;
	aifg_ie_dt_callingNum		dt_callingNum;
	aifg_ie_dt_calledNum		dt_calledNum;
	aifg_ie_dt_redirNum			dt_redirNum;
	aifg_ie_dt_connSubAddr		dt_connSubAddr;
	aifg_ie_dt_callingSubAddr	dt_callingSubAddr;
	aifg_ie_dt_calledSubAddr	dt_calledSubAddr;
	aifg_ie_dt_redirSubAddr		dt_redirSubAddr;
	aifg_ie_dt_ssVer			dt_ssVer;
	aifg_ie_dt_hiComp			dt_hiComp;
	aifg_ie_dt_loComp			dt_loComp;
	aifg_ie_dt_callStat			dt_callStat;
	aifg_ie_dt_auxStat			dt_auxStat;
	aifg_ie_dt_followOnProceed	dt_followOnProceed;
	aifg_ie_dt_CTSPermission	dt_CTSPermission;
	aifg_ie_dt_rejectCause		dt_rejectCause;
	aifg_ie_dt_cmType			dt_cmType;
	aifg_ie_dt_cipherKey		dt_cipherKey;
	aifg_ie_dt_priority			dt_priority;
	aifg_ie_dt_idType			dt_idType;
	aifg_ie_dt_rpInd			dt_rpInd;
	aifg_ie_dt_congestLevel		dt_congestLevel;
	aifg_ie_dt_notificationInd	dt_notificationInd;
	aifg_ie_dt_signal			dt_signal;
	aifg_ie_dt_alertPattern		dt_alertPattern;
	aifg_ie_dt_keypad			dt_keypad;
	aifg_ie_dt_moreData			dt_moreData;
	aifg_ie_dt_revCallDir		dt_revCallDir;
	aifg_ie_dt_timeZone			dt_timeZone;
	aifg_ie_dt_authRAND			dt_authRAND;
	aifg_ie_dt_authSRES			dt_authSRES;
	aifg_ie_dt_lsaId			dt_lsaId;
	aifg_ie_dt_facility			dt_facility;
	aifg_ie_dt_rpAddr			dt_rpAddr;
	aifg_ie_dt_rpUD				dt_rpUD;
	aifg_ie_dt_rpCause			dt_rpCause;

	//BSSMAP
	aifg_ie_bm_cic				bm_cic;
	aifg_ie_bm_resrcAvail		bm_resrcAvail;
	aifg_ie_bm_cause			bm_cause;
	aifg_ie_bm_cellId			bm_cellId;
	aifg_ie_bm_priority			bm_priority;
	aifg_ie_bm_L3HeaderInfo		bm_L3HeaderInfo;
	aifg_ie_bm_imsi				bm_imsi;
	aifg_ie_bm_encryptInfo		bm_encryptInfo;
	aifg_ie_bm_channelType		bm_channelType;
	aifg_ie_bm_extResourceInd	bm_extResrcInd;
	aifg_ie_bm_cmInfo2			bm_cmInfo2;
	aifg_ie_bm_l3Info			bm_l3Info;
	aifg_ie_bm_cidList			bm_cellIdList;
	aifg_ie_bm_cicList			bm_cicList;
	aifg_ie_bm_diagnostics		bm_diagnostics;
	aifg_ie_bm_chosenChannel	bm_chosenChannel;
	aifg_ie_bm_totalResrc		bm_totalResrc;
	aifg_ie_bm_triggerId		bm_triggerId;
	aifg_ie_bm_circuitPoolList	bm_circuitPoolList;
	aifg_ie_bm_resrcSit			bm_resrcSit;
	aifg_ie_bm_curChannelType1	bm_curChannelType1;
	aifg_ie_bm_groupRef			bm_groupRef;
	aifg_ie_bm_lsaIdList		bm_lsaIdList;
	aifg_ie_bm_lsaInfo			bm_lsaInfo;
	aifg_ie_bm_locInfo			bm_locInfo;
	aifg_ie_bm_omcId			bm_omcId;
	aifg_ie_bm_bssOldtoNew		bm_bssOldtoNew;
	aifg_ie_bm_periodicity		bm_periodicity;
	aifg_ie_bm_msNum			bm_msNum;
	aifg_ie_bm_bandUsed			bm_bandUsed;
	aifg_ie_bm_rrCause			bm_rrCause;
	aifg_ie_bm_dlci				bm_dlci;
	aifg_ie_bm_dtx				bm_dtx;
	aifg_ie_bm_respReq			bm_respReq;
	aifg_ie_bm_resrcIndMethod	bm_resrcIndMethod;
	aifg_ie_bm_cipherRespMode	bm_cipherRespMode;
	aifg_ie_bm_channelNeeded	bm_channelNeeded;
	aifg_ie_bm_traceType		bm_traceType;
	aifg_ie_bm_fowardInd		bm_fowardInd;
	aifg_ie_bm_chosenEncrypt	bm_chosenEncrypt;
	aifg_ie_bm_circuitPool		bm_circuitPool;
	aifg_ie_bm_timeId			bm_timeId;
	aifg_ie_bm_speechVer		bm_speechVer;
	aifg_ie_bm_queuingInd		bm_queuingInd;
	aifg_ie_bm_assignReq		bm_assignReq;
	aifg_ie_bm_talkerFlag		bm_talkerFlag;
	aifg_ie_bm_connRelReq		bm_connRelReq;
	aifg_ie_bm_eMLPP			bm_eMLPP;
	aifg_ie_bm_cfgEvoInd		bm_cfgEvoInd;
	aifg_ie_bm_traceRef			bm_traceRef;
	aifg_ie_bm_transId			bm_transId;
	aifg_ie_bm_tmsi				bm_tmsi;
	aifg_ie_bm_lsaId			bm_lsaId;
}ie_u;

typedef struct{
	int		iei;
	ie_u	param;
}aifg_ie;

#endif

