www.pudn.com > Read.rar > DataStruct.h


// DataStruct.h: interface for the CDataStruct class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_DATASTRUCT_H__BD300136_9538_4DAA_9535_0AC858DB261C__INCLUDED_) 
#define AFX_DATASTRUCT_H__BD300136_9538_4DAA_9535_0AC858DB261C__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#define unchar	unsigned char 
#define unshort	unsigned short	 
#define	unlong	unsigned long 
 
#define	MAX_LEN				2048 
#define MAX_TCP_LIST        256 
#define MAX_SERVER_LIST     10 
 
typedef struct tagTcpLstMember 
{ 
	int		ServerSocketfd; 
	 
	char    ServerIpAddr[16];//想连接的服务器端ip地址 
    unshort    ServerPort; 
}CTcpLstMember; 
 
typedef struct	tagTcpLst 
{ 
	struct	tagTcpLstMember	TcpMember[MAX_TCP_LIST]; 
	unshort	TcpTotal; 
}CTcpLst; 
 
typedef struct tagVehicle 
{ 
	unshort  CenterId; 
	char     VehicleType[10]; 
	unshort  Count; 
}CVehicleType; 
 
struct tag8240pkt 
{ 
	unchar   type; 
	unchar   Count; 
	CVehicleType VehicleType[16]; 
}; 
 
struct tagSock5negotiation 
{ 
	unchar   Version; 
	unchar   MethodCount; 
	unchar   Method[255]; 
}; 
 
struct tagSock5negotiationack 
{ 
	unchar   Version; 
	unchar   Method; 
}; 
 
struct tagSock5connect 
{ 
	unchar   Version; 
	unchar   Command; 
	unchar   RSV; 
	unchar   AType; 
	unlong   Addr; 
	unshort  Port; 
}; 
 
struct tagSock5connectack 
{ 
	unchar   Version; 
	unchar   Rep; 
	unchar   RSV; 
	unchar   AType; 
	char     Addr[16]; 
	unshort  Port; 
}; 
 
typedef struct tagSock5 
{ 
	union udata 
	{ 
		tagSock5negotiation     negotiation; 
		tagSock5negotiationack  negotiationack; 
		tagSock5connect         connect; 
		tagSock5connectack      connectack; 
		char                    data[MAX_LEN]; 
	}userdata; 
}CSock5; 
 
typedef struct tagPktB 
{ 
	unlong 	sid;				//源IP 
	unlong 	did;				//目的IP 
	unshort 	centerid;			//中心ID 
	unchar 	version;			//版本号 
 
	unshort	type;				//业务类型 + 数据类型 
 
	union udata 
  	{ 
		struct tag8240pkt    Nm_8240pkt1; 
		char data[MAX_LEN-13]; 
	}userdata; 
}CPktB; 
 
class CDataStruct   
{ 
public: 
	CDataStruct(); 
	virtual ~CDataStruct(); 
 
}; 
 
#endif // !defined(AFX_DATASTRUCT_H__BD300136_9538_4DAA_9535_0AC858DB261C__INCLUDED_)