#ifndef PPSMIBTABLE_H
#define	PPSMIBTABLE_H

#include "../../../../plat/snmp/src/include/snmp.h"
#include "../../../../plat/snmp/src/include/macro.h"
#include "../../../../plat/radius/src/include/radius_if.h"

#include "ramdata.h"

#define		EndLength				2		/*	EOF,protect overflow	*/
#define		MAX_LANGUAGE_TYPES		5

#define		MAX_INPUT_SMS			128
#define		MAX_TEXT_PROMPT			128

#define		MAX_CHILD_COS_PER_PARENT	2

typedef enum _valueType
{
	INTEGER		= 2,
	OctetString = 4	
}valueType;


typedef enum _PPS_oid {
	PPS_HEARTBEAT = 1,
	PPS_PARAMETER,
	PPS_CSTA,
	PPS_CDR,	
	PPS_USERDATA
}PPS_oid;

typedef enum _PPS_TYPE_DEF
{
	CAP_TYPE_DISABLE,
	CAP_TYPE_CALL,
	CAP_TYPE_SMS,
	CAP_TYPE_BOTH
}PPS_TYPE_DEF;

#define		PPSOID	6

typedef enum _ppsParameter_oid{
 		ServiceControl	= 1,
 		COSID	,
		SrfParameter,
		RouteVMS,
		PPSOID_FileOperation,
		Status,
		PPSOID_InitRequest,
		SMCLIRegisterOPR,
		PPSOID_COMMAND	= 10
}ppsParameter_oid;


#define 	PpsMaxTitleLen				65
#define		MAX_SMS_LEN					100
#define		TABLE_ACTIVE_COMMAND 		1
#define		TABLE_DESTROY_COMMAND 		6

typedef	struct _MnpPrefix
{
	u_char	title[PpsMaxTitleLen];
	u_char	prefix[16+EndLength];
	u8		reserve[32];
	u8		existFlag;
}MnpPrefix;

typedef enum 
{
	SMS_ACCOUNT_BALANCE=0,
	SMS_ACCOUNT_PROMOTION=1,
	SMS_EXPIRED_ON=2,
	SMS_RECHARGE_ON=3,
	SMS_LAST_CALL_ON=4,
	SMS_LAST_RECEIVE_ON=5,
	SMS_AT=6,
	SMS_TO=7,
	SMS_FROM=8,
	SMS_ON=9,
	SMS_CMB_PROMPT=10,
	SMS_CMB_NOTIFY=11,
	
	SMS_FREE_SERVICE_ACTIVE=12,
	SMS_FREE_SERVICE_DEACTIVE=13,
	SMS_FREE_SERVICE_ENQUIRY=14,
	SMS_FREE_SERVICE_ACTIVED_NOTIFY=15,
	SMS_FREE_SERVICE_DEACTIVED_NOTIFY=16,
	SMS_FREE_SERVICE_ACTIVE_ALREADY=17,
	SMS_FREE_SERVICE_DEACTIVE_ALREADY=18,
	SMS_FREE_SERVICE_DEACTIVED_EXPIRED=19,
	SMS_FREE_SERVICE_VALID_DAYS_LEFT=20,
	
	SMS_WILL_TRANSFER_OUT=21,
	SMS_TRANSFERED_OUT=22,
	SMS_TRANSFERED_IN=23,
	SMS_SERVICE_NOT_APPLIED=24,
	SMS_TRANSFER_PROMPT=25,
	SMS_FORMAT_ERROR=26,
	SMS_INVALID_NUMBER=27,
	SMS_INSUFFICIENT_FEE=28,
	SMS_EXPIRED_ACCOUNT=29,
	SMS_YES_OR_NO=30,
	SMS_TRANSFER_SUCCESS=31,

	SMS_POOL_CHILD_LOW_FEE=32,
	SMS_POOL_ADDED_CHILD=33,
	SMS_POOL_DELED_CHILD=34,
	SMS_POOL_BEEN_ADDED_CHILD=35,
	SMS_POOL_BEEN_DELED_CHILD=36,

	SMS_CLEAR_FEE_NOTIFY=37,
	SMS_CAPGRPS_NOTIFY=38,
	SMS_NOT_REGISTER_PREPAID_USER=39,
	SMS_USSD_MENU=40,
	SMS_USSD_ERROR_INPUT=41,
	SMS_RECHARGE_INPUT_PIN=42,
	SMS_RECHARGE_INPUT_PIN_AGAIN=43,
	SMS_LOW_BALANCE_NOTIFY=44,
	SMS_USSD_COMPLETED=45,	

	SMS_OVERDRAFT_NOTIFICATION =46,
	SMS_GPRS_VOLUME_THIS_MONTH=47,
	SMS_GPRS_VOLUME_CONSUMED=48,
	SMS_GPRS_DURATION=49,
	SMS_GPRS_CHARGED=50,

	SMS_GPRS_RECHARGE_SUCCESS =51,

	SMS_PROMOTION_NEWS=52,
	SMS_FREE_SMS_NOTIFICATION=53,
	
	SMS_RECHARGE_FAILED_NO_CARD=54,
	SMS_RECHARGE_FAILED_CARD_USED=55,
	SMS_RECHARGE_FAILED_CARD_EXPIRED=56,
	SMS_RECHARGE_FAILED_SYS_FAILURE=57,

	SMS_CMB_REACH_MAX_LIMIT=58,
	SMS_CMB_AD=59,

	SMS_ACTIVATION_NOTIFY=60,
	SMS_CAPSMS_NOTIFY=61,
	SMS_CAPSMS_1_NOTIFY=62,
	SMS_CAPSMS_2_NOTIFY=63,

	SMS_TELL_ME_NUMBER=64,
	SMS_RENT_CHARGE=65,
	SMS_FRIEND_FAMILY_REG=66,
	SMS_FRIEND_FAMILY_REG_FAILED=67,
	SMS_FRIEND_FAMILY_SERVICE_SUSPEND=68,
	SMS_FRIEND_FAMILY_PLAN_EXHAUST=69,
	SMS_FRIEND_FAMILY_QUERY=70,
	SMS_FRIEND_FAMILY_SERIVCE_REACTIVATE=71,
	SMS_FRIEND_FAMILY_REMOVE=72,
	SMS_FRIEND_FAMILY_QUERY_NOT_REGISTERED=73,
	SMS_FRIEND_FAMILY_QUERY_NOT_PLAN=74,
	SMS_FRIEND_FAMILY_QUERY_SUSPENDT=75,
	SMS_FRIEND_FAMILY_QUERY_SUSPEND_REAC=76,
	SMS_FRIEND_FAMILY_QUERY_NO_LIMIT=77,
	SMS_BUNDLE_PLAN = 78,
	SMS_BUNDLE_PLAN_SUBSCRIBE_CMD = 79,
	SMS_BUNDLE_PLAN_SUBSCRIBE_PLEASE = 80,	
	SMS_BUNDLE_PLAN_SUBSCRIBE_OK = 81,
	SMS_BUNDLE_PLAN_SUBSCRIBE_NOK = 82,
	SMS_BUNDLE_PLAN_QUERY = 83,
	SMS_BUNDLE_PLAN_DATA_WARN = 84,
	SMS_BUNDLE_PLAN_DATA_USEDUP = 85,
	SMS_BUNDLE_PLAN_DATA = 86,
	SMS_BUNDLE_PLAN_QUERY_DATA = 87,
	SMS_USSD_MENU1 = 88,	
	SMS_BUNDLE_PLAN_USSD_SUB_CHOICE = 89,// has voice or sms, or have both
	SMS_BUNDLE_PLAN_USSD_DATA = 90,// no voice and sms
	SMS_BUNDLE_PLAN_NO_REFUND = 91,
	SMS_BUNDLE_PLAN_USSD_MENU = 92,
	SMS_BUNDLE_PLAN_NOT_APPLIED = 93,
	SMS_BUNDLE_PLAN_USSD_SUB_DATA_CHOICE=94,// no voice and sms
	SMS_BUNDLE_PLAN_USSD_SUB_MENU=95,// has voice or sms, or have both
	SMS_BUNDLE_PLAN_DATA_WARN_HAS_V = 96,
	SMS_BUNDLE_PLAN_VOICE_USEDUP = 97,
	SMS_BUNDLE_PLAN_SMS_USEDUP = 98,
	SMS_BUNDLE_PLAN_USSD_MENU1 = 99,
	
	SMS_MAX_ITEM = 100	,
	SMS_LAST_CALL_INFO = 101,
	SMS_LAST_SMS_INFO = 102,	
}SMS_SENTENCE;

typedef enum _PPS_USSD_OPERATON
{
    USSD_OC_HOTLINE,
    USSD_OC_INQUIRY,
    USSD_OC_RECHARGE,
    USSD_OC_FEE_TRANSFER,
    USSD_OC_CALL_ME_BACK,
    USSD_OC_TELL_ME_NUMBER,
    USSD_OC_FRIEND_FAMILY_QUERY,
    USSD_OC_BUNDLE_PLAN,
    USSD_OC_BUNDLE_QUERY,
    USSD_OC_BUNDLE_PLAN_ALL,
    USSD_OC_EXIT,
    USSD_OC_MAX,
}PPS_USSD_OPERATION;

typedef enum _ppsTableType
{
	PromptResolutionTable 				= 20,
	MnpPrefixTable 						= 21,
	SmsSentenceTable 					= 22,
	Resered								= 23,
	ThirdPartyInfoTable 					= 24,
	BasicTariffZoneTable 				= 25,
	IvrSourceTable 						= 26,
	SrfNumberTable 						= 27,
	ServiceNumberTable 				= 28,
	ServiceKeyTable 					= 29,
	VmsUserSegmentTable 				= 30,
	RadiusGsnTable						= 31,
	RadiusSgsnTable						= 32,
	BundlePlanTable						= 33,
	/******************	cos tables	********************/
	CosTable							= 50,
	TariffTable							= 51,
	ServiceControlTable					= 52,
	AccountValidityTable       			= 53,
	SmsNotificationInquiryTable 		= 54,
	RechargeCardValidityTable   		= 55,
	RechargePromotionTable			= 56,
	CapPlanTable					= 57,
	PoolAccountTable				= 58,
	CosGprsTable					= 59,
	FriendFamilyTable				= 60,
	UssdServiceNumberTable			= 61,
	UssdServiceKeyTable			= 62,
	/******************	cos tables	********************/
}ppsTableType;

typedef enum _ppsTableMaxItem
{
	MaxPromptResolutionItem 			= 1,
	MaxMnpPrefixItem 					= 32,
	MaxSmsSentenceItem				= SMS_MAX_ITEM,
	MaxThirdPartyInfoItem				= 8,
	MaxBasicTariffZoneItem				= 64,
	MaxIvrSourceItem					= 1,
	MaxSrfNumberItem					= 2,
	MaxServiceNumberItem				= 16,
	MaxServiceKeyItem					= 7,
	MaxVmsUserSegmentItem			= 128,
	MaxRadiusGsnItem					= RADIUS_MAX_NUM_OF_NAS,
	MaxRadiusSgsnItem					= RADIUS_MAX_NUM_OF_NAS,
	/******************	cos tables	********************/
	MaxCosTableItem						= 64,
	MaxTariffTableItem					= 1,
	MaxServiceControlTableItem			= 1,
	MaxAccountValidityTableItem        	= 1,
	MaxSmsNotificationInquiryTableItem 	= 1,
	MaxRechargeCardType   				= MAX_VALUE_TYPE,
	MaxcapPlanTableItem					= 4,		
	MaxPoolAccountTableItem				= 1,
	MaxGprsTableItem					= 1,	
 	MaxGprsCapPlan						= 1,
 	MaxFriendFamilyTableItem			= 1, 
	/******************	cos tables	********************/
	
	/*** if you add items in any table,notify these value	***/
	MaxPromptResolutionReservedItem						= 1,
	MaxMnpPrefixReservedItem							= 1,
	MaxSmsSentenceReservedItem							= 1,
	MaxThirdPartyInfoReservedItem						= 1,
	MaxBasicTariffZoneReservedItem						= 1,
	MaxIvrSourceReservedItem							= 1,
	MaxSrfNumberReservedItem							= 5,
	MaxServiceNumberReservedItem						= 8,
	MaxServiceKeyReservedItem							= 5,
	MaxVmsUserSegmentReservedItem						= 1,
	MaxRadiusGsnReservedItem							= 0,
	MaxCosTableReservedItem								= 1,
	MaxTariffTableReservedItem							= 1,
	MaxServiceControlReservedItem						= 0,
	MaxAccountValidityReservedItem						= 1,
	MaxSmsNotificationInquiryReservedItem				= 1,
	MaxRechargeCardValidityReservedItem					= 1,
	MaxRechargePromotionReservedItem					= 1,
	MaxCapPlanReservedItem								= 1,
	MaxPoolAccountReservedItem							= 0,
	MaxGprsTableTableReservedItem						= 1,
	/*** if you add items in any table,notify these value	***/
}ppsTableMaxItem;

typedef	enum _srfNumberPosition
{
	SRF0Position = 0,
	SRF1Postion
}srfNumberPosition;

typedef	enum _serviceNumberPosition
{
	HotLineNumberPosition = 0,
	InquiryNumberPosition,
	ScratchCardRechargeNumberPosition,
	CreditCardRechargeNumberPosition,
	ThirdPartyRechargeNumberPosition,
	CustomerCareCenterNumberPosition,
	RechargeNumberPosition,
	OPRNumberPosition,
	VirtualCallingCardNumberPosition,
	PalimRegisterNumberPosition,	//2010-03-08
	PoolAccountPosition,
	FeeTransferPosition,
	FreeServicePosition,
	CallMeBackPosition,
	GPRSPrepaidPostion,
	TellMeNumber,
	FriendFamilyPosition,
	MAXServicePostion,
	
}serviceNumberPosition;

typedef struct 	_PromptResolution
{
	u_char	title[PpsMaxTitleLen];
	u8		currencyResolution;
	u8		dataFormat;
	u8		currencySymbolPosition;		
	u8		reserve[32];
	u8		existFlag;
}PromptResolution;


typedef struct
{
	u8		language[MAX_SMS_LEN+EndLength];
}LANGUAGE_INFO;

typedef	struct _SmsSentence
{
	u_char			title[PpsMaxTitleLen];	
	u8				english[MAX_SMS_LEN+EndLength];
	LANGUAGE_INFO	language[MAX_LANGUAGE_TYPES];
	u8				existFlag;
}SmsSentence;

typedef	struct _LastCallInfo
{
	u_char	title[PpsMaxTitleLen];
	u8		lastCallSentOn[32+EndLength];
	u8		lastCallReceiveOn[32+EndLength];
	u8		at[8+EndLength];
	u8		to[8+EndLength];
	u8		from[8+EndLength];	
	u8		reserve[32];
	u8		existFlag;
}LastCallInfo;

typedef	struct _ThirdPartyInfo
{
	u_char	title[PpsMaxTitleLen];
	u_char	serviceID[8+EndLength];
	u_char	servicePassword[8+EndLength];
	u8		reserve[32];
	u8		existFlag;
}ThirdPartyInfo;

typedef	struct _BasicTariffZone
{
	u_char	title[PpsMaxTitleLen];
	u8		mcc[3+EndLength];
	u8		mnc[3+EndLength];
	u16		lac;
	u16		cellId;
	u32		moTariffId;
	u32		mtTariffId;	
	u8		reserve[32];
	u8		existFlag;
}BasicTariffZone;

typedef	struct _IvrSource
{
	u_char	title[PpsMaxTitleLen];
	u8		inquiry;
	u8		recharge;
	u8		reserve[32];
	u8		existFlag;
}IvrSource;

typedef	struct _SrfNumber
{
	u_char	title[PpsMaxTitleLen];
	u8		number[16+EndLength];
	u8		reachable;
	u8		reserve[32];
	u8		existFlag;
}SrfNumber;

typedef	struct _ServiceNumber
{
	u_char	title[PpsMaxTitleLen];
	u8		number[16+EndLength];
	u8		reserve[32];
	u8		existFlag;
}ServiceNumber;

typedef	struct _ServiceKey
{
	u_char	title[PpsMaxTitleLen];
	u8		key;
	u8		reserve[32];
	u8		existFlag;
}ServiceKey;

typedef	struct _VmsUserSegment
{
	u_char	title[PpsMaxTitleLen];
	u8		startMsisdn[16+EndLength];
	u8		endMsisdn[16+EndLength];
	u8		vmsPLMNserviceNumber[16+EndLength];
	u8		vmsPSTNserviceNumber[16+EndLength];
	u8		leaveMessageNumber[16+EndLength];	
	u8		reserve[32];
	u8		existFlag;
}VmsUserSegment;

typedef struct _PPS_RADIUS_NAS_INFO{
	u_char 						title[PpsMaxTitleLen];
	ulong						volumeMeterUnit;/*byte	*/
	ulong						durationMeterUnit;/*s */
	u8							tariffID;
	RADIUS_NAS_INFORMATION		nasInfo;	
	u8							existFlag;
}PPS_RADIUS_NAS_INFO;

typedef struct _PPS_RADIUS_SGSN_INFO{
	u_char 						title[PpsMaxTitleLen];
	DWORD						sgsnIP;
	u8							cosID;
	u8							apnName[16];
	u8							tariffID;
	u8							reserved[15];
	u8							existFlag;
}PPS_RADIUS_SGSN_INFO;


/**********************		COS tables		***********************/
typedef struct _promotion_plan_control
{
	u_long	rechargePromotionStartDate;
	u_long	rechargePromotionEndDate;
	
	struct{
		BOOL	IDD;
		BOOL	NDD;
		BOOL	LOCAL;
	}usedForCall;
	
	struct{
		BOOL	IDD;
		BOOL	NDD;
		BOOL	LOCAL;
	}usedForSMS;
	
	struct{
		BOOL	allowed;	
	}usedForGPRS;	
	
	struct{
		BOOL	transfer;
		u_char	transferPrioriy;
	}transfer;
}promotion_plan_control;

typedef struct	_CosTariff
{
	u_char					title[PpsMaxTitleLen];
	u8						moTariffID;
	u8						mtTariffID;
	u8						chargeBy;	
	u8						capPlanResetDay;	
	promotion_plan_control		promotionUseControl;
	u8						promotionUsedForRoDebit;
	u8						reserve[31];
	u8						existFlag;
}CosTariff;

typedef struct	_CosServiceControl
{
	u_char	title[PpsMaxTitleLen];
	u8		moThresholdSet;
	int		moMinimumBalance;
	u8		mtChargeFlag;
	u8		mtBalanceControl;
	int		mtBalanceThreshold;
	u8		poolAccountFlag;
	u8		poolAccountChangeChargeFlag;
	u8		poolAccountFreeChangeTimes;
	u8		closeUserGroupService;
	u8		rechargeViaCreditCard;
	u8		creditVault;
	u16		creditVaultAmount;	
	u8		relatedCosID;
	u8		freeSMSActiveDays;
	u8		freeSMSRentType;
	u8		callMeBackThreshold;
	u8		callMeBackMaxTimes;
	u8          mtSMSCharge;
	u8		validiDaysActivatedByInquiringAccountWithZeroBalance0;
	u8          actionWhenMOorMTExpired; /*0=mo,1=MT */
//	u16        validiDaysActivatedByInquiringAccountWithZeroBalance;
//	u16		sReserved[2];
	u16         serviceNumberFlag;
	u16		smsServiceFlag;
	u16         ussdServiceFlag;
	
	u8		bundle_data_warning_threashold; /*in 5 MB */
	u8		bundle_data_warning_threashold_low; /*in 5 MB */
	u8		event_charging_flag;// 0, disable; 1, enable;
	u8		cap_or_bundle_in_tariff;// Cap or Bundle used in Tariff Table: 0, cap; 1, bundle;
	u8		bundle_plan_contorl;	//0=bundle plan with data/voice/sms, 1=data plan only 
	u8		reserve[11];
	u8		existFlag;
	
}CosServiceControl;

typedef struct	_CosAccountValidity
{
	u_char	title[PpsMaxTitleLen];
	u16		maxAccountValidityDays;
	u8		actionWhenAccountExpires;
	u16		daysKeepingAnExpiredAccount;
	u8		actionAfterDaysKeepingAnExpiredAccount;
	u8		actionAfterRecharge;
	u8		actionAfterBalanceDepleted;
	u8		validDaysChangeTo;
	u8		activiationByInquiryIs;
	u8		validiDaysActivatedByInquiringAccountWithZeroBalance0;
	u8      	actionWhenMOorMTExpired; /*0=mo,1=MT */
	u16     	validiDaysActivatedByInquiringAccountWithZeroBalance;
	u8		reserve[27];
	u8		bundlePlanIDWhenActivated;
	u8		existFlag;
}CosAccountValidity;


typedef struct	_CosSmsNotificationInquiry
{
	u_char	title[PpsMaxTitleLen];
	u8		smsNotificationWhenRecharge;
	u8		smsNotificationWhenInquiry;
	u8		smsNotificationWhenExpired;
	u8		theDaysSendingSMSBeforeExpiredDay;
	u8		smsNotificationWhenBalanceInsufficient;
	u16		insufficientBalanceThreshold;
	u8		chargeWhenInquiryBySMS;
	u8		freeInquiryPerDay;
	u8		smsNotificationWhenCleanBalance; //2010-03-08
	u8		smsNotificationWhenCapPlanChanged; //2010-03-08
	u8		smsNotificationWhenApplyOverdraft;
	u8		smsNotificationWhenRentCharge;
	u8           smsNotificationWhenFriendFamilyServiceReg;
	u8           smsNotificationWhenFriendFamilyServiceSuspend;	
	u8           smsNotificationWhenFriendFamilyPlanExhaust;
	u8           smsNotificationWhenFriendFamilyServiceRemoved;
	u8		reserve[26];
	u8		existFlag;
}CosSmsNotificationInquiry;

typedef struct	_CosRechargeCardValidity
{
	u_char	title[PpsMaxTitleLen];
	u16		cardCredit;
	u16		moValidity;
	u16		mtValidity;
	u8		reserve[32];
	u8		existFlag;
}CosRechargeCardValidity;


typedef struct	_CosRechargePromotion
{
	u_char	title[PpsMaxTitleLen];
	int		rechargeCardCredit;
	int		promotionBonus;
	int		promotionValidity;
	u8		reserve[32];
	u8		existFlag;
}CosRechargePromotion;

typedef struct	_CosCapPlan
{
	u_char	title[PpsMaxTitleLen];
	u8		flag;
	u8		type;
	u32		threshold0;
	u32		threshold1;
	u32		threshold2;
	u8		tariffID0;
	u8		tariffID1;
	u8		tariffID2;
	u8		tariffID3;
	u8		reserve[32];
	u8		existFlag;
}CosCapPlan;

typedef struct{
	u_char	title[PpsMaxTitleLen];
	u_char 	role;
	struct{
		struct
		{	
			u_char	cosIDForChild[MAX_CHILD_COS_PER_PARENT];
		}parent;
		struct
		{	
			u_char		isRechargeAllowed;
			u_char		isTransferAllowed;
			u_char		periodicTransferOrAutoByParent;
			u_short		maxCallsPerDay;
			u_short		maxSMSPerDay;
			u_long		maxFeePerDay;
		}child;
	}roleParty;
	u8		existFlag;
}COS_Pool_Account;

typedef struct _GPRS_VOLUME_CAP_PLAN{
	u8		type;/*	0:cap by volume;1:cap by charge	*/
	u32		threshold0;/*	0-1024*1024*1024KB		*/
	u32		threshold1;/*	0-1024*1024*1024KB		*/
	u32		threshold2;/*	0-1024*1024*1024KB		*/
	u8		tariffID0;
	u8		tariffID1;
	u8		tariffID2;
	u8		tariffID3;
}GPRS_VOLUME_CAP_PLAN;

typedef	struct _PPS_COS_RADIUS_ITEM
{
	u_char					title[PpsMaxTitleLen];
	u8						gprsChargeFlag;/*0:disable;1:enable	*/	
	u32						miniBalanceForGprs;/*<=0:unlimited;other:limited		*/
	ulong					inactiveSessionLimit;/*0:unlimit;others:limited	*/
	u8						notificationWhenSessionTerminate;
	u_short					maxSmsForGprsNotificationPerDay;
	ulong					maxVolumeQuotaEachTime;/*	byte	*/
	ulong					volumeThresholdDiff;/* byte */
	ulong					maxDurationQuotaEachTime;/* s */
	ulong					durationThresholdDiff;/* s */
	u8						gprsChargedBy;/*0:define by cos;1:defined by incoming GSN IP	*/
	GPRS_VOLUME_CAP_PLAN	capPlan[MaxGprsCapPlan];
	u8						reserved[64];
	u8						existFlag;
}PPS_COS_RADIUS_ITEM;

#define	MAX_FAVORITE_PALN	6

typedef	struct CosFriendFamilyPlan
{
	u16        rentCharge;
	u8          maxNumbers;
	u16		freeSMS;      /* 0 means no limitation */
	u32		freeCallDuration;    /* 0 means no limitation */
	u8		rentID;		/*1-8 index of rent tariff */
	u8          cReserved[4];
	u16        sReserved[2];
	u32        iReserved[2];
}CosFriendFamilyPlan;

typedef	struct CosFriendFamilyControl
{
       u_char	title[PpsMaxTitleLen];
	u8		friendFamilyFlag;
	u8		friendFamilyChangeChargeFlag;
	u8		friendFamilyFreeChangeTimes;
	u8		friendFamilyNumberTypeLocal;
	u8		friendFamilyNumberTypeNDD;
	u8		friendFamilyNumberTypeIDD;	
	u16		balanceThresholdForFriendFamilyCall;
	u8		keepOrRemoveFriendFamilyNumber;
	u16		balanceThresholdToKeepFriendFamilyNumber;	
	u8		cReserved[32];
	u16		sReserved[8];
	u32		lReserved[4];
	CosFriendFamilyPlan   friendFamilyPlan[MAX_FAVORITE_PALN];
	u8		existFlag;
}CosFriendFamilyControl;

typedef struct _COSTable
{
	u_char					title[PpsMaxTitleLen];
	CosTariff					tariff[MaxTariffTableItem+MaxTariffTableReservedItem];
	CosServiceControl			serviceControl[MaxServiceControlTableItem+MaxServiceControlReservedItem];
	CosAccountValidity			accountValidity[MaxAccountValidityTableItem+MaxAccountValidityReservedItem];
	CosSmsNotificationInquiry	smsNotificationInquiry[MaxSmsNotificationInquiryTableItem+MaxSmsNotificationInquiryReservedItem];
	CosRechargeCardValidity	rechargeCardValidity[MaxRechargeCardType+MaxRechargeCardValidityReservedItem];
	CosRechargePromotion		rechargePromotion[MaxRechargeCardType+MaxRechargePromotionReservedItem];
	CosCapPlan				capPlan[MaxcapPlanTableItem+MaxCapPlanReservedItem];	
	COS_Pool_Account			poolAccount[MaxPoolAccountTableItem+MaxPoolAccountReservedItem];
	PPS_COS_RADIUS_ITEM	gprs[MaxGprsTableItem+MaxGprsTableTableReservedItem];
	CosFriendFamilyControl		friendFamilyControl[MaxFriendFamilyTableItem+MaxServiceControlReservedItem];
	u8						existFlag;
}COSTable;
/**********************		COS tables		***********************/
#define	MAX_BUNDLE_PLANS	16
typedef	struct serviceBundlePlan
{
       u_char	title[PpsMaxTitleLen];
	u32		charge;
	u32		data;
	u16		mo_voice;
	u16		mt_voice;
	u16		sms;
	u16		validity;
	u8		apply_flag;
	u8		apply_code;
	u8		cRes[3];
	u16		sRes[4];	
	u8		existFlag;
}serviceBundlePlan;

typedef struct	_PpsTable
{
	PromptResolution	       promptResolution[MaxPromptResolutionItem+MaxPromptResolutionReservedItem];
	MnpPrefix			mnpPrefix[MaxMnpPrefixItem+MaxMnpPrefixReservedItem];
	SmsSentence			smsSentence[MaxSmsSentenceItem+MaxSmsSentenceReservedItem];
	ThirdPartyInfo		       thirdPartyInfo[MaxThirdPartyInfoItem+MaxThirdPartyInfoReservedItem];
	BasicTariffZone		basicTariffZone[MaxBasicTariffZoneItem+MaxBasicTariffZoneReservedItem];
	IvrSource			ivrSource[MaxIvrSourceItem+MaxIvrSourceReservedItem];
	SrfNumber			srfNumber[MaxSrfNumberItem+MaxSrfNumberReservedItem];
	ServiceNumber		serviceNumber[MaxServiceNumberItem+MaxServiceNumberReservedItem];
	ServiceKey			serviceKey[MaxServiceKeyItem+MaxServiceKeyReservedItem];
	VmsUserSegment		vmsUserSegment[MaxVmsUserSegmentItem+MaxVmsUserSegmentReservedItem];
	PPS_RADIUS_NAS_INFO	gsn[MaxRadiusGsnItem];
	PPS_RADIUS_SGSN_INFO	sgsn[MaxRadiusSgsnItem];
	COSTable			cosTable[MaxCosTableItem+MaxCosTableReservedItem];
	COSTable			reserveTable[MaxCosTableReservedItem];
	ServiceNumber		ussdServiceNumber[MaxServiceNumberItem+MaxServiceNumberReservedItem];
	ServiceKey			ussdServiceKey[10+3];

	serviceBundlePlan		bundlePlans[MAX_BUNDLE_PLANS];

	SmsSentence			smsExtSentence[MaxSmsSentenceItem+MaxSmsSentenceReservedItem];
	

}PpsTable;


typedef struct	_PpsServiceConrol{
 		u32	licenseduser;
 		u8	cdrFlag;
 		u8	maxRechargeFailedNum;
 		int	maxBalance;// for balance overflow prevention
 		u_char	currencyName[8+EndLength];
 		u8	cos_group_flag;
 		u8	support_mnp_flag;
 		u8	callingCardVadilityDays; //2010-03-08
 		u8	truncation_flag; 		
		u8	mt_release_for_no_charge;
		u8	mo_release_for_no_charge;
		u8	delay_timer_for_roaming;
		u8	vms_allways_go;
		u8	languageSmEncodeType[MAX_LANGUAGE_TYPES];
		u8   transfer_idd_prefix;
		u8   external_vc;
		u8   charge_by_lac_flag; /* 0=by lac+ci, 1=by ci */
		u8   not_change_expiry_date_when_transfer;
		u8   only_normal_can_transfer_balance;
		u8	max_call_duration; /* in second*/
		u8   gy_delay_timer0;
		u8   gy_delay_timer1;
		char smsc_addr[12];
		u8	ussd_callback_service_key;	/*service key for USSD_CALLBACK feature */		
		u8	ucbc_number[16];	/* the GT number of UCBC entity */		
		u8	answer_timer;	/* in seconds */
		u8	gy_not_support_threshold;
		u8	gy_report_data_method;	/* 0=segment, 1=accumulated */
		u8	balance_transfer_resolution; /*0=minimum , 1= currency resolution */ 
		u8	nai_for_diameter_proxy;
		u8    mt_play_voice_flag;
		u8	tcp_sync_flag;
		u8	smpp_over_tcp_flag;
		u8	gy_postpaid_flag;
		u8	log_func_flag;
		u8	calling_card_method;
		u8	calling_card_cos_id;	
		u8	work_with_crm;
		u8   mt_not_charged_for_cdr;
		u8   crm_free_seconds;
		u8   crm_status_validity;
		u8   crm_days_before_validity;
		u8   crm_notification_for_event;
		u8	cellid_present_in_ccr;		
		u8	reserved[8];
 		/*******	below is table	********/
 }PpsServiceConrol;


/*
   CT_LOCAL_CALL_OUT=100,
    CT_TRUNK_CALL_OUT,          // Local city call out
    CT_NDD_CALL_OUT,            // Nation l.d.tel
    CT_HMT_CALL_OUT,            // Hong Kong, Macao, TaiWan
    CT_IDD_CALL_OUT,            // International L.D.Tel
    CT_LOCAL_CALL_IN,
    CT_TRUNK_CALL_IN,
 
*/
#define MAX_CALL_TYPE_DES	10
typedef struct	ocsCRMCallTypeDes{
	char	equal_or_contain;	//0=equal, 1=contain
	char description[MAX_CALL_TYPE_DES][128]; //0=LOCAL CALL OUT...
 }_ocsCRMCallTypeDes;

typedef struct	ocsCRMConrol{
	char		base_prefix_file_name[128];
	_ocsCRMCallTypeDes	crm_call_type;
 }_ocsCRMConrol;

 
typedef struct _VmsRouteParam
{
	u_char		plmnServiceNumber[16+EndLength];
	u_char		pstnServiceNumber[16+EndLength];
	u_char		leaveMessageNumber[16+EndLength];
	u8			routeMethodOption;
	u8			routeNumberOption;
	u8			isPostpaidAllowed;
	u_char		ring_back_service_key;	
	u8			reserved[64];				
}VmsRouteParam;

#endif
