Logo Search packages:      
Sourcecode: nmap version File versions  Download package

Packet.dll definitions and data structures


Detailed Description

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


Classes

struct  _ADAPTER
 Describes an opened network adapter. More...
struct  _ADAPTER_INFO
 Contains comprehensive information about a network adapter. More...
struct  _PACKET
 Structure that contains a group of packets coming from the driver. More...
struct  _PACKET_OID_DATA
 Structure containing an OID request. More...
struct  bpf_hdr
 Packet header. More...
struct  bpf_insn
 A single BPF pseudo-instruction. More...
struct  bpf_program
 A BPF pseudo-assembly program. More...
struct  bpf_stat
 Structure that contains a couple of statistics values on the current capture. More...
struct  dump_bpf_hdr
 Dump packet header. More...
struct  NetType
 Network type structure. More...
struct  npf_if_addr
 Addresses of a network adapter. More...
typedef struct _ADAPTER ADAPTER
 Describes an opened network adapter.
typedef struct _ADAPTER_INFO ADAPTER_INFO
 Contains comprehensive information about a network adapter.
typedef struct _ADAPTERLPADAPTER
typedef struct _PACKETLPPACKET
typedef struct _PACKET PACKET
 Structure that contains a group of packets coming from the driver.
typedef struct _PACKET_OID_DATA PACKET_OID_DATA
typedef struct _ADAPTER_INFOPADAPTER_INFO
typedef struct _PACKET_OID_DATAPPACKET_OID_DATA
typedef WAN_ADAPTERPWAN_ADAPTER
 Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
typedef struct WAN_ADAPTER_INT WAN_ADAPTER
 Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
#define ADAPTER_DESC_LENGTH   128
 Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
#define ADAPTER_NAME_LENGTH   256 + 12
 Maximum length for the name of an adapter. The value is the same used by the IP Helper API.
#define DOSNAMEPREFIX   TEXT("Packet_")
 Prefix added to the adapters device names to create the WinPcap devices.
#define FILE_DEVICE_PROTOCOL   0x8000
#define INFO_FLAG_DAG_CARD   2
 Flag for ADAPTER_INFO: this is a DAG card.
#define INFO_FLAG_DAG_FILE   6
 Flag for ADAPTER_INFO: this is a DAG file.
#define INFO_FLAG_DONT_EXPORT   8
 Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones.
#define INFO_FLAG_NDIS_ADAPTER   0
 Flag for ADAPTER_INFO: this is a traditional ndis adapter.
#define INFO_FLAG_NDISWAN_ADAPTER   1
 Flag for ADAPTER_INFO: this is a NdisWan adapter.
#define IOCTL_CLOSE   CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OPEN   CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_MACNAME   CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_READ   CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_RESET   CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_STATISTICS   CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_WRITE   CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define MAX_LINK_NAME_LENGTH   64
#define MAX_MAC_ADDR_LENGTH   8
 Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
#define MAX_NETWORK_ADDRESSES   16
 Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
#define NdisMediumCHDLC   -2
#define NdisMediumNull   -1
#define NdisMediumPPPSerial   -3
#define NMAX_PACKET   65535
#define ODS(_x)
#define ODSEx(_x, _y)
#define Packet_ALIGNMENT   sizeof(int)
 Alignment macro. Defines the alignment size.
#define PACKET_MODE_CAPT   0x0
 Capture mode.
#define PACKET_MODE_DUMP   0x10
 Dump mode.
#define PACKET_MODE_MON   0x2
 Monitoring mode.
#define PACKET_MODE_STAT   0x1
 Statistical mode.
#define PACKET_MODE_STAT_DUMP   MODE_DUMP | MODE_STAT
 Statistical dump Mode.
#define Packet_WORDALIGN(x)   (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
 Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
#define pATTACHPROCESS   7117
 IOCTL code: attach a process to the driver. Used in Win9x only.
#define pBIOCEVNAME   7415
 IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
#define pBIOCGSTATS   9031
 IOCTL code: get the capture stats.
#define pBIOCISDUMPENDED   7411
 IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
#define pBIOCQUERYOID   2147483652
 IOCTL code: get an OID value.
#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 pBIOCSETBUFFERSIZE   9592
 IOCTL code: set kernel buffer size.
#define pBIOCSETDUMPFILENAME   9029
 IOCTL code: set the name of a the file used by kernel dump mode.
#define pBIOCSETDUMPLIMITS   9034
 IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
#define pBIOCSETF   9030
 IOCTL code: set packet filtering program.
#define pBIOCSETOID   2147483648
 IOCTL code: set an OID value.
#define pBIOCSMINTOCOPY   7414
 IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
#define pBIOCSMODE   7412
 IOCTL code: set working mode.
#define pBIOCSRTIMEOUT   7416
 IOCTL code: set the read timeout.
#define pBIOCSTIMEZONE   7471
 IOCTL code: set time zone. Used in Win9x only.
#define pBIOCSWRITEREP   7413
 IOCTL code: set number of physical repetions of every packet written by the app.
#define pDETACHPROCESS   7118
 IOCTL code: detach a process from the driver. Used in Win9x only.

Defines

#define FIREWIRE_SUBSTR   L"1394"

Functions

BOOLEAN IsFireWire (TCHAR *AdapterDesc)
LPPACKET PacketAllocatePacket (void)
VOID PacketCloseAdapter (LPADAPTER lpAdapter)
PADAPTER_INFO PacketFindAdInfo (PCHAR AdapterName)
VOID PacketFreePacket (LPPACKET lpPacket)
BOOLEAN PacketGetAdapterNames (PTSTR pStr, PULONG BufferSize)
PCHAR PacketGetDriverVersion ()
BOOL PacketGetFileVersion (LPTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen)
BOOLEAN PacketGetNetInfoEx (PCHAR AdapterName, npf_if_addr *buffer, PLONG NEntries)
BOOLEAN PacketGetNetType (LPADAPTER AdapterObject, NetType *type)
HANDLE PacketGetReadEvent (LPADAPTER AdapterObject)
BOOLEAN PacketGetStats (LPADAPTER AdapterObject, struct bpf_stat *s)
BOOLEAN PacketGetStatsEx (LPADAPTER AdapterObject, struct bpf_stat *s)
PCHAR PacketGetVersion ()
VOID PacketInitPacket (LPPACKET lpPacket, PVOID Buffer, UINT Length)
BOOLEAN PacketIsDumpEnded (LPADAPTER AdapterObject, BOOLEAN sync)
LPADAPTER PacketOpenAdapter (PCHAR AdapterName)
void PacketPopulateAdaptersInfoList ()
BOOLEAN PacketReceivePacket (LPADAPTER AdapterObject, LPPACKET lpPacket, BOOLEAN Sync)
BOOLEAN PacketRequest (LPADAPTER AdapterObject, BOOLEAN Set, PPACKET_OID_DATA OidData)
BOOLEAN PacketSendPacket (LPADAPTER AdapterObject, LPPACKET pPacket, BOOLEAN Sync)
INT PacketSendPackets (LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync)
BOOLEAN PacketSetBpf (LPADAPTER AdapterObject, struct bpf_program *fp)
BOOLEAN PacketSetBuff (LPADAPTER AdapterObject, int dim)
BOOLEAN PacketSetDumpLimits (LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks)
BOOLEAN PacketSetDumpName (LPADAPTER AdapterObject, void *name, int len)
BOOLEAN PacketSetHwFilter (LPADAPTER AdapterObject, ULONG Filter)
BOOLEAN PacketSetMinToCopy (LPADAPTER AdapterObject, int nbytes)
BOOLEAN PacketSetMode (LPADAPTER AdapterObject, int mode)
BOOLEAN PacketSetNumWrites (LPADAPTER AdapterObject, int nwrites)
BOOLEAN PacketSetReadTimeout (LPADAPTER AdapterObject, int timeout)
INT PacketSetSnapLen (LPADAPTER AdapterObject, int snaplen)
BOOL PacketStopDriver ()
BOOLEAN PacketUpdateAdInfo (PCHAR AdapterName)
PWCHAR SChar2WChar (PCHAR string)
PCHAR WChar2SChar (PWCHAR string)

Variables

struct bpf_insnbpf_program::bf_insns
 A pointer to the first instruction of the program.
UINT bpf_hdr::bh_caplen
UINT bpf_hdr::bh_datalen
 Original length of packet.
USHORT bpf_hdr::bh_hdrlen
BOOLEAN _PACKET::bIoComplete
struct sockaddr_storage npf_if_addr::Broadcast
 Broadcast address.
UINT bpf_stat::bs_capt
 thus reach the application.
UINT bpf_stat::bs_drop
PVOID _PACKET::Buffer
 details about the organization of the data in this buffer
UINT dump_bpf_hdr::caplen
UCHAR _PACKET_OID_DATA::Data [1]
 from the adapter.
CHAR _ADAPTER_INFO::Description [ADAPTER_DESC_LENGTH+1]
 Human understandable description of the adapter.
UINT _ADAPTER::Flags
 Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
UINT _ADAPTER_INFO::Flags
 Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
UCHAR bpf_insn::jf
 Jump if false.
UCHAR bpf_insn::jt
 Jump if true.
int bpf_insn::k
 Generic field used for various purposes.
UINT dump_bpf_hdr::len
 Length of the original packet (off wire).
ULONG _PACKET_OID_DATA::Length
 Length of the data field.
UINT _PACKET::Length
 Length of the buffer.
NetType _ADAPTER_INFO::LinkLayer
 Physical characteristics of this adapter. This NetType structure contains the link type and the speed of the adapter.
ULONGLONG NetType::LinkSpeed
 The speed of the network in bits per second.
UCHAR _ADAPTER_INFO::MacAddress [MAX_MAC_ADDR_LENGTH]
 Link layer address.
UINT _ADAPTER_INFO::MacAddressLen
 Length of the link layer address.
CHAR _ADAPTER::Name [ADAPTER_NAME_LENGTH]
CHAR _ADAPTER_INFO::Name [ADAPTER_NAME_LENGTH+1]
 Name of the device representing the adapter.
npf_if_addr_ADAPTER_INFO::NetworkAddresses
 Pointer to an array of npf_if_addr, each of which specifies a network address of this adapter.
INT _ADAPTER_INFO::NNetworkAddresses
 Number of network layer addresses of this adapter.
int _ADAPTER::NumWrites
 on the wire.
OVERLAPPED _PACKET::OverLapped
UINT bpf_stat::ps_ifdrop
 drops by interface. XXX not yet supported
PWAN_ADAPTER _ADAPTER::pWanAdapter
HANDLE _ADAPTER::ReadEvent
UINT _ADAPTER::ReadTimeOut
 ReadEvent will be signaled, also if no packets were captured.
struct sockaddr_storage npf_if_addr::SubnetMask
 Netmask for that address.
CHAR _ADAPTER::SymbolicLink [MAX_LINK_NAME_LENGTH]
DWORD _PACKET::ulBytesReceived
 received by the last call to PacketReceivePacket()


Generated by  Doxygen 1.6.0   Back to index