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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? packet32.h

?? 一個網絡監視的程序
?? H
字號:
/*
 * Copyright (c) 1999, 2000
 *	Politecnico di Torino.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that: (1) source code distributions
 * retain the above copyright notice and this paragraph in its entirety, (2)
 * distributions including binary code include the above copyright notice and
 * this paragraph in its entirety in the documentation or other materials
 * provided with the distribution, and (3) all advertising materials mentioning
 * features or use of this software display the following acknowledgement:
 * ``This product includes software developed by the Politecnico
 * di Torino, and its contributors.'' Neither the name of
 * the University nor the names of its contributors may be used to endorse
 * or promote products derived from this software without specific prior
 * written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

/** @ingroup packetapi
 *  @{ 
 */

/** @defgroup packet32h Packet.dll definitions and data structures
 *  Packet32.h contains the data structures and the definitions used by packet.dll.
 *  The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included
 *  by the applications that use the functions of this library
 *  @{
 */

#ifndef __PACKET32
#define __PACKET32

#include <winsock2.h>
#include "devioctl.h"

// Working modes
#define PACKET_MODE_CAPT 0x0 ///< Capture mode
#define PACKET_MODE_STAT 0x1 ///< Statistical mode
#define PACKET_MODE_DUMP 0x10 ///< Dump mode
#define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode

// ioctls
#define FILE_DEVICE_PROTOCOL        0x8000

#define IOCTL_PROTOCOL_STATISTICS   CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_RESET        CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_READ         CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_WRITE        CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_MACNAME      CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OPEN                  CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CLOSE                 CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)

#define	 pBIOCSETBUFFERSIZE 9592		///< IOCTL code: set kernel buffer size.
#define	 pBIOCSETF 9030					///< IOCTL code: set packet filtering program.
#define  pBIOCGSTATS 9031				///< IOCTL code: get the capture stats.
#define	 pBIOCSRTIMEOUT 7416			///< IOCTL code: set the read timeout.
#define	 pBIOCSMODE 7412				///< IOCTL code: set working mode.
#define	 pBIOCSWRITEREP 7413			///< IOCTL code: set number of physical repetions of every packet written by the app.
#define	 pBIOCSMINTOCOPY 7414			///< IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
#define	 pBIOCSETOID 2147483648			///< IOCTL code: set an OID value.
#define	 pBIOCQUERYOID 2147483652		///< IOCTL code: get an OID value.
#define	 pATTACHPROCESS 7117			///< IOCTL code: attach a process to the driver. Used in Win9x only.
#define	 pDETACHPROCESS 7118			///< IOCTL code: detach a process from the driver. Used in Win9x only.
#define  pBIOCSETDUMPFILENAME 9029		///< IOCTL code: set the name of a the file used by kernel dump mode.
#define  pBIOCEVNAME 7415				///< IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
#define  pBIOCSENDPACKETSNOSYNC 9032	///< IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets.
#define  pBIOCSENDPACKETSSYNC 9033		///< IOCTL code: Send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets.
#define  pBIOCSETDUMPLIMITS 9034		///< IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
#define  pBIOCISDUMPENDED 7411			///< IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.

#define  pBIOCSTIMEZONE 7471			///< IOCTL code: set time zone. Used in Win9x only.


/// Alignment macro. Defines the alignment size.
#define Packet_ALIGNMENT sizeof(int)
/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. 
#define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))

/*!
  \brief Network type structure.

  This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
*/
typedef struct NetType
{
	UINT LinkType;	///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
	UINT LinkSpeed;	///< The speed of the network in bits per second
}NetType;


//some definitions stolen from libpcap

#ifndef BPF_MAJOR_VERSION

/*!
  \brief A BPF pseudo-assembly program.

  The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. 
*/
struct bpf_program {
	UINT bf_len;				///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
	struct bpf_insn *bf_insns;	///< A pointer to the first instruction of the program.
};

/*!
  \brief A single BPF pseudo-instruction.

  bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
*/
struct bpf_insn {
	USHORT	code;		///< Instruction type and addressing mode.
	UCHAR 	jt;			///< Jump if true
	UCHAR 	jf;			///< Jump if false
	int k;				///< Generic field used for various purposes.
};

/*!
  \brief Structure that contains a couple of statistics values on the current capture.

  It is used by packet.dll to return statistics about a capture session.
*/
struct bpf_stat {
	UINT bs_recv;		///< Number of packets that the driver received from the network adapter 
						///< from the beginning of the current capture. This value includes the packets 
						///< lost by the driver.
	UINT bs_drop;		///< number of packets that the driver lost from the beginning of a capture. 
						///< Basically, a packet is lost when the the buffer of the driver is full. 
						///< In this situation the packet cannot be stored and the driver rejects it.
	UINT ps_ifdrop;		///< drops by interface. XXX not yet supported
	UINT bs_capt;		///< number of packets that pass the filter, find place in the kernel buffer and
						///< thus reach the application.
};

/*!
  \brief Packet header.

  This structure defines the header associated with every packet delivered to the application.
*/
struct bpf_hdr {
	struct timeval	bh_tstamp;	///< The timestamp associated with the captured packet. 
								///< It is stored in a TimeVal structure.
	UINT	bh_caplen;			///< Length of captured portion. The captured portion <b>can be different</b>
								///< from the original packet, because it is possible (with a proper filter)
								///< to instruct the driver to capture only a portion of the packets.
	UINT	bh_datalen;			///< Original length of packet
	USHORT		bh_hdrlen;		///< Length of bpf header (this struct plus alignment padding). In some cases,
								///< a padding could be added between the end of this structure and the packet
								///< data for performance reasons. This filed can be used to retrieve the actual data 
								///< of the packet.
};

/*!
  \brief Dump packet header.

  This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
  It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
  packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
*/
struct dump_bpf_hdr{
    struct timeval	ts;			///< Time stamp of the packet
    UINT			caplen;		///< Length of captured portion. The captured portion can smaller than the 
								///< the original packet, because it is possible (with a proper filter) to 
								///< instruct the driver to capture only a portion of the packets. 
    UINT			len;		///< Length of the original packet (off wire).
};


#endif

#define        DOSNAMEPREFIX   TEXT("Packet_")	///< Prefix added to the adapters device names to create the WinPcap devices
#define        MAX_LINK_NAME_LENGTH	64			//< Maximum length of the devices symbolic links
#define        NMAX_PACKET 65535

/*!
  \brief Describes a network adapter.

  This structure is the most important for the functioning of packet.dll, but the great part of its fields
  should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
*/
typedef struct _ADAPTER  { 
	HANDLE hFile;				///< \internal Handle to an open instance of the NPF driver.
	CHAR  SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
	int NumWrites;				///< \internal Number of times a packets written on this adapter will be repeated 
								///< on the wire.
	HANDLE ReadEvent;			///< A notification event associated with the read calls on the adapter.
								///< It can be passed to standard Win32 functions (like WaitForSingleObject
								///< or WaitForMultipleObjects) to wait until the driver's buffer contains some 
								///< data. It is particularly useful in GUI applications that need to wait 
								///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
								///< function can be used to define the minimum amount of data in the kernel buffer
								///< that will cause the event to be signalled. 
	
	UINT ReadTimeOut;			///< \internal The amount of time after which a read on the driver will be released and 
								///< ReadEvent will be signaled, also if no packets were captured
}  ADAPTER, *LPADAPTER;

/*!
  \brief Structure that contains a group of packets coming from the driver.

  This structure defines the header associated with every packet delivered to the application.
*/
typedef struct _PACKET {  
	HANDLE       hEvent;		///< \deprecated Still present for compatibility with old applications.
	OVERLAPPED   OverLapped;	///< \deprecated Still present for compatibility with old applications.
	PVOID        Buffer;		///< Buffer with containing the packets. See the PacketReceivePacket() for
								///< details about the organization of the data in this buffer
	UINT         Length;		///< Length of the buffer
	DWORD        ulBytesReceived;	///< Number of valid bytes present in the buffer, i.e. amount of data
									///< received by the last call to PacketReceivePacket()
	BOOLEAN      bIoComplete;	///< \deprecated Still present for compatibility with old applications.
}  PACKET, *LPPACKET;

/*!
  \brief Structure containing an OID request.

  It is used by the PacketRequest() function to send an OID to the interface card driver. 
  It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, 
  the list of the multicast groups defined on it, and so on.
*/
struct _PACKET_OID_DATA {
    ULONG Oid;					///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
								///< for a complete list of valid codes.
    ULONG Length;				///< Length of the data field
    UCHAR Data[1];				///< variable-lenght field that contains the information passed to or received 
								///< from the adapter.
}; 
typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;

/*!
  \brief Addresses of a network adapter.

  This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with 
  an adapter.
*/
typedef struct npf_if_addr {
	struct sockaddr IPAddress;	///< IP address.
	struct sockaddr SubnetMask;	///< Netmask for that address.
	struct sockaddr Broadcast;	///< Broadcast address.
}npf_if_addr;

#ifdef __cplusplus
extern "C" {
#endif

/**
 *  @}
 */

//---------------------------------------------------------------------------
// FUNCTIONS
//---------------------------------------------------------------------------

PCHAR PacketGetVersion();
BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);
BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);
BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);
BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);
BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);
BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);
BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);
BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);
BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);
LPADAPTER PacketOpenAdapter(LPTSTR AdapterName);
BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
LPPACKET PacketAllocatePacket(void);
VOID PacketInitPacket(LPPACKET lpPacket,PVOID  Buffer,UINT  Length);
VOID PacketFreePacket(LPPACKET lpPacket);
BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);
BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG  BufferSize);
BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp);
BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, npf_if_addr* buffer, PLONG NEntries);
BOOLEAN PacketRequest(LPADAPTER  AdapterObject,BOOLEAN Set,PPACKET_OID_DATA  OidData);
HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);
BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
BOOL PacketStopDriver();
VOID PacketCloseAdapter(LPADAPTER lpAdapter);

#ifdef __cplusplus
}
#endif 

#endif //__PACKET32

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区一线天视频 | 亚洲日本乱码在线观看| 日韩一区二区影院| 欧美精品在线观看播放| 欧美亚洲国产bt| 欧美日韩日本视频| 欧美一级日韩免费不卡| 91精品国产一区二区| 欧美一区二区私人影院日本| 欧美男女性生活在线直播观看| 欧美性xxxxxx少妇| 9191精品国产综合久久久久久| 91精品国产黑色紧身裤美女| 91精品国产综合久久精品| 日韩欧美你懂的| 久久网这里都是精品| 国产精品污污网站在线观看| 国产精品久久久久久久久图文区 | 国产精品麻豆久久久| 国产精品狼人久久影院观看方式| 中文字幕在线免费不卡| 一区二区三区在线看| 亚洲成人黄色小说| 韩国v欧美v亚洲v日本v| 成人性视频免费网站| 欧洲另类一二三四区| 精品免费99久久| 成人免费小视频| 蜜臀av在线播放一区二区三区 | 91玉足脚交白嫩脚丫在线播放| 色八戒一区二区三区| 日韩视频免费观看高清完整版在线观看 | 日本一区二区久久| 亚洲美女在线一区| 免费的国产精品| 成人精品免费看| 8v天堂国产在线一区二区| 久久这里只有精品6| 亚洲图片一区二区| 国产精品888| 67194成人在线观看| 亚洲四区在线观看| 国内精品在线播放| 欧美丝袜丝nylons| 中文字幕av一区二区三区高| 午夜精品久久久久久久久| 国产精品一区二区三区99| 欧美色男人天堂| 中文字幕在线不卡| 国产精品77777| 精品国产91久久久久久久妲己| 亚洲精品视频在线观看免费 | 色天天综合久久久久综合片| 亚洲精品一区二区三区四区高清| 亚洲国产婷婷综合在线精品| 高清在线观看日韩| 精品国产乱码久久| 日韩精品久久理论片| 色婷婷亚洲精品| 亚洲欧美国产三级| www.久久久久久久久| 国产亚洲欧美激情| 激情成人综合网| 欧美sm美女调教| 日本强好片久久久久久aaa| 精品视频资源站| 亚洲午夜三级在线| 欧美丝袜丝nylons| 亚洲国产日韩a在线播放性色| 91麻豆蜜桃一区二区三区| 中文字幕不卡的av| 99亚偷拍自图区亚洲| 中文字幕在线观看不卡| 91麻豆精东视频| 亚洲精品成人悠悠色影视| 色综合久久天天| 一区二区三区在线视频观看58| 一本大道av伊人久久综合| 一区二区三区欧美在线观看| 色一情一伦一子一伦一区| 伊人夜夜躁av伊人久久| 欧美中文字幕一区二区三区| 亚洲电影激情视频网站| 911精品国产一区二区在线| 免费成人在线观看视频| 亚洲精品在线网站| 99久免费精品视频在线观看 | 老司机精品视频一区二区三区| 欧美电影免费观看高清完整版在线观看| 日韩二区在线观看| 欧美大片一区二区| 99视频一区二区三区| 亚洲一二三四久久| 日韩三级av在线播放| 国产精品一区免费视频| 亚洲欧美另类图片小说| 欧美日韩一区高清| 国产一区二区三区电影在线观看 | 久久99国内精品| 中文字幕巨乱亚洲| 欧美视频一区二区三区| 久久99久久99小草精品免视看| 久久久国产精品午夜一区ai换脸| 99精品久久只有精品| 婷婷夜色潮精品综合在线| 久久综合色综合88| 色婷婷香蕉在线一区二区| 日本特黄久久久高潮| 欧美极品少妇xxxxⅹ高跟鞋| 色婷婷av一区| 国产精品18久久久久久久久 | 精久久久久久久久久久| 亚洲人成在线观看一区二区| 欧美一区二区三区性视频| 粉嫩av一区二区三区粉嫩| 亚洲不卡av一区二区三区| 久久亚洲捆绑美女| 欧美日韩精品电影| 99久久精品国产毛片| 久久精品国产亚洲高清剧情介绍 | 日韩高清在线一区| 亚洲欧美一区二区三区国产精品 | 本田岬高潮一区二区三区| 免费观看久久久4p| 一区二区三区在线视频播放| 国产午夜精品一区二区三区视频| 欧美日免费三级在线| 国产凹凸在线观看一区二区| 日本不卡一区二区三区高清视频| 国产精品初高中害羞小美女文| 精品免费99久久| 日韩欧美亚洲国产精品字幕久久久| 色综合欧美在线| 99久久99久久综合| 国产白丝精品91爽爽久久| 黄色精品一二区| 日韩制服丝袜av| 亚洲h精品动漫在线观看| 亚洲三级在线观看| 国产精品国产三级国产aⅴ原创| 欧美r级电影在线观看| 欧美日韩大陆一区二区| 91行情网站电视在线观看高清版| 国产a视频精品免费观看| 国产精品一区二区无线| 国产综合色在线视频区| 久久99在线观看| 韩日av一区二区| 国产成人一级电影| 国产成人啪免费观看软件| 国产成人aaaa| 成人中文字幕在线| aa级大片欧美| 日本精品视频一区二区| 欧美体内she精高潮| 欧美日韩精品二区第二页| 欧美日本免费一区二区三区| 欧美日本一区二区三区四区| 26uuu色噜噜精品一区二区| 日韩精品一区二区三区视频播放| 日韩一区二区三区电影| 欧美成人精品1314www| 久久久青草青青国产亚洲免观| 国产色一区二区| 日韩一区在线看| 亚洲在线一区二区三区| 亚洲一区二区av电影| 日韩精品成人一区二区在线| 久久精品久久99精品久久| 国产精品一区三区| 色拍拍在线精品视频8848| 欧美日韩在线观看一区二区 | 欧美一区二区三区播放老司机| 69av一区二区三区| 26uuu色噜噜精品一区| 亚洲国产精品成人久久综合一区 | 亚洲国产精品久久久久秋霞影院| 性欧美大战久久久久久久久| 麻豆精品一二三| 粉嫩蜜臀av国产精品网站| 日本精品一区二区三区高清 | 日韩中文字幕1| 国产激情91久久精品导航 | 91精品久久久久久蜜臀| 精品国产乱码久久久久久夜甘婷婷| 国产精品久久久久久久久免费相片 | 18欧美亚洲精品| 中文字幕一区二区三区在线不卡| 亚洲综合在线五月| 国产一区在线视频| 在线精品视频免费播放| 日韩免费看的电影| 国产精品高潮久久久久无| 日韩av一级电影| 91成人在线观看喷潮| 欧美国产综合一区二区| 免费的成人av| 欧美性受极品xxxx喷水| 中文字幕第一区| 国产综合色精品一区二区三区|