teleport/client/tp_assist_win/ts_network.h

44 lines
1.0 KiB
C
Raw Normal View History

2016-12-06 17:05:56 +00:00
#pragma once
#include <map>
struct ICMPheaderRet
{
unsigned int ulSrcServerIP; //IP<49><50>ַ
unsigned int ulDesServerIP; //IP<49><50>ַ
int nPacketsSent; //<2F><><EFBFBD>͵İ<CDB5>
int nPacketsReceived; //<2F>յ<EFBFBD><D5B5>İ<EFBFBD>
int nMinRoundTripTime; //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
int nMaxRoundTripTime; //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
int nAverageRoundTripTime; //ƽ<><C6BD>ʱ<EFBFBD><CAB1>
int nSesssionID; //sessionId
};
typedef std::map<unsigned int, ICMPheaderRet>ICMPheaderRetMap;
struct ICMPheader
{
unsigned char byType;
unsigned char byCode;
unsigned short nChecksum;
unsigned short nId;
unsigned short nSequence;
unsigned int Tick;
};
struct IPheader
{
unsigned char byVerLen;
unsigned char byTos;
unsigned short nTotalLength;
unsigned short nId;
unsigned short nOffset;
unsigned char byTtl;
unsigned char byProtocol;
unsigned short nChecksum;
unsigned int nSrcAddr;
unsigned int nDestAddr;
};
bool TestTCPPort(const ex_astr& strServerIP, int port);
int ICMPSendTo(ICMPheaderRet* pICMPheaderRet, char* pszRemoteIP, int nMessageSize, int nCount);