亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? icmp.cpp

?? VC通信程序源代碼.TCP/UDP高級編程,TCP,IP終端程序源代碼等.
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
// Icmp.cpp : implementation file
//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//					Implementation of the CIcmp class							//
//																				//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//			1998. EarthWalk Designs Software, by Jay Wheeler.					//
//			All inquiries and/or comments to Jay@EarthWalkDesigns.com			//
//			Latest version can be downloaded from:								//
//																				//
//				http://www.earthwalkdesigns.com									//
//																				//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//			Designed using Microsoft VisualC++ 4.2 and MFC						//
//			Tested on WindowsNT 4.0 Workstation and Server						//
//																				//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//			This software is released into the public domain as is and			//
//			without warranty.													//
//																				//
//			Use it in good health, and please let me know if it was useful.		//
//			If you make improvements or fixed problems, please drop me an		//
//			e-mail describing your changes.  I will try to incorporate			//
//			them into this package so that others may benefit from your			//
//			improvements.														//
//																				//
//			Enjoy!																//
//																				// 
//////////////////////////////////////////////////////////////////////////////////
//																				//
//			Icmp Class - Derived from CSocket class								//
//																				//
//		Provides the following class methods for WindowsNT 4.0 systems			//
//		utilizing the WindowsNT Winsock 2 interface to the Internet.			//
//																				//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//		OpenNewSocket															//
//			When called with no arguements, opens a SOCKET connection to a		//
//			RAW socket with ICMP protocol.										//
//																				//
//			Requires a handle to a message processor which will process the		//
//			socket events, the message number to process, and a mask giving		//
//			the events to process.												//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns TRUE if successful, else FALSE.				//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		OpenNewSocket															//
//			Opens a SOCKET connection to a socket of specified family, type		//
//			and protocol														//
//																				//
//			Requires a handle to a message processor which will process the		//
//			socket events, the message number to process, and a mask giving		//
//			the events to process.												//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns TRUE if successful, else FALSE.				//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		Connect																	//
//			When called with 2 arguements, connects an Icmp object to a RAW		//
//			socket with ICMP protocol.											//
//																				//
//			Requires 2 integer values specifying the receive and transmit		//
//			timeouts															//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns TRUE if successful, else FALSE.				//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		Connect																	//
//			When called with 5 arguements, connects an Icmp object to a socket	//
//			of specified family, type and protocol.								//
//																				//
//			Requires 2 integer values specifying the receive and transmit		//
//			timeouts															//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns TRUE if successful, else FALSE.				//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		CloseIcmpSocket															//
//			Closes a socket associated with an Icmp object.						//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		SetAsynchNotification													//
//			Sets the window (process) to notify when a network event on the		//
//			socket associated with the Icmp object occurs.						//
//																				//
//			Requires the message number to send to the window, and the events	//
//			to notify on.														//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		SetTTL																	//
//			Set the TTL option on the socket associated with an Icmp object.	//
//			TTL specifies the number of hops (gateways) to query in the			//
//			Internet tree before a response is returned.  Should be set to		//
//			icmpMaxHops to get a response from the host.						//
//			By incrementing the TTL from 1 to (number of hops to final			//
//			destination), a TraceRoute function can be performed.				//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		Ping																	//
//			Sends an ICMP ping message to the host indicated in the Icmp		//
//			variable icmpSockAddr.  The Icmp variables icmpCurSeq and			//
//			icmpCurId are sent in the buffer referenced by pIcmpBuffer.  The	//
//			referenced buffer must be large	enough to hold DataLen bytes plus	//
//			the size of the ICMP message header.								//
//																				//
//			The Icmp variable icmpPingSentAt is set to the time value at the	//
//			time the ping message is sent.										//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		IcmpChecksum															//
//			Computes the icmp checksum of the Len data in the buffer referenced	//
//			by lpBuf.															//
//																				//
//			Returns an unsigned integer value of the computed checksum.			//
//																				//
//		GetIPAddress															//
//			Returns the value of the IP address of the host pointed by			//
//			iHostName as an unsigned long in network byte order, as described	//
//			in inet_aton														//
//																				//
//			Sets iHostName to the value of the host name returned in			//
//			icmpHostEnt.														//
//																				//
//			Requires the message number to send to the window, and the events	//
//			to notify on.														//
//																				//
//			Sets Icmp variable icmpSockAddr fields appropriately, leaving the	//
//			IP address in icmpSockAddr.sin_addr, and the type of address in		//
//			icmpSockAddr.sin_family.  Also sets icmpHostEnt fields appropriately//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		Receive																	//
//																				//
//			Reads the socket associated with the Icmp object and returns the	//
//			number of bytes read, or SOCKET_ERROR, if an error occurs.			//
//																				//
//			Requires the address of the buffer to store the incoming message	//
//			and an integer buffer size.  The buffer must be large enough to		//
//			contain the incoming message.  In the case of an ICMP ping echo		//
//			response, the size would be the size of the outgoing message plus	//
//			the size of an ICMP header plus the size of an IP header.			//
//																				//
//			Sets icmpPingReceivedAt to the time the receive command is issued,	//
//			icmpRoundTripTime to the difference between icmpPingSentAt and		//
//			icmpPingReceivedAt, icmpCurSeq to the incoming sequence number		//
//			and icmpCurId to the incoming id field.								//
//																				//
//			Sets rcvSockAddr fields appropriately.								//
//																				//
//			Sets icmpSocketError and icmpSocketErrorMod to indicate the type	//
//			of error, and returns the integer result of the operation.			//
//																				//
//			icmpSocketError and icmpSocketErrorMod are preserved until the next	//
//			operation on this Icmp object is performed.							//
//																				//
//		DisplayError															//
//			Displays the provided ErrorType message prior to the decoded error	//
//			message in icmpSocketError and icmpSocketErrorMod.					//
//																				//
//			Sets the message box title to FunctionName.							//
//																				//
//			The message is displayed in a modal box, requiring an OK response	//
//			before the thread containing this method can progress.				//
//																				//
//////////////////////////////////////////////////////////////////////////////////
//																				//
//		Useage:																	//
//			To use this class, copy the files Icmp.cpp, Icmp.h and Icmp.rc		//
//			to the same directory as your project.	Include Icmp.cpp and		//
//			Icmp.rc in your	project.  This will cause an error notification		//
//			that only one .rc file can be active...ignore it, the next step		//
//			will fix it.  Open the file Icmp.rc, select the string table, and	//
//			highlight all of the messages.  Copy the resource strings to the	//
//			clipboard (copy button).  Open the projects' string table and paste	//
//		    the strings into the next available slot (paste button).  Close		//
//			both string tables and remove (delete) the file Icmp.rc from your	//
//			project.															//
//																				//
//////////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Icmp.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
/////////////////////////////////////////////////////////////////////////////
// CIcmp

CIcmp::CIcmp()
{
	pIcmpHeader = NULL;
	pIpHeader = NULL;

	icmpSocket = INVALID_SOCKET;
	
	icmpSockAddr.sin_family = 0;
	icmpSockAddr.sin_port = 0;
	icmpSockAddr.sin_addr.s_addr = 0;

	rcvSockAddr.sin_family = 0;
	rcvSockAddr.sin_port = 0;
	rcvSockAddr.sin_addr.s_addr = 0;

	icmpRoundTripTime = 0;

	icmpHops = 0;
	icmpMaxHops = MAX_HOPS;
	icmpCurSeq = 0;
	icmpCurId = 0;

	icmpRcvLen = 0;

}

CIcmp::~CIcmp()
{
	
	if (icmpSocket != INVALID_SOCKET)
		closesocket (icmpSocket);

}


// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CIcmp, CSocket)
	//{{AFX_MSG_MAP(CIcmp)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif	// 0

/////////////////////////////////////////////////////////////////////////////
//
//		Copy constructor
//
CIcmp::CIcmp(CIcmp &copy)
{
	pIcmpHeader = copy.pIcmpHeader;
	pIpHeader = copy.pIpHeader;
	icmpSocket = copy.icmpSocket;
	icmpSockAddr = copy.icmpSockAddr;
	icmpRoundTripTime = copy.icmpRoundTripTime;
	icmpHops = copy.icmpHops;
	icmpMaxHops = copy.icmpMaxHops;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
视频一区二区欧美| 精品88久久久久88久久久 | 日韩欧美一二三区| 亚洲成人免费观看| 一本一道久久a久久精品综合蜜臀| 久久久无码精品亚洲日韩按摩| 天天做天天摸天天爽国产一区 | 久久精品国产亚洲aⅴ| 欧美亚洲一区二区三区四区| 亚洲免费av观看| 9i看片成人免费高清| 国产精品网站一区| 不卡的av网站| 亚洲色图欧美在线| 日本高清视频一区二区| 一区二区三区高清在线| 在线视频一区二区三区| 一区二区三区在线免费观看| 91蜜桃在线观看| 亚洲免费在线视频| 色综合视频一区二区三区高清| 国产精品第13页| 在线观看免费亚洲| 舔着乳尖日韩一区| 欧美成人伊人久久综合网| 久久国产麻豆精品| 欧美人成免费网站| 经典三级一区二区| 国产色综合久久| 成人国产亚洲欧美成人综合网| 亚洲同性同志一二三专区| 欧美丝袜丝nylons| 国产一级精品在线| 中文字幕一区二区三区在线播放| 色综合久久久久久久久久久| 五月婷婷综合在线| 国产精品成人在线观看| 日韩欧美中文字幕制服| 91女神在线视频| 国产美女一区二区三区| 婷婷国产在线综合| 欧美精品一区二区三区很污很色的| 国产在线精品一区二区夜色| 最新热久久免费视频| 色妞www精品视频| 国产一区亚洲一区| 国产精品夫妻自拍| 日韩欧美在线网站| 色婷婷精品久久二区二区蜜臂av| 视频一区二区欧美| 自拍偷在线精品自拍偷无码专区| 欧美一激情一区二区三区| 成人av免费在线观看| 日韩**一区毛片| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日本一区二区三区电影| 91一区二区三区在线播放| 人妖欧美一区二区| 亚洲欧美一区二区三区孕妇| 日韩美女主播在线视频一区二区三区| 成人免费毛片app| 婷婷综合五月天| 国产欧美日韩激情| 91精品国产综合久久久蜜臀图片| 国产大片一区二区| 午夜精品在线视频一区| 欧美激情一区二区三区四区| 精品视频色一区| eeuss鲁一区二区三区| 亚欧色一区w666天堂| 国产片一区二区| 国产成人在线观看免费网站| 尤物视频一区二区| 久久久99精品久久| 精品国产髙清在线看国产毛片| 欧美亚洲综合另类| 亚洲国产电影在线观看| 亚洲一区二区三区四区不卡| 国产亚洲一区二区三区四区 | 久久精品99国产精品日本| 一区二区三区蜜桃| 国产色产综合色产在线视频| 欧美成va人片在线观看| 欧美色倩网站大全免费| 91日韩一区二区三区| 成人在线视频一区| 国产一区二区福利| 国产一区二区三区在线观看免费视频| 亚洲123区在线观看| 亚洲国产日韩一级| 亚洲另类在线制服丝袜| 亚洲天堂2016| 136国产福利精品导航| 国产日韩v精品一区二区| 久久综合成人精品亚洲另类欧美| 制服丝袜国产精品| 欧美一级久久久久久久大片| 欧美二区乱c少妇| 精品视频999| 欧美顶级少妇做爰| 欧美色图片你懂的| 欧美日本一道本在线视频| 成人aa视频在线观看| 久久国产精品99久久久久久老狼| 激情图片小说一区| 国产精品伊人色| 风间由美中文字幕在线看视频国产欧美 | 国产精品欧美综合在线| 欧美国产欧美综合| 亚洲色图视频网| 亚洲一区免费视频| 日韩精品亚洲专区| 国产一二精品视频| 97精品久久久午夜一区二区三区| 色综合久久综合网欧美综合网| 在线日韩一区二区| 日韩久久精品一区| 久久精品无码一区二区三区| 欧美极品美女视频| 亚洲欧美日韩中文字幕一区二区三区| 亚洲蜜桃精久久久久久久| 一区二区欧美视频| 偷窥国产亚洲免费视频| 捆绑紧缚一区二区三区视频| 国产丶欧美丶日本不卡视频| av成人老司机| 欧美丰满美乳xxx高潮www| 久久久久国产精品免费免费搜索| 中文字幕不卡在线观看| 亚洲一区二区三区不卡国产欧美| 美国欧美日韩国产在线播放| 国产精品中文字幕欧美| 欧美在线观看视频一区二区| 欧美一区二区三区免费| 精品少妇一区二区三区| 国产精品美女www爽爽爽| 亚洲成人免费av| 岛国精品在线观看| 在线观看区一区二| 久久久久亚洲综合| 亚洲国产精品一区二区久久 | 2欧美一区二区三区在线观看视频| 国产情人综合久久777777| 亚洲综合在线五月| 狠狠色丁香久久婷婷综合丁香| 色香蕉久久蜜桃| 精品免费国产二区三区| 亚洲欧美日韩中文播放| 国产自产v一区二区三区c| 91国产成人在线| 久久人人爽人人爽| 亚洲成人午夜电影| 99re这里只有精品首页| 精品国产1区2区3区| 亚洲愉拍自拍另类高清精品| 国产综合色产在线精品| 欧美人牲a欧美精品| 久久久久久久久久久99999| 亚洲男人天堂一区| 国产激情视频一区二区在线观看 | 久久精品国产在热久久| 91在线视频观看| 国产亚洲精品7777| 日本系列欧美系列| 欧美少妇性性性| 亚洲人成在线观看一区二区| 国产精品综合在线视频| 欧美电影一区二区三区| 亚洲精品午夜久久久| 美日韩一区二区三区| 波多野结衣亚洲| 久久久久88色偷偷免费| 麻豆91小视频| 91麻豆精品91久久久久同性| 一个色综合网站| 色老头久久综合| 久久色.com| 狠狠色狠狠色综合系列| 欧美一级在线观看| 天天操天天综合网| 91女神在线视频| 亚洲人成亚洲人成在线观看图片| 国产馆精品极品| 欧美激情一区二区在线| 国产福利一区二区三区视频在线| 欧美一级日韩免费不卡| 专区另类欧美日韩| 99re成人在线| 亚洲最新视频在线观看| 欧美四级电影网| 国产精品美女久久久久久2018| 亚洲高清免费在线| 日韩欧美国产综合一区| 国产99一区视频免费| 亚洲猫色日本管| 欧美xfplay| 欧美中文字幕久久| 国产在线精品国自产拍免费| 亚洲欧美影音先锋| 欧美一级一级性生活免费录像|