/*	MAP operation and error code			*/
/*	written by liu zhiguo 2001-07-25		*/
/*	Version 1.0	(according GSM 09.02 17.5)	*/
/*	-------------------------------------	*/
#ifndef _MAP_CODE
#define _MAP_CODE

/*	+++++++++++++++++		*/
/*	MAP message type		*/
/*	+++++++++++++++++		*/
/*	dialogue control portion	*/
#define MAP_OPEN					0xff
#define MAP_CLOSE					0xfe
#define MAP_U_ABORT					0xfd
#define MAP_P_ABORT					0xfc
#define MAP_NOTICE					0xfb
#define MAP_DELIMITER				0xfa
#define MAP_LINK					0xef

#define MAP_REQUEST					0x01
#define	MAP_INDICATE				0x02
#define MAP_RESPONSE				0x03
#define MAP_CONFIRM					0x04

/*	++++++++++++++++++++	*/
/*	MAP operation code		*/
/*	++++++++++++++++++++	*/

/*	locaion registration operation codes	*/
#define UpLoc						2	// update location
#define CancelLoc					3	// cancel location
#define PurgeMS						67	// purge mobile station
#define SndIdent					55	// send identification

/*	handover operatin codes					*/
#define PreHo						68	// prepare handover
#define SndEndSig					29	// send end signal
#define ProcAccSig					33	// process access signalling
#define FwdAccSig					34	// forward access signalling
#define PreSubsHo					69	// prepare subsequent handover

/*	authentication operation codes			*/
#define SndAuthInfo					56	// send authentication information

/*	IMEI management operation codes			*/
#define ChkIMEI						43	// check IMEI

/*	subscriber management operation codes	*/
#define InsSubData					7	// insert subscriber data
#define DelSubData					8	// delete subscriber data
#define SendParam					9	// send parameters

/*	fault recovery operation codes			*/
#define Reset						37	// reset
#define FwdChkSSInd					38	// forward check SS indication
#define RestoreData					57	// restore data

/*	operation and maintenance operation codes	*/
#define ActvTraceMode				50	// active trace mode
#define DeactvTraceMode				51	// deactive trace mode
#define SndIMSI						58	// send IMSI

/*	call handling operation codes	*/
#define SndRoutInfo					22	// send routing information
#define ProvRoamNum					4	// provide roaming number
#define ResumeCH					6	// resume call handling
#define ProvSIWFSNum				31	// provide SIWFS nunmber
#define SIWFSSigMdf					32	// SIWFS signalling modify
#define SetRepState					73	// set report state
#define StatusRep					74	// status report
#define RmtUserFree					75	// remote user free

/*	supplementary service handling operation codes	*/
#define RegSS						10	// register SS
#define EraseSS						11	// erase SS
#define ActvSS						12	// activate SS
#define DeactvSS					13	// deactivate SS
#define InterSS						14	// interrogate SS
#define ProcUnstrctSSReq			59	// process unstructure SS request
#define UnstrctSSReq				60	// unstructure SS request
#define UnstrctSSNoti				61	// unstructure SS notify
#define RegPasswd					17	// register password
#define GetPasswd					18	// get password
#define RegCCEntry					76	// register CC entry
#define EraseCCEntry				77	// erase CC entry

/*	short message service operation codes	*/
#define SndRoutInfoForSM			45	// send routing information for SM
#define FwdSM						46	// Forward SM  V1
#define MOFwdSM						46	// MO-forward SM
#define MTFwdSM						46	// MT-forward SM
#define MTFwdSM_v3					44
#define RptSMDelvStat				47	// report SM delivery status
#define InfSC						63	// inform service center
#define AlrtSC						64	// alert service center
#define RdyForSM					66	// ready for SM

/*	provide subsriber info operation codes	*/
#define ProvSubInfo					70	// provider subscriber information

/*	any time interrogation operation codes	*/
#define AnyTimeInter				71	// any time interrogation

/*	supplementary service invocation notification operation codes	*/
#define SSInvNoti					72	// SS invocation notification

/*	group call operation codes	*/
#define PreGrpCall					39	// prepare group call
#define SndGrpCallEndSig			40	// send group call end signal
#define ProcGrpCallSig				41	// process group call signalling
#define FwdGrpCallSig				42	// forward group call signalling

/*	GPRS location updating operation codes	*/
#define UpGprsLoc					23	// update GPRS location

/*	GPRS location information retrieval operation codes	*/
#define SndRoutInfoForGprs			24	// send routing info for GPRS

/*	failure reportin operation codes	*/
#define FailRep						25	// failure report

/*	GPRS notification operation codes	*/
#define NoteMsPresForGprs			26	// note ms present for GPRS

/*	MAP-H operaion codes, defined by owner	*/
#define SecuTrip					200	// security triplets
#define InterrSubs					201	// interrogate subscriber
#define CreateSubs					202	// create subscriber
#define DelSubs						203	// deleter subscriber
#define PingAuc						204	// HLR ping AUC

/*	+++++++++++++++++++++++++	*/
/*	MAP operation error code	*/
/*	+++++++++++++++++++++++++	*/

/* generic error codes	*/
#define SysFail						34	// system failure
#define DataMissing					35
#define UnexpDataVal				36	// unexpected data value
#define FaciNotSpprt				21	// facility not support
#define IncomTerm					28	// incompatible terminal
#define ResLimit					51	// resource limitation

/*	identification and numbering error codes	*/
#define UnknwnSub					1	// unknown subscriber
#define NumChng						44	// number changed
#define UnknwnMSC					3	// unknown MSC
#define UnidentSub					5	// unidentified subscriber
#define UnknwnEquip					7	// unkown equipment

/*	subscription error codes	*/
#define RoamNotAllow				8	// roaming not allowed
#define IllgSub						9	// illegal subscriber
#define IllgEquip					12	// illegal equipment
#define BSNotProv					10	// bearer service not provisioned
#define TSNotProv					11	// teleservice not provisioned

/*	handover error codes	*/
#define NoHONumAvail				25	// no handover number available
#define SubsHOFail					26	// subsequent handover failure

/*	operation and maintenance error codes	*/
#define TrcBufferFull				40	// tracing buffer full

/*	call handling error codes	*/
#define NoRoamNumAvail				39	// no roaming number available
#define AbsentSub					27	// absent subscriber
#define BusySub						45	// busy subscriber
#define NoSubReply					46	// no subscriber reply
#define CallBarred					13
#define FwdFail						47	// forwarding failing
#define OR_NotAllow					48	// OR not allowed
#define FwdViolate					14	// forwarding violate
#define CUG_Reject					15

/*	any time interrogatin error codes	*/
#define ATI_NotAllow				49	// ati not allowed

/*	group call error codes	*/
#define NoGrpCallNumAvail			50	// no group call number available

/*	supplementary service error codes	*/
#define IllgSSOper					16	// illegal SS operation
#define SSErrStatus					17	// SS error status
#define SSNotAvail					18	// SS not available
#define SSSubscViolate				19	// SS subscription violation
#define SSIncompat					20	// SS incompatibility
#define UnknwnAlph					71	// unknown alphabet
#define USSDBusy					72
#define PWRegFail					37	// pw-registration failure
#define NegPWCheck					38	// negative pw-check
#define NumOfPWAttViolate			43	// number of pw-attempts violation
#define ShortTermDen				29	// short term denial
#define LongTermDen					30	// long term denial

/*	short message service error codes	*/
#define SubBusyForMTSMS				31	// subscriber busy for MT-SMS
#define SMDelivFail					32	// SM-delivery failure
#define MsgWaitListFull				33	// message waiting list full
#define AbsentSubSM					6	// absent subscriber SM

/*	++++++++++++++++++++++++++++++++	*/
/*	MAP operation provider error		*/
/*	defined by user						*/
/*	++++++++++++++++++++++++++++++++	*/
#define DupInvokeId					101	// duplicated invoke id
#define SrvNotSupport				102	// service not supported
#define MistypeParam				103	// mistyped parameter
#define ResourceLimit				104	// resource limitation
#define InitRelease					105	// initiating release
#define UnexpResFromPeer			106	// unexpected response from the peer
#define SrvCompleteFailure			107	// service completion failure
#define NoResFromPeer				108	// no response from the peer
#define InvResReceive				109	// invalid response received

/*	++++++++++++++++++++++++++++++++	*/
/*	the following codes is reserved		*/
/*	++++++++++++++++++++++++++++++++	*/

/*	reserved operation codes	*/
#define SndParam					9	// send parameter
#define ProcUnstrctSSData			19	// process unstructure SS data
#define PerformHo					28	// perform handover
#define PerformSubsHo				30	// perform subsequence handvoer
#define NoteInterHo					35	// note internal handover
#define NoteSubPrnt					48	// not subscriber present
#define AlrtSCWithoutRes			49	// alert service center without result
#define TraceSubAct					52	// trace subscriber activity
#define BeginSubAct					54	// beging subscriber activity

/*	reserved error codes	*/
#define UnknwnBS					2	// unknowd base station
#define InvalidTBS					23	// invalid target base station
#define NoRRAvail					24	// no radio resource available

/*	MAP OPEN response result	*/
#define OpenResultRefuse			0x01
#define OpenResultAccept			0x02

/*	MAP OPEN refuse result	*/
#define ACNotSupported				0x01
#define InvalidDesReference			0x02	// invalid destination reference
#define InvalidOrgReference			0x03	// invalid original reference
#define NoReasonGiven				0x04
#define RemoteNodeNotReachable		0x05
#define PotentialVerIncompat		0x06	// potential version incompatibility

/*	MAP CLOSE release method	*/
#define NormalRelease				0x01
#define PrearrangedEnd				0x02

/*	MAP U-ABORT user reason	*/
#define ResourceLimite				0x01
#define ResourceUnavailable			0x02
#define ApplicationCancel			0x03
#define ProcedureError				0x04

/*	MAP U-AOBRT	diagnostic information	*/
#define ShortTermProblem			0x01
#define LongTermProblem				0x02
#define HandoverCancel				0x03
#define RadioChannelRelease			0x04
#define NetworkPathRelease			0x05
#define CallRelease					0x06
#define AssociateProcedureFailure	0x07
#define TandemDialogueRelease		0x08
#define RemoteOperationFailure		0x09

/*	MAP P-ABORT provider reason	*/
#define ProviderMalfunction			0x01
#define SupportingReleased			0x02
#define ResourceLimitation			0x03
#define MaintenanceActivity			0x04
#define VersionIncompatibility		0x05
#define AbnormalMAPDialogue			0x06

/*	MAP P-ABORT source	*/
#define MAPProblem					0x01
#define TCProblem					0x02
#define NetworkProblem				0x03

/*	MAP NOTICE problem diagnostic	*/
#define AbnormalEventDetect			0x01
#define ResponseRejected			0x02
#define AbnormalEventReceived		0x03
#define MessageNotDelivered			0x04







/////////////////////////////////////lw add MAP V1 Modify

#define SendParam					9	// send parameters
#define NoteSubPrnt					48	// not subscriber present
#define ProcUnstrctSSData			19	// process unstructure SS data
#define BeginSubAct					54	// beging subscriber activity
#define PerformHo					28	// perform handover
#define PerformSubsHo				30	// perform subsequence handvoer
#define NoteInterHo					35	// note internal handover
#define BeginSubAct					54	// beging subscriber activity
#define AlrtSCWithoutRes			49	// alert service center without result
#define TraceSubAct					52	// trace subscriber activity
//////////////////////////////////////

/**** OPR VLR message ********/
#define	DetermineOprUser				128
#define VlrUpdateLocation				129
/**** OPR VLR message ********/

/**** OPR HLR message ********/
#define	CreateUserWithMsisdnImsi		130
#define	DeleteOprUser					131
/**** OPR HLR message ********/

/**** IMDM VLR message ********/
#define	VlrEnquiryIMDMStatus			132
/**** IMDM VLR message ********/

/*****************		LCS		**************/
#define	RoutingInfoForLCS					85
#define	ProvideSubscriberLocation			83
/*****************		LCS		**************/







#endif
