├── .gitignore ├── .gitreview ├── Common ├── Packet32.h ├── WpcapNames.h └── dagc.h ├── Examples-pcap ├── GNUmakefile ├── MakeaAll.dsw ├── MakeaAll.sln ├── UDPdump │ ├── GNUmakefile │ ├── UDPdump.dsp │ ├── UDPdump.dsw │ ├── UDPdump.vcproj │ └── udpdump.c ├── basic_dump │ ├── GNUmakefile │ ├── basic_dump.c │ ├── basic_dump.dsp │ ├── basic_dump.dsw │ └── basic_dump.vcproj ├── basic_dump_ex │ ├── GNUmakefile │ ├── basic_dump_ex.c │ ├── basic_dump_ex.dsp │ ├── basic_dump_ex.dsw │ └── basic_dump_ex.vcproj ├── iflist │ ├── GNUmakefile │ ├── iflist.c │ ├── iflist.dsp │ ├── iflist.dsw │ └── iflist.vcproj ├── pcap_filter │ ├── GNUmakefile │ ├── Makefile.unix │ ├── pcap_filter.c │ ├── pcap_filter.dsp │ ├── pcap_filter.dsw │ └── pcap_filter.vcproj ├── pktdump_ex │ ├── GNUmakefile │ ├── pktdump_ex.c │ ├── pktdump_ex.dsp │ ├── pktdump_ex.dsw │ └── pktdump_ex.vcproj ├── readfile │ ├── GNUmakefile │ ├── readfile.c │ ├── readfile.dsp │ ├── readfile.dsw │ └── readfile.vcproj ├── readfile_ex │ ├── GNUmakefile │ ├── readfile_ex.c │ ├── readfile_ex.dsp │ ├── readfile_ex.dsw │ └── readfile_ex.vcproj ├── savedump │ ├── GNUmakefile │ ├── savedump.c │ ├── savedump.dsp │ ├── savedump.dsw │ └── savedump.vcproj ├── sendpack │ ├── GNUmakefile │ ├── sendpack.c │ ├── sendpack.dsp │ ├── sendpack.dsw │ └── sendpack.vcproj ├── stats │ ├── stats.c │ ├── stats.dsp │ └── stats.dsw └── winpcap_stress │ ├── winpcap_stress.c │ ├── winpcap_stress.dsp │ └── winpcap_stress.dsw ├── Examples ├── MakeAll.sln ├── MakeaAll.dsw ├── NETMETER │ ├── CapDll.h │ ├── CaptureThread.cpp │ ├── Console.h │ ├── LineColl.cpp │ ├── LineColl.h │ ├── MainFrm.cpp │ ├── MainFrm.h │ ├── NETMETER.CPP │ ├── NETMETER.H │ ├── ProgCaptDlg.h │ ├── SelectAdapter.cpp │ ├── SelectAdapter.h │ ├── StdAfx.cpp │ ├── StdAfx.h │ ├── netmeter.dsp │ ├── netmeter.dsw │ ├── netmeter.rc │ ├── netmeterDoc.cpp │ ├── netmeterDoc.h │ ├── netmeterView.cpp │ ├── netmeterView.h │ ├── res │ │ ├── BMP00001.BMP │ │ ├── bitmap1.bmp │ │ ├── bitmap2.bmp │ │ ├── cap_wizi.bmp │ │ ├── listbmp.bmp │ │ ├── netmeter.ico │ │ ├── netmeter.rc2 │ │ └── netmeterDoc.ico │ └── resource.h ├── PacketDriver │ ├── GetMacAddress │ │ ├── GetMacAddress.c │ │ ├── GetMacAddress.dsp │ │ └── GetMacAddress.vcproj │ ├── TestPacketCapture │ │ ├── TestPacketCapture.c │ │ ├── TestPacketCapture.dsp │ │ └── TestPacketCapture.vcproj │ ├── TestPacketSend │ │ ├── TestPacketSend.c │ │ ├── TestPacketSend.dsp │ │ └── TestPacketSend.vcproj │ └── readme.txt ├── UDPdump │ ├── UDPdump.dsp │ ├── UDPdump.dsw │ ├── UDPdump.vcproj │ └── udpdump.c ├── UserLevelBridge │ ├── UserBridge.c │ ├── UserBridge.dsp │ ├── UserBridge.dsw │ └── UserBridge.vcproj ├── iflist │ ├── iflist.c │ ├── iflist.dsp │ ├── iflist.dsw │ └── iflist.vcproj ├── kdump │ ├── kdump.c │ ├── kdump.dsp │ ├── kdump.dsw │ └── kdump.exe ├── misc │ ├── MakeAll.sln │ ├── MakeaAll.dsw │ ├── basic_dump.c │ ├── basic_dump.dsp │ ├── basic_dump.vcproj │ ├── basic_dump_ex.c │ ├── basic_dump_ex.dsp │ ├── basic_dump_ex.vcproj │ ├── readfile.c │ ├── readfile.dsp │ ├── readfile.vcproj │ ├── readfile_ex.c │ ├── readfile_ex.dsp │ ├── readfile_ex.vcproj │ ├── savedump.c │ ├── savedump.dsp │ ├── savedump.vcproj │ ├── sendpack.c │ ├── sendpack.dsp │ └── sendpack.vcproj ├── pcap_filter │ ├── pcap_filter.c │ ├── pcap_filter.dsp │ ├── pcap_filter.dsw │ └── pcap_filter.vcproj ├── pcap_fopen │ ├── pcap_fopen.cpp │ └── pcap_fopen.vcproj ├── pktdump_ex │ ├── pktdump_ex.c │ ├── pktdump_ex.dsp │ ├── pktdump_ex.dsw │ └── pktdump_ex.vcproj ├── sendcap │ ├── sencap.dsw │ ├── sendcap.c │ ├── sendcap.dsp │ └── sendcap.vcproj ├── smp_1 │ ├── smp_1.c │ ├── smp_1.dsp │ ├── smp_1.dsw │ └── smp_1.vcproj └── tcptop │ ├── tcptop.c │ ├── tcptop.dsp │ ├── tcptop.dsw │ └── tcptop.vcproj ├── Packet9x ├── DLL │ ├── Packet.def │ ├── Packet32.c │ ├── Project │ │ ├── GNUmakefile │ │ ├── Packet.dsp │ │ └── Packet.dsw │ ├── version.rc │ └── version.rc2 └── VXD │ ├── DEVIOCTL.H │ ├── Debug.h │ ├── Functs.asm │ ├── Lock.c │ ├── MAKEFILE │ ├── NPF.def │ ├── NPF.rc │ ├── Ndis.mk │ ├── Ndisdev.asm │ ├── Ntddpack.h │ ├── Openclos.c │ ├── Packet.c │ ├── Packet.h │ ├── Read.c │ ├── Request.c │ ├── Vpacket.rc │ ├── Write.c │ ├── win_Bpf.h │ └── win_bpf_filter.c ├── build_wpdpack.bat ├── build_wpdpack.txt ├── create_docs.bat ├── create_examples.bat ├── create_include.bat ├── create_lib.bat ├── create_web.bat ├── dox ├── WinPcap_docs.html ├── compile.htm ├── doxygen_groups.txt ├── doxygen_groups_packetdll.txt ├── footer.htm ├── internals-arch.gif ├── internals.htm ├── intro.htm ├── language.htm ├── libpcap │ ├── funcs │ │ └── pcap.h │ └── incs │ │ └── pcap.h ├── main.txt ├── main_packetdll.txt ├── note.txt ├── npf-dump.gif ├── npf-ndis.gif ├── npf-npf.gif ├── npf.htm ├── packet.htm ├── packet_samp.htm ├── pics │ ├── dump.gif │ ├── encoding.gif │ ├── stats.gif │ ├── stats_wpcap.gif │ ├── winpcap.gif │ └── winpcap_small.gif ├── prj │ ├── winpcap_c.dox │ ├── winpcap_c_packetdll.dox │ └── winpcap_noc.dox ├── slides.ppt ├── style.css ├── wpcap.htm ├── wpcap_remote.htm ├── wpcap_samp.htm ├── wpcap_samp1.htm ├── wpcap_samp2.htm ├── wpcap_tut.txt ├── wpcap_tut1.txt ├── wpcap_tut2.txt ├── wpcap_tut3.txt ├── wpcap_tut4.txt ├── wpcap_tut5.txt ├── wpcap_tut6.txt ├── wpcap_tut7.txt ├── wpcap_tut8.txt └── wpcap_tut9.txt ├── install ├── BuildMe.bat ├── MakeAll.sln ├── NetMonInstaller │ ├── NetMonInstaller.cpp │ ├── NetMonInstaller.h │ ├── compile.bat │ ├── idls.idl │ ├── implinc.cpp │ ├── makefile │ ├── pch.h │ ├── sources │ ├── version.h │ └── version.rc ├── WinPcap Installer Helper │ ├── NetMonInstaller.cpp │ ├── NetMonInstaller.h │ ├── NpfDriverInstaller.c │ ├── RpcapdServiceInstaller.c │ ├── ServiceInstaller.cpp │ ├── WinPcap Installer Helper.dsp │ ├── WinPcap Installer Helper.dsw │ ├── WinPcap Installer Helper.sln │ ├── WinPcap Installer Helper.vcxproj │ ├── WinPcap Installer Helper.vcxproj.filters │ ├── WinPcapInstallerHelper.def │ ├── WinPcapInstallerHelper.h │ ├── netcfgn.h │ ├── netcfgx.h │ ├── test │ │ ├── test.c │ │ ├── test.dsp │ │ └── test.dsw │ ├── version.rc │ └── version.rc2 ├── WorksList.xml ├── copy_installer_files.bat ├── create-driver-signing-cab.ps1 ├── daemon_mgm │ ├── daemon_mgm.c │ ├── daemon_mgm.dsp │ ├── daemon_mgm.dsw │ ├── resource.h │ └── version.rc ├── installer │ ├── WinPcap.nsi │ ├── WinPcap_gui.gi2 │ ├── WinPcap_nogui.gi2 │ ├── WinPcap_nogui_nobanner.gi2 │ ├── WinPcap_nogui_noreboot.gi2 │ ├── WinPcap_nogui_noreboot_nobanner.gi2 │ ├── WpBann.htm │ ├── bootOptions.ini │ └── distribution │ │ ├── license.txt │ │ ├── readme.txt │ │ ├── winpcap.bmp │ │ └── winpcap_nsis.bmp ├── npf.ddf ├── npf_mgm │ ├── npf_mgm.c │ ├── npf_mgm.dsp │ ├── npf_mgm.dsw │ ├── npf_mgm.rc │ └── resource.h ├── npfx64.inf ├── npfx86.inf └── release procedures.txt ├── integrate_libpcap.bat ├── packetNtx ├── CompileDriver.bat ├── CompileDriverNew.bat ├── DIRS ├── Dll │ ├── AdInfo.c │ ├── NpfImExt.c │ ├── NpfImExt.h │ ├── Packet.def │ ├── Packet32-Int.h │ ├── Packet32.c │ ├── Project │ │ ├── GNUmakefile │ │ ├── Packet.dsp │ │ ├── Packet.dsw │ │ ├── Packet.sln │ │ ├── Packet.vcxproj │ │ └── Packet.vcxproj.filters │ ├── WanPacket │ │ ├── WanPacket.cpp │ │ ├── WanPacket.def │ │ ├── WanPacket.dsp │ │ ├── WanPacket.dsw │ │ ├── WanPacket.h │ │ ├── version.rc │ │ └── version.rc2 │ ├── debug.h │ ├── strsafe.h │ ├── version.rc │ └── version.rc2 ├── ddkbuild.cmd └── driver │ ├── DEBUG.H │ ├── Driver.vcxproj │ ├── Driver.vcxproj.filters │ ├── MAKEFILE │ ├── NPF.RC │ ├── Openclos.c │ ├── Packet.c │ ├── Packet.h │ ├── Read.c │ ├── Sources │ ├── WinPcap NTx Driver_2003.vcproj │ ├── Write.c │ ├── bucket_lookup.c │ ├── bucket_lookup.h │ ├── count_packets.c │ ├── count_packets.h │ ├── dump.c │ ├── functions.c │ ├── functions.h │ ├── ioctls.h │ ├── jitter.c │ ├── jitter.h │ ├── memory_t.h │ ├── normal_lookup.c │ ├── normal_lookup.h │ ├── resource.h │ ├── tcp_session.c │ ├── tcp_session.h │ ├── time_calls.h │ ├── tme.c │ ├── tme.h │ ├── valid_insns.h │ ├── win_bpf.h │ ├── win_bpf_filter.c │ ├── win_bpf_filter_init.c │ └── win_bpf_filter_init.h ├── todo.txt ├── tools └── win-setup.ps1 ├── version.h └── wpcap ├── PRJ ├── GNUmakefile ├── WPCAP.DEF ├── WPCAP.dsw ├── Wpcap_no_extensions.def ├── build_scanner_parser.bat ├── wpcap.dsp ├── wpcap.sln ├── wpcap.vcxproj └── wpcap.vcxproj.filters ├── Win32-Extensions ├── Win32-Extensions.c ├── Win32-Extensions.h ├── version.aps ├── version.rc └── version.rc2 └── libpcap ├── TcApi.h ├── pcap-new.c ├── pcap-remote.c ├── pcap-remote.h ├── pcap-tc.c ├── pcap-tc.h ├── readme-rpcap.txt ├── remote-ext.h ├── remote_code.patch ├── remote_overwritten_files.zip ├── rpcapd ├── Makefile ├── daemon.c ├── daemon.h ├── fileconf.c ├── fileconf.h ├── resource.h ├── rpcapd.c ├── rpcapd.dsp ├── rpcapd.dsw ├── rpcapd.h ├── rpcapd.sln ├── rpcapd.vcxproj ├── rpcapd.vcxproj.filters ├── utils.c ├── utils.h ├── version.rc ├── version.rc2 ├── win32-pthreads │ ├── pthread.h │ ├── pthreadVC.dll │ ├── pthreadVC.lib │ ├── sched.h │ └── semaphore.h ├── win32-svc.c └── win32-svc.h ├── snprintf.patch ├── sockutils.c ├── sockutils.h └── tc.patch /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # This file is tracked by git for the winpcap repository, and thus should 3 | # only contain ignore entries common to all WinPcap developers. To ignore 4 | # files specific to your local repository, for example files generated by 5 | # your editor, add them to your repository exclude file (.git/info/exclude) 6 | # or your global ~/.gitignore_global. For details see: 7 | # https://help.github.com/articles/ignoring-files 8 | # 9 | 10 | # Compiled or generated source # 11 | ################################ 12 | *.dll 13 | *.exe 14 | *.obj 15 | *grammar.out 16 | *grammar.[ch] 17 | *scanner.c 18 | *_dict.c 19 | *_lex.h 20 | 21 | # CMake (currently unused) # 22 | ################## 23 | CMakeCache.txt 24 | CMakeFiles 25 | cmake_install.cmake 26 | CPackConfig.cmake 27 | CPackSourceConfig.cmake 28 | 29 | # Miscellaneous Windows Development # 30 | ################# 31 | *.bsc 32 | *.dsp 33 | *.dsw 34 | *.chm 35 | *.exp 36 | *.lib 37 | *.ilk 38 | *.manifest 39 | *.pdb 40 | *.nativecodeanalysis.xml 41 | *.rc 42 | *.res 43 | *.vcxproj.user 44 | *.opensdf 45 | *.sdf 46 | *.v12.suo 47 | 48 | # Misc # 49 | ######## 50 | *.swp 51 | *~ 52 | .DS_Store 53 | cscope.* 54 | dummy.cpp 55 | tags 56 | TAGS 57 | 58 | # Project specific ignores 59 | install/WinPcap Installer Helper/Debug 60 | packetNtx/Dll/Project/Debug 61 | packetNtx/driver/Debug 62 | wpcap/PRJ/Debug 63 | wpcap/libpcap/rpcapd/Debug 64 | install/NPF_CABS 65 | install/setup.inf 66 | install/setup.rpt 67 | install/installer/distribution/x64 68 | install/installer/distribution/x86 69 | install/WinPcap Installer Helper/Release 70 | packetNtx/Dll/Project/Debug No NetMon 71 | packetNtx/Dll/Project/Release LOG_TO_FILE 72 | packetNtx/Dll/Project/Release No NetMon LOG_TO_FILE 73 | packetNtx/Dll/Project/Release No NetMon 74 | packetNtx/Dll/Project/Release 75 | packetNtx/buildfre_win7_amd64.log 76 | packetNtx/buildfre_win7_x86.log 77 | packetNtx/driver/Release 78 | packetNtx/driver/bin 79 | packetNtx/driver/objfre_win7_amd64 80 | packetNtx/driver/objfre_win7_x86 81 | packetNtx/driver/x64 82 | wpcap/PRJ/Debug No AirPcap 83 | wpcap/PRJ/Release No AirPcap 84 | wpcap/PRJ/Release 85 | wpcap/libpcap/rpcapd/Release 86 | packetNtx/driver/PREfast_defects_* 87 | packetNtx/driver/buildchk_* 88 | packetNtx/driver/buildfre_* 89 | packetNtx/driver/objchk_* 90 | packetNtx/driver/objfre_* 91 | packetNtx/driver/prefastchk_* 92 | packetNtx/driver/prefastfre_* 93 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=code.wireshark.org 3 | port=29418 4 | project=winpcap.git 5 | defaultremote=origin 6 | defaultbranch=master 7 | -------------------------------------------------------------------------------- /Examples-pcap/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | SUBDIRS = basic_dump basic_dump_ex iflist pcap_filter pktdump_ex readfile readfile_ex savedump sendpack UDPdump 5 | 6 | all clean install uninstall: ${SUBDIRS} 7 | for subdir in ${SUBDIRS}; do \ 8 | echo "Entering $$subdir"; \ 9 | (cd $$subdir && ${MAKE} $@) \ 10 | done; 11 | -------------------------------------------------------------------------------- /Examples-pcap/UDPdump/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Loris Degioanni 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = udpdump.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap -lwsock32 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o udpdump.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} udpdump.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/UDPdump/UDPdump.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "UDPdump"=.\UDPdump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/basic_dump/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = basic_dump.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o basic_dump.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} basic_dump.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/basic_dump/basic_dump.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "basic_dump"=.\basic_dump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/basic_dump_ex/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = basic_dump_ex.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o basic_dump_ex.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} basic_dump_ex.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/basic_dump_ex/basic_dump_ex.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "basic_dump_ex"=.\basic_dump_ex.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/iflist/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = iflist.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o iflist.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} iflist.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/iflist/iflist.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "iflist"=.\iflist.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/pcap_filter/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = pcap_filter.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o pf.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} pf.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/pcap_filter/Makefile.unix: -------------------------------------------------------------------------------- 1 | 2 | CC = gcc 3 | INCLDIR = -I /usr/src/sys 4 | LIBS = -lpcap 5 | 6 | pktdump: pcap_filter.o 7 | $(CC) $(INCLDIR) pcap_filter.o $(LIBS) -o pf 8 | rm *.o 9 | 10 | -------------------------------------------------------------------------------- /Examples-pcap/pcap_filter/pcap_filter.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pcap_filter"=.\pcap_filter.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/pktdump_ex/GNUmakefile: -------------------------------------------------------------------------------- 1 | PCAP_PATH = ../../lib 2 | CFLAGS = -g -O -mno-cygwin -I ../../include 3 | 4 | OBJS = pktdump_ex.o 5 | LIBS = -L ${PCAP_PATH} -lwpcap 6 | 7 | all: ${OBJS} 8 | ${CC} ${CFLAGS} -o pktdump_ex.exe ${OBJS} ${LIBS} 9 | 10 | clean: 11 | rm -f ${OBJS} pktdump_ex.exe 12 | 13 | .c.o: 14 | ${CC} ${CFLAGS} -c -o $*.o $< 15 | -------------------------------------------------------------------------------- /Examples-pcap/pktdump_ex/pktdump_ex.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pktdump_ex"=.\pktdump_ex.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/readfile/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = readfile.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o readfile.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} readfile.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/readfile/readfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LINE_LEN 16 5 | 6 | void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); 7 | 8 | int main(int argc, char **argv) 9 | { 10 | pcap_t *fp; 11 | char errbuf[PCAP_ERRBUF_SIZE]; 12 | 13 | if(argc != 2) 14 | { 15 | printf("usage: %s filename", argv[0]); 16 | return -1; 17 | 18 | } 19 | 20 | /* Open the capture file */ 21 | if ((fp = pcap_open_offline(argv[1], // name of the device 22 | errbuf // error buffer 23 | )) == NULL) 24 | { 25 | fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]); 26 | return -1; 27 | } 28 | 29 | /* read and dispatch packets until EOF is reached */ 30 | pcap_loop(fp, 0, dispatcher_handler, NULL); 31 | 32 | pcap_close(fp); 33 | return 0; 34 | } 35 | 36 | 37 | 38 | void dispatcher_handler(u_char *temp1, 39 | const struct pcap_pkthdr *header, 40 | const u_char *pkt_data) 41 | { 42 | u_int i=0; 43 | 44 | /* 45 | * unused variable 46 | */ 47 | (VOID*)temp1; 48 | 49 | /* print pkt timestamp and pkt len */ 50 | printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); 51 | 52 | /* Print the packet */ 53 | for (i=1; (i < header->caplen + 1 ) ; i++) 54 | { 55 | printf("%.2x ", pkt_data[i-1]); 56 | if ( (i % LINE_LEN) == 0) printf("\n"); 57 | } 58 | 59 | printf("\n\n"); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Examples-pcap/readfile/readfile.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "readfile"=.\readfile.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/readfile_ex/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = readfile_ex.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o readfile_ex.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} readfile_ex.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/readfile_ex/readfile_ex.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LINE_LEN 16 5 | 6 | int main(int argc, char **argv) 7 | { 8 | pcap_t *fp; 9 | char errbuf[PCAP_ERRBUF_SIZE]; 10 | struct pcap_pkthdr *header; 11 | const u_char *pkt_data; 12 | u_int i=0; 13 | int res; 14 | 15 | if(argc != 2) 16 | { 17 | printf("usage: %s filename", argv[0]); 18 | return -1; 19 | 20 | } 21 | 22 | /* Open the capture file */ 23 | if ((fp = pcap_open_offline(argv[1], // name of the device 24 | errbuf // error buffer 25 | )) == NULL) 26 | { 27 | fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]); 28 | return -1; 29 | } 30 | 31 | /* Retrieve the packets from the file */ 32 | while((res = pcap_next_ex(fp, &header, &pkt_data)) >= 0) 33 | { 34 | /* print pkt timestamp and pkt len */ 35 | printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); 36 | 37 | /* Print the packet */ 38 | for (i=1; (i < header->caplen + 1 ) ; i++) 39 | { 40 | printf("%.2x ", pkt_data[i-1]); 41 | if ( (i % LINE_LEN) == 0) printf("\n"); 42 | } 43 | 44 | printf("\n\n"); 45 | } 46 | 47 | 48 | if (res == -1) 49 | { 50 | printf("Error reading the packets: %s\n", pcap_geterr(fp)); 51 | } 52 | 53 | pcap_close(fp); 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Examples-pcap/readfile_ex/readfile_ex.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "readfile_ex"=.\readfile_ex.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/savedump/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = savedump.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o savedump.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} savedump.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/savedump/savedump.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "savedump"=.\savedump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/sendpack/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | PCAP_PATH = ../../lib 5 | CFLAGS = -g -O -mno-cygwin -I ../../include 6 | 7 | OBJS = sendpack.o 8 | LIBS = -L ${PCAP_PATH} -lwpcap 9 | 10 | all: ${OBJS} 11 | ${CC} ${CFLAGS} -o sendpack.exe ${OBJS} ${LIBS} 12 | 13 | clean: 14 | rm -f ${OBJS} sendpack.exe 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -c -o $*.o $< 18 | -------------------------------------------------------------------------------- /Examples-pcap/sendpack/sendpack.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | 7 | int main(int argc, char **argv) 8 | { 9 | pcap_t *fp; 10 | char errbuf[PCAP_ERRBUF_SIZE]; 11 | u_char packet[100]; 12 | int i; 13 | 14 | /* Check the validity of the command line */ 15 | if (argc != 2) 16 | { 17 | printf("usage: %s interface", argv[0]); 18 | return 1; 19 | } 20 | 21 | /* Open the adapter */ 22 | if ((fp = pcap_open_live(argv[1], // name of the device 23 | 65536, // portion of the packet to capture. It doesn't matter in this case 24 | 1, // promiscuous mode (nonzero means promiscuous) 25 | 1000, // read timeout 26 | errbuf // error buffer 27 | )) == NULL) 28 | { 29 | fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", argv[1]); 30 | return 2; 31 | } 32 | 33 | /* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */ 34 | packet[0]=1; 35 | packet[1]=1; 36 | packet[2]=1; 37 | packet[3]=1; 38 | packet[4]=1; 39 | packet[5]=1; 40 | 41 | /* set mac source to 2:2:2:2:2:2 */ 42 | packet[6]=2; 43 | packet[7]=2; 44 | packet[8]=2; 45 | packet[9]=2; 46 | packet[10]=2; 47 | packet[11]=2; 48 | 49 | /* Fill the rest of the packet */ 50 | for(i=12;i<100;i++) 51 | { 52 | packet[i]= (u_char)i; 53 | } 54 | 55 | /* Send down the packet */ 56 | if (pcap_sendpacket(fp, // Adapter 57 | packet, // buffer with the packet 58 | 100 // size 59 | ) != 0) 60 | { 61 | fprintf(stderr,"\nError sending the packet: %s\n", pcap_geterr(fp)); 62 | return 3; 63 | } 64 | 65 | pcap_close(fp); 66 | return 0; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /Examples-pcap/sendpack/sendpack.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "sendpack"=.\sendpack.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/stats/stats.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "stats"=.\stats.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples-pcap/winpcap_stress/winpcap_stress.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "winpcap_stress"=.\winpcap_stress.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/NETMETER/Console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) 3 | * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino, CACE Technologies 16 | * nor the names of its contributors may be used to endorse or promote 17 | * products derived from this software without specific prior written 18 | * permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #include "..\..\include\pcap.h" 35 | #include "netmeterDoc.h" 36 | #include "netmeterView.h" 37 | 38 | UINT MyThreadProc( LPVOID pParam ); 39 | 40 | typedef struct CCapPars 41 | { 42 | CNetmeterView* prg; //CNetmeterView class that launched the capture thread 43 | pcap_t *fp; //libpcap adapter 44 | struct timeval lasttime; //last capture time (internal) 45 | }CCapPars; 46 | -------------------------------------------------------------------------------- /Examples/NETMETER/LineColl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) 3 | * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino, CACE Technologies 16 | * nor the names of its contributors may be used to endorse or promote 17 | * products derived from this software without specific prior written 18 | * permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #if !defined(AFX_LINECOLL_H__EE11D4A3_ED58_11D1_939A_000000000000__INCLUDED_) 35 | #define AFX_LINECOLL_H__EE11D4A3_ED58_11D1_939A_000000000000__INCLUDED_ 36 | 37 | #if _MSC_VER >= 1000 38 | #pragma once 39 | #endif // _MSC_VER >= 1000 40 | 41 | #include 42 | #include 43 | 44 | class LineCollection 45 | { 46 | public: 47 | void clear(); 48 | CString & operator =(CString &); 49 | int GetSize(); 50 | int getLineCount(){return GetSize();}; 51 | const char* line(int i){if (i vect; 59 | }; 60 | 61 | #endif // !defined(AFX_LINECOLL_H__EE11D4A3_ED58_11D1_939A_000000000000__INCLUDED_) 62 | -------------------------------------------------------------------------------- /Examples/NETMETER/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) 3 | * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino, CACE Technologies 16 | * nor the names of its contributors may be used to endorse or promote 17 | * products derived from this software without specific prior written 18 | * permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | // stdafx.cpp : source file that includes just the standard includes 35 | // netmeter.pch will be the pre-compiled header 36 | // stdafx.obj will contain the pre-compiled type information 37 | 38 | #include "stdafx.h" 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Examples/NETMETER/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__3BF6CD25_6C2B_11D3_B76F_0080C8DF82B3__INCLUDED_) 7 | #define AFX_STDAFX_H__3BF6CD25_6C2B_11D3_B76F_0080C8DF82B3__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 14 | 15 | #include // MFC core and standard components 16 | #include // MFC extensions 17 | #include // MFC support for Internet Explorer 4 Common Controls 18 | #ifndef _AFX_NO_AFXCMN_SUPPORT 19 | #include // MFC support for Windows Common Controls 20 | #endif // _AFX_NO_AFXCMN_SUPPORT 21 | 22 | 23 | //{{AFX_INSERT_LOCATION}} 24 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 25 | 26 | #endif // !defined(AFX_STDAFX_H__3BF6CD25_6C2B_11D3_B76F_0080C8DF82B3__INCLUDED_) 27 | -------------------------------------------------------------------------------- /Examples/NETMETER/netmeter.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "netmeter"=.\netmeter.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/NETMETER/res/BMP00001.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/BMP00001.BMP -------------------------------------------------------------------------------- /Examples/NETMETER/res/bitmap1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/bitmap1.bmp -------------------------------------------------------------------------------- /Examples/NETMETER/res/bitmap2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/bitmap2.bmp -------------------------------------------------------------------------------- /Examples/NETMETER/res/cap_wizi.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/cap_wizi.bmp -------------------------------------------------------------------------------- /Examples/NETMETER/res/listbmp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/listbmp.bmp -------------------------------------------------------------------------------- /Examples/NETMETER/res/netmeter.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/netmeter.ico -------------------------------------------------------------------------------- /Examples/NETMETER/res/netmeter.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // NETMETER.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /Examples/NETMETER/res/netmeterDoc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/NETMETER/res/netmeterDoc.ico -------------------------------------------------------------------------------- /Examples/NETMETER/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by netmeter.rc 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define IDR_MAINFRAME 128 7 | #define IDR_NETMETTYPE 129 8 | #define IDB_YELLOW 133 9 | #define IDB_BLUE 134 10 | #define IDB_YELL 135 11 | #define IDB_CAP_WIZ 175 12 | #define IDD_ADAPTER 180 13 | #define IDC_ADAPTER 1000 14 | #define IDC_LIST1 3109 15 | #define seladapter 32771 16 | 17 | // Next default values for new objects 18 | // 19 | #ifdef APSTUDIO_INVOKED 20 | #ifndef APSTUDIO_READONLY_SYMBOLS 21 | #define _APS_NEXT_RESOURCE_VALUE 137 22 | #define _APS_NEXT_COMMAND_VALUE 32772 23 | #define _APS_NEXT_CONTROL_VALUE 1000 24 | #define _APS_NEXT_SYMED_VALUE 101 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /Examples/PacketDriver/readme.txt: -------------------------------------------------------------------------------- 1 | These files use the packet.dll API instead of wpcap.dll. 2 | The use of packet.dll API is strongly discouraged. 3 | -------------------------------------------------------------------------------- /Examples/UDPdump/UDPdump.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "UDPdump"=.\UDPdump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/UserLevelBridge/UserBridge.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "UserBridge"=.\UserBridge.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/iflist/iflist.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "iflist"=.\iflist.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/kdump/kdump.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "kdump"=.\kdump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/kdump/kdump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/Examples/kdump/kdump.exe -------------------------------------------------------------------------------- /Examples/misc/MakeaAll.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "basic_dump"=.\basic_dump.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "basic_dump_ex"=.\basic_dump_ex.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "readfile"=.\readfile.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "readfile_ex"=.\readfile_ex.dsp - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "savedump"=.\savedump.dsp - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | }}} 63 | 64 | ############################################################################### 65 | 66 | Project: "sendpack"=.\sendpack.dsp - Package Owner=<4> 67 | 68 | Package=<5> 69 | {{{ 70 | }}} 71 | 72 | Package=<4> 73 | {{{ 74 | }}} 75 | 76 | ############################################################################### 77 | 78 | Global: 79 | 80 | Package=<5> 81 | {{{ 82 | }}} 83 | 84 | Package=<3> 85 | {{{ 86 | }}} 87 | 88 | ############################################################################### 89 | 90 | -------------------------------------------------------------------------------- /Examples/misc/basic_dump_ex.c: -------------------------------------------------------------------------------- 1 | #include "pcap.h" 2 | 3 | 4 | int main() 5 | { 6 | pcap_if_t *alldevs; 7 | pcap_if_t *d; 8 | int inum; 9 | int i=0; 10 | pcap_t *adhandle; 11 | int res; 12 | char errbuf[PCAP_ERRBUF_SIZE]; 13 | struct tm ltime; 14 | char timestr[16]; 15 | struct pcap_pkthdr *header; 16 | const u_char *pkt_data; 17 | time_t local_tv_sec; 18 | 19 | 20 | /* Retrieve the device list on the local machine */ 21 | if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) 22 | { 23 | fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); 24 | exit(1); 25 | } 26 | 27 | /* Print the list */ 28 | for(d=alldevs; d; d=d->next) 29 | { 30 | printf("%d. %s", ++i, d->name); 31 | if (d->description) 32 | printf(" (%s)\n", d->description); 33 | else 34 | printf(" (No description available)\n"); 35 | } 36 | 37 | if(i==0) 38 | { 39 | printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); 40 | return -1; 41 | } 42 | 43 | printf("Enter the interface number (1-%d):",i); 44 | scanf_s("%d", &inum); 45 | 46 | if(inum < 1 || inum > i) 47 | { 48 | printf("\nInterface number out of range.\n"); 49 | /* Free the device list */ 50 | pcap_freealldevs(alldevs); 51 | return -1; 52 | } 53 | 54 | /* Jump to the selected adapter */ 55 | for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); 56 | 57 | /* Open the device */ 58 | if ( (adhandle= pcap_open(d->name, // name of the device 59 | 65536, // portion of the packet to capture. 60 | // 65536 guarantees that the whole packet will be captured on all the link layers 61 | PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode 62 | 1000, // read timeout 63 | NULL, // authentication on the remote machine 64 | errbuf // error buffer 65 | ) ) == NULL) 66 | { 67 | fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); 68 | /* Free the device list */ 69 | pcap_freealldevs(alldevs); 70 | return -1; 71 | } 72 | 73 | printf("\nlistening on %s...\n", d->description); 74 | 75 | /* At this point, we don't need any more the device list. Free it */ 76 | pcap_freealldevs(alldevs); 77 | 78 | /* Retrieve the packets */ 79 | while((res = pcap_next_ex( adhandle, &header, &pkt_data)) >= 0){ 80 | 81 | if(res == 0) 82 | /* Timeout elapsed */ 83 | continue; 84 | 85 | /* convert the timestamp to readable format */ 86 | local_tv_sec = header->ts.tv_sec; 87 | localtime_s(<ime, &local_tv_sec); 88 | strftime( timestr, sizeof timestr, "%H:%M:%S", <ime); 89 | 90 | printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); 91 | } 92 | 93 | if(res == -1){ 94 | printf("Error reading the packets: %s\n", pcap_geterr(adhandle)); 95 | return -1; 96 | } 97 | 98 | return 0; 99 | } -------------------------------------------------------------------------------- /Examples/misc/readfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LINE_LEN 16 5 | 6 | void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); 7 | 8 | int main(int argc, char **argv) 9 | { 10 | pcap_t *fp; 11 | char errbuf[PCAP_ERRBUF_SIZE]; 12 | char source[PCAP_BUF_SIZE]; 13 | 14 | if(argc != 2){ 15 | 16 | printf("usage: %s filename", argv[0]); 17 | return -1; 18 | 19 | } 20 | 21 | /* Create the source string according to the new WinPcap syntax */ 22 | if ( pcap_createsrcstr( source, // variable that will keep the source string 23 | PCAP_SRC_FILE, // we want to open a file 24 | NULL, // remote host 25 | NULL, // port on the remote host 26 | argv[1], // name of the file we want to open 27 | errbuf // error buffer 28 | ) != 0) 29 | { 30 | fprintf(stderr,"\nError creating a source string\n"); 31 | return -1; 32 | } 33 | 34 | /* Open the capture file */ 35 | if ( (fp= pcap_open(source, // name of the device 36 | 65536, // portion of the packet to capture 37 | // 65536 guarantees that the whole packet will be captured on all the link layers 38 | PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode 39 | 1000, // read timeout 40 | NULL, // authentication on the remote machine 41 | errbuf // error buffer 42 | ) ) == NULL) 43 | { 44 | fprintf(stderr,"\nUnable to open the file %s.\n", source); 45 | return -1; 46 | } 47 | 48 | // read and dispatch packets until EOF is reached 49 | pcap_loop(fp, 0, dispatcher_handler, NULL); 50 | 51 | return 0; 52 | } 53 | 54 | 55 | 56 | void dispatcher_handler(u_char *temp1, 57 | const struct pcap_pkthdr *header, const u_char *pkt_data) 58 | { 59 | u_int i=0; 60 | 61 | /* 62 | * Unused variable 63 | */ 64 | (VOID)temp1; 65 | 66 | /* print pkt timestamp and pkt len */ 67 | printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); 68 | 69 | /* Print the packet */ 70 | for (i=1; (i < header->caplen + 1 ) ; i++) 71 | { 72 | printf("%.2x ", pkt_data[i-1]); 73 | if ( (i % LINE_LEN) == 0) printf("\n"); 74 | } 75 | 76 | printf("\n\n"); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Examples/misc/readfile_ex.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LINE_LEN 16 5 | 6 | int main(int argc, char **argv) 7 | { 8 | pcap_t *fp; 9 | char errbuf[PCAP_ERRBUF_SIZE]; 10 | char source[PCAP_BUF_SIZE]; 11 | struct pcap_pkthdr *header; 12 | const u_char *pkt_data; 13 | u_int i=0; 14 | int res; 15 | 16 | if(argc != 2) 17 | { 18 | printf("usage: %s filename", argv[0]); 19 | return -1; 20 | } 21 | 22 | /* Create the source string according to the new WinPcap syntax */ 23 | if ( pcap_createsrcstr( source, // variable that will keep the source string 24 | PCAP_SRC_FILE, // we want to open a file 25 | NULL, // remote host 26 | NULL, // port on the remote host 27 | argv[1], // name of the file we want to open 28 | errbuf // error buffer 29 | ) != 0) 30 | { 31 | fprintf(stderr,"\nError creating a source string\n"); 32 | return -1; 33 | } 34 | 35 | /* Open the capture file */ 36 | if ( (fp= pcap_open(source, // name of the device 37 | 65536, // portion of the packet to capture 38 | // 65536 guarantees that the whole packet will be captured on all the link layers 39 | PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode 40 | 1000, // read timeout 41 | NULL, // authentication on the remote machine 42 | errbuf // error buffer 43 | ) ) == NULL) 44 | { 45 | fprintf(stderr,"\nUnable to open the file %s.\n", source); 46 | return -1; 47 | } 48 | 49 | /* Retrieve the packets from the file */ 50 | while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) 51 | { 52 | /* print pkt timestamp and pkt len */ 53 | printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); 54 | 55 | /* Print the packet */ 56 | for (i=1; (i < header->caplen + 1 ) ; i++) 57 | { 58 | printf("%.2x ", pkt_data[i-1]); 59 | if ( (i % LINE_LEN) == 0) printf("\n"); 60 | } 61 | 62 | printf("\n\n"); 63 | } 64 | 65 | 66 | if (res == -1) 67 | { 68 | printf("Error reading the packets: %s\n", pcap_geterr(fp)); 69 | } 70 | 71 | return 0; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /Examples/misc/sendpack.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | 7 | void main(int argc, char **argv) 8 | { 9 | pcap_t *fp; 10 | char errbuf[PCAP_ERRBUF_SIZE]; 11 | u_char packet[100]; 12 | int i; 13 | 14 | /* Check the validity of the command line */ 15 | if (argc != 2) 16 | { 17 | printf("usage: %s interface (e.g. 'rpcap://eth0')", argv[0]); 18 | return; 19 | } 20 | 21 | /* Open the output device */ 22 | if ( (fp= pcap_open(argv[1], // name of the device 23 | 100, // portion of the packet to capture (only the first 100 bytes) 24 | PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode 25 | 1000, // read timeout 26 | NULL, // authentication on the remote machine 27 | errbuf // error buffer 28 | ) ) == NULL) 29 | { 30 | fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", argv[1]); 31 | return; 32 | } 33 | 34 | /* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */ 35 | packet[0]=1; 36 | packet[1]=1; 37 | packet[2]=1; 38 | packet[3]=1; 39 | packet[4]=1; 40 | packet[5]=1; 41 | 42 | /* set mac source to 2:2:2:2:2:2 */ 43 | packet[6]=2; 44 | packet[7]=2; 45 | packet[8]=2; 46 | packet[9]=2; 47 | packet[10]=2; 48 | packet[11]=2; 49 | 50 | /* Fill the rest of the packet */ 51 | for(i=12;i<100;i++) 52 | { 53 | packet[i]=(u_char)i; 54 | } 55 | 56 | /* Send down the packet */ 57 | if (pcap_sendpacket(fp, packet, 100 /* size */) != 0) 58 | { 59 | fprintf(stderr,"\nError sending the packet: %s\n", pcap_geterr(fp)); 60 | return; 61 | } 62 | 63 | return; 64 | } 65 | -------------------------------------------------------------------------------- /Examples/pcap_filter/pcap_filter.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pcap_filter"=.\pcap_filter.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/pktdump_ex/pktdump_ex.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "pktdump_ex"=.\pktdump_ex.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/sendcap/sencap.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "sendcap"=.\sendcap.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/smp_1/smp_1.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "smp_1"=.\smp_1.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Examples/tcptop/tcptop.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "tcptop"=.\tcptop.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Packet9x/DLL/Packet.def: -------------------------------------------------------------------------------- 1 | LIBRARY Packet.dll 2 | 3 | DESCRIPTION 'Packet driver dll' 4 | 5 | EXPORTS 6 | PacketLibraryVersion 7 | PacketGetVersion 8 | PacketGetDriverVersion 9 | PacketOpenAdapter 10 | PacketInitPacket 11 | PacketAllocatePacket 12 | PacketSendPacket 13 | PacketResetAdapter 14 | PacketReceivePacket 15 | PacketWaitPacket 16 | PacketCloseAdapter 17 | PacketSetHwFilter 18 | PacketFreePacket 19 | PacketGetAdapterNames 20 | PacketRequest 21 | StartPacketDriver 22 | StopPacketDriver 23 | PacketSetBuff 24 | PacketSetBpf 25 | PacketGetStats 26 | PacketGetStatsEx 27 | PacketGetNetType 28 | PacketSetReadTimeout 29 | PacketSetMode 30 | PacketSetNumWrites 31 | PacketGetNetInfo 32 | PacketGetNetInfoEx 33 | PacketSetMinToCopy 34 | PacketGetReadEvent 35 | PacketSetDumpName 36 | PacketSetDumpLimits 37 | PacketIsDumpEnded 38 | PacketSendPackets 39 | PacketSetSnapLen 40 | PacketSetLoopbackBehavior 41 | PacketGetAirPcapHandle -------------------------------------------------------------------------------- /Packet9x/DLL/Project/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | # OPTFLAGS = -g -DDBG 5 | OPTFLAGS = -O 6 | # I am suspicious of -O2 since it hosed wpcap.dll. To be safe, use -O only 7 | 8 | CFLAGS = -I ../../../common -shared -mno-cygwin ${OPTFLAGS} 9 | LDFLAGS = -Wl,--out-implib,Packet.a 10 | OBJS = ../Packet32.o 11 | LIBS = -lwsock32 12 | 13 | Packet.dll: ${OBJS} 14 | ${CC} ${CFLAGS} ${LDFLAGS} -o Packet.dll ../Packet.def ${OBJS} ${LIBS} 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -o $*.o -c $< 18 | 19 | clean: 20 | rm -f ${OBJS} Packet.a Packet.dll 21 | 22 | install: Packet.dll 23 | cp Packet.dll c:/windows/system 24 | -------------------------------------------------------------------------------- /Packet9x/DLL/Project/Packet.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 5.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Packet"=".\Packet.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Packet9x/DLL/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /Packet9x/DLL/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x17L 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x4L 22 | FILETYPE 0x2L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | VALUE "FileDescription", "packet.dll (9x) Dynamic Link Library" 31 | VALUE "FileVersion", WINPCAP_VER_STRING 32 | VALUE "InternalName", "packet.dll" 33 | VALUE "LegalCopyright", WINPCAP_COPYRIGHT_STRING 34 | VALUE "LegalTrademarks", "" 35 | VALUE "OriginalFilename", "packet.dll" 36 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 37 | VALUE "ProductVersion", WINPCAP_VER_STRING 38 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 39 | END 40 | END 41 | BLOCK "VarFileInfo" 42 | BEGIN 43 | VALUE "Translation", 0x0, 1200 44 | END 45 | END 46 | -------------------------------------------------------------------------------- /Packet9x/VXD/Functs.asm: -------------------------------------------------------------------------------- 1 | .LALL 2 | 3 | ; 4 | ; Copyright (c) 1999, 2000 5 | ; Politecnico di Torino. All rights reserved. 6 | ; 7 | ; Redistribution and use in source and binary forms, with or without 8 | ; modification, are permitted provided that: (1) source code distributions 9 | ; retain the above copyright notice and this paragraph in its entirety, (2) 10 | ; distributions including binary code include the above copyright notice and 11 | ; this paragraph in its entirety in the documentation or other materials 12 | ; provided with the distribution, and (3) all advertising materials mentioning 13 | ; features or use of this software display the following acknowledgement: 14 | ; ``This product includes software developed by the netgroup of Politecnico 15 | ; di Torino, and its contributors.'' Neither the name of 16 | ; the University nor the names of its contributors may be used to endorse 17 | ; or promote products derived from this software without specific prior 18 | ; written permission. 19 | ; THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 20 | ; WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 21 | ; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 22 | ; 23 | 24 | TITLE $PACKET 25 | .386P 26 | INCLUDE VMM.INC 27 | INCLUDE NDIS.INC 28 | INCLUDE NETVXD.INC ; Net VxD initialization oredr 29 | include vtd.inc 30 | 31 | ; the following equate makes the VXD dynamically loadable. 32 | %DEVICE_DYNAMIC EQU 1 33 | 34 | VxD_LOCKED_DATA_SEG 35 | 36 | VxD_LOCKED_DATA_ENDS 37 | 38 | 39 | VxD_LOCKED_CODE_SEG 40 | 41 | 42 | BeginProc _SetReadTimeOut@12, PUBLIC 43 | 44 | push esi 45 | 46 | mov eax, [esp+12] ;number of ms 47 | mov edx, [esp+16] ;data returned to the procedure 48 | mov esi, [esp+8] 49 | VMMcall Set_Global_Time_Out 50 | mov eax, esi 51 | 52 | pop esi 53 | ret 3*4 54 | 55 | _SetReadTimeOut@12 EndP 56 | 57 | 58 | BeginProc _CancelReadTimeOut@0, PUBLIC 59 | 60 | VMMcall Cancel_Time_Out 61 | 62 | ret 63 | 64 | _CancelReadTimeOut@0 EndP 65 | 66 | 67 | BeginProc _QuerySystemTime@0, PUBLIC 68 | 69 | VxdCall VTD_Get_Real_Time 70 | ret 71 | 72 | _QuerySystemTime@0 EndP 73 | 74 | 75 | BeginProc _GetDate@0, PUBLIC 76 | 77 | VxdCall VTD_Get_Date_And_Time 78 | ret 79 | 80 | _GetDate@0 EndP 81 | 82 | VxD_LOCKED_CODE_ENDS 83 | 84 | END 85 | -------------------------------------------------------------------------------- /Packet9x/VXD/MAKEFILE: -------------------------------------------------------------------------------- 1 | ################################################################## 2 | # 3 | # Microsoft Confidential 4 | # Copyright (C) Microsoft Corporation 1993-95 5 | # All Rights Reserved. 6 | # 7 | # This document is provided for informational purposes only and Microsoft 8 | # Corporation makes no warranties, either expressed or implied, in this document. 9 | # Information in this document may be substantially changed without notice in 10 | # subsequent versions of windows and does not represent a commitment on the 11 | # part of Microsoft Corporation. This information is for internal use only for 12 | # development purposes. 13 | # 14 | # INPUT: 15 | # BIN: Where to put the stuff 16 | # DEB: Flags to control debug level 17 | # 18 | ################################################################## 19 | 20 | DEVICE=NPF 21 | 22 | BIN = debug 23 | #SDK = $(SDKROOT) 24 | #DDK = $(DDKROOT) 25 | 26 | OBJS=\ 27 | $(BIN)\openclos.obj\ 28 | $(BIN)\packet.obj\ 29 | $(BIN)\request.obj\ 30 | $(BIN)\win_bpf_filter.obj\ 31 | $(BIN)\read.obj\ 32 | $(BIN)\write.obj\ 33 | $(BIN)\lock.obj\ 34 | $(BIN)\functs.obj\ 35 | $(BIN)\ndisdev.obj\ 36 | # this is needed by 64 bit math operations 37 | $(MSVCDIR)\lib\msvcrt.lib\ 38 | 39 | !include ndis.mk 40 | -------------------------------------------------------------------------------- /Packet9x/VXD/NPF.def: -------------------------------------------------------------------------------- 1 | 2 | VXD NPF DYNAMIC 3 | DESCRIPTION 'winpcap packet driver' 4 | 5 | SEGMENTS 6 | _LPTEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE 7 | _LTEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE 8 | _LDATA CLASS 'LCODE' PRELOAD NONDISCARDABLE 9 | _TEXT CLASS 'LCODE' PRELOAD NONDISCARDABLE 10 | _DATA CLASS 'LCODE' PRELOAD NONDISCARDABLE 11 | CONST CLASS 'LCODE' PRELOAD NONDISCARDABLE 12 | _TLS CLASS 'LCODE' PRELOAD NONDISCARDABLE 13 | _BSS CLASS 'LCODE' PRELOAD NONDISCARDABLE 14 | _MSGTABLE CLASS 'MCODE' PRELOAD NONDISCARDABLE IOPL 15 | _MSGDATA CLASS 'MCODE' PRELOAD NONDISCARDABLE IOPL 16 | _IMSGTABLE CLASS 'MCODE' PRELOAD DISCARDABLE IOPL 17 | _IMSGDATA CLASS 'MCODE' PRELOAD DISCARDABLE IOPL 18 | _ITEXT CLASS 'ICODE' DISCARDABLE 19 | _IDATA CLASS 'ICODE' DISCARDABLE 20 | _PTEXT CLASS 'PCODE' NONDISCARDABLE 21 | _PDATA CLASS 'PDATA' NONDISCARDABLE SHARED 22 | _STEXT CLASS 'SCODE' RESIDENT 23 | _SDATA CLASS 'SCODE' RESIDENT 24 | _DBOCODE CLASS 'DBOCODE' PRELOAD NONDISCARDABLE CONFORMING 25 | _DBODATA CLASS 'DBOCODE' PRELOAD NONDISCARDABLE CONFORMING 26 | _16ICODE CLASS '16ICODE' PRELOAD DISCARDABLE 27 | _RCODE CLASS 'RCODE' 28 | 29 | EXPORTS 30 | 31 | NPF_DDB @1 32 | -------------------------------------------------------------------------------- /Packet9x/VXD/NPF.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #define Not_VxD 3 | #include 4 | #include 5 | 6 | /*-----------------------------------------------*/ 7 | /* the following lines are specific to this file */ 8 | /*-----------------------------------------------*/ 9 | 10 | /* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR 11 | * and VER_INTERNALNAME_STR must be defined before including COMMON.VER 12 | * The strings don't need a '\0', since common.ver has them. 13 | */ 14 | 15 | 16 | #define VER_FILEVERSION 1,00,00,000 17 | #define VER_PRODUCTVERSION 1,00,00,000 18 | 19 | #define VER_FILEFLAGSMASK 0x3fL 20 | #ifdef _DEBUG 21 | #define VER_FILEFLAGS 0x1L 22 | #else 23 | #define VER_FILEFLAGS 0x0L 24 | #endif 25 | 26 | #define VER_FILEOS VOS_DOS_WINDOWS32 27 | #define VER_FILETYPE VFT_VXD 28 | #define VER_FILESUBTYPE UNDEFINED_DEVICE_ID //VFT2_UNKNOWN 29 | 30 | 31 | #define VER_FILEDESCRIPTION_STR "WinPcap NPF Packet Driver for Win95/98" 32 | #define VER_INTERNALNAME_STR "NPF" 33 | #define VER_PRODUCTNAME_STR "NPF Driver" 34 | #define VER_LEGALCOPYRIGHT_YEARS "1999-2002" 35 | #define VER_LEGALCOPYRIGHT_STR "Copyright \251 NetGroup, Politecnico di Torino " VER_LEGALCOPYRIGHT_YEARS 36 | #define VER_COMPANYNAME_STR "Politecnico di Torino" 37 | #define VER_ORIGINALFILENAME_STR "npf.Vxd" 38 | 39 | #define VER_PRODUCTVERSION_STR "1.00" 40 | #define VER_FILEVERSION_STR "1.00" 41 | 42 | 43 | #include 44 | -------------------------------------------------------------------------------- /Packet9x/VXD/Ndisdev.asm: -------------------------------------------------------------------------------- 1 | .LALL 2 | ;***************************************************************************** 3 | ; 4 | ; (C) Copyright MICROSOFT Corp, 1995 5 | ; 6 | ; Title: NDISDEV.ASM sourced from: 7 | ; Title: NDISLNK.ASM - Assembly linkage to NDIS Wrapper for MACs 8 | ; and Protocols 9 | ; 10 | ; This document is provided for informational purposes only and Microsoft 11 | ; Corporation makes no warranties, either expressed or implied, in this document. 12 | ; Information in this document may be substantially changed without notice in 13 | ; subsequent versions of windows and does not represent a commitment on the 14 | ; part of Microsoft Corporation. This information is for internal use only for 15 | ; development purposes. 16 | ; 17 | ; Version: 3.00 18 | ; 19 | ; Date: 05-Nov-1991 20 | ; 21 | ;============================================================================= 22 | TITLE $PACKET 23 | .386P 24 | INCLUDE VMM.INC 25 | INCLUDE NDIS.INC 26 | INCLUDE NETVXD.INC ; Net VxD initialization oredr 27 | include vtd.inc 28 | 29 | 30 | ; the following equate makes the VXD dynamically loadable. 31 | %DEVICE_DYNAMIC EQU 1 32 | DECLARE_VIRTUAL_DEVICE %DEVICE, 3, 10, <%DEVICE>_Control, Undefined_Device_Id, PROTOCOL_Init_Order 33 | VxD_LOCKED_DATA_SEG 34 | Public bInitAlready 35 | bInitAlready DB 0 36 | 37 | VxD_LOCKED_DATA_ENDS 38 | VxD_LOCKED_CODE_SEG 39 | BeginProc C_Device_Init 40 | IFDEF NDIS_STDCALL 41 | extern _DriverEntry@8:NEAR 42 | ELSE 43 | extern _DriverEntry:NEAR 44 | ENDIF 45 | mov al, bInitAlready 46 | cmp al, 0 ; Make sure we' haven't been called already. 47 | jnz Succeed_Init_Phase 48 | inc bInitAlready ; Set the "Called Already" Flag 49 | ; Make sure the wrapper (Ndis.386) is loaded 50 | VxDcall NdisGetVersion 51 | jc Fail_Init_Phase 52 | push 0 53 | push 0 54 | IFDEF NDIS_STDCALL 55 | call _DriverEntry@8 56 | ELSE 57 | call _DriverEntry 58 | add esp,8 59 | ENDIF 60 | cmp eax, NDIS_STATUS_SUCCESS 61 | jne Fail_Init_Phase 62 | Succeed_Init_Phase: 63 | clc 64 | ret 65 | Fail_Init_Phase: 66 | stc 67 | ret 68 | EndProc C_Device_Init 69 | 70 | 71 | Begin_Control_Dispatch %DEVICE 72 | Control_Dispatch Sys_Dynamic_Device_Init, C_Device_Init 73 | Control_Dispatch W32_DEVICEIOCONTROL, PacketIOControl, sCall, 74 | IFDEF DEBUG 75 | Control_Dispatch DEBUG_QUERY, PacketDebugQuery, sCall 76 | ENDIF 77 | End_Control_Dispatch %DEVICE 78 | VxD_LOCKED_CODE_ENDS 79 | END 80 | -------------------------------------------------------------------------------- /Packet9x/VXD/Ntddpack.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __NTDDPACKET 3 | #define __NTDDPACKET 1 4 | #include "devioctl.h" 5 | /*#include */ 6 | struct _PACKET_OID_DATA { 7 | ULONG Oid; 8 | ULONG Length; 9 | UCHAR Data[1]; 10 | }; 11 | 12 | typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA; 13 | 14 | /*#include */ 15 | #define FILE_DEVICE_PROTOCOL 0x8000 16 | #define IOCTL_PROTOCOL_QUERY_OID CTL_CODE(FILE_DEVICE_PROTOCOL, 0 , METHOD_BUFFERED, FILE_ANY_ACCESS) 17 | #define IOCTL_PROTOCOL_SET_OID CTL_CODE(FILE_DEVICE_PROTOCOL, 1 , METHOD_BUFFERED, FILE_ANY_ACCESS) 18 | #define IOCTL_PROTOCOL_STATISTICS CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS) 19 | #define IOCTL_PROTOCOL_RESET CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS) 20 | #define IOCTL_PROTOCOL_READ CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS) 21 | #define IOCTL_PROTOCOL_WRITE CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS) 22 | #define IOCTL_PROTOCOL_MACNAME CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS) 23 | #define IOCTL_OPEN CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS) 24 | #define IOCTL_CLOSE CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS) 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Packet9x/VXD/Vpacket.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #define Not_VxD 3 | #include 4 | #include 5 | 6 | /*-----------------------------------------------*/ 7 | /* the following lines are specific to this file */ 8 | /*-----------------------------------------------*/ 9 | 10 | /* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR 11 | * and VER_INTERNALNAME_STR must be defined before including COMMON.VER 12 | * The strings don't need a '\0', since common.ver has them. 13 | */ 14 | 15 | 16 | #define VER_FILEVERSION 1,00,00,000 17 | #define VER_PRODUCTVERSION 1,00,00,000 18 | 19 | #define VER_FILEFLAGSMASK 0x3fL 20 | #ifdef _DEBUG 21 | #define VER_FILEFLAGS 0x1L 22 | #else 23 | #define VER_FILEFLAGS 0x0L 24 | #endif 25 | 26 | #define VER_FILEOS VOS_DOS_WINDOWS32 27 | #define VER_FILETYPE VFT_VXD 28 | #define VER_FILESUBTYPE UNDEFINED_DEVICE_ID //VFT2_UNKNOWN 29 | 30 | 31 | #define VER_FILEDESCRIPTION_STR "NDIS Packet Capture Driver for Win95/98" 32 | #define VER_INTERNALNAME_STR "VPacket" 33 | #define VER_PRODUCTNAME_STR "Vpacket Virtual Device Driver" 34 | #define VER_LEGALCOPYRIGHT_YEARS "1997-1998-1999" 35 | #define VER_LEGALCOPYRIGHT_STR "Copyright \251 NetGroup, Politecnico di Torino " VER_LEGALCOPYRIGHT_YEARS 36 | #define VER_COMPANYNAME_STR "Politecnico di Torino" 37 | #define VER_ORIGINALFILENAME_STR "VPacket.Vxd" 38 | 39 | #define VER_PRODUCTVERSION_STR "1.00" 40 | #define VER_FILEVERSION_STR "1.00" 41 | 42 | 43 | #include 44 | -------------------------------------------------------------------------------- /build_wpdpack.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if "%2"== "" ( rd /s/q ./wpdpack 2>nul >nul) else ( rd /s /q "%2" 2>nul >nul) 4 | 5 | call create_include.bat %1 %2 6 | PAUSE 7 | call create_lib.bat %1 %2 8 | PAUSE 9 | call create_examples.bat %1 %2 10 | PAUSE 11 | call create_docs.bat %1 %2 12 | 13 | 14 | -------------------------------------------------------------------------------- /build_wpdpack.txt: -------------------------------------------------------------------------------- 1 | In order to build the developers' pack, you need to compile the various DLLs and then call build_wpdpack.bat 2 | This batch file, in turn, calls the four batches 3 | - create_includes.bat creates the include folder 4 | - create_lib.bat creates the lib folder 5 | - create_examples.bat copies the examples folder to the developers' pack. The examples can be compiled only under the developers' pack folder. 6 | - create_docs.bat creates the documentation (via doxygen), and then copies the generated files under the developers' pack folder. 7 | 8 | The syntax for the various scripts is 9 | 10 | winpcap_folder developer_folder 11 | 12 | winpcap_folder The winpcap sources folder. It is defaulted to .\ 13 | developer_folder The developers' pack folder. It is defaulted to .\wpdpack. 14 | 15 | HINT: just call build_wpdpack.bat without any parameter! 16 | 17 | -------------------------------------------------------------------------------- /create_docs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF "%2"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%2) 4 | 5 | IF ""=="%1" (set WINPCAPSOURCEDIR=.\) ELSE (set WINPCAPSOURCEDIR=%1) 6 | 7 | echo Creating \docs folder 8 | mkdir %WPDPACKDESTDIR% >nul 2>nul 9 | mkdir %WPDPACKDESTDIR%\docs >nul 2>nul 10 | mkdir %WPDPACKDESTDIR%\docs\html >nul 2>nul 11 | 12 | pushd %WINPCAPSOURCEDIR%\dox\prj 13 | 14 | echo - Deleting existing WinPcap documentation 15 | del /q docs\*.* 2> nul > nul 16 | echo - Creating new documentation 17 | doxygen winpcap_noc.dox >nul 18 | echo - Copying all gif files 19 | xcopy ..\pics\*.gif docs\. /v /y /q >nul 20 | xcopy ..\*.gif docs\. /v /y /q >nul 21 | 22 | popd 23 | 24 | xcopy /v /Y %WINPCAPSOURCEDIR%\dox\WinPcap_docs.html %WPDPACKDESTDIR%\docs\ >nul 25 | xcopy /v /Y %WINPCAPSOURCEDIR%\dox\prj\docs\*.* %WPDPACKDESTDIR%\docs\html\ >nul 26 | xcopy /v /Y %WINPCAPSOURCEDIR%\dox\*.gif %WPDPACKDESTDIR%\docs\html\ >nul 27 | xcopy /v /Y %WINPCAPSOURCEDIR%\dox\pics\*.gif %WPDPACKDESTDIR%\docs\html\ >nul 28 | echo Folder \docs created successfully 29 | set WPDPACKDESTDIR= 30 | set WINPCAPSOURCEDIR= 31 | -------------------------------------------------------------------------------- /create_examples.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF "%2"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%2) 4 | 5 | IF ""=="%1" (set WINPCAPSOURCEDIR=.\) ELSE (set WINPCAPSOURCEDIR=%1) 6 | 7 | echo Creating \Examples folder 8 | mkdir %WPDPACKDESTDIR% >nul 2>nul 9 | mkdir %WPDPACKDESTDIR%\Examples-pcap >nul 2>nul 10 | mkdir %WPDPACKDESTDIR%\Examples-remote >nul 2>nul 11 | 12 | xcopy /s/e/v /Y %WINPCAPSOURCEDIR%\Examples %WPDPACKDESTDIR%\Examples-remote >nul 13 | 14 | rem *** Delete Netmeter since it's no more part of the Developer's pack *** 15 | rd /S /Q %WPDPACKDESTDIR%\Examples-remote\NetMeter\ 16 | 17 | rem *** Delete kdump since the feature is not available at the moment *** 18 | rd /S /Q %WPDPACKDESTDIR%\Examples-remote\kdump\ 19 | 20 | xcopy /s/e/v /Y %WINPCAPSOURCEDIR%\Examples-pcap %WPDPACKDESTDIR%\Examples-pcap >nul 21 | 22 | rem *** Delete WinPcapStress, since it's not a real example *** 23 | rd /S /Q %WPDPACKDESTDIR%\Examples-pcap\winpcap_stress 24 | 25 | rem *** Delete stats, since it's not a real example *** 26 | rd /S /Q %WPDPACKDESTDIR%\Examples-pcap\stats 27 | 28 | 29 | echo Folder \Examples created successfully 30 | set WPDPACKDESTDIR= 31 | set WINPCAPSOURCEDIR= 32 | 33 | echo ******************************************************************** 34 | echo * * 35 | echo * Now you can build the examples from the developers' pack folder! * 36 | echo * * 37 | echo ******************************************************************** 38 | -------------------------------------------------------------------------------- /create_include.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF "%2"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%2) 4 | 5 | IF ""=="%1" (set WINPCAPSOURCEDIR=.\) ELSE (set WINPCAPSOURCEDIR=%1) 6 | 7 | echo Creating \Include folder 8 | mkdir %WPDPACKDESTDIR% 2>nul >nul 9 | mkdir %WPDPACKDESTDIR%\Include 2>nul >nul 10 | mkdir %WPDPACKDESTDIR%\Include\pcap 2>nul >nul 11 | 12 | 13 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap\*.h %WPDPACKDESTDIR%\Include\pcap\ >nul 14 | 15 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap.h %WPDPACKDESTDIR%\Include\ >nul 16 | rem xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-int.h %WPDPACKDESTDIR%\Include\ >nul 17 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-bpf.h %WPDPACKDESTDIR%\Include\ >nul 18 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-namedb.h %WPDPACKDESTDIR%\Include\ >nul 19 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\remote-ext.h %WPDPACKDESTDIR%\Include\ >nul 20 | 21 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\pcap-stdinc.h %WPDPACKDESTDIR%\Include\ >nul 22 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\Win32-Extensions\Win32-Extensions.h %WPDPACKDESTDIR%\Include\ >nul 23 | 24 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\Win32\Include\bittypes.h %WPDPACKDESTDIR%\Include\ >nul 25 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\Win32\Include\ip6_misc.h %WPDPACKDESTDIR%\Include\ >nul 26 | 27 | rem xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\libpcap\Win32\Include\Gnuc.h %WPDPACKDESTDIR%\Include\ >nul 28 | 29 | 30 | IF "%HAVE_BUGGY_TME_SUPPORT%"=="" ( goto skip_tme ) 31 | 32 | rem TME stuff 33 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\bucket_lookup.h %WPDPACKDESTDIR%\Include\ >nul 34 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\count_packets.h %WPDPACKDESTDIR%\Include\ >nul 35 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\memory_t.h %WPDPACKDESTDIR%\Include\ >nul 36 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\normal_lookup.h %WPDPACKDESTDIR%\Include\ >nul 37 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\tcp_session.h %WPDPACKDESTDIR%\Include\ >nul 38 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\time_calls.h %WPDPACKDESTDIR%\Include\ >nul 39 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\driver\tme.h %WPDPACKDESTDIR%\Include\ >nul 40 | 41 | :skip_tme 42 | 43 | xcopy /v /Y %WINPCAPSOURCEDIR%\Common\Packet32.h %WPDPACKDESTDIR%\Include\ >nul 44 | 45 | echo Folder \Include created successfully 46 | set WPDPACKDESTDIR= 47 | set WINPCAPSOURCEDIR= 48 | -------------------------------------------------------------------------------- /create_lib.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF "%2"=="" (set WPDPACKDESTDIR=.\WpdPack\) ELSE (set WPDPACKDESTDIR=%2) 4 | 5 | IF ""=="%1" (set WINPCAPSOURCEDIR=.\) ELSE (set WINPCAPSOURCEDIR=%1) 6 | 7 | echo Creating \Lib folder 8 | mkdir %WPDPACKDESTDIR% >nul 2>nul 9 | mkdir %WPDPACKDESTDIR%\Lib >nul 2>nul 10 | mkdir %WPDPACKDESTDIR%\Lib\x64 >nul 2>nul 11 | 12 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\PRJ\Release\x86\wpcap.lib %WPDPACKDESTDIR%\Lib\ >nul 13 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\PRJ\Release\x64\wpcap.lib %WPDPACKDESTDIR%\Lib\x64 >nul 14 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\Dll\Project\Release\x86\packet.lib %WPDPACKDESTDIR%\Lib\ >nul 15 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\Dll\Project\Release\x64\packet.lib %WPDPACKDESTDIR%\Lib\x64 >nul 16 | xcopy /v /Y %WINPCAPSOURCEDIR%\packetNtx\Dll\Project\libpacket.a %WPDPACKDESTDIR%\Lib\ >nul 17 | xcopy /v /Y %WINPCAPSOURCEDIR%\wpcap\LIB\libwpcap.a %WPDPACKDESTDIR%\Lib\ >nul 18 | 19 | echo Folder \Lib created successfully 20 | 21 | set WPDPACKDESTDIR= 22 | set WINPCAPSOURCEDIR= 23 | 24 | -------------------------------------------------------------------------------- /create_web.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if "%1"=="" ( 4 | echo You must specify the version string as parameter 5 | goto end 6 | ) 7 | 8 | echo Creating \web folder 9 | mkdir .\web >nul 2>nul 10 | mkdir .\web\install >nul 2>nul 11 | mkdir .\web\install\bin >nul 2>nul 12 | mkdir .\web\install\bin\debug >nul 2>nul 13 | mkdir .\web\install\bin\debug\nt4_%1 >nul 2>nul 14 | mkdir .\web\install\bin\debug\nt4_%1\x86 >nul 2>nul 15 | mkdir .\web\install\bin\debug\nt5x_%1 >nul 2>nul 16 | mkdir .\web\install\bin\debug\nt5x_%1\x86 >nul 2>nul 17 | mkdir .\web\install\bin\debug\nt5x_%1\x64 >nul 2>nul 18 | mkdir .\web\install\bin\debug\nt6_%1 >nul 2>nul 19 | mkdir .\web\install\bin\debug\nt6_%1\x86 >nul 2>nul 20 | mkdir .\web\install\bin\debug\nt6_%1\x64 >nul 2>nul 21 | mkdir .\web\docs >nul 2>nul 22 | mkdir .\web\docs\docs_%1 >nul 2>nul 23 | 24 | 25 | rem 26 | rem debug DLLs 27 | rem 28 | xcopy /v /y ".\packetntx\dll\project\release LOG_TO_FILE\x86\packet.dll" .\web\install\bin\debug\nt5x_%1\x86 >nul 29 | xcopy /v /y ".\packetntx\dll\project\release LOG_TO_FILE\x64\packet.dll" .\web\install\bin\debug\nt5x_%1\x64 >nul 30 | xcopy /v /y ".\packetntx\dll\project\release No NetMon LOG_TO_FILE\x86\packet.dll" .\web\install\bin\debug\nt6_%1\x86 >nul 31 | xcopy /v /y ".\packetntx\dll\project\release No NetMon LOG_TO_FILE\x64\packet.dll" .\web\install\bin\debug\nt6_%1\x64 >nul 32 | xcopy /v /y ".\packetNtx\Dll\Project\Release NT4 LOG_TO_FILE\x86\packet.dll" .\web\install\bin\debug\nt4_%1\x86 >nul 33 | 34 | rem 35 | rem docs 36 | rem 37 | xcopy /s /e /v /y ".\wpdpack\docs\*.*" .\web\docs\docs_%1\ >nul 38 | 39 | :end -------------------------------------------------------------------------------- /dox/WinPcap_docs.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dox/doxygen_groups.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | \defgroup internals WinPcap internals 3 | \htmlinclude internals.htm 4 | */ 5 | 6 | /*! 7 | \ingroup internals 8 | \defgroup NPF NPF driver internals manual 9 | \htmlinclude npf.htm 10 | */ 11 | 12 | 13 | 14 | /*! 15 | \ingroup internals 16 | \defgroup compilation How to compile WinPcap 17 | \htmlinclude compile.htm 18 | */ 19 | 20 | 21 | 22 | /*! 23 | \ingroup internals 24 | \defgroup packetapi Packet.dll -- Packet Driver API 25 | \htmlinclude packet.htm 26 | */ 27 | 28 | /*! 29 | \defgroup wpcap WinPcap user's manual 30 | \htmlinclude wpcap.htm 31 | */ 32 | 33 | /*! 34 | \ingroup wpcap 35 | \defgroup language Filtering expression syntax 36 | \htmlinclude language.htm 37 | */ 38 | 39 | 40 | /*! 41 | \ingroup wpcap 42 | \defgroup wpcapsamps Using WinPcap in your programs 43 | \htmlinclude wpcap_samp.htm 44 | 45 | \htmlinclude wpcap_samp1.htm 46 | \include pktdump_ex\pktdump_ex.c 47 | 48 | \htmlinclude wpcap_samp2.htm 49 | \include pcap_filter/pcap_filter.c 50 | */ 51 | 52 | 53 | 54 | 55 | 56 | /*! 57 | \defgroup remote Remote Capture 58 | \htmlinclude wpcap_remote.htm 59 | */ 60 | 61 | /*! 62 | \ingroup remote 63 | \defgroup remote_struct Exported Structures and Definitions 64 | */ 65 | 66 | /*! 67 | \ingroup remote 68 | \defgroup remotefunc Exported Functions 69 | */ 70 | 71 | /*! 72 | \ingroup remote 73 | \defgroup remote_pri_func Internal Functions 74 | */ 75 | 76 | /*! 77 | \ingroup remote 78 | \defgroup remote_pri_struct Internal Structures and Definitions 79 | */ 80 | 81 | 82 | /*! 83 | \ingroup remote_struct 84 | \defgroup remote_source_string Strings related to the new source syntax 85 | */ 86 | 87 | /*! 88 | \ingroup remote_struct 89 | \defgroup remote_source_ID Identifiers related to the new source syntax 90 | */ 91 | 92 | /*! 93 | \ingroup remote_struct 94 | \defgroup remote_open_flags Flags defined in the pcap_open() function 95 | */ 96 | 97 | /*! 98 | \ingroup remote_struct 99 | \defgroup remote_samp_methods Sampling methods defined in the pcap_setsampling() function 100 | */ 101 | 102 | /*! 103 | \ingroup remote_struct 104 | \defgroup remote_auth_methods Authentication methods supported by the RPCAP protocol 105 | */ 106 | -------------------------------------------------------------------------------- /dox/doxygen_groups_packetdll.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | \defgroup internals WinPcap internals 3 | \htmlinclude internals.htm 4 | */ 5 | 6 | /*! 7 | \ingroup internals 8 | \defgroup NPF NPF driver internals manual 9 | \htmlinclude npf.htm 10 | */ 11 | 12 | 13 | 14 | /*! 15 | \ingroup internals 16 | \defgroup compilation How to compile WinPcap 17 | \htmlinclude compile.htm 18 | */ 19 | 20 | 21 | 22 | /*! 23 | \ingroup internals 24 | \defgroup packetapi Packet Driver API developer's manual 25 | \htmlinclude packet.htm 26 | */ 27 | 28 | 29 | /*! 30 | \ingroup packetapi 31 | \defgroup packetsamps Packet.dll samples 32 | \htmlinclude packet_samp.htm 33 | */ 34 | 35 | 36 | 37 | /*! 38 | \defgroup wpcap WinPcap user's manual 39 | \htmlinclude wpcap.htm 40 | */ 41 | 42 | /*! 43 | \ingroup wpcap 44 | \defgroup language Filtering expression syntax 45 | \htmlinclude language.htm 46 | */ 47 | 48 | 49 | /*! 50 | \ingroup wpcap 51 | \defgroup wpcapsamps Using WinPcap in your programs 52 | \htmlinclude wpcap_samp.htm 53 | 54 | \htmlinclude wpcap_samp1.htm 55 | \include pktdump_ex\pktdump_ex.c 56 | 57 | \htmlinclude wpcap_samp2.htm 58 | \include pcap_filter/pcap_filter.c 59 | */ 60 | 61 | 62 | 63 | 64 | 65 | /*! 66 | \defgroup remote Remote Capture 67 | \htmlinclude wpcap_remote.htm 68 | */ 69 | 70 | /*! 71 | \ingroup remote 72 | \defgroup remote_struct Exported Structures and Definitions 73 | */ 74 | 75 | /*! 76 | \ingroup remote 77 | \defgroup remotefunc Exported Functions 78 | */ 79 | 80 | /*! 81 | \ingroup remote 82 | \defgroup remote_pri_func Internal Functions 83 | */ 84 | 85 | /*! 86 | \ingroup remote 87 | \defgroup remote_pri_struct Internal Structures and Definitions 88 | */ 89 | 90 | 91 | /*! 92 | \ingroup remote_struct 93 | \defgroup remote_source_string Strings related to the new source syntax 94 | */ 95 | 96 | /*! 97 | \ingroup remote_struct 98 | \defgroup remote_source_ID Identifiers related to the new source syntax 99 | */ 100 | 101 | /*! 102 | \ingroup remote_struct 103 | \defgroup remote_open_flags Flags defined in the pcap_open() function 104 | */ 105 | 106 | /*! 107 | \ingroup remote_struct 108 | \defgroup remote_samp_methods Sampling methods defined in the pcap_setsampling() function 109 | */ 110 | 111 | /*! 112 | \ingroup remote_struct 113 | \defgroup remote_auth_methods Authentication methods supported by the RPCAP protocol 114 | */ 115 | -------------------------------------------------------------------------------- /dox/footer.htm: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2010 5 | CACE Technologies. Copyright (c) 2010-2013 6 | Riverbed Technology. All rights reserved.

7 | -------------------------------------------------------------------------------- /dox/internals-arch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/internals-arch.gif -------------------------------------------------------------------------------- /dox/libpcap/incs/pcap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/libpcap/incs/pcap.h -------------------------------------------------------------------------------- /dox/main.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | \mainpage WinPcap Documentation 4 | 5 | \image html winpcap.gif 6 | 7 | \htmlonly 8 | 9 |
10 |
Authors:
11 |
The WinPcap Team
12 |
Home page:
13 |
http://www.winpcap.org
14 |
15 |
16 | 17 |

Modules

18 | 19 | \endhtmlonly 20 | 21 | - \ref wpcap 22 | - \ref wpcap_def 23 | - \ref wpcapfunc 24 | - \ref language 25 | - \ref wpcapsamps 26 | - \ref wpcap_tut 27 | - \ref wpcap_tut1 28 | - \ref wpcap_tut2 29 | - \ref wpcap_tut3 30 | - \ref wpcap_tut4 31 | - \ref wpcap_tut5 32 | - \ref wpcap_tut6 33 | - \ref wpcap_tut7 34 | - \ref wpcap_tut8 35 | - \ref wpcap_tut9 36 | - \ref internals 37 | - \ref NPF 38 | - \ref NPF_include 39 | - \ref NPF_code 40 | - \ref packetapi 41 | - \ref compilation 42 | - \ref remote 43 | - \ref remote_struct 44 | - Exported Functions. For a reference of the functions that support remote capture, see the "Windows-specific Extensions" in the WinPcap \ref wpcapfunc section. 45 | - \ref remote_pri_struct 46 | 47 | \htmlinclude intro.htm 48 | 49 | 50 | */ 51 | 52 | -------------------------------------------------------------------------------- /dox/main_packetdll.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | \mainpage WinPcap Documentation 4 | 5 | \image html winpcap.gif 6 | 7 | \htmlonly 8 | 9 |
10 |
Authors:
11 |
The WinPcap Team
12 |
Home page:
13 |
http://www.winpcap.org
14 |
15 |
16 | 17 |

Modules

18 | 19 | \endhtmlonly 20 | 21 | - \ref wpcap 22 | - \ref wpcap_def 23 | - \ref wpcapfunc 24 | - \ref language 25 | - \ref wpcapsamps 26 | - \ref wpcap_tut 27 | - \ref wpcap_tut1 28 | - \ref wpcap_tut2 29 | - \ref wpcap_tut3 30 | - \ref wpcap_tut4 31 | - \ref wpcap_tut5 32 | - \ref wpcap_tut6 33 | - \ref wpcap_tut7 34 | - \ref wpcap_tut8 35 | - \ref wpcap_tut9 36 | - \ref internals 37 | - \ref NPF 38 | - \ref NPF_include 39 | - \ref NPF_code 40 | - \ref packetapi 41 | - \ref packet32h 42 | - \ref packet32 43 | - \ref packetsamps 44 | - \ref compilation 45 | - \ref remote 46 | - \ref remote_struct 47 | - \ref remotefunc 48 | - \ref remote_pri_struct 49 | - \ref remote_pri_struct 50 | 51 | \htmlinclude intro.htm 52 | 53 | 54 | */ 55 | 56 | -------------------------------------------------------------------------------- /dox/note.txt: -------------------------------------------------------------------------------- 1 | per far linkare correttamente gli esempi di libpcap: 2 | - editare il file funcs\pcap.h 3 | - cambiare il blocco a inizio file: 4 | /** @defgroup wpcapfunc Exported functions 5 | * @ingroup wpcap 6 | * Functions exported by wpcap.dll 7 | * @{ 8 | */ 9 | 10 | in 11 | 12 | /** @ingroup wpcapfunc 13 | * @{ 14 | */ 15 | - generare la documentazione 16 | - salvare il file "funcs_2pcap_8h.html" 17 | - rimettere tutto a posto 18 | - rigenerare la documentazione 19 | - sovrascrivere il file salvato su quello nuovo 20 | 21 | per far si' che gli esempi puntino al manuale in maniera corretta: 22 | - generare la documentazione winpcap_noc.dox 23 | - backuppare i vari group__wpcap__tutXXX.html, pcap__filter_8c-source.html, Pktdump_8c-source.html, group__wpcapsampsXXX.html 24 | - generare la documentazione winpcap_c.dox 25 | - copiare i file backuppati sui nuovi 26 | 27 | l'immagine nella pagina principale e' da mettere: al centro -------------------------------------------------------------------------------- /dox/npf-dump.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/npf-dump.gif -------------------------------------------------------------------------------- /dox/npf-ndis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/npf-ndis.gif -------------------------------------------------------------------------------- /dox/npf-npf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/npf-npf.gif -------------------------------------------------------------------------------- /dox/npf.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/npf.htm -------------------------------------------------------------------------------- /dox/pics/dump.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/dump.gif -------------------------------------------------------------------------------- /dox/pics/encoding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/encoding.gif -------------------------------------------------------------------------------- /dox/pics/stats.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/stats.gif -------------------------------------------------------------------------------- /dox/pics/stats_wpcap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/stats_wpcap.gif -------------------------------------------------------------------------------- /dox/pics/winpcap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/winpcap.gif -------------------------------------------------------------------------------- /dox/pics/winpcap_small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/pics/winpcap_small.gif -------------------------------------------------------------------------------- /dox/slides.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/dox/slides.ppt -------------------------------------------------------------------------------- /dox/wpcap.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

This section contains the user manual of wpcap.dll, the 12 | dynamic library that contains the public WinPcap API. 13 | wpcap.dll exports a set of 14 | system-independent functions for packet capture and network analysis. These 15 | functions can be used to:

16 |
    17 |
  • obtain the list of the available network adapters 18 |
  • retrieve various information about an adapter, like the description and the list of addresses
  • 19 |
  • sniff the packets using one of the network interface cards of the PC
  • 20 |
  • send packets to the network 21 |
  • efficiently save packets to disk and load them with an interface similar to the one of 22 | live capture
  • 23 |
  • create packet filters using a high level language and apply them to the captured 24 | packets
  • 25 |
26 |

wpcap.dll is compatible with libpcap, the well known packet capture library 27 | for Unix. This compatibility means that one can develop portable network tools 28 | that will run on the Win32 OS family and on all of the major Unix flavors.

29 |

Several portions of the manual present in this section derive directly from the man pages of tcpdump and libpcap, maintained by the tcpdump.org developers. Therefore, if you 30 | are looking for updated docs, you can consult the web site www.tcpdump.org.

31 |

Note

32 |

Some functions are marked deprecated 33 | or discouraged. The meanings of these labels are:

34 |
    35 |
  • discouraged: the use of another function with similar purpose is 36 | suggested, however this one is still valid.
  • 37 |
  • deprecated: the function is present only for portability and 38 | backward compatibility. It should be avoided, and it is strongly suggested 39 | to use another equivalent function instead.
    40 |
  • 41 |
42 |

43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /dox/wpcap_samp1.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Packet Dump

13 |

This program reads packets from a file or a network adapter, depending on 14 | a command line switch. If a source is not provided, the program shows a list of 15 | available adapters, one of which can be selected. Once the 16 | capture is started, the program prints the timestamp, the length and the raw 17 | contents of the packets. Once compiled, it will run on all the Win32 platforms. It 18 | can be compiled to run on Unix as well (the makefile is provided).

19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dox/wpcap_samp2.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Packet Filter

13 | 14 |

This is a more complete example of libpcap usage. It shows, among other 15 | things, how to create and set filters and how to save a capture to disk. It can 16 | be compiled under Win32 or Unix (projects and makefiles are provided). 17 | Pcap_filter (pf.exe) is a general-purpose packet filtering application: its 18 | input parameters are a source of packets (it can be a physical interface or a 19 | file), a filter and an output file. It takes packets from the source until 20 | CTRL+C is pressed or the whole file is processed, applies the filter to the 21 | incoming packets and saves them to the output file if they satisfy the filter. 22 | Pcap_filter can be used to dump network data according to a particular filter, 23 | but also to extract a set of packets from a previously saved file. The format of 24 | both input and output files is the format used by libpcap, i.e. same of WinDump, tcpdump 25 | and many other network tools.

26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dox/wpcap_tut.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap 2 | */ 3 | 4 | 5 | /** @defgroup wpcap_tut WinPcap tutorial: a step by step guide to using WinPcap 6 | * @{ 7 | 8 | 9 | This section shows how to use the features of the WinPcap API. It is organized as a tutorial, subdivided into a set of lessons that will introduce the reader, in a step-by-step fashion, to program development using WinPcap, from the basic functions (obtaining the adapter list, starting a capture, etc.) to the most advanced ones (handling send queues and gathering statistics about network traffic). 10 | 11 | Several code snippets, as well as simple but complete programs are provided as a reference: all of the source code contains links to the rest of the manual, making it is possible to click on functions and data structures to jump to the corresponding documentation. 12 | 13 | The samples are written in plain C, so a basic knowledge of C programming is required. Also, since this is a tutorial about a library dealing with "raw" networking packets, good knowledge of networks and network protocols is assumed. 14 | 15 | \ref wpcap_tut1 "Next >>>" 16 | 17 | @}*/ 18 | -------------------------------------------------------------------------------- /dox/wpcap_tut2.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap_tut 2 | */ 3 | 4 | /** @defgroup wpcap_tut2 Obtaining advanced information about installed devices 5 | * @{ 6 | 7 | Lesson 1 (\ref wpcap_tut1) demonstrated how to get basic information (i.e. device name and description) about available adapters. Actually, WinPcap provides also other advanced information. In particular, every pcap_if structure returned by pcap_findalldevs_ex() contains also a list of pcap_addr structures, with: 8 | - a list of addresses for that interface. 9 | - a list of netmasks (each of which corresponds to an entry in the addresses list). 10 | - a list of broadcast addresses (each of which corresponds to an entry in the addresses list). 11 | - a list of destination addresses (each of which corresponds to an entry in the addresses list). 12 | 13 | Additionally, pcap_findalldevs_ex() can also return remote adapters and a list of pcap files that are located in a given local folder. 14 | 15 | The following sample provides an ifprint() function that prints the complete contents of a pcap_if structure. It is invoked by the program for every entry returned by pcap_findalldevs_ex(). 16 | 17 | \include iflist/iflist.c 18 | 19 | \ref wpcap_tut1 "<<< Previous" \ref wpcap_tut3 "Next >>>" 20 | 21 | @}*/ 22 | -------------------------------------------------------------------------------- /dox/wpcap_tut4.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap_tut 2 | */ 3 | 4 | 5 | /** @defgroup wpcap_tut4 Capturing the packets without the callback 6 | * @{ 7 | 8 | The example program in this lesson behaves exactly like the previous program (\ref wpcap_tut3), but it uses pcap_next_ex() instead of pcap_loop(). 9 | 10 | The callback-based capture mechanism of pcap_loop() is elegant and it could be a good choice in some situations. However, handling a callback is sometimes not practical -- it often makes the program more complex especially in situations with multithreaded applications or C++ classes. 11 | 12 | In these cases, pcap_next_ex() retrievs a packet with a direct call -- using pcap_next_ex() packets are received only when the programmer wants them. 13 | 14 | The parameters of this function are the same as a capture callback -- it takes an adapter descriptor and a couple of pointers that will be initialized and returned to the user (one to a pcap_pkthdr structure and another to a buffer with the packet data). 15 | 16 | In the following program, we recycle the callback code of the previous lesson's example and move it inside main() right after the call to pcap_next_ex(). 17 | 18 | 19 | \include misc/basic_dump_ex.c 20 | 21 | Why do we use pcap_next_ex() instead of the old pcap_next()? Because pcap_next() has some drawbacks. First of all, it is inefficient because it hides the callback method but still relies on pcap_dispatch(). Second, it is not able to detect EOF, so it's not very useful when gathering packets from a file. 22 | 23 | Notice also that pcap_next_ex() returns different values for success, timeout elapsed, error and EOF conditions. 24 | 25 | \ref wpcap_tut3 "<<< Previous" \ref wpcap_tut5 "Next >>>" 26 | 27 | @}*/ 28 | -------------------------------------------------------------------------------- /dox/wpcap_tut5.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap_tut 2 | */ 3 | 4 | 5 | /** @defgroup wpcap_tut5 Filtering the traffic 6 | * @{ 7 | 8 | One of the most powerful features offered by WinPcap (and by libpcap as well) is the filtering engine. It provides a very efficient way to receive subsets of the network traffic, and is (usually) integrated with the capture mechanism provided by WinPcap. The functions used to filter packets are pcap_compile() and pcap_setfilter(). 9 | 10 | pcap_compile() takes a string containing a high-level Boolean (filter) expression and produces a low-level byte code that can be interpreted by the fileter engine in the packet driver. The syntax of the boolean expression can be found in the \ref language section of this documentation. 11 | 12 | pcap_setfilter() associates a filter with a capture session in the kernel driver. Once pcap_setfilter() is called, the associated filter will be applied to all the packets coming from the network, and all the conformant packets (i.e., packets for which the Boolean expression evaluates to true) will be actually copied to the application. 13 | 14 | The following code shows how to compile and set a filter. Note that we must retrieve the netmask from the pcap_if structure that describes the adapter, because some filters created by pcap_compile() require it. 15 | 16 | The filter passed to pcap_compile() in this code snippet is "ip and tcp", which means to "keep only the packets that are both IPv4 and TCP and deliver them to the application". 17 | 18 | \code 19 | if (d->addresses != NULL) 20 | /* Retrieve the mask of the first address of the interface */ 21 | netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; 22 | else 23 | /* If the interface is without an address we suppose to be in a C class network */ 24 | netmask=0xffffff; 25 | 26 | 27 | //compile the filter 28 | if (pcap_compile(adhandle, &fcode, "ip and tcp", 1, netmask) < 0) 29 | { 30 | fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); 31 | /* Free the device list */ 32 | pcap_freealldevs(alldevs); 33 | return -1; 34 | } 35 | 36 | //set the filter 37 | if (pcap_setfilter(adhandle, &fcode) < 0) 38 | { 39 | fprintf(stderr,"\nError setting the filter.\n"); 40 | /* Free the device list */ 41 | pcap_freealldevs(alldevs); 42 | return -1; 43 | } 44 | \endcode 45 | 46 | If you want to see some code that uses the filtering functions shown in this lesson, look at the example presented in the next Lesson, \ref wpcap_tut6. 47 | 48 | \ref wpcap_tut4 "<<< Previous" \ref wpcap_tut6 "Next >>>" 49 | 50 | @}*/ 51 | -------------------------------------------------------------------------------- /dox/wpcap_tut6.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap_tut 2 | */ 3 | 4 | /** @defgroup wpcap_tut6 Interpreting the packets 5 | * @{ 6 | 7 | Now that we are able to capture and filter network traffic, we want to put our knowledge to work with a simple "real world" application. 8 | 9 | In this lesson we will take code from the previous lessons and use these pieces to build a more useful program. the main purpose of the current program is to show how the protocol headers of a captured packet can be parsed and interpreted. 10 | The resulting application, called UDPdump, prints a summary of the UDP traffic on our network. 11 | 12 | We have chosen to parse and display the UDP protocol because it is more accessible than other protocols such as TCP and consequently is an excellent initial example. Let's look at the code: 13 | 14 | \include UDPdump/udpdump.c 15 | 16 | First of all, we set the filter to "ip and udp". In this way we are sure that packet_handler() will receive only UDP packets over IPv4: this simplifies the parsing and increases the efficiency of the program. 17 | 18 | We have also created a couple of structs that describe the IP and UDP headers. These structs are used by packet_handler() to properly locate the various header fields. 19 | 20 | packet_handler(), although limited to a single protocol dissector (UDP over IPv4), shows how complex "sniffers" like tcpdump/WinDump decode the network traffic. Since we aren't interested in the MAC header, we skip it. 21 | For simplicity and before starting the capture, we check the MAC layer with pcap_datalink() to make sure that 22 | we are dealing with an Ethernet network. This way we can be sure that the MAC header is exactly 14 bytes. 23 | 24 | The IP header is located just after the MAC header. We will extract the IP source and destination addresses from the 25 | IP header. 26 | 27 | Reaching the UDP header is a bit more complicated, because the IP header doesn't have a fixed length. 28 | Therefore, we use the IP header's length field to know its size. 29 | Once we know the location of the UDP header, we extract the source and destination ports. 30 | 31 | The extracted values are printed on the screen, and the result is something like: 32 | 33 | 34 | 1. \\Device\\Packet_{A7FD048A-5D4B-478E-B3C1-34401AC3B72F} (Xircom 35 | t 10/100 Adapter) \n 36 | Enter the interface number (1-2):1\n 37 | 38 | listening on Xircom CardBus Ethernet 10/100 Adapter... \n 39 | 16:13:15.312784 len:87 130.192.31.67.2682 -> 130.192.3.21.53 \n 40 | 16:13:15.314796 len:137 130.192.3.21.53 -> 130.192.31.67.2682 \n 41 | 16:13:15.322101 len:78 130.192.31.67.2683 -> 130.192.3.21.53 \n 42 | 43 | 44 | Each of the final 3 lines represents a different packet. 45 | 46 | \ref wpcap_tut5 "<<< Previous" \ref wpcap_tut7 "Next >>>" 47 | 48 | @}*/ 49 | -------------------------------------------------------------------------------- /dox/wpcap_tut9.txt: -------------------------------------------------------------------------------- 1 | /** @ingroup wpcap_tut 2 | */ 3 | 4 | /** @defgroup wpcap_tut9 Gathering Statistics on the network traffic 5 | * @{ 6 | 7 | This lesson shows another advanced feature of WinPcap: the ability to collect statistics about network traffic. The statistical engine makes use of the kernel-level packet filter to efficiently classify the incoming packet. 8 | You can take a look at the \ref NPF if you want to know more details. 9 | 10 | In order to use this feature, the programmer must open an adapter and put it in \e statistical \e mode. 11 | This can be done with pcap_setmode(). In particular, MODE_STAT must be used as the \e mode argument of this function. 12 | 13 | With statistical mode, making an application that monitors the TCP traffic load is a matter of few lines of code. 14 | The following sample shows how to do it. 15 | 16 | \include tcptop/tcptop.c 17 | 18 | Before enabling statistical mode, the user has the option to set a filter that defines the subset of network traffic that will be monitored. See the paragraph on the \ref language for details. 19 | If no filter has been set, all of the traffic will be monitored. 20 | 21 | Once 22 | 23 | - the filter is set 24 | - pcap_setmode() is called 25 | - callback invocation is enabled with pcap_loop() 26 | 27 | the interface descriptor starts to work in statistical mode. 28 | Notice the fourth parameter (\e to_ms) of pcap_open(): it defines the interval among the statistical samples. 29 | The callback function receives the samples calculated by the driver every \e to_ms milliseconds. These samples are encapsulated in the second and third parameters of the callback function, as shown in the following figure: 30 | 31 | \image html stats_wpcap.gif 32 | 33 | 34 | Two 64-bit counters are provided: the number of packets and the amount of bytes received during the last interval. 35 | 36 | In the example, the adapter is opened with a timeout of 1000 ms. 37 | This means that dispatcher_handler() is called once per second. 38 | At this point a filter that keeps only tcp packets is compiled and set. 39 | Then pcap_setmode() and pcap_loop() are called. 40 | Note that a struct timeval pointer is passed to pcap_loop() as the \e user parameter. 41 | This structure will be used to store a timestamp in order to calculate the interval between two samples. 42 | dispatcher_handler()uses this interval to obtain the bits per second and the 43 | packets per second and then prints these values on the screen. 44 | 45 | Note finally that this example is by far more efficient than a program that captures the packets in the traditional way and calculates statistics at user-level. 46 | Statistical mode requires the minumum amount of data copies and context switches and therefore the CPU is optimized. Moreover, a very small amount of memory is required. 47 | 48 | \ref wpcap_tut8 "<<< Previous" 49 | 50 | @}*/ 51 | 52 | 53 | -------------------------------------------------------------------------------- /install/BuildMe.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if "%1" == "clean" ( 4 | set __BUILD_TYPE=clean 5 | ) else ( 6 | set __BUILD_TYPE=Build 7 | ) 8 | 9 | rem Tell MSBuild to use environment variables. 10 | rem set UseEnv=true 11 | 12 | rem Issues with building both x86 and x64 from the same command prompt, 13 | rem as only 1 architecture build type can be set 14 | rem Maybe need a buildme_x86 and a buildme_x64, each one swetting their env. 15 | 16 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug" /p:Platform="Win32" 17 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug No AirPcap" /p:Platform="Win32" 18 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug No NetMon" /p:Platform="Win32" 19 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release" /p:Platform="Win32" 20 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No AirPcap" /p:Platform="Win32" 21 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No NetMon" /p:Platform="Win32" 22 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release LOG_TO_FILE" /p:Platform="Win32" 23 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No NetMon LOG_TO_FILE" /p:Platform="Win32" 24 | 25 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug" /p:Platform="x64" 26 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug No AirPcap" /p:Platform="x64" 27 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Debug No NetMon" /p:Platform="x64" 28 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release" /p:Platform="x64" 29 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No AirPcap" /p:Platform="x64" 30 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No NetMon" /p:Platform="x64" 31 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release LOG_TO_FILE" /p:Platform="x64" 32 | msbuild MakeAll.sln /t:%__BUILD_TYPE% /p:Configuration="Release No NetMon LOG_TO_FILE" /p:Platform="x64" 33 | -------------------------------------------------------------------------------- /install/NetMonInstaller/NetMonInstaller.h: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // Microsoft Windows 4 | // Copyright (C) Microsoft Corporation, 1997. 5 | // 6 | // File: S N E T C F G . H 7 | // 8 | // Contents: Sample code that demonstrates how to: 9 | // - find out if a component is installed 10 | // - install a net component 11 | // - install an OEM net component 12 | // - uninstall a net component 13 | // - enumerate net components 14 | // - enumerate net adapters using Setup API 15 | // - enumerate binding paths of a component 16 | // 17 | // Notes: 18 | // 19 | // Author: kumarp 26-March-98 20 | // 21 | //---------------------------------------------------------------------------- 22 | 23 | #pragma once 24 | 25 | enum NetClass 26 | { 27 | NC_NetAdapter=0, 28 | NC_NetProtocol, 29 | NC_NetService, 30 | NC_NetClient, 31 | NC_Unknown 32 | }; 33 | 34 | void FindIfComponentInstalled(IN PCWSTR szComponentId); 35 | 36 | HRESULT HrInstallNetMonProtocol(); 37 | HRESULT HrUninstallNetMonProtocol(); 38 | 39 | -------------------------------------------------------------------------------- /install/NetMonInstaller/compile.bat: -------------------------------------------------------------------------------- 1 | build -cw -------------------------------------------------------------------------------- /install/NetMonInstaller/idls.idl: -------------------------------------------------------------------------------- 1 | #include "netcfgx.idl" 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/NetMonInstaller/implinc.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #pragma hdrstop 3 | #include "idls_i.c" 4 | 5 | 6 | -------------------------------------------------------------------------------- /install/NetMonInstaller/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | 8 | -------------------------------------------------------------------------------- /install/NetMonInstaller/pch.h: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // Microsoft Windows 4 | // Copyright (C) Microsoft Corporation, 1997. 5 | // 6 | // File: P C H . H 7 | // 8 | // Contents: Pre-compiled header file 9 | // 10 | // Notes: 11 | // 12 | // Author: kumarp 28-September-98 13 | // 14 | //---------------------------------------------------------------------------- 15 | 16 | #pragma once 17 | 18 | // Turns off "string too long - truncated to 255 characters in the debug 19 | // information, debugger cannot evaluate symbol." 20 | // 21 | #pragma warning (disable: 4786) 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | -------------------------------------------------------------------------------- /install/NetMonInstaller/sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=NetMonInstaller 2 | TARGETPATH=obj 3 | TARGETTYPE=PROGRAM 4 | 5 | C_DEFINES=-DWIN32 -DUNICODE -D_UNICODE 6 | PRECOMPILED_CXX=1 7 | PRECOMPILED_INCLUDE=pch.h 8 | RCOPTIONS=-N 9 | UMENTRY=wmain 10 | UMTYPE=console 11 | USE_MSVCRT=1 12 | USE_NATIVE_EH=1 13 | USE_RTTI=1 14 | USE_STATIC_ATL=1 15 | 16 | TARGETLIBS=\ 17 | $(SDK_LIB_PATH)\advapi32.lib \ 18 | $(SDK_LIB_PATH)\comctl32.lib \ 19 | $(SDK_LIB_PATH)\kernel32.lib \ 20 | $(SDK_LIB_PATH)\ole32.lib \ 21 | $(SDK_LIB_PATH)\oleaut32.lib \ 22 | $(SDK_LIB_PATH)\user32.lib \ 23 | $(SDK_LIB_PATH)\uuid.lib \ 24 | $(SDK_LIB_PATH)\setupapi.lib 25 | 26 | INCLUDES= 27 | 28 | SOURCES=\ 29 | version.rc \ 30 | NetMonInstaller.cpp \ 31 | implinc.cpp \ 32 | idls.idl 33 | 34 | -------------------------------------------------------------------------------- /install/NetMonInstaller/version.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by NetMonInstaller.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /install/NetMonInstaller/version.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/NetMonInstaller/version.rc -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/NetMonInstaller.h: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // Microsoft Windows 4 | // Copyright (C) Microsoft Corporation, 1997. 5 | // 6 | // File: S N E T C F G . H 7 | // 8 | // Contents: Sample code that demonstrates how to: 9 | // - find out if a component is installed 10 | // - install a net component 11 | // - install an OEM net component 12 | // - uninstall a net component 13 | // - enumerate net components 14 | // - enumerate net adapters using Setup API 15 | // - enumerate binding paths of a component 16 | // 17 | // Notes: 18 | // 19 | // Author: kumarp 26-March-98 20 | // 21 | //---------------------------------------------------------------------------- 22 | 23 | 24 | enum NetClass 25 | { 26 | NC_NetAdapter=0, 27 | NC_NetProtocol, 28 | NC_NetService, 29 | NC_NetClient, 30 | NC_Unknown 31 | }; 32 | 33 | void FindIfComponentInstalled(IN PCWSTR szComponentId); 34 | 35 | HRESULT HrInstallNetMonProtocol(); 36 | HRESULT HrUninstallNetMonProtocol(); 37 | 38 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/WinPcap Installer Helper.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "WinPcap installer Helper"=".\WinPcap installer Helper.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/WinPcap Installer Helper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinPcap Installer Helper", "WinPcap Installer Helper.vcproj", "{34378168-44FC-4671-A964-20E750DB90A3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {34378168-44FC-4671-A964-20E750DB90A3}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {34378168-44FC-4671-A964-20E750DB90A3}.Debug|Win32.Build.0 = Debug|Win32 14 | {34378168-44FC-4671-A964-20E750DB90A3}.Release|Win32.ActiveCfg = Release|Win32 15 | {34378168-44FC-4671-A964-20E750DB90A3}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/WinPcap Installer Helper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | Header Files 42 | 43 | 44 | Header Files 45 | 46 | 47 | 48 | 49 | Resource Files 50 | 51 | 52 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/WinPcapInstallerHelper.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | manage_npf_driver 3 | manage_rpcapd_service 4 | manage_netmon -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/WinPcapInstallerHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 - 2007 CACE Technologies, Davis (California). 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of CACE Technologies 15 | * nor the names of its contributors may be used to endorse or promote 16 | * products derived from this software without specific prior written 17 | * permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef WINPCAP_INSTALL_HELPER__ 34 | #define WINPCAP_INSTALL_HELPER__ 35 | 36 | #include 37 | 38 | // The following ifdef block is the standard way of creating macros which make exporting 39 | // from a DLL simpler. All files within this DLL are compiled with the WINPCAPINSTALLERHELPER_EXPORTS 40 | // symbol defined on the command line. this symbol should not be defined on any project 41 | // that uses this DLL. This way any other project whose source files include this file see 42 | // WINPCAPINSTALLERHELPER_API functions as being imported from a DLL, wheras this DLL sees symbols 43 | // defined with this macro as being exported. 44 | #ifdef WINPCAPINSTALLERHELPER_EXPORTS 45 | #define WINPCAPINSTALLERHELPER_API __declspec(dllexport) 46 | #else 47 | #define WINPCAPINSTALLERHELPER_API __declspec(dllimport) 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | extern "C" 52 | { 53 | #endif 54 | 55 | int WINAPI manage_npf_driver(LPCTSTR LogFileName, char operation); 56 | int WINAPI manage_rpcapd_service(LPCTSTR LogFileName, char operation); 57 | int WINAPI manage_netmon(LPCTSTR LogFileName, char operation); 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif //WINPCAP_INSTALL_HELPER__ 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/test/test.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "test"=".\test.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /install/WinPcap Installer Helper/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x17L 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x4L 22 | FILETYPE 0x2L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | VALUE "FileDescription", "WinPcap Installer Helper" 31 | VALUE "FileVersion", WINPCAP_VER_STRING 32 | VALUE "InternalName", "WinPcapInstall.dll" 33 | VALUE "LegalCopyright", WINPCAP_INSTALLERHELPER_COPYRIGHT_STRING 34 | VALUE "LegalTrademarks", "" 35 | VALUE "OriginalFilename", "WinPcapInstall.dll" 36 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 37 | VALUE "ProductVersion", WINPCAP_VER_STRING 38 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 39 | END 40 | END 41 | BLOCK "VarFileInfo" 42 | BEGIN 43 | VALUE "Translation", 0x0, 1200 44 | END 45 | END 46 | -------------------------------------------------------------------------------- /install/copy_installer_files.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | mkdir installer\distribution 2>nul >nul 3 | mkdir installer\distribution\x86 2>nul >nul 4 | 5 | mkdir installer\distribution\x64 2>nul >nul 6 | mkdir installer\distribution\Vista_x86 2>nul >nul 7 | mkdir installer\distribution\Vista_x64 2>nul >nul 8 | 9 | rem 10 | rem Driver 11 | rem 12 | xcopy /v /Y ..\packetNtx\driver\bin\i386\npf.sys installer\distribution\x86\ >nul 13 | xcopy /v /Y ..\packetNtx\driver\bin\i386\npf.pdb installer\distribution\x86\ >nul 14 | xcopy /v /Y ..\packetNtx\driver\bin\amd64\npf.sys installer\distribution\x64\ >nul 15 | xcopy /v /Y ..\packetNtx\driver\bin\amd64\npf.pdb installer\distribution\x64\ >nul 16 | 17 | rem 18 | rem Packet DLL 19 | rem 20 | 21 | rem 22 | rem Windows 2000, XP, 2003 (x86 and x64) 23 | rem 24 | xcopy /v /Y ..\packetntx\dll\project\Release\x86\Packet.dll installer\distribution\x86\ >nul 25 | xcopy /v /Y ..\packetntx\dll\project\Release\x86\Packet.pdb installer\distribution\x86\ >nul 26 | xcopy /v /Y ..\packetntx\dll\project\Release\x64\Packet.dll installer\distribution\x64\ >nul 27 | xcopy /v /Y ..\packetntx\dll\project\Release\x64\Packet.pdb installer\distribution\x64\ >nul 28 | 29 | rem 30 | rem Windows Vista (x86 and x64) 31 | rem 32 | xcopy /v /Y "..\packetntx\dll\project\Release No NetMon\x86\Packet.dll" installer\distribution\Vista_x86\ >nul 33 | xcopy /v /Y "..\packetntx\dll\project\Release No NetMon\x64\Packet.dll" installer\distribution\Vista_x64\ >nul 34 | xcopy /v /Y "..\packetntx\dll\project\Release No NetMon\x86\Packet.pdb" installer\distribution\Vista_x86\ >nul 35 | xcopy /v /Y "..\packetntx\dll\project\Release No NetMon\x64\Packet.pdb" installer\distribution\Vista_x64\ >nul 36 | 37 | rem 38 | rem Wpcap.dll (x86 and x64) 39 | rem 40 | xcopy /v /Y ..\wpcap\prj\Release\x86\wpcap.dll installer\distribution\x86\ >nul 41 | xcopy /v /Y ..\wpcap\prj\Release\x86\wpcap.pdb installer\distribution\x86\ >nul 42 | xcopy /v /Y ..\wpcap\prj\Release\x64\wpcap.dll installer\distribution\x64\ >nul 43 | xcopy /v /Y ..\wpcap\prj\Release\x64\wpcap.pdb installer\distribution\x64\ >nul 44 | 45 | rem 46 | rem rpcapd (x86 only) 47 | rem 48 | xcopy /v /Y ..\wpcap\libpcap\rpcapd\Release\x86\rpcapd.exe installer\distribution\x86\ >nul 49 | xcopy /v /Y ..\wpcap\libpcap\rpcapd\Release\x86\rpcapd.pdb installer\distribution\x86\ >nul 50 | 51 | rem 52 | rem installer helper (x86 as the installer is 32 bit) 53 | rem 54 | xcopy /v /Y ".\WinPcap Installer Helper\Release\x86\WinPcapInstall.dll" installer\distribution\x86\ >nul 55 | xcopy /v /Y ".\WinPcap Installer Helper\Release\x86\WinPcapInstall.pdb" installer\distribution\x86\ >nul 56 | 57 | xcopy /v /Y ..\wpcap\libpcap\rpcapd\win32-pthreads\pthreadVC.dll installer\distribution\x86\ >nul 58 | rem this nasty hack is needed to fix some time zone issues with the CVS... 59 | touch installer\distribution\x86\pthreadVC.dll >nul 60 | 61 | -------------------------------------------------------------------------------- /install/create-driver-signing-cab.ps1: -------------------------------------------------------------------------------- 1 | # Create a driver signing .cab suitable for submission to the hardware 2 | # dev center. 3 | # https://msdn.microsoft.com/en-us/library/windows/hardware/dn962252.aspx 4 | 5 | # We need a unique folder name. For now just date-stamp it. 6 | $cab_version = Get-Date -Format yyyy_MM_dd_HH_mm_ss 7 | $cab_dir = "winpcap_driver_signing_$cab_version" 8 | $cab_x86_dir = "$cab_dir\x86" 9 | $cab_x64_dir = "$cab_dir\x64" 10 | $driver_x86_dir = "..\packetNtx\driver\bin\i386" 11 | $driver_x64_dir = "..\packetNtx\driver\bin\amd64" 12 | 13 | write-host "Creating $cab_dir" 14 | 15 | new-item -ItemType Directory -Path $cab_dir 16 | new-item -ItemType Directory -Path $cab_x86_dir 17 | new-item -ItemType Directory -Path $cab_x64_dir 18 | 19 | copy-item "npfx86.inf" -Destination "$cab_x86_dir\npf.inf" 20 | copy-item "$driver_x86_dir\npf.sys" -Destination $cab_x86_dir 21 | copy-item "$driver_x86_dir\npf.pdb" -Destination $cab_x86_dir 22 | 23 | copy-item "npfx64.inf" -Destination "$cab_x64_dir\npf.inf" 24 | copy-item "$driver_x64_dir\npf.sys" -Destination $cab_x64_dir 25 | copy-item "$driver_x64_dir\npf.pdb" -Destination $cab_x64_dir 26 | 27 | # http://stackoverflow.com/questions/19411440/makecab-create-a-cab-file-from-all-the-files-in-a-folder 28 | 29 | function compress-directory([string]$dir, [string]$output) 30 | { 31 | $ddf = ".OPTION EXPLICIT 32 | .Set CabinetNameTemplate=$output 33 | .Set DiskDirectory1=. 34 | .Set CompressionType=MSZIP 35 | .Set Cabinet=on 36 | .Set Compress=on 37 | .Set CabinetFileCountThreshold=0 38 | .Set FolderFileCountThreshold=0 39 | .Set FolderSizeThreshold=0 40 | .Set MaxCabinetSize=0 41 | .Set MaxDiskFileCount=0 42 | .Set MaxDiskSize=0 43 | " 44 | $dirfullname = (get-item $dir).fullname 45 | $ddfpath = ($env:TEMP+"\temp.ddf") 46 | $ddf += (ls -recurse $dir | ? {!$_.psiscontainer}|select -expand fullname|%{'"'+$_+'" "'+$_.SubString($dirfullname.length+1)+'"'}) -join "`r`n" 47 | $ddf 48 | $ddf | Out-File -encoding UTF8 $ddfpath 49 | makecab /F $ddfpath 50 | rm $ddfpath 51 | rm setup.inf 52 | rm setup.rpt 53 | } 54 | 55 | compress-directory ".\$cab_dir" ".\$cab_dir.cab" 56 | -------------------------------------------------------------------------------- /install/daemon_mgm/daemon_mgm.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "daemon_mgm"=".\daemon_mgm.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /install/daemon_mgm/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by version.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /install/daemon_mgm/version.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/daemon_mgm/version.rc -------------------------------------------------------------------------------- /install/installer/WinPcap.nsi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/installer/WinPcap.nsi -------------------------------------------------------------------------------- /install/installer/WpBann.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 |

This Wizard will guide you through 4 | the entire WinPcap installation. 5 |
6 | For more information or support about WinPcap, check out the 7 | WinPcap website.

8 | 9 | -------------------------------------------------------------------------------- /install/installer/bootOptions.ini: -------------------------------------------------------------------------------- 1 | ; Ini file generated by the HM NIS Edit IO designer. 2 | [Settings] 3 | NumFields=1 4 | 5 | [Field 1] 6 | Type=Checkbox 7 | Text=Automatically start the WinPcap driver at boot time 8 | Left=8 9 | Right=198 10 | Top=36 11 | Bottom=46 12 | State=1 13 | 14 | ;[Field 2] 15 | ;Type=Text 16 | ;Flags=NOTABSTOP|MULTILINE|READONLY 17 | ;State=Text\r\nPirla 18 | ;Left=8 19 | ;Right=279 20 | ;Top=70 21 | ;Bottom=136 22 | 23 | -------------------------------------------------------------------------------- /install/installer/distribution/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/installer/distribution/license.txt -------------------------------------------------------------------------------- /install/installer/distribution/readme.txt: -------------------------------------------------------------------------------- 1 | If an old version of WinPcap was already present on the system, it is strongly recommended to reboot the system at the end of the installation process. 2 | 3 | Please visit the WinPcap home page at http://www.winpcap.org for information and updates. -------------------------------------------------------------------------------- /install/installer/distribution/winpcap.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/installer/distribution/winpcap.bmp -------------------------------------------------------------------------------- /install/installer/distribution/winpcap_nsis.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/installer/distribution/winpcap_nsis.bmp -------------------------------------------------------------------------------- /install/npf.ddf: -------------------------------------------------------------------------------- 1 | ;*** MakeCAB Directive file for npf *** 2 | ; 3 | 4 | ; Setup 5 | .Set CabinetFileCountThreshold=0 6 | .Set FolderFileCountThreshold=0 7 | .Set FolderSizeThreshold=0 8 | .Set MaxCabinetSize=0 9 | .Set MaxDiskFileCount=0 10 | .Set MaxDiskSize=0 11 | .Set CompressionType=MSZIP;** All files are compressed in cabinet files 12 | .Set Cabinet=on 13 | .Set Compress=on 14 | 15 | ; Filename for cab file 16 | .Set CabinetNameTemplate=npf%arch%.cab 17 | 18 | ; Filename for disk directory 19 | .Set DiskDirectory1=NPF_CABS 20 | 21 | ; Package directory in cab 22 | .Set DestinationDir=npf 23 | 24 | ; Files for driver 25 | npf%arch%.inf 26 | installer\distribution\%arch%\npf.sys 27 | ;*** -------------------------------------------------------------------------------- /install/npf_mgm/npf_mgm.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "npf_mgm"=.\npf_mgm.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /install/npf_mgm/npf_mgm.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/npf_mgm/npf_mgm.rc -------------------------------------------------------------------------------- /install/npf_mgm/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by npf_mgm.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /install/npfx64.inf: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------- 2 | ; Npf.INF -- WinPCap Network Packet Filter Driver 3 | ; 4 | ; Copyright (c) Wireshark Foundation, Inc. All rights reserved. 5 | ;------------------------------------------------------------------------- 6 | [version] 7 | Signature = "$Windows NT$" 8 | Class = NetService 9 | ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318} 10 | Provider = %WFINC% 11 | DriverVer = 07/25/2015,4.1.0.4001 12 | CatalogFile = npfx64.cat 13 | 14 | ;[Manufacturer] 15 | ;%WFINC%=WFINC,NTamd64 16 | 17 | ;[WFINC.NTamd64] 18 | ;%Npf_Desc%=Install, npf 19 | 20 | ;------------------------------------------------------------------------- 21 | ; Installation Section 22 | ;------------------------------------------------------------------------- 23 | [DefaultInstall] 24 | Copyfiles = npf.copyfiles.sys 25 | 26 | [SourceDisksNames] 27 | 1=%Npf_Desc%,"",, 28 | 29 | [SourceDisksFiles] 30 | npf.sys=1 31 | 32 | [DestinationDirs] 33 | DefaultDestDir=12 34 | npf.copyfiles.sys=12 35 | 36 | [npf.copyfiles.sys] 37 | npf.sys,,,2 38 | 39 | 40 | ;------------------------------------------------------------------------- 41 | ; Service installation support 42 | ;------------------------------------------------------------------------- 43 | [DefaultInstall.Services] 44 | AddService=Npf,,Npf_Service_Inst 45 | 46 | [Npf_Service_Inst] 47 | DisplayName = %Npf_Desc% 48 | ServiceType = 1 ;SERVICE_KERNEL_DRIVER 49 | ;StartType = 2 ;SERVICE_AUTO_START 50 | StartType = 1 ;SERVICE_SYSTEM_START 51 | ErrorControl = 1 ;SERVICE_ERROR_NORMAL 52 | ServiceBinary = %12%\npf.sys 53 | 54 | [Strings] 55 | WFINC = "Wireshark Foundation, Inc." 56 | Npf_Desc = "Netgroup Packet Filter Driver" 57 | -------------------------------------------------------------------------------- /install/npfx86.inf: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------- 2 | ; Npf.INF -- WinPCap Network Packet Filter Driver 3 | ; 4 | ; Copyright (c) Wireshark Foundation, Inc. All rights reserved. 5 | ;------------------------------------------------------------------------- 6 | [version] 7 | Signature = "$Windows NT$" 8 | Class = NetService 9 | ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318} 10 | Provider = %WFINC% 11 | DriverVer = 07/25/2015,4.1.0.4001 12 | CatalogFile = npfx86.cat 13 | 14 | ;[Manufacturer] 15 | ;%WFINC%=WFINC,NTx86 16 | 17 | ;[WFINC.NTx86] 18 | ;%Npf_Desc%=Install, npf 19 | 20 | ;------------------------------------------------------------------------- 21 | ; Installation Section 22 | ;------------------------------------------------------------------------- 23 | [DefaultInstall] 24 | Copyfiles = npf.copyfiles.sys 25 | 26 | [SourceDisksNames] 27 | 1=%Npf_Desc%,"",, 28 | 29 | [SourceDisksFiles] 30 | npf.sys=1 31 | 32 | [DestinationDirs] 33 | DefaultDestDir=12 34 | npf.copyfiles.sys=12 35 | 36 | [npf.copyfiles.sys] 37 | npf.sys,,,2 38 | 39 | 40 | ;------------------------------------------------------------------------- 41 | ; Service installation support 42 | ;------------------------------------------------------------------------- 43 | [DefaultInstall.Services] 44 | AddService=Npf,,Npf_Service_Inst 45 | 46 | [Npf_Service_Inst] 47 | DisplayName = %Npf_Desc% 48 | ServiceType = 1 ;SERVICE_KERNEL_DRIVER 49 | ;StartType = 2 ;SERVICE_AUTO_START 50 | StartType = 1 ;SERVICE_SYSTEM_START 51 | ErrorControl = 1 ;SERVICE_ERROR_NORMAL 52 | ServiceBinary = %12%\npf.sys 53 | 54 | [Strings] 55 | WFINC = "Wireshark Foundation, Inc." 56 | Npf_Desc = "Netgroup Packet Filter Driver" 57 | -------------------------------------------------------------------------------- /install/release procedures.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/install/release procedures.txt -------------------------------------------------------------------------------- /integrate_libpcap.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo Copying files... 4 | 5 | set LIBPCAP_FOLDER=..\libpcap 6 | set LIBPCAP_TEMP_FOLDER=.\libpcap_temp 7 | 8 | rmdir /S /Q %LIBPCAP_TEMP_FOLDER% >NUL 2>NUL 9 | 10 | mkdir %LIBPCAP_TEMP_FOLDER% >NUL 11 | 12 | xcopy /s/e/v %LIBPCAP_FOLDER%\*.* %LIBPCAP_TEMP_FOLDER%\ >NUL 13 | 14 | xcopy /s/e/v /y %LIBPCAP_TEMP_FOLDER%\*.* .\wpcap\libpcap >NUL 15 | 16 | rmdir /S /Q %LIBPCAP_TEMP_FOLDER% >NUL 17 | 18 | set LIBPCAP_FOLDER= 19 | set LIBPCAP_TEMP_FOLDER= 20 | 21 | echo Copying files -- Done 22 | 23 | echo --------------------------------------- 24 | 25 | echo Applying remote code patch... 26 | pushd .\wpcap\libpcap\ 27 | patch -p1 -s < remote_code.patch 28 | chmod -R guoa+rw * 29 | del /s *.orig >NUL 2>NUL 30 | popd 31 | echo Applying remote code patch -- Done 32 | 33 | echo --------------------------------------- 34 | 35 | echo Applying TurboCap code patch... 36 | pushd .\wpcap\libpcap\ 37 | patch -p1 -s < tc.patch 38 | chmod -R guoa+rw * 39 | del /s *.orig >NUL 2>NUL 40 | popd 41 | echo Applying TurboCap code patch -- Done 42 | 43 | echo --------------------------------------- 44 | 45 | echo Applying _snprintf _MSC_VER patch... 46 | pushd .\wpcap\libpcap\ 47 | patch -p1 -s < snprintf.patch 48 | chmod -R guoa+rw * 49 | del /s *.orig >NUL 2>NUL 50 | popd 51 | echo Applying _snprintf _MSC_VER patch -- Done 52 | 53 | echo --------------------------------------- 54 | 55 | echo DOS'ifing the libpcap makefile... 56 | pushd .\wpcap\libpcap\win32\prj 57 | unix2dos libpcap.dsp 58 | popd 59 | echo DOS'ifing the libpcap makefile -- Done 60 | 61 | echo --------------------------------------- 62 | 63 | echo Generating the compiler files... 64 | pushd .\wpcap\prj\ 65 | call build_scanner_parser.bat 66 | popd 67 | echo Generating the compiler files -- Done 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /packetNtx/CompileDriverNew.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if "%2" == "checked" ( 4 | set __BUILD_TYPE=checked 5 | ) else ( 6 | set __BUILD_TYPE=free 7 | ) 8 | 9 | set W7BASE=C:\WinDDK\7600.16385.1 10 | 11 | if "%1"=="x86" goto x86_build 12 | if "%1"=="AMD64" goto amd64_build 13 | 14 | echo ****************************************************** 15 | echo ERROR: unknown or unspecified build architecture (%1) 16 | echo ****************************************************** 17 | 18 | goto end 19 | 20 | :x86_build 21 | 22 | echo ****************************************************** 23 | echo * Compiling the driver for Windows NT5.x 32 bit * 24 | echo ****************************************************** 25 | 26 | mkdir driver\bin 2> nul 27 | 28 | set NPF_C_DEFINES=-DNDIS50 29 | 30 | rem ** enable the following line to enable the TME extensions ** 31 | rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c 32 | rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT 33 | 34 | ddkbuild -WIN7XP %__BUILD_TYPE% .\driver -prefast -cefw 35 | 36 | rem ** enable the following line to enable the TME extensions ** 37 | rem set NPF_TME_FILES= 38 | rem set NPF_JIT_FILES= 39 | set NPF_C_DEFINES= 40 | 41 | goto end 42 | 43 | :amd64_build 44 | 45 | echo ******************************************************* 46 | echo * Compiling the driver for Windows NT5.x x64 (AMD64) * 47 | echo ******************************************************* 48 | 49 | mkdir driver\bin 2> nul 50 | mkdir driver\bin\xp 2> nul 51 | 52 | set NPF_C_DEFINES=-DNDIS50 53 | 54 | rem 55 | rem The TME extensions and the JIT is not supported on x64, at the moment 56 | rem 57 | rem set NPF_TME_FILES= 58 | rem set NPF_JIT_FILES= 59 | 60 | ddkbuild -WIN7NETA64 %__BUILD_TYPE% .\driver -prefast -cefw 61 | 62 | set NPF_C_DEFINES= 63 | rem set NPF_TME_FILES= 64 | rem set NPF_JIT_FILES= 65 | 66 | goto end 67 | 68 | :end 69 | 70 | set __BUILD_TYPE= 71 | -------------------------------------------------------------------------------- /packetNtx/DIRS: -------------------------------------------------------------------------------- 1 | DIRS=driver \ 2 | 3 | -------------------------------------------------------------------------------- /packetNtx/Dll/Packet.def: -------------------------------------------------------------------------------- 1 | LIBRARY packet 2 | 3 | EXPORTS 4 | PacketLibraryVersion 5 | PacketGetVersion 6 | PacketGetDriverVersion 7 | PacketOpenAdapter 8 | PacketSendPacket 9 | PacketSendPackets 10 | PacketAllocatePacket 11 | PacketInitPacket 12 | PacketFreePacket 13 | PacketReceivePacket 14 | PacketCloseAdapter 15 | PacketSetHwFilter 16 | PacketGetAdapterNames 17 | PacketRequest 18 | PacketSetBuff 19 | PacketSetBpf 20 | PacketSetSnapLen 21 | PacketGetStats 22 | PacketGetStatsEx 23 | PacketGetNetType 24 | PacketSetReadTimeout 25 | PacketSetMode 26 | PacketSetNumWrites 27 | PacketGetNetInfoEx 28 | PacketSetMinToCopy 29 | PacketGetReadEvent 30 | PacketStopDriver 31 | PacketSetDumpName 32 | PacketSetDumpLimits 33 | PacketIsDumpEnded 34 | PacketSetLoopbackBehavior 35 | PacketGetAirPcapHandle 36 | -------------------------------------------------------------------------------- /packetNtx/Dll/Packet32.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/packetNtx/Dll/Packet32.c -------------------------------------------------------------------------------- /packetNtx/Dll/Project/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Makefile for cygwin gcc 2 | # Nate Lawson 3 | 4 | # OPTFLAGS = -g -DDBG 5 | OPTFLAGS = -O -D_WINNT4 6 | # I am suspicious of -O2 since it hosed wpcap.dll. To be safe, use -O only 7 | 8 | CFLAGS = -I ../../../common -shared -mno-cygwin ${OPTFLAGS} -I.. 9 | LDFLAGS = -Wl,--out-implib,libpacket.a 10 | OBJS = ../Packet32.o ../AdInfo.o 11 | LIBS = -lws2_32 -lversion 12 | 13 | Packet.dll: ${OBJS} 14 | ${CC} ${CFLAGS} ${LDFLAGS} -o Packet.dll ../Packet.def ${OBJS} ${LIBS} 15 | 16 | .c.o: 17 | ${CC} ${CFLAGS} -o $*.o -c $< 18 | 19 | clean: 20 | ${RM} ${OBJS} libpacket.a Packet.dll 21 | 22 | install: Packet.dll 23 | cp Packet.dll c:/winnt/system32 24 | -------------------------------------------------------------------------------- /packetNtx/Dll/Project/Packet.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "PacketNT"=.\Packet.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name WanPacket 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "WanPacket"=..\WanPacket\WanPacket.dsp - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /packetNtx/Dll/Project/Packet.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | 55 | 56 | Resource Files 57 | 58 | 59 | -------------------------------------------------------------------------------- /packetNtx/Dll/WanPacket/WanPacket.def: -------------------------------------------------------------------------------- 1 | LIBRARY WanPacket 2 | EXPORTS 3 | WanPacketOpenAdapter 4 | WanPacketCloseAdapter 5 | WanPacketReceivePacket 6 | WanPacketSetBufferSize 7 | WanPacketSetBpfFilter 8 | WanPacketSetMinToCopy 9 | WanPacketSetReadTimeout 10 | WanPacketGetStats 11 | WanPacketGetReadEvent 12 | WanPacketSetMode 13 | WanPacketTestAdapter -------------------------------------------------------------------------------- /packetNtx/Dll/WanPacket/WanPacket.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "WanPacket"=.\WanPacket.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /packetNtx/Dll/WanPacket/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /packetNtx/Dll/WanPacket/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x17L 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x4L 22 | FILETYPE 0x2L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | VALUE "FileDescription", "WinPcap low level NetMon wrapper library" 31 | VALUE "FileVersion", WINPCAP_VER_STRING 32 | VALUE "InternalName", "WanPacket.dll" 33 | VALUE "LegalCopyright", WINPCAP_WANPACKET_COPYRIGHT_STRING 34 | VALUE "LegalTrademarks", "" 35 | VALUE "OriginalFilename", "WanPacket.dll" 36 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 37 | VALUE "ProductVersion", WINPCAP_VER_STRING 38 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 39 | END 40 | END 41 | BLOCK "VarFileInfo" 42 | BEGIN 43 | VALUE "Translation", 0x0, 1200 44 | END 45 | END 46 | -------------------------------------------------------------------------------- /packetNtx/Dll/strsafe.h: -------------------------------------------------------------------------------- 1 | #ifndef __STRSAFE_GCC__383773443 2 | #define __STRSAFE_GCC__383773443 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #ifdef _MSC_VER 9 | #error Trying to use strsafe.h for GCC within Visual Studio 10 | #endif 11 | 12 | static int vsnprintf(char *buffer,size_t count, const char *format, va_list argptr ) 13 | { 14 | return vsprintf(buffer, format, argptr); 15 | } 16 | 17 | 18 | static void StringCchPrintfA(char *pszDest,size_t cbDest, char *pszFormat, ...) 19 | { 20 | va_list marker; 21 | va_start( marker, pszFormat ); /* Initialize variable arguments. */ 22 | 23 | if (cbDest == 0 || pszDest == NULL || pszFormat == NULL) 24 | return; 25 | 26 | 27 | pszDest[cbDest - 1] = '\0'; 28 | vsnprintf(pszDest, cbDest - 1, pszFormat, marker); 29 | 30 | va_end(marker); 31 | } 32 | 33 | static void StringCchPrintfW( WCHAR *pszDest,size_t cbDest, WCHAR *pszFormat, ...) 34 | { 35 | va_list marker; 36 | va_start( marker, pszFormat ); /* Initialize variable arguments. */ 37 | 38 | if (cbDest == 0 || pszDest == NULL || pszFormat == NULL) 39 | return; 40 | 41 | 42 | pszDest[cbDest - 1] = L'\0'; 43 | _vsnwprintf(pszDest, cbDest - 1, pszFormat, marker); 44 | 45 | va_end(marker); 46 | } 47 | 48 | 49 | static void StringCchCopyA(char *pszDest,size_t cbDest, const char* pszSrc) 50 | { 51 | if (cbDest == 0 || pszDest == NULL || pszSrc == NULL) 52 | return; 53 | 54 | pszDest[cbDest - 1] = '\0'; 55 | 56 | strncpy(pszDest, pszSrc, cbDest - 1); 57 | 58 | } 59 | 60 | static void StringCchCatA(char* pszDest, size_t cbDest,const char* pszSrc) 61 | { 62 | if (cbDest == 0 || pszDest == NULL || pszSrc == NULL) 63 | return; 64 | 65 | pszDest[cbDest - 1] = '\0'; 66 | 67 | strncat(pszDest, pszSrc, cbDest - 1); 68 | 69 | } 70 | 71 | #ifdef UNICODE 72 | #define StringCchPrintf StringCchPrintfW 73 | #else 74 | #define StringCchPrintf StringCchPrintfA 75 | #endif 76 | 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /packetNtx/Dll/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /packetNtx/Dll/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // WinPcapOem.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x17L 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x4L 22 | FILETYPE 0x2L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | #ifdef _WINNT4 31 | VALUE "FileDescription", "packet.dll (NT4) Dynamic Link Library" 32 | #elif defined(_WINVISTA) 33 | VALUE "FileDescription", "packet.dll (Vista) Dynamic Link Library" 34 | #else 35 | VALUE "FileDescription", "packet.dll (NT5) Dynamic Link Library" 36 | #endif 37 | VALUE "FileVersion", WINPCAP_VER_STRING 38 | VALUE "InternalName", "packet.dll" 39 | VALUE "LegalCopyright", WINPCAP_COPYRIGHT_STRING 40 | VALUE "LegalTrademarks", "" 41 | VALUE "OriginalFilename", "packet.dll" 42 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 43 | VALUE "ProductVersion", WINPCAP_VER_STRING 44 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 45 | END 46 | END 47 | BLOCK "VarFileInfo" 48 | BEGIN 49 | VALUE "Translation", 0x0, 1200 50 | END 51 | END 52 | -------------------------------------------------------------------------------- /packetNtx/driver/MAKEFILE: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the driver components of the Windows NT DDK 5 | # 6 | 7 | !INCLUDE $(NTMAKEENV)\makefile.def 8 | -------------------------------------------------------------------------------- /packetNtx/driver/NPF.RC: -------------------------------------------------------------------------------- 1 | #include "windows.h" 2 | #include "..\..\version.h" 3 | 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Version 7 | // 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 10 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x40004L 18 | FILETYPE 0x3L 19 | FILESUBTYPE 0x7L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "000004b0" 24 | BEGIN 25 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 26 | #ifdef __NPF_NT4__ 27 | VALUE "FileDescription", "npf.sys (NT4) Kernel Driver" 28 | #elif defined(_AMD64_) 29 | VALUE "FileDescription", "npf.sys (NT5/6 AMD64) Kernel Driver" 30 | #else 31 | VALUE "FileDescription", "npf.sys (NT5/6 x86) Kernel Driver" 32 | #endif 33 | VALUE "FileVersion", WINPCAP_VER_STRING 34 | VALUE "InternalName", "NPF + TME" 35 | VALUE "LegalCopyright", WINPCAP_COPYRIGHT_STRING 36 | VALUE "LegalTrademarks", "" 37 | VALUE "OriginalFilename", "npf.sys" 38 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 39 | VALUE "ProductVersion", WINPCAP_VER_STRING 40 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 41 | END 42 | END 43 | BLOCK "VarFileInfo" 44 | BEGIN 45 | VALUE "Translation", 0x0, 1200 46 | END 47 | END 48 | 49 | -------------------------------------------------------------------------------- /packetNtx/driver/Sources: -------------------------------------------------------------------------------- 1 | TARGETNAME=npf 2 | 3 | TARGETPATH=bin$(TARGETSUFFIX) 4 | 5 | TARGETTYPE=DRIVER 6 | 7 | TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib 8 | 9 | C_DEFINES=$(C_DEFINES) -DWIN_NT_DRIVER -DWIN32_EXT $(NPF_C_DEFINES) 10 | 11 | INCLUDES=..\..\common 12 | 13 | SOURCES=packet.c \ 14 | openclos.c \ 15 | read.c \ 16 | write.c \ 17 | dump.c \ 18 | win_bpf_filter.c \ 19 | NPF.rc \ 20 | $(NPF_TME_FILES) 21 | 22 | I386_SOURCES = jitter.c 23 | -------------------------------------------------------------------------------- /packetNtx/driver/bucket_lookup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __bucket_lookup 34 | #define __bucket_lookup 35 | #ifdef WIN32 36 | #include "tme.h" 37 | #endif 38 | 39 | #ifdef __FreeBSD__ 40 | 41 | #ifdef _KERNEL 42 | #include 43 | #else 44 | #include 45 | #endif 46 | 47 | #endif 48 | 49 | #define BUCKET_LOOKUP_INSERT 0x00000011 50 | uint32 bucket_lookup_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); 51 | #define BUCKET_LOOKUP 0x00000010 52 | uint32 bucket_lookup(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); 53 | 54 | #endif -------------------------------------------------------------------------------- /packetNtx/driver/count_packets.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifdef WIN32 34 | #include "tme.h" 35 | #include "count_packets.h" 36 | #endif 37 | 38 | #ifdef __FreeBSD__ 39 | 40 | #ifdef _KERNEL 41 | #include 42 | #include 43 | #else 44 | #include 45 | #include 46 | #endif 47 | 48 | #endif 49 | 50 | #ifndef UNUSED 51 | #define UNUSED(_x) (_x) 52 | #endif 53 | 54 | 55 | uint32 count_packets(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data) 56 | { 57 | c_p_data *counters; 58 | 59 | UNUSED(mem_data); 60 | UNUSED(mem_ex); 61 | 62 | counters = (c_p_data*)(block+data->key_len*4); 63 | 64 | counters->bytes+=pkt_size; 65 | counters->packets++; 66 | 67 | return TME_SUCCESS; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /packetNtx/driver/count_packets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __count_packets 34 | #define __count_packets 35 | 36 | #ifdef WIN32 37 | #include "tme.h" 38 | #endif 39 | 40 | #ifdef __FreeBSD__ 41 | 42 | #ifdef _KERNEL 43 | #include 44 | #else 45 | #include 46 | #endif 47 | 48 | #endif 49 | 50 | typedef struct __c_p_data 51 | { 52 | struct timeval timestamp; 53 | uint64 packets; 54 | uint64 bytes; 55 | } 56 | c_p_data; 57 | 58 | #define COUNT_PACKETS 0x00000000 59 | uint32 count_packets(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data); 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /packetNtx/driver/functions.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifdef WIN32 34 | #include "tme.h" 35 | #include "functions.h" 36 | #endif 37 | 38 | #ifdef __FreeBSD__ 39 | 40 | #ifdef _KERNEL 41 | #include 42 | #include 43 | #include 44 | #else 45 | #include 46 | #include 47 | #include 48 | #endif 49 | 50 | #endif 51 | 52 | 53 | 54 | lut_fcn lut_fcn_mapper(uint32 index) 55 | { 56 | 57 | switch (index) 58 | { 59 | case NORMAL_LUT_W_INSERT: 60 | return (lut_fcn) normal_lut_w_insert; 61 | 62 | case NORMAL_LUT_WO_INSERT: 63 | return (lut_fcn) normal_lut_wo_insert; 64 | 65 | case BUCKET_LOOKUP: 66 | return (lut_fcn) bucket_lookup; 67 | 68 | case BUCKET_LOOKUP_INSERT: 69 | return (lut_fcn) bucket_lookup_insert; 70 | 71 | default: 72 | return NULL; 73 | } 74 | 75 | } 76 | 77 | exec_fcn exec_fcn_mapper(uint32 index) 78 | { 79 | switch (index) 80 | { 81 | case COUNT_PACKETS: 82 | return (exec_fcn) count_packets; 83 | 84 | case TCP_SESSION: 85 | return (exec_fcn) tcp_session; 86 | default: 87 | return NULL; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /packetNtx/driver/functions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1999 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __FUNCTIONS 34 | #define __FUNCTIONS 35 | 36 | #ifdef WIN32 37 | #include "tme.h" 38 | #endif 39 | 40 | #ifdef __FreeBSD__ 41 | 42 | #ifdef _KERNEL 43 | #include 44 | #else 45 | #include 46 | #endif 47 | 48 | #endif 49 | /*function mappers */ 50 | 51 | lut_fcn lut_fcn_mapper(uint32 index); 52 | exec_fcn exec_fcn_mapper(uint32 index); 53 | 54 | /* lookup functions */ 55 | 56 | #ifdef WIN32 57 | #include "bucket_lookup.h" 58 | #include "normal_lookup.h" 59 | #endif 60 | 61 | #ifdef __FreeBSD__ 62 | #include 63 | #include 64 | #endif 65 | 66 | /* execution functions */ 67 | 68 | #ifdef WIN32 69 | #include "count_packets.h" 70 | #include "tcp_session.h" 71 | #endif 72 | 73 | #ifdef __FreeBSD__ 74 | #include 75 | #include 76 | #endif 77 | 78 | #endif -------------------------------------------------------------------------------- /packetNtx/driver/normal_lookup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __normal_lookup 34 | #define __normal_lookup 35 | 36 | #ifdef WIN32 37 | #include "tme.h" 38 | #endif 39 | 40 | #ifdef __FreeBSD__ 41 | 42 | #ifdef _KERNEL 43 | #include 44 | #else 45 | #include 46 | #endif 47 | 48 | #endif 49 | 50 | #define NORMAL_LUT_W_INSERT 0x00000000 51 | uint32 normal_lut_w_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); 52 | #define NORMAL_LUT_WO_INSERT 0x00000001 53 | uint32 normal_lut_wo_insert(uint8 *key, TME_DATA *data, MEM_TYPE *mem_ex, struct time_conv *time_ref); 54 | #define DUMMY_INSERT 1234 55 | 56 | #endif -------------------------------------------------------------------------------- /packetNtx/driver/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by NPF.RC 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /packetNtx/driver/win_bpf_filter_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __FILTER_INIT 34 | #define __FILTER_INIT 35 | 36 | #include "tme.h" 37 | 38 | #define INIT_OK 1 39 | #define INIT_ERROR 0 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | uint32 bpf_filter_init(register struct bpf_insn *pc,MEM_TYPE *mem_ex, TME_CORE *tme, struct time_conv *time_ref); 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | - Implement the kernel dump with the new buffering mode 2 | - Check the buffered write functionality, in particular with the new gigabit adapters that caused problems to some users 3 | - Change the #define WIN32 with #define _WIN32 4 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/version.h -------------------------------------------------------------------------------- /wpcap/PRJ/WPCAP.DEF: -------------------------------------------------------------------------------- 1 | LIBRARY wpcap.dll 2 | 3 | EXPORTS 4 | pcap_lookupdev 5 | pcap_lookupnet 6 | pcap_open_live 7 | pcap_open_offline 8 | pcap_close 9 | pcap_getnonblock 10 | pcap_setnonblock 11 | pcap_loop 12 | pcap_dispatch 13 | pcap_read 14 | pcap_setuserbuffer 15 | pcap_offline_read 16 | pcap_next 17 | pcap_stats 18 | pcap_stats_ex 19 | pcap_setfilter 20 | pcap_perror 21 | pcap_strerror 22 | pcap_geterr 23 | pcap_compile 24 | pcap_compile_nopcap 25 | pcap_freecode 26 | pcap_datalink 27 | pcap_snapshot 28 | pcap_is_swapped 29 | pcap_major_version 30 | pcap_minor_version 31 | pcap_file 32 | pcap_fileno 33 | pcap_dump_open 34 | pcap_dump_close 35 | pcap_dump_flush 36 | pcap_dump 37 | pcap_dump_file 38 | pcap_setbuff 39 | pcap_setmode 40 | pcap_sendpacket 41 | pcap_sendqueue_alloc 42 | pcap_sendqueue_destroy 43 | pcap_sendqueue_queue 44 | pcap_sendqueue_transmit 45 | pcap_next_etherent 46 | pcap_getevent 47 | pcap_setmintocopy 48 | pcap_open_dead 49 | pcap_findalldevs 50 | pcap_freealldevs 51 | pcap_live_dump 52 | pcap_live_dump_ended 53 | bpf_filter 54 | bpf_validate 55 | bpf_image 56 | bpf_dump 57 | wsockinit 58 | endservent 59 | getservent 60 | eproto_db 61 | pcap_stats_ex 62 | pcap_open 63 | pcap_createsrcstr 64 | pcap_parsesrcstr 65 | pcap_findalldevs_ex 66 | pcap_remoteact_accept 67 | pcap_remoteact_list 68 | pcap_remoteact_close 69 | pcap_remoteact_cleanup 70 | install_bpf_program 71 | pcap_next_ex 72 | pcap_offline_filter 73 | pcap_setsampling 74 | pcap_breakloop 75 | pcap_list_datalinks 76 | pcap_list_datalinks 77 | pcap_set_datalink 78 | pcap_datalink_name_to_val 79 | pcap_datalink_val_to_name 80 | pcap_datalink_val_to_description 81 | pcap_lib_version 82 | pcap_dump_file 83 | pcap_dump_ftell 84 | pcap_get_airpcap_handle 85 | pcap_create 86 | pcap_activate 87 | pcap_set_promisc 88 | pcap_set_snaplen 89 | pcap_set_timeout 90 | pcap_set_buffer_size 91 | pcap_hopen_offline 92 | pcap_setdirection 93 | pcap_free_datalinks -------------------------------------------------------------------------------- /wpcap/PRJ/WPCAP.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "libpcap"=..\libpcap\Win32\Prj\libpcap.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "rpcapd"=..\libpcap\rpcapd\rpcapd.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name wpcap 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Project: "wpcap"=.\wpcap.dsp - Package Owner=<4> 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<4> 40 | {{{ 41 | Begin Project Dependency 42 | Project_Dep_Name libpcap 43 | End Project Dependency 44 | }}} 45 | 46 | ############################################################################### 47 | 48 | Global: 49 | 50 | Package=<5> 51 | {{{ 52 | }}} 53 | 54 | Package=<3> 55 | {{{ 56 | }}} 57 | 58 | ############################################################################### 59 | 60 | -------------------------------------------------------------------------------- /wpcap/PRJ/Wpcap_no_extensions.def: -------------------------------------------------------------------------------- 1 | LIBRARY wpcap.dll 2 | 3 | DESCRIPTION 'Win32 Packet Capture Library' 4 | 5 | EXPORTS 6 | pcap_lookupdev 7 | pcap_lookupnet 8 | pcap_open_live 9 | pcap_open_offline 10 | pcap_close 11 | pcap_getnonblock 12 | pcap_setnonblock 13 | pcap_loop 14 | pcap_dispatch 15 | pcap_read 16 | pcap_setuserbuffer 17 | pcap_offline_read 18 | pcap_next 19 | pcap_stats 20 | pcap_stats_ex 21 | pcap_setfilter 22 | pcap_perror 23 | pcap_strerror 24 | pcap_geterr 25 | pcap_compile 26 | pcap_compile_nopcap 27 | pcap_freecode 28 | pcap_datalink 29 | pcap_snapshot 30 | pcap_is_swapped 31 | pcap_major_version 32 | pcap_minor_version 33 | pcap_file 34 | pcap_fileno 35 | pcap_dump_open 36 | pcap_dump_close 37 | pcap_dump_flush 38 | pcap_dump 39 | pcap_dump_file 40 | pcap_setbuff 41 | pcap_setmode 42 | pcap_sendpacket 43 | pcap_sendqueue_alloc 44 | pcap_sendqueue_destroy 45 | pcap_sendqueue_queue 46 | pcap_sendqueue_transmit 47 | pcap_next_etherent 48 | pcap_getevent 49 | pcap_setmintocopy 50 | pcap_open_dead 51 | pcap_findalldevs 52 | pcap_freealldevs 53 | pcap_live_dump 54 | pcap_live_dump_ended 55 | bpf_filter 56 | bpf_validate 57 | bpf_image 58 | bpf_dump 59 | wsockinit 60 | endservent 61 | getservent 62 | eproto_db 63 | pcap_stats_ex 64 | install_bpf_program 65 | pcap_next_ex 66 | pcap_offline_filter 67 | pcap_breakloop 68 | pcap_list_datalinks 69 | pcap_list_datalinks 70 | pcap_set_datalink 71 | pcap_datalink_name_to_val 72 | pcap_datalink_val_to_name 73 | pcap_datalink_val_to_description 74 | pcap_lib_version 75 | pcap_dump_file 76 | pcap_dump_ftell 77 | pcap_get_airpcap_handle -------------------------------------------------------------------------------- /wpcap/PRJ/build_scanner_parser.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo Building the libpcap parser and scanner... 4 | del /Q /F ..\libpcap\grammar.c > nul 2> nul 5 | del /Q /F ..\libpcap\tokdefs.h > nul 2> nul 6 | 7 | bison -y -p pcap_ -d ../libpcap/GRAMMAR.Y > nul 8 | if not %ERRORLEVEL% == 0 ( 9 | echo failure in generating the grammar. 10 | goto end 11 | ) 12 | 13 | move y.tab.c ..\libpcap\grammar.c 14 | move y.tab.h ..\libpcap\tokdefs.h 15 | 16 | del /Q /F ..\libpcap\scanner.c >/nul 2>/nul 17 | flex -Ppcap_ -t ../libpcap/scanner.l > ../libpcap/scanner.c 18 | 19 | if not %ERRORLEVEL% == 0 ( 20 | echo failure in generating the scanner. 21 | goto end 22 | ) 23 | 24 | echo --- Done! 25 | 26 | :end -------------------------------------------------------------------------------- /wpcap/PRJ/wpcap.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wpcap", "wpcap.vcproj", "{20B438DA-CBEC-4AFF-B11C-67B301D14AD5}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug - No AirPcap|Win32 = Debug - No AirPcap|Win32 9 | Debug - No AirPcap|x64 = Debug - No AirPcap|x64 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release - No AirPcap|Win32 = Release - No AirPcap|Win32 13 | Release - No AirPcap|x64 = Release - No AirPcap|x64 14 | Release|Win32 = Release|Win32 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug - No AirPcap|Win32.ActiveCfg = Debug No AirPcap|Win32 19 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug - No AirPcap|Win32.Build.0 = Debug No AirPcap|Win32 20 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug - No AirPcap|x64.ActiveCfg = Debug No AirPcap|x64 21 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug - No AirPcap|x64.Build.0 = Debug No AirPcap|x64 22 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug|Win32.Build.0 = Debug|Win32 24 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug|x64.ActiveCfg = Debug|x64 25 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Debug|x64.Build.0 = Debug|x64 26 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release - No AirPcap|Win32.ActiveCfg = Release No AirPcap|Win32 27 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release - No AirPcap|Win32.Build.0 = Release No AirPcap|Win32 28 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release - No AirPcap|x64.ActiveCfg = Release No AirPcap|x64 29 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release - No AirPcap|x64.Build.0 = Release No AirPcap|x64 30 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release|Win32.ActiveCfg = Release|Win32 31 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release|Win32.Build.0 = Release|Win32 32 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release|x64.ActiveCfg = Release|x64 33 | {20B438DA-CBEC-4AFF-B11C-67B301D14AD5}.Release|x64.Build.0 = Release|x64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /wpcap/Win32-Extensions/version.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/wpcap/Win32-Extensions/version.aps -------------------------------------------------------------------------------- /wpcap/Win32-Extensions/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /wpcap/Win32-Extensions/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // Version.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x17L 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x4L 22 | FILETYPE 0x2L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | VALUE "FileDescription", "wpcap.dll Dynamic Link Library - based on libpcap " WINPCAP_LIBPCAP_VERSION 31 | VALUE "FileVersion", WINPCAP_VER_STRING 32 | VALUE "InternalName", "wpcap.dll" 33 | VALUE "LegalCopyright", WINPCAP_COPYRIGHT_STRING 34 | VALUE "LegalTrademarks", "" 35 | VALUE "OriginalFilename", "wpcap.dll" 36 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 37 | VALUE "ProductVersion", WINPCAP_VER_STRING 38 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 39 | END 40 | END 41 | BLOCK "VarFileInfo" 42 | BEGIN 43 | VALUE "Translation", 0x0, 1200 44 | END 45 | END 46 | -------------------------------------------------------------------------------- /wpcap/libpcap/pcap-tc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 CACE Technologies, Davis (California) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of CACE Technologies nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | */ 31 | 32 | #ifndef __PCAP_TC_H__ 33 | #define __PCAP_TC_H__ 34 | 35 | /* 36 | * needed because gcc headers do not have C_ASSERT 37 | */ 38 | #ifndef C_ASSERT 39 | #define C_ASSERT(a) 40 | #endif 41 | 42 | #include 43 | 44 | /* 45 | * functions used effectively by the pcap library 46 | */ 47 | 48 | int 49 | TcFindAllDevs(pcap_if_t **alldevsp, char *errbuf); 50 | 51 | int 52 | IsTcDevice(pcap_t *p); 53 | 54 | int 55 | TcActivate(pcap_t *p); 56 | 57 | HANDLE 58 | TcGetReceiveWaitHandle(pcap_t *p); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /wpcap/libpcap/readme-rpcap.txt: -------------------------------------------------------------------------------- 1 | ******************** RPCAP AND CODE MODIFICATIONS ******************** 2 | 3 | These files are the ones which have to be modified when compiling a new release of WinPcap. 4 | 5 | All the modifications are included within: 6 | 7 | #ifdef REMOTE 8 | .... 9 | #endif 10 | 11 | therefore it should be quite easy to locate which point you have to modify. 12 | 13 | 14 | ******************** COMPILE LIBPCAP WITH RPCAP SUPPORT UNDER UNIX ******************** 15 | 16 | First, you must unpack all text files according to the UNIX standard. For this, you may use 17 | "unzip -a" (it extracts the files using the platform-native format for text files) or the 18 | dos2unix conversion utility. 19 | 20 | Second, you have to type '/.configure' in order to create the makefile. 21 | In case this step fails, you should re-create the configure by launching 'autoconf' 22 | (version 2.50 or higher) in the libpcap folder. 23 | 24 | Finally, you have to compile the project by typing 'make'. 25 | In case some error occurs, let's try to delete all the config.* files from the 'libpcap' 26 | folder and restart this process from scratch. 27 | 28 | These steps are able to compile the libpcap library; now you have to compile the rpcapd daemon. 29 | For this, you have to type 'make' in the 'rpcapd' folder. 30 | 31 | 32 | -------------------------------------------------------------------------------- /wpcap/libpcap/remote_overwritten_files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/wpcap/libpcap/remote_overwritten_files.zip -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/Makefile: -------------------------------------------------------------------------------- 1 | ################################ 2 | # Makefile for the remote daemon 3 | ################################ 4 | 5 | CC = gcc 6 | CFLAGS = -pthread -DHAVE_REMOTE -DHAVE_SNPRINTF 7 | #flags for debugging: -D_DEBUG -g -Wall 8 | 9 | INCLUDE = -I../ 10 | 11 | LIB = -lpcap -lcrypt 12 | #Solaris: add '-lsocket' 13 | 14 | LIBPATH = -L../ 15 | 16 | # Files that are needed to compile this project 17 | FILES = rpcapd.o daemon.o utils.o fileconf.o pcap-remote.o sockutils.o pcap-new.o 18 | 19 | # Makefile syntax: 20 | # Project name : dependencies 21 | # command line 22 | 23 | rpcapd: $(FILES) 24 | $(CC) $(CFLAGS) $(INCLUDE) -o rpcapd $(FILES) $(LIBPATH) $(LIB) 25 | 26 | rpcapd.o: rpcapd.c 27 | $(CC) $(CFLAGS) $(INCLUDE) -c rpcapd.c 28 | 29 | daemon.o: daemon.c 30 | $(CC) $(CFLAGS) $(INCLUDE) -c daemon.c 31 | 32 | utils.o: utils.c 33 | $(CC) $(CFLAGS) $(INCLUDE) -c utils.c 34 | 35 | fileconf.o: fileconf.c 36 | $(CC) $(CFLAGS) $(INCLUDE) -c fileconf.c 37 | 38 | sockutils.o: ../sockutils.c 39 | $(CC) $(CFLAGS) $(INCLUDE) -c ../sockutils.c 40 | 41 | pcap-remote.o: ../pcap-remote.c 42 | $(CC) $(CFLAGS) $(INCLUDE) -c ../pcap-remote.c 43 | 44 | pcap-new.o: ../pcap-new.c 45 | $(CC) $(CFLAGS) $(INCLUDE) -c ../pcap-new.c 46 | 47 | clean: 48 | rm -f *.o 49 | rm rpcapd 50 | 51 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __DAEMON_H__ 34 | #define __DAEMON_H__ 35 | 36 | //! Structure that keeps the parameters needed by the daemon_serviceloop() function 37 | struct daemon_slpars 38 | { 39 | SOCKET sockctrl; //!< SOCKET ID of the control connection 40 | int isactive; //!< Not null if the daemon has to run in active mode 41 | int nullAuthAllowed; //!< '1' if we permit NULL authentication, '0' otherwise 42 | int activeclose; //!< '1' if the client closed the control connection explicitely; used in active mode only 43 | }; 44 | 45 | 46 | void daemon_serviceloop( void *ptr ); 47 | 48 | void pthread_suspend(int msec); 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/fileconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __FILECONF_H__ 34 | #define __FILECONF_H__ 35 | 36 | 37 | void fileconf_read(int sign); 38 | int fileconf_save(const char *savefile); 39 | 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by version.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/rpcapd.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "rpcapd"=.\rpcapd.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/rpcapd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __RPCAPD_H__ 34 | #define __RPCAPD_H__ 35 | 36 | 37 | #define PROGRAM_NAME "rpcapd" 38 | #define MAX_LINE 2048 /* Maximum chars allowed for the host list (in passive mode) */ 39 | #define SOCKET_MAXCONN 10 /* Maximum number of connections queued into the accept() */ 40 | #define MAX_HOST_LIST 64000 41 | #define MAX_ACTIVE_LIST 10 42 | 43 | 44 | struct active_pars 45 | { 46 | char address[MAX_LINE + 1]; // keeps the network address (either numeric or literal) to of the active client 47 | char port[MAX_LINE + 1]; // keeps the network port to bind to 48 | int ai_family; // address faimly to use 49 | }; 50 | 51 | 52 | void main_startup(void); 53 | void main_cleanup(int sign); 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/rpcapd.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcapd", "rpcapd.vcproj", "{4ACD9F0C-4716-4F6E-AD37-B60D73265840}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {4ACD9F0C-4716-4F6E-AD37-B60D73265840}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {4ACD9F0C-4716-4F6E-AD37-B60D73265840}.Debug|Win32.Build.0 = Debug|Win32 14 | {4ACD9F0C-4716-4F6E-AD37-B60D73265840}.Release|Win32.ActiveCfg = Release|Win32 15 | {4ACD9F0C-4716-4F6E-AD37-B60D73265840}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/rpcapd.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | 67 | 68 | Resource Files 69 | 70 | 71 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | #ifndef __UTILS_H__ 34 | #define __UTILS_H__ 35 | 36 | 37 | // Common functions declaration 38 | 39 | #ifdef WIN32 40 | int getopt(int nargc, char * const *nargv, const char *ostr); 41 | #endif 42 | 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/version.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | 4 | #define APSTUDIO_READONLY_SYMBOLS 5 | ///////////////////////////////////////////////////////////////////////////// 6 | // 7 | // Generated from the TEXTINCLUDE 2 resource. 8 | // 9 | #include "afxres.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Neutral resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "\r\n" 32 | "\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "#include ""version.rc2""\r\n" 44 | "\r\n" 45 | "\0" 46 | END 47 | 48 | #endif // APSTUDIO_INVOKED 49 | 50 | #endif // Neutral resources 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | 54 | 55 | #ifndef APSTUDIO_INVOKED 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // Generated from the TEXTINCLUDE 3 resource. 59 | // 60 | #include "Version.rc2" 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | #endif // not APSTUDIO_INVOKED 64 | 65 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/version.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // version.rc2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | #include "..\..\..\version.h" 11 | 12 | VS_VERSION_INFO VERSIONINFO 13 | FILEVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 14 | PRODUCTVERSION WINPCAP_MAJOR,WINPCAP_MINOR,WINPCAP_REV,WINPCAP_BUILD 15 | FILEFLAGSMASK 0x3fL 16 | #ifdef _DEBUG 17 | FILEFLAGS 0x1L 18 | #else 19 | FILEFLAGS 0x0L 20 | #endif 21 | FILEOS 0x40004L 22 | FILETYPE 0x1L 23 | FILESUBTYPE 0x0L 24 | BEGIN 25 | BLOCK "StringFileInfo" 26 | BEGIN 27 | BLOCK "000004b0" 28 | BEGIN 29 | VALUE "CompanyName", WINPCAP_COMPANY_NAME 30 | VALUE "FileDescription", "Remote Packet Capture Daemon" 31 | VALUE "FileVersion", WINPCAP_VER_STRING 32 | VALUE "InternalName", "rpcapd" 33 | VALUE "LegalCopyright", WINPCAP_RPCAPD_COPYRIGHT_STRING 34 | VALUE "LegalTrademarks", "" 35 | VALUE "OriginalFilename", "rpcapd.exe" 36 | VALUE "ProductName", WINPCAP_PRODUCT_NAME 37 | VALUE "ProductVersion", WINPCAP_VER_STRING 38 | VALUE "Build Description", WINPCAP_BUILD_DESCRIPTION 39 | END 40 | END 41 | BLOCK "VarFileInfo" 42 | BEGIN 43 | VALUE "Translation", 0x0, 1200 44 | END 45 | END 46 | -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/win32-pthreads/pthreadVC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/wpcap/libpcap/rpcapd/win32-pthreads/pthreadVC.dll -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/win32-pthreads/pthreadVC.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wireshark/winpcap/267327e28031d2d3d74c28cf18a08dfbc515071b/wpcap/libpcap/rpcapd/win32-pthreads/pthreadVC.lib -------------------------------------------------------------------------------- /wpcap/libpcap/rpcapd/win32-svc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2003 3 | * NetGroup, Politecnico di Torino (Italy) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | */ 32 | 33 | int svc_start(void); 34 | -------------------------------------------------------------------------------- /wpcap/libpcap/snprintf.patch: -------------------------------------------------------------------------------- 1 | diff --git a/pcap-stdinc.h b/pcap-stdinc.h 2 | --- a/pcap-stdinc.h 3 | +++ b/pcap-stdinc.h 4 | @@ -60,7 +60,7 @@ 5 | 6 | #define caddr_t char* 7 | 8 | -#if _MSC_VER < 1500 9 | +#ifdef _MSC_VER 10 | #define snprintf _snprintf 11 | #define vsnprintf _vsnprintf 12 | #define strdup _strdup 13 | --------------------------------------------------------------------------------