📄 gbptl.hpp
字号:
/* ======================================================================== *\
|
|
| JOYIT Communications
| Copyright (C) 2003-2008, All Right Reserved.
|
| System: PUBLIC
| Sub-system:
| Filename: datatype.hpp
| Environment: LINUX -- Red Hat 7.2 & GNU C/C++ Compiler 2.96
| Function description: This file declare the common data type
| for the system.
|
| <<History list>>
| Date Author Modify description
| -----------|---------------|-------------------------------------------
| 2008-06-19 Wu jianjin Inherited from PUB-3.0
|
\* ======================================================================== */
#ifndef _CGBPdu_HPP
#define _CGBPdu_HPP
/*
#ifndef _PUBDEF_HPP
#include "pubdef.hpp"
#endif
*/
#ifndef _PTLBASE_HPP
#include "ptlbase.hpp"
#include "deftype.hpp"
#endif
//下面这些外部自定义IE仅供Joyit内部使用
//__________________________________________________
//外部自定义IE
//----------------------------------------
//帧中继0xa0开始
#define IE_FRAME_DLCI 0xa0
///
//NS从0x70开始
#define IE_NS_PDU_TYPE 0x80
#define IE_NS_BVCI 0x81
#define IE_NS_CAUSE1 0x82//原因IE
#define IE_NS_VCI 0x83
#define IE_NS_NSEI 0x84
#define IE_NS_PDU 0x85
//----------------------------------------
//----------------------------------------
//BSSGP从x40开始
//DL-UNITDATA PDU contents IE
#define IE_BSSGP_PDU_TYPE 0x40
#define IE_BSSGP_CUR_TLLI 0x41
#define IE_BSSGP_QOS_PROFILE 0x42
#define IE_BSSGP_PDU_LIFETIME 0x43//PDU Lifetime
#define IE_BSSGP_MS_RADIO_ACCESS 0x44
#define IE_BSSGP_PRIORITY 0x45
#define IE_BSSGP_DRX_PARAMETERS 0x46
#define IE_BSSGP_IMSI 0x47
#define IE_BSSGP_PFI 0x48//Packet Flow Identifier
#define IE_BSSGP_OLD_TLLI 0x49
#define IE_BSSGP_LSA_INFORMATION 0x4b
#define IE_BSSGP_SERVICE_UTRAN_CCO 0x4c
#define IE_BSSGP_ALIGNMENT_OCTETS 0x4d
#define IE_BSSGP_LLC_PDU 0x4e
#define IE_BSSGP_CGI 0x4f
#define IE_BSSGP_CELL_CHANGE_ORDER 0x50//Cell Change Order
#define IE_BSSGP_BVCIIE 0x51
#define IE_BSSGP_LOCATION_AREA 0x52//Location Area
#define IE_BSSGP_ROUTEING_AREA 0x53//Routeing Area
#define IE_BSSGP_BSS_AREA_INDICATION 0x54//BSS Area Indication
#define IE_BSSGP_PFT 0x55//Packet Flow Timer
#define IE_BSSGP_AGGREGATE_BSS_QOS_PROFILE 0x56//Aggregate BSS QoS Profile (ABQP)
#define IE_BSSGP_TMSI 0x57
#define IE_BSSGP_CHANNEL_NEEDED 0x58//Channel needed
#define IE_BSSGP_EMLPP_PRIORITY 0x59//eMLPP-Priority
#define IE_BSSGP_TAG 0x60//Tag
#define IE_BSSGP_RA_CAP_UPD_CAUSE 0x61//RA-Cap-UPD-Cause
#define IE_BSSGP_RADIO_CAUSE 0x62//Radio Cause
#define IE_BSSGP_SUSPEND_REFERENCE_NUMBER 0x63//Suspend Reference Number
#define IE_BSSGP_CAUSE 0x64//Cause
#define IE_BSSGP_FLUSH_ACTION 0x65//Flush Action
#define IE_BSSGP_NUMBER_OF_OCTETS_AFFECTED 0x66//Number of octets affected
#define IE_BSSGP_LLC_FRAMES_DISCARDED 0x67//LLC Frames Discarded
#define IE_BSSGP_BVC_BUCKET_SIZE 0x68//BVC Bucket Size
#define IE_BSSGP_BUCKET_LEAK_RATE 0x69//Bucket Leak Rate
#define IE_BSSGP_BMAX_DEFAULT_MS 0x6a//Bmax default MS
#define IE_BSSGP_R_DEFAULT_MS 0x6b//R_default_MS
#define IE_BSSGP_BUCKET_FULL_RATIO 0x6c//Bucket_Full Ratio
#define IE_BSSGP_BVC_MEASUREMENT 0x6d//BVC Measurement
#define IE_BSSGP_MS_BUCKET_SIZE 0x6e//MS Bucket Size
#define IE_BSSGP_FEATURE_BITMAP 0x6f//Feature Bitmap
#define IE_BSSGP_PDU_IN_ERROR 0x70//PDU In Error
#define IE_BSSGP_TRACE_TYPE 0x71//Trace Type
#define IE_BSSGP_TRACE_REFERENCE 0x72//Trace Reference
#define IE_BSSGP_TRIGGER_ID 0x73//Trigger Id
#define IE_BSSGP_MOBILE_ID 0x74//Mobile Id
#define IE_BSSGP_OMC_ID 0x75//OMC Id
#define IE_BSSGP_TRANSACTIONID 0x76//TransactionId
#define IE_BSSGP_OLD_BVCI 0x77//old Bvci
//UL-UNITDATA PDU content IE
//-----------------------------------------
//-----------------------------------------
//LLC从0x90开始
#define IE_LLC_SAP 0x90
#define IE_LLC_GMML_TYPE 0x91
//Layer3从0xb0开始
#define IE_LAYER3_MSG_TYPE IE_LLC_GMML_TYPE
#define IE_LAYER3_MS_NETWORK_CAPABILITY 0xb1//MS network capability
#define IE_LAYER3_TYPE 0xb2
#define IE_LAYER3_GPRS_CIPHERING_KEY_SEQUENCE_NUMBER 0xb3
#define IE_LAYER3_DRX_PARAMETER 0xb4//DRX parameter
#define IE_LAYER3_PTMSI_IMSI 0xb5
#define IE_LAYER3_OLD_ROUTING_AERA_IDENTIFICATION 0xb6//Old routing area identification
#define IE_LAYER3_MS_RADIO_ACCESS_CAPABILITY 0xb7//MS Radio Access capability
#define IE_LAYER3_OLD_PTMSI_SIGNATURE 0xb8//old P-TMSI signature
#define IE_LAYER3_REQUESTED_READY_TIMER_VALUE 0xb9//Requested READY timer
#define IE_LAYER3_TMSI_STATUS 0xba//TMSI status
#define IE_LAYER3_ATTACH_RESULT 0xbb
#define IE_LAYER3_FORCE_TO_STANDBY 0xbc
#define IE_LAYER3_PERIODIC_RA_UPDATE_TIMER 0xbe
#define IE_LAYER3_SPARE_HALF_OCTET 0xc0
#define IE_LAYER3_GMM_CAUSE 0xc1//GMM cause
#define IE_LAYER3_ALLOCATED_PTMSI 0xc2 //Allocated P-TMSI
#define IE_LAYER3_MS_IDENTITY 0xc3//MS identity
#define IE_LAYER3_AUTHENTICATIO_PARAMETER_RAND 0xc4//Authentication parameter RAND
#define IE_LAYER3_CIPHERING_KEY_SEQUENCE_NUMBER 0xc5
#define IE_LAYER3_LIST_OF_RECEIVE_N_PDU_NUMBERS 0xc6//List of Receive N-PDU Numbers
#define IE_LAYER3_GPRS_TIME 0xc7//GPRS Timer
#define IE_LAYER3_FORCE_TO_STANDBY_OR_SPARE_HALF_OCTET 0xc8//Force to standby or Spare half octet
#define IE_LAYER3_AUTHENTION_PARAMETER_SRES 0xc9//Authentication parameter SRES
#define IE_LAYER3_REQUESTED_NSAPI 0xca//Requested NSAPI
#define IE_LAYER3_REQUSTED_LLC_SAPI 0xcb//Requested LLC SAPI
#define IE_LAYER3_REQUSTED_QOS_OR_NEW_QOS 0xcc//Requested QoS or new Qos
#define IE_LAYER3_ACCESS_POINT_NAME 0xce//Access point name
#define IE_LAYER3_PROTOCOL_CONFIGURATION_OPTIONS 0xcf//Protocol configuration options
#define IE_LAYER3_REQUESTED_PDP_ADDRESS_AND_PDP_ADDRESS 0xd0//Requested PDP address and PDP address and Offered PDP address
#define IE_LAYER3_NEGOTIATED_LLC_SAPI 0xd1//Negotiated LLC SAPI
#define IE_LAYER3_NEGOTIATED_QOS 0xd2//Negotiated QoS
#define IE_LAYER3_RADIO_PRIORITY_FOR_SMS 0xd3//Radio priority for SMS
#define IE_LAYER3_REQUSTED_PDP_ADDRESS_AND_PDP_ADDRESS_OFFERED_PDP_ADDRESS 0xd4//Requested PDP address and PDP address and Offered PDP address
#define IE_LAYER3_SM_CAUSE 0xd5//SM cause
#define IE_LAYER3_REQUESTED_LLC_SAPI 0xd6//Requested LLC SAPI
#define IE_LAYER3_PACKET_DATA_PROTOCOL 0xd8//Packet data protocol address
#define IE_LAYER3_DETACH_TYPE 0xd9//Detach type
#define IE_LAYER3_ROUTING_AREA_IDENTIFCATION 0xda//Routing area identification
#define IE_LAYER3_OLD_P_TMSI_SIGNATURE 0xdb//Old P-TMSI signature
#define IE_LAYER3_CIPHERING_ALGORITHM_OR_IMSEISV_REQUEST 0xdc//Ciphering algorithm or IMEISV request
#define IE_LAYER3_PERIODIC_RA_UPDATE_TIME 0xdd//Periodic RA update timer
#define IE_LAYER3_USER_DATE 0xde//用户数据
#define IE_LAYER3_AUTHENTICATION_RESPONSE 0xdf//Authentication Response parameter
#define IE_LAYER3_PDP_CONTEXT_STATUS 0xe0//PDP context status
#define IE_LAYER3_PLMN_LIST 0xe1//plmn list
//Layer3 IE从0xd0开始
/*
#define LLCMSNETCAP 0xb1//网络接入能力
#define LLCTYPE 0xb2//类型
#define LLCDRXPARAMETER 0xb3//DRX参数
#define LLCP_TMSI_IMSI 0xb4//p-tmsi or imsi
#define LLCORAI 0xb5//Old routing area identification
#define LLCMSRAC 0xb6//MS Radio Access capability
#define LLCATTACHRESULT 0xb9//附着原因
#define LLCPRAUT 0xba//Periodic RA update timer
#define LLCRPFS 0xbc//Radio priority for SMS
#define LLCRAI 0xbd//Routing area identification
#define LLCDETACHTYPE 0xbe//Detach type
#define LLCFORCETOSTANDBY 0xbf//Force to standby or Spare half octet
#define LLCALLOCATEDP_TMSI 0xd0//Allocated P-TMSI
#define LLCIMEISVREQUEST 0xd1//Ciphering algorithm or IMEISV request
#define REQUESTEDNSAPI 0xd3//Requested NSAPI
#define REQUESTEDLLCSAPI 0xd4//Requested LLC SAPI
#define REQUESTEDQOS 0xd5//Requested QoS or new Qos
#define NEGOTIATEDLLCSAPI 0xd6//Negotiated LLC SAPI
#define NEGOTIATEDQOS 0xd7//Negotiated QoS
#define LLCSMCAUSE 0xd8//SM cause
#define PACKETDATAPROTOCOLADDRESS 0xd9//Packet data protocol address
*/
//LLC控制不当IE用
#define LLCOPTS 0x19//Old P-TMSI signature
#define LLCAPT 0x18//Allocated P-TMSI
#define AUTHENTICATIONPARAMETERRAND 0x21//Authentication parameter RAND
#define LLCMSIDENTITY 0x23//MS identity
#define LLCGMMCAUSE 0x25//GMM cause
#define DRXPARAMETER 0x27//DRX parameter
#define MSNETWORKCAPABILITY 0x31//MS network capability
#define LISTOFRECEIVEN_PDUNUMBERS 0x26//List of Receive N-PDU Numbers
#define AUTHENTICATIONPARAMETERSRES 0x22//Authentication parameter SRES
#define LLCAPN 0x28//Access point name
#define LLCPCO 0x27//Protocol configuration options
#define GPRSTIME 0x29//Requested AA-READY timer value,GPRS Timer
#define PDPADDRESS 0x2b//Requested PDP address and PDP address and Offered PDP address
#define LLCRRT 0x17//Requested READY timer
#define LLCTMSIS 0x18//TMSI status
#define TMSI_STATUS 0x09//TMSI status
#define CIPHERINGKEYSEQUENCENUMBER 0x08//Ciphering key sequence number
#pragma pack(1)
typedef struct _BSSGP
{
unsigned char PDUType;
unsigned long CurrTlli;
unsigned char Qos[3];
}*LPBSSGP,BSSGP;
typedef struct _SLLC
{
unsigned char Gprs:4;//GPRS移动管理消息
unsigned char Spare:2;//空闲
unsigned char OrderMark:1;//命令/响应标记(C/R)
unsigned char PD:1;//协议瓣别
unsigned char UiSnH:3;//发送端UI帧无证实模式序号为0
unsigned char UiSpare:2;//空闲
unsigned char UiFormatH:3;//格式分为U ,UI,S,I,
//UI序号高位
unsigned char uiProtect:1;//保护模式位
unsigned char Encryption:1;//加密模式位
unsigned char uiFormatL:6;//N(u)=0
//UI序号低位
}*LPSLLC,SLLC;
typedef struct _GMMSM
{
unsigned char PD:4;//协议瓣别
unsigned char Tion:3;//处理识别码
unsigned char TionID:1;//处理识别码ID
unsigned char Type;//请求类型
}*LPGMMSM,GMMSM;
#pragma pack()
#define CGBPdu_LLGMM_UFRMAT 3//格式属于U格式里面只有XID参数
#define CGBPdu_PROTOCOL_ERROR 2
#define CGBPdu_LLGMM 1//消息属于LLGMM层
#define CGBPdu_SUCCESS 0
#define CGBPdu_ERROR_SHORT -1 //消息太短
#define CGBPdu_ERROR_INVLID -2 //不合法消息
#define CGBPdu_ERROR_DECODE -3 //解析错误
#define CGBPdu_ERROR_NULL -4 //无效的空指针
class CGBPdu: public CPduBase
{
public:
CGBPdu();
char Decode(UINT8 *ptr,UINT16 len);
char NsDecode(UINT8 *ptr,UINT16 len);
LPGMMSM lpGmm;
UINT8* pBSSGPMessage;
UINT8* Frame;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -