From 5e68b7c2a9c9a070b54b561c6649764f0ecb0e9d Mon Sep 17 00:00:00 2001 From: gangphon Date: Thu, 25 Aug 2022 18:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4ledset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ledset/.gitignore | 73 + ledset/128.ico | Bin 0 -> 67646 bytes .../WpdPack_4_1_2/Examples-pcap/GNUmakefile | 10 + .../WpdPack_4_1_2/Examples-pcap/MakeaAll.dsw | 137 + .../Examples-pcap/UDPdump/GNUmakefile | 17 + .../Examples-pcap/UDPdump/UDPdump.dsp | 110 + .../Examples-pcap/UDPdump/UDPdump.dsw | 29 + .../Examples-pcap/UDPdump/udpdump.c | 242 + .../Examples-pcap/basic_dump/GNUmakefile | 17 + .../Examples-pcap/basic_dump/basic_dump.c | 109 + .../Examples-pcap/basic_dump/basic_dump.dsp | 110 + .../Examples-pcap/basic_dump/basic_dump.dsw | 29 + .../Examples-pcap/basic_dump_ex/GNUmakefile | 17 + .../basic_dump_ex/basic_dump_ex.c | 106 + .../basic_dump_ex/basic_dump_ex.dsp | 110 + .../basic_dump_ex/basic_dump_ex.dsw | 29 + .../Examples-pcap/iflist/GNUmakefile | 17 + .../Examples-pcap/iflist/iflist.c | 172 + .../Examples-pcap/iflist/iflist.dsp | 110 + .../Examples-pcap/iflist/iflist.dsw | 29 + .../Examples-pcap/pcap_filter/GNUmakefile | 17 + .../Examples-pcap/pcap_filter/pcap_filter.c | 179 + .../Examples-pcap/pcap_filter/pcap_filter.dsp | 110 + .../Examples-pcap/pcap_filter/pcap_filter.dsw | 29 + .../Examples-pcap/pktdump_ex/GNUmakefile | 14 + .../Examples-pcap/pktdump_ex/pktdump_ex.c | 166 + .../Examples-pcap/pktdump_ex/pktdump_ex.dsp | 110 + .../Examples-pcap/pktdump_ex/pktdump_ex.dsw | 29 + .../Examples-pcap/readfile/GNUmakefile | 17 + .../Examples-pcap/readfile/readfile.c | 61 + .../Examples-pcap/readfile/readfile.dsp | 110 + .../Examples-pcap/readfile/readfile.dsw | 29 + .../Examples-pcap/readfile_ex/GNUmakefile | 17 + .../Examples-pcap/readfile_ex/readfile_ex.c | 56 + .../Examples-pcap/readfile_ex/readfile_ex.dsp | 110 + .../Examples-pcap/readfile_ex/readfile_ex.dsw | 29 + .../Examples-pcap/savedump/GNUmakefile | 17 + .../Examples-pcap/savedump/savedump.c | 111 + .../Examples-pcap/savedump/savedump.dsp | 110 + .../Examples-pcap/savedump/savedump.dsw | 29 + .../Examples-pcap/sendpack/GNUmakefile | 17 + .../Examples-pcap/sendpack/sendpack.c | 68 + .../Examples-pcap/sendpack/sendpack.dsp | 110 + .../Examples-pcap/sendpack/sendpack.dsw | 29 + .../Examples-remote/MakeaAll.dsw | 221 + .../GetMacAddress/GetMacAddress.c | 152 + .../GetMacAddress/GetMacAddress.dsp | 105 + .../TestPacketCapture/TestPacketCapture.c | 244 + .../TestPacketCapture/TestPacketCapture.dsp | 105 + .../TestPacketSend/TestPacketSend.c | 235 + .../TestPacketSend/TestPacketSend.dsp | 107 + .../Examples-remote/PacketDriver/readme.txt | 2 + .../Examples-remote/UDPdump/UDPdump.dsp | 110 + .../Examples-remote/UDPdump/UDPdump.dsw | 29 + .../Examples-remote/UDPdump/udpdump.c | 230 + .../UserLevelBridge/UserBridge.c | 467 + .../UserLevelBridge/UserBridge.dsp | 106 + .../UserLevelBridge/UserBridge.dsw | 29 + .../Examples-remote/iflist/iflist.c | 176 + .../Examples-remote/iflist/iflist.dsp | 110 + .../Examples-remote/iflist/iflist.dsw | 29 + .../Examples-remote/misc/MakeaAll.dsw | 89 + .../Examples-remote/misc/basic_dump.c | 100 + .../Examples-remote/misc/basic_dump.dsp | 110 + .../Examples-remote/misc/basic_dump_ex.c | 99 + .../Examples-remote/misc/basic_dump_ex.dsp | 110 + .../Examples-remote/misc/readfile.c | 78 + .../Examples-remote/misc/readfile.dsp | 110 + .../Examples-remote/misc/readfile_ex.c | 73 + .../Examples-remote/misc/readfile_ex.dsp | 110 + .../Examples-remote/misc/savedump.c | 104 + .../Examples-remote/misc/savedump.dsp | 110 + .../Examples-remote/misc/sendpack.c | 64 + .../Examples-remote/misc/sendpack.dsp | 110 + .../Examples-remote/pcap_filter/pcap_filter.c | 169 + .../pcap_filter/pcap_filter.dsp | 110 + .../pcap_filter/pcap_filter.dsw | 29 + .../Examples-remote/pcap_fopen/pcap_fopen.cpp | 94 + .../Examples-remote/pktdump_ex/pktdump_ex.c | 163 + .../Examples-remote/pktdump_ex/pktdump_ex.dsp | 110 + .../Examples-remote/pktdump_ex/pktdump_ex.dsw | 29 + .../Examples-remote/sendcap/sencap.dsw | 29 + .../Examples-remote/sendcap/sendcap.c | 184 + .../Examples-remote/sendcap/sendcap.dsp | 110 + .../Examples-remote/smp_1/smp_1.c | 134 + .../Examples-remote/smp_1/smp_1.dsp | 102 + .../Examples-remote/smp_1/smp_1.dsw | 29 + .../Examples-remote/tcptop/tcptop.c | 158 + .../Examples-remote/tcptop/tcptop.dsp | 110 + .../Examples-remote/tcptop/tcptop.dsw | 29 + ledset/WpdPack_4_1_2/Include/Packet32.h | 359 + .../WpdPack_4_1_2/Include/Win32-Extensions.h | 113 + ledset/WpdPack_4_1_2/Include/bittypes.h | 137 + ledset/WpdPack_4_1_2/Include/ip6_misc.h | 163 + ledset/WpdPack_4_1_2/Include/pcap-bpf.h | 47 + ledset/WpdPack_4_1_2/Include/pcap-namedb.h | 42 + ledset/WpdPack_4_1_2/Include/pcap-stdinc.h | 93 + ledset/WpdPack_4_1_2/Include/pcap.h | 45 + ledset/WpdPack_4_1_2/Include/pcap/bluetooth.h | 48 + ledset/WpdPack_4_1_2/Include/pcap/bpf.h | 934 ++ ledset/WpdPack_4_1_2/Include/pcap/namedb.h | 89 + ledset/WpdPack_4_1_2/Include/pcap/pcap.h | 407 + ledset/WpdPack_4_1_2/Include/pcap/sll.h | 129 + ledset/WpdPack_4_1_2/Include/pcap/usb.h | 90 + ledset/WpdPack_4_1_2/Include/pcap/vlan.h | 46 + ledset/WpdPack_4_1_2/Include/remote-ext.h | 444 + ledset/WpdPack_4_1_2/Lib/Packet.lib | Bin 0 -> 8450 bytes ledset/WpdPack_4_1_2/Lib/wpcap.lib | Bin 0 -> 19320 bytes ledset/WpdPack_4_1_2/Lib/x64/Packet.lib | Bin 0 -> 8290 bytes ledset/WpdPack_4_1_2/Lib/x64/wpcap.lib | Bin 0 -> 18892 bytes ledset/WpdPack_4_1_2/docs/WinPcap_docs.html | 9 + ledset/WpdPack_4_1_2/docs/html/Packet_8h.html | 201 + .../docs/html/Packet_8h_source.html | 572 ++ .../docs/html/Win32-Extensions_8h.html | 700 ++ .../docs/html/Win32-Extensions_8h_source.html | 139 + ledset/WpdPack_4_1_2/docs/html/annotated.html | 70 + ledset/WpdPack_4_1_2/docs/html/classes.html | 45 + ledset/WpdPack_4_1_2/docs/html/daemon_8h.html | 81 + .../docs/html/daemon_8h_source.html | 82 + .../WpdPack_4_1_2/docs/html/deprecated.html | 51 + ledset/WpdPack_4_1_2/docs/html/doxygen.png | Bin 0 -> 1281 bytes .../docs/html/doxygen__groups_8txt.html | 36 + ledset/WpdPack_4_1_2/docs/html/dump.gif | Bin 0 -> 6353 bytes ledset/WpdPack_4_1_2/docs/html/encoding.gif | Bin 0 -> 2777 bytes .../WpdPack_4_1_2/docs/html/fileconf_8h.html | 78 + .../docs/html/fileconf_8h_source.html | 74 + ledset/WpdPack_4_1_2/docs/html/files.html | 50 + ledset/WpdPack_4_1_2/docs/html/ftv2blank.png | Bin 0 -> 174 bytes ledset/WpdPack_4_1_2/docs/html/ftv2doc.png | Bin 0 -> 255 bytes .../docs/html/ftv2folderclosed.png | Bin 0 -> 259 bytes .../docs/html/ftv2folderopen.png | Bin 0 -> 261 bytes .../WpdPack_4_1_2/docs/html/ftv2lastnode.png | Bin 0 -> 233 bytes ledset/WpdPack_4_1_2/docs/html/ftv2link.png | Bin 0 -> 358 bytes .../WpdPack_4_1_2/docs/html/ftv2mlastnode.png | Bin 0 -> 160 bytes ledset/WpdPack_4_1_2/docs/html/ftv2mnode.png | Bin 0 -> 194 bytes ledset/WpdPack_4_1_2/docs/html/ftv2node.png | Bin 0 -> 235 bytes .../WpdPack_4_1_2/docs/html/ftv2plastnode.png | Bin 0 -> 165 bytes ledset/WpdPack_4_1_2/docs/html/ftv2pnode.png | Bin 0 -> 200 bytes .../WpdPack_4_1_2/docs/html/ftv2vertline.png | Bin 0 -> 229 bytes .../docs/html/funcs_2pcap_8h.html | 176 + .../docs/html/funcs_2pcap_8h_source.html | 206 + ledset/WpdPack_4_1_2/docs/html/functions.html | 627 ++ .../docs/html/functions_vars.html | 627 ++ ledset/WpdPack_4_1_2/docs/html/globals.html | 114 + .../WpdPack_4_1_2/docs/html/globals_0x62.html | 204 + .../WpdPack_4_1_2/docs/html/globals_0x63.html | 99 + .../WpdPack_4_1_2/docs/html/globals_0x64.html | 96 + .../WpdPack_4_1_2/docs/html/globals_0x65.html | 105 + .../WpdPack_4_1_2/docs/html/globals_0x66.html | 78 + .../WpdPack_4_1_2/docs/html/globals_0x67.html | 96 + .../WpdPack_4_1_2/docs/html/globals_0x68.html | 75 + .../WpdPack_4_1_2/docs/html/globals_0x69.html | 81 + .../WpdPack_4_1_2/docs/html/globals_0x6a.html | 99 + .../WpdPack_4_1_2/docs/html/globals_0x6b.html | 75 + .../WpdPack_4_1_2/docs/html/globals_0x6d.html | 128 + .../WpdPack_4_1_2/docs/html/globals_0x6e.html | 195 + .../WpdPack_4_1_2/docs/html/globals_0x6f.html | 81 + .../WpdPack_4_1_2/docs/html/globals_0x70.html | 486 + .../WpdPack_4_1_2/docs/html/globals_0x72.html | 210 + .../WpdPack_4_1_2/docs/html/globals_0x73.html | 105 + .../WpdPack_4_1_2/docs/html/globals_0x74.html | 81 + .../WpdPack_4_1_2/docs/html/globals_0x75.html | 81 + .../WpdPack_4_1_2/docs/html/globals_defs.html | 707 ++ .../WpdPack_4_1_2/docs/html/globals_enum.html | 50 + .../WpdPack_4_1_2/docs/html/globals_eval.html | 56 + .../WpdPack_4_1_2/docs/html/globals_func.html | 526 + .../WpdPack_4_1_2/docs/html/globals_type.html | 125 + .../WpdPack_4_1_2/docs/html/globals_vars.html | 71 + .../WpdPack_4_1_2/docs/html/group__NPF.html | 301 + .../docs/html/group__NPF__code.html | 1667 ++++ .../docs/html/group__NPF__include.html | 756 ++ .../docs/html/group__NPF__ioctl.html | 376 + .../docs/html/group__NPF__jitter.html | 1652 ++++ .../docs/html/group__compilation.html | 242 + .../docs/html/group__internals.html | 98 + .../docs/html/group__language.html | 633 ++ .../docs/html/group__packetapi.html | 87 + .../docs/html/group__remote.html | 386 + .../html/group__remote__auth__methods.html | 76 + .../docs/html/group__remote__open__flags.html | 135 + .../docs/html/group__remote__pri__func.html | 33 + .../docs/html/group__remote__pri__struct.html | 1033 ++ .../html/group__remote__samp__methods.html | 95 + .../docs/html/group__remote__source__ID.html | 95 + .../html/group__remote__source__string.html | 112 + .../docs/html/group__remote__struct.html | 85 + .../docs/html/group__remotefunc.html | 33 + .../WpdPack_4_1_2/docs/html/group__wpcap.html | 81 + .../docs/html/group__wpcap__def.html | 279 + .../docs/html/group__wpcap__tut.html | 34 + .../docs/html/group__wpcap__tut1.html | 81 + .../docs/html/group__wpcap__tut2.html | 216 + .../docs/html/group__wpcap__tut3.html | 140 + .../docs/html/group__wpcap__tut4.html | 137 + .../docs/html/group__wpcap__tut5.html | 62 + .../docs/html/group__wpcap__tut6.html | 279 + .../docs/html/group__wpcap__tut7.html | 438 + .../docs/html/group__wpcap__tut8.html | 292 + .../docs/html/group__wpcap__tut9.html | 206 + .../docs/html/group__wpcapfunc.html | 2452 +++++ .../docs/html/group__wpcapsamps.html | 500 + .../docs/html/incs_2pcap_8h.html | 78 + .../docs/html/incs_2pcap_8h_source.html | 155 + ledset/WpdPack_4_1_2/docs/html/index.hhc | 171 + ledset/WpdPack_4_1_2/docs/html/index.hhk | 2939 ++++++ ledset/WpdPack_4_1_2/docs/html/index.hhp | 160 + ledset/WpdPack_4_1_2/docs/html/index.html | 16 + .../docs/html/internals-arch.gif | Bin 0 -> 4650 bytes ledset/WpdPack_4_1_2/docs/html/ioctls_8h.html | 73 + .../docs/html/ioctls_8h_source.html | 105 + ledset/WpdPack_4_1_2/docs/html/jitter_8h.html | 160 + .../docs/html/jitter_8h_source.html | 321 + ledset/WpdPack_4_1_2/docs/html/main.html | 237 + ledset/WpdPack_4_1_2/docs/html/main_8txt.html | 36 + ledset/WpdPack_4_1_2/docs/html/modules.html | 73 + ledset/WpdPack_4_1_2/docs/html/npf-dump.gif | Bin 0 -> 4656 bytes ledset/WpdPack_4_1_2/docs/html/npf-ndis.gif | Bin 0 -> 3572 bytes ledset/WpdPack_4_1_2/docs/html/npf-npf.gif | Bin 0 -> 8463 bytes ledset/WpdPack_4_1_2/docs/html/pages.html | 32 + .../docs/html/pcap-remote_8h.html | 626 ++ .../docs/html/pcap-remote_8h_source.html | 307 + .../docs/html/remote-ext_8h.html | 444 + .../docs/html/remote-ext_8h_source.html | 171 + ledset/WpdPack_4_1_2/docs/html/rpcapd_8h.html | 162 + .../docs/html/rpcapd_8h_source.html | 88 + ledset/WpdPack_4_1_2/docs/html/stats.gif | Bin 0 -> 5431 bytes .../WpdPack_4_1_2/docs/html/stats_wpcap.gif | Bin 0 -> 5267 bytes .../docs/html/structJIT__BPF__Filter.html | 88 + .../docs/html/structPacketHeader.html | 92 + .../docs/html/struct__DEVICE__EXTENSION.html | 90 + .../docs/html/struct__INTERNAL__REQUEST.html | 124 + .../docs/html/struct__OPEN__INSTANCE.html | 978 ++ .../docs/html/struct__PACKET__OID__DATA.html | 107 + .../docs/html/struct__PACKET__RESERVED.html | 147 + .../html/struct____CPU__Private__Data.html | 257 + .../docs/html/structactive__pars.html | 94 + .../docs/html/structactivehosts.html | 102 + .../docs/html/structbinary__stream.html | 129 + .../docs/html/structdaemon__slpars.html | 126 + .../docs/html/structpacket__file__header.html | 187 + .../docs/html/structpcap__addr.html | 148 + .../docs/html/structpcap__file__header.html | 192 + .../docs/html/structpcap__if.html | 148 + .../docs/html/structpcap__pkthdr.html | 111 + .../docs/html/structpcap__rmtauth.html | 115 + .../docs/html/structpcap__samp.html | 89 + .../docs/html/structpcap__send__queue.html | 107 + .../docs/html/structpcap__stat.html | 130 + .../docs/html/structrpcap__auth.html | 129 + .../docs/html/structrpcap__filter.html | 110 + .../html/structrpcap__filterbpf__insn.html | 129 + .../html/structrpcap__findalldevs__if.html | 148 + .../structrpcap__findalldevs__ifaddr.html | 129 + .../docs/html/structrpcap__header.html | 129 + .../docs/html/structrpcap__openreply.html | 92 + .../docs/html/structrpcap__pkthdr.html | 149 + .../docs/html/structrpcap__sampling.html | 129 + .../docs/html/structrpcap__startcapreply.html | 110 + .../docs/html/structrpcap__startcapreq.html | 129 + .../docs/html/structrpcap__stats.html | 129 + .../docs/html/structsf__pkthdr.html | 108 + ledset/WpdPack_4_1_2/docs/html/style.css | 360 + ledset/WpdPack_4_1_2/docs/html/tab_b.gif | Bin 0 -> 35 bytes ledset/WpdPack_4_1_2/docs/html/tab_l.gif | Bin 0 -> 706 bytes ledset/WpdPack_4_1_2/docs/html/tab_r.gif | Bin 0 -> 2585 bytes ledset/WpdPack_4_1_2/docs/html/tabs.css | 105 + ledset/WpdPack_4_1_2/docs/html/tree.html | 175 + ledset/WpdPack_4_1_2/docs/html/utils_8h.html | 74 + .../docs/html/utils_8h_source.html | 77 + .../WpdPack_4_1_2/docs/html/win32-svc_8h.html | 59 + .../docs/html/win32-svc_8h_source.html | 65 + ledset/WpdPack_4_1_2/docs/html/winpcap.gif | Bin 0 -> 10723 bytes .../WpdPack_4_1_2/docs/html/winpcap_small.gif | Bin 0 -> 2160 bytes .../docs/html/wpcap__remote_8htm.html | 180 + .../docs/html/wpcap__remote_8htm_source.html | 382 + .../docs/html/wpcap__tut1_8txt.html | 36 + .../docs/html/wpcap__tut2_8txt.html | 36 + .../docs/html/wpcap__tut3_8txt.html | 36 + .../docs/html/wpcap__tut4_8txt.html | 36 + .../docs/html/wpcap__tut5_8txt.html | 36 + .../docs/html/wpcap__tut6_8txt.html | 36 + .../docs/html/wpcap__tut7_8txt.html | 36 + .../docs/html/wpcap__tut8_8txt.html | 36 + .../docs/html/wpcap__tut9_8txt.html | 36 + .../docs/html/wpcap__tut_8txt.html | 36 + ledset/basewin.cpp | 172 + ledset/basewin.h | 113 + ledset/brightwin.cpp | 196 + ledset/brightwin.h | 13 + ledset/capthread - 副本.cpp | 324 + ledset/capthread - 副本.h | 114 + ledset/expertsmartpointsetwin.cpp | 229 + ledset/expertsmartpointsetwin.h | 12 + ledset/expertwin.cpp | 227 + ledset/expertwin.h | 29 + ledset/fast.cpp | 17 + ledset/fast.h | 13 + ledset/gqt.cpp | 4 + ledset/gqt.h | 33 + ledset/imgs/bright.png | Bin 0 -> 4498 bytes ledset/imgs/correct.png | Bin 0 -> 3610 bytes ledset/imgs/expert.png | Bin 0 -> 3682 bytes ledset/imgs/fast.png | Bin 0 -> 2353 bytes ledset/imgs/idea.png | Bin 0 -> 3173 bytes ledset/imgs/monitor.png | Bin 0 -> 3383 bytes ledset/imgs/multi.png | Bin 0 -> 5219 bytes ledset/imgs/radio-check.png | Bin 0 -> 1307 bytes ledset/imgs/radio-un.png | Bin 0 -> 1021 bytes ledset/imgs/video.png | Bin 0 -> 3185 bytes ledset/ledset.pro | 78 + ledset/main.cpp | 172 + ledset/mainwin.cpp | 111 + ledset/mainwin.h | 13 + ledset/pcapthread.cpp | 45 + ledset/pcapthread.h | 37 + ledset/pcapwin.cpp | 289 + ledset/pcapwin.h | 38 + ledset/res.qrc | 15 + ledset/screenunit.cpp | 325 + ledset/screenunit.h | 37 + ledset/table.cpp | 18 + ledset/table.h | 83 + ledset/translations/app_en.ts | 3 + ledset/translations/qt_en.ts | 4 + ledset/translations/qt_ja.ts | 8655 +++++++++++++++++ ledset/translations/qt_zh_CN.ts | 6666 +++++++++++++ ledset/translations/qt_zh_TW.ts | 7387 ++++++++++++++ 327 files changed, 71330 insertions(+) create mode 100644 ledset/.gitignore create mode 100644 ledset/128.ico create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/MakeaAll.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/udpdump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/iflist/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/savedump/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/sendpack/GNUmakefile create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.c create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/MakeaAll.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketCapture/TestPacketCapture.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketCapture/TestPacketCapture.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/readme.txt create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UDPdump/udpdump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/MakeaAll.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pcap_fopen/pcap_fopen.cpp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/sendcap/sencap.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsw create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.c create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsp create mode 100644 ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsw create mode 100644 ledset/WpdPack_4_1_2/Include/Packet32.h create mode 100644 ledset/WpdPack_4_1_2/Include/Win32-Extensions.h create mode 100644 ledset/WpdPack_4_1_2/Include/bittypes.h create mode 100644 ledset/WpdPack_4_1_2/Include/ip6_misc.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap-bpf.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap-namedb.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap-stdinc.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/bluetooth.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/bpf.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/namedb.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/pcap.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/sll.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/usb.h create mode 100644 ledset/WpdPack_4_1_2/Include/pcap/vlan.h create mode 100644 ledset/WpdPack_4_1_2/Include/remote-ext.h create mode 100644 ledset/WpdPack_4_1_2/Lib/Packet.lib create mode 100644 ledset/WpdPack_4_1_2/Lib/wpcap.lib create mode 100644 ledset/WpdPack_4_1_2/Lib/x64/Packet.lib create mode 100644 ledset/WpdPack_4_1_2/Lib/x64/wpcap.lib create mode 100644 ledset/WpdPack_4_1_2/docs/WinPcap_docs.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/Packet_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/Packet_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/annotated.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/classes.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/daemon_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/daemon_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/deprecated.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/doxygen.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/doxygen__groups_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/dump.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/encoding.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/fileconf_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/fileconf_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/files.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2blank.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2doc.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2folderclosed.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2folderopen.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2lastnode.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2link.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2mlastnode.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2mnode.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2node.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2plastnode.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2pnode.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/ftv2vertline.png create mode 100644 ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/functions.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/functions_vars.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x62.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x63.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x64.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x65.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x66.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x67.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x68.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x69.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x6a.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x6b.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x6d.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x6e.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x6f.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x70.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x72.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x73.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x74.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_0x75.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_defs.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_enum.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_eval.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_func.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_type.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/globals_vars.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__NPF.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__NPF__code.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__NPF__include.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__NPF__ioctl.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__NPF__jitter.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__compilation.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__internals.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__language.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__packetapi.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__auth__methods.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__open__flags.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__pri__func.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__pri__struct.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__samp__methods.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__source__ID.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__source__string.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remote__struct.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__remotefunc.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__def.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut1.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut2.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut3.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut4.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut5.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut6.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut7.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut8.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut9.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcapfunc.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/group__wpcapsamps.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/index.hhc create mode 100644 ledset/WpdPack_4_1_2/docs/html/index.hhk create mode 100644 ledset/WpdPack_4_1_2/docs/html/index.hhp create mode 100644 ledset/WpdPack_4_1_2/docs/html/index.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/internals-arch.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/ioctls_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/ioctls_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/jitter_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/jitter_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/main.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/main_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/modules.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/npf-dump.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/npf-ndis.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/npf-npf.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/pages.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/remote-ext_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/remote-ext_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/rpcapd_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/rpcapd_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/stats.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/stats_wpcap.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/structJIT__BPF__Filter.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structPacketHeader.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct__DEVICE__EXTENSION.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct__INTERNAL__REQUEST.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct__OPEN__INSTANCE.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct__PACKET__OID__DATA.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct__PACKET__RESERVED.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/struct____CPU__Private__Data.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structactive__pars.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structactivehosts.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structbinary__stream.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structdaemon__slpars.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpacket__file__header.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__addr.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__file__header.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__if.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__pkthdr.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__rmtauth.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__samp.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__send__queue.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structpcap__stat.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__auth.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__filter.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__filterbpf__insn.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__if.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__ifaddr.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__header.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__openreply.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__pkthdr.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__sampling.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreply.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreq.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structrpcap__stats.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/structsf__pkthdr.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/style.css create mode 100644 ledset/WpdPack_4_1_2/docs/html/tab_b.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/tab_l.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/tab_r.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/tabs.css create mode 100644 ledset/WpdPack_4_1_2/docs/html/tree.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/utils_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/utils_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/win32-svc_8h.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/win32-svc_8h_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/winpcap.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/winpcap_small.gif create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm_source.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut1_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut2_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut3_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut4_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut5_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut6_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut7_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut8_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut9_8txt.html create mode 100644 ledset/WpdPack_4_1_2/docs/html/wpcap__tut_8txt.html create mode 100644 ledset/basewin.cpp create mode 100644 ledset/basewin.h create mode 100644 ledset/brightwin.cpp create mode 100644 ledset/brightwin.h create mode 100644 ledset/capthread - 副本.cpp create mode 100644 ledset/capthread - 副本.h create mode 100644 ledset/expertsmartpointsetwin.cpp create mode 100644 ledset/expertsmartpointsetwin.h create mode 100644 ledset/expertwin.cpp create mode 100644 ledset/expertwin.h create mode 100644 ledset/fast.cpp create mode 100644 ledset/fast.h create mode 100644 ledset/gqt.cpp create mode 100644 ledset/gqt.h create mode 100644 ledset/imgs/bright.png create mode 100644 ledset/imgs/correct.png create mode 100644 ledset/imgs/expert.png create mode 100644 ledset/imgs/fast.png create mode 100644 ledset/imgs/idea.png create mode 100644 ledset/imgs/monitor.png create mode 100644 ledset/imgs/multi.png create mode 100644 ledset/imgs/radio-check.png create mode 100644 ledset/imgs/radio-un.png create mode 100644 ledset/imgs/video.png create mode 100644 ledset/ledset.pro create mode 100644 ledset/main.cpp create mode 100644 ledset/mainwin.cpp create mode 100644 ledset/mainwin.h create mode 100644 ledset/pcapthread.cpp create mode 100644 ledset/pcapthread.h create mode 100644 ledset/pcapwin.cpp create mode 100644 ledset/pcapwin.h create mode 100644 ledset/res.qrc create mode 100644 ledset/screenunit.cpp create mode 100644 ledset/screenunit.h create mode 100644 ledset/table.cpp create mode 100644 ledset/table.h create mode 100644 ledset/translations/app_en.ts create mode 100644 ledset/translations/qt_en.ts create mode 100644 ledset/translations/qt_ja.ts create mode 100644 ledset/translations/qt_zh_CN.ts create mode 100644 ledset/translations/qt_zh_TW.ts diff --git a/ledset/.gitignore b/ledset/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/ledset/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/ledset/128.ico b/ledset/128.ico new file mode 100644 index 0000000000000000000000000000000000000000..1faa5a6d0dc91823b05ebb8d2ed3ef9d376513f4 GIT binary patch literal 67646 zcmeI4L2lwu5JVkiGbfmJq-?Uv8FS@10rMLOk~dX|7D!!wwjeS6P3V4A{ePVCY}?z~ ze}1<0{IPxgdE5SO+xE2{>!o_}{Ca&`+voS?aXDJgr||uj=wsiUR)vxu;q(`}-j>Y1 za*N-4_*Z%G|7eZCU(R2n+1}H=;1BWCu?9hUB3dr|IGgl4J3QN za*N*^?CVtc4_65M>HiH4;D7v|tbyTl{raWh{W>+7edQLv!=L%Tp#l6qyhAkD*QxM_ zf3gOK)Aj2Y{LlQ~&_J^HE4TQ)!M;v~|8RxCpZ?#_0RA8D|I?Cx;{kv8Cu?9jUH|#< zztXR--}DjihyUXmP_;{lO?S8d{ExG*bz=f!m4mO}^bzof|Kl1^wM&RicenlgjcY%3 zY64@GgRS56zYxG*u3_M>1){u@5Q9Jbqcx!M+Gv8uRSwbYYwgn9RP7RC@Ye!KV61Y0 zKm4OLpz+$M@=ii5nmzNs{N2Cw8^2qJ>j4QKS2@5R{?QuHcx_a9Cm|Nip822o-#T0m zNbtDI0sq54S_2xdjVkXX#G=_V|1G^flmtLRr{NS%E0RLmx2mbI^8qn3rkE+^K zZ2Fd-UzbmMebV!TzpeoMk6j=5!(VAYS0_KJYE!Z4TY7$7KI!#I&kz2(0`Na}ec%s& zr2$=?{HUr;#h$#qzyCWWKicIBze75iedPv!{V%-WZxn+6N6!z2t`EZ>{=pic|C<&N z%)V9z@P~i01`J&v#{Z*xga>R!z#sm>8c6Q_m78(54+pbn{pa!Pt7r40_}^#%|1-|NIr6&LG+QmD?SJ^$`5e`Y%`m_+Q&!chC7z_`^S01BR{- z2lxK!Udik$HxJm1fd6QX7`i?T|JnTA{S`Joe~qUyi0}WF@4ClEj#1T{AA>*qlQp2d z?bug5drxLxxxruS7yhmX==x2M!XN(08leB{4wcNla`P8>%m~(hv#%U+P;D2p@-96_=;Sc|0 z4H&vU9Nhb>dnL24+&o}20{){lV(9uX{NW$00s6mb0m1Cgzr9@2UpK+*Hja1YSa*>; z_jv#AuRnTre!Tyl>8&2u|9W73SudTRf4>~#_*#}*JvcsB;MMimtMm0oug;gBcV+w^ DlQ-Q@ literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/GNUmakefile new file mode 100644 index 0000000..9bf8252 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/GNUmakefile @@ -0,0 +1,10 @@ +# Makefile for cygwin gcc +# Nate Lawson + +SUBDIRS = basic_dump basic_dump_ex iflist pcap_filter pktdump_ex readfile readfile_ex savedump sendpack UDPdump + +all clean install uninstall: ${SUBDIRS} + for subdir in ${SUBDIRS}; do \ + echo "Entering $$subdir"; \ + (cd $$subdir && ${MAKE} $@) \ + done; diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/MakeaAll.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/MakeaAll.dsw new file mode 100644 index 0000000..3a595ac --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/MakeaAll.dsw @@ -0,0 +1,137 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "UDPdump"=.\UDPdump\UDPdump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "basic_dump"=.\basic_dump\basic_dump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "basic_dump_ex"=.\basic_dump_ex\basic_dump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "iflist"=.\iflist\iflist.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pcap_filter"=.\pcap_filter\pcap_filter.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pktdump_ex"=.\pktdump_ex\pktdump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile"=.\readfile\readfile.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile_ex"=.\readfile_ex\readfile_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "savedump"=.\savedump\savedump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "sendpack"=.\sendpack\sendpack.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/GNUmakefile new file mode 100644 index 0000000..d9e75f0 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Loris Degioanni + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = udpdump.o +LIBS = -L ${PCAP_PATH} -lwpcap -lwsock32 + +all: ${OBJS} + ${CC} ${CFLAGS} -o udpdump.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} udpdump.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsp new file mode 100644 index 0000000..b955312 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="UDPdump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=UDPdump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "UDPdump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "UDPdump.mak" CFG="UDPdump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "UDPdump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "UDPdump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "UDPdump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "UDPdump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "UDPdump - Win32 Release" +# Name "UDPdump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\udpdump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsw new file mode 100644 index 0000000..8981cf4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/UDPdump.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "UDPdump"=.\UDPdump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/udpdump.c b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/udpdump.c new file mode 100644 index 0000000..e627add --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/UDPdump/udpdump.c @@ -0,0 +1,242 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "pcap.h" + +/* 4 bytes IP address */ +typedef struct ip_address +{ + u_char byte1; + u_char byte2; + u_char byte3; + u_char byte4; +}ip_address; + +/* IPv4 header */ +typedef struct ip_header +{ + u_char ver_ihl; // Version (4 bits) + Internet header length (4 bits) + u_char tos; // Type of service + u_short tlen; // Total length + u_short identification; // Identification + u_short flags_fo; // Flags (3 bits) + Fragment offset (13 bits) + u_char ttl; // Time to live + u_char proto; // Protocol + u_short crc; // Header checksum + ip_address saddr; // Source address + ip_address daddr; // Destination address + u_int op_pad; // Option + Padding +}ip_header; + +/* UDP header*/ +typedef struct udp_header +{ + u_short sport; // Source port + u_short dport; // Destination port + u_short len; // Datagram length + u_short crc; // Checksum +}udp_header; + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int inum; + int i=0; + pcap_t *adhandle; + char errbuf[PCAP_ERRBUF_SIZE]; + u_int netmask; + char packet_filter[] = "ip and udp"; + struct bpf_program fcode; + + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf("%d", &inum); + + /* Check if the user specified a valid adapter */ + if(inum < 1 || inum > i) + { + printf("\nAdapter number out of range.\n"); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the adapter */ + if ((adhandle= pcap_open_live(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Check the link layer. We support only Ethernet for simplicity. */ + if(pcap_datalink(adhandle) != DLT_EN10MB) + { + fprintf(stderr,"\nThis program works only on Ethernet networks.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + if(d->addresses != NULL) + /* Retrieve the mask of the first address of the interface */ + netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; + else + /* If the interface is without addresses we suppose to be in a C class network */ + netmask=0xffffff; + + + //compile the filter + if (pcap_compile(adhandle, &fcode, packet_filter, 1, netmask) <0 ) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + //set the filter + if (pcap_setfilter(adhandle, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, NULL); + + return 0; +} + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + struct tm *ltime; + char timestr[16]; + ip_header *ih; + udp_header *uh; + u_int ip_len; + u_short sport,dport; + time_t local_tv_sec; + + /* + * unused parameter + */ + (VOID)(param); + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + ltime=localtime(&local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); + + /* print timestamp and length of the packet */ + printf("%s.%.6d len:%d ", timestr, header->ts.tv_usec, header->len); + + /* retireve the position of the ip header */ + ih = (ip_header *) (pkt_data + + 14); //length of ethernet header + + /* retireve the position of the udp header */ + ip_len = (ih->ver_ihl & 0xf) * 4; + uh = (udp_header *) ((u_char*)ih + ip_len); + + /* convert from network byte order to host byte order */ + sport = ntohs( uh->sport ); + dport = ntohs( uh->dport ); + + /* print ip addresses and udp ports */ + printf("%d.%d.%d.%d.%d -> %d.%d.%d.%d.%d\n", + ih->saddr.byte1, + ih->saddr.byte2, + ih->saddr.byte3, + ih->saddr.byte4, + sport, + ih->daddr.byte1, + ih->daddr.byte2, + ih->daddr.byte3, + ih->daddr.byte4, + dport); +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/GNUmakefile new file mode 100644 index 0000000..11951f4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = basic_dump.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o basic_dump.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} basic_dump.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.c b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.c new file mode 100644 index 0000000..2980fd2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.c @@ -0,0 +1,109 @@ +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "pcap.h" + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int inum; + int i=0; + pcap_t *adhandle; + char errbuf[PCAP_ERRBUF_SIZE]; + + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the device */ + /* Open the adapter */ + if ((adhandle= pcap_open_live(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, NULL); + + pcap_close(adhandle); + return 0; +} + + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + struct tm *ltime; + char timestr[16]; + time_t local_tv_sec; + + /* + * unused parameters + */ + (VOID)(param); + (VOID)(pkt_data); + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + ltime=localtime(&local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); + + printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); + +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsp new file mode 100644 index 0000000..7e74aaa --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="basic_dump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=basic_dump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "basic_dump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "basic_dump.mak" CFG="basic_dump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "basic_dump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "basic_dump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "basic_dump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "basic_dump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "basic_dump - Win32 Release" +# Name "basic_dump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\basic_dump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsw new file mode 100644 index 0000000..3494209 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump/basic_dump.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "basic_dump"=.\basic_dump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/GNUmakefile new file mode 100644 index 0000000..aeeeea6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = basic_dump_ex.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o basic_dump_ex.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} basic_dump_ex.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.c b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.c new file mode 100644 index 0000000..d4e6117 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.c @@ -0,0 +1,106 @@ +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "pcap.h" + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int inum; + int i=0; + pcap_t *adhandle; + int res; + char errbuf[PCAP_ERRBUF_SIZE]; + struct tm *ltime; + char timestr[16]; + struct pcap_pkthdr *header; + const u_char *pkt_data; + time_t local_tv_sec; + + + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + return -1; + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the adapter */ + if ((adhandle= pcap_open_live(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* Retrieve the packets */ + while((res = pcap_next_ex( adhandle, &header, &pkt_data)) >= 0){ + + if(res == 0) + /* Timeout elapsed */ + continue; + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + ltime=localtime(&local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); + + printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); + } + + if(res == -1){ + printf("Error reading the packets: %s\n", pcap_geterr(adhandle)); + return -1; + } + + pcap_close(adhandle); + return 0; +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp new file mode 100644 index 0000000..0405d29 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="basic_dump_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=basic_dump_ex - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "basic_dump_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "basic_dump_ex.mak" CFG="basic_dump_ex - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "basic_dump_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "basic_dump_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "basic_dump_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "basic_dump_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "basic_dump_ex - Win32 Release" +# Name "basic_dump_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\basic_dump_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw new file mode 100644 index 0000000..ff590dd --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "basic_dump_ex"=.\basic_dump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/iflist/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/GNUmakefile new file mode 100644 index 0000000..01766bd --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = iflist.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o iflist.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} iflist.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.c b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.c new file mode 100644 index 0000000..d462afb --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.c @@ -0,0 +1,172 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "pcap.h" + +#ifndef WIN32 + #include + #include +#else + #include +#endif + + +// Function prototypes +void ifprint(pcap_if_t *d); +char *iptos(u_long in); +char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen); + + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + char errbuf[PCAP_ERRBUF_SIZE+1]; + + /* Retrieve the device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Scan the list printing every entry */ + for(d=alldevs;d;d=d->next) + { + ifprint(d); + } + + /* Free the device list */ + pcap_freealldevs(alldevs); + + return 1; +} + + + +/* Print all the available information on the given interface */ +void ifprint(pcap_if_t *d) +{ + pcap_addr_t *a; + char ip6str[128]; + + /* Name */ + printf("%s\n",d->name); + + /* Description */ + if (d->description) + printf("\tDescription: %s\n",d->description); + + /* Loopback Address*/ + printf("\tLoopback: %s\n",(d->flags & PCAP_IF_LOOPBACK)?"yes":"no"); + + /* IP addresses */ + for(a=d->addresses;a;a=a->next) { + printf("\tAddress Family: #%d\n",a->addr->sa_family); + + switch(a->addr->sa_family) + { + case AF_INET: + printf("\tAddress Family Name: AF_INET\n"); + if (a->addr) + printf("\tAddress: %s\n",iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr)); + if (a->netmask) + printf("\tNetmask: %s\n",iptos(((struct sockaddr_in *)a->netmask)->sin_addr.s_addr)); + if (a->broadaddr) + printf("\tBroadcast Address: %s\n",iptos(((struct sockaddr_in *)a->broadaddr)->sin_addr.s_addr)); + if (a->dstaddr) + printf("\tDestination Address: %s\n",iptos(((struct sockaddr_in *)a->dstaddr)->sin_addr.s_addr)); + break; + + case AF_INET6: + printf("\tAddress Family Name: AF_INET6\n"); +#ifndef __MINGW32__ /* Cygnus doesn't have IPv6 */ + if (a->addr) + printf("\tAddress: %s\n", ip6tos(a->addr, ip6str, sizeof(ip6str))); +#endif + break; + + default: + printf("\tAddress Family Name: Unknown\n"); + break; + } + } + printf("\n"); +} + +/* From tcptraceroute, convert a numeric IP address to a string */ +#define IPTOSBUFFERS 12 +char *iptos(u_long in) +{ + static char output[IPTOSBUFFERS][3*4+3+1]; + static short which; + u_char *p; + + p = (u_char *)∈ + which = (which + 1 == IPTOSBUFFERS ? 0 : which + 1); + sprintf(output[which], "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + return output[which]; +} + +#ifndef __MINGW32__ /* Cygnus doesn't have IPv6 */ +char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen) +{ + socklen_t sockaddrlen; + + #ifdef WIN32 + sockaddrlen = sizeof(struct sockaddr_in6); + #else + sockaddrlen = sizeof(struct sockaddr_storage); + #endif + + + if(getnameinfo(sockaddr, + sockaddrlen, + address, + addrlen, + NULL, + 0, + NI_NUMERICHOST) != 0) address = NULL; + + return address; +} +#endif /* __MINGW32__ */ + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsp new file mode 100644 index 0000000..4182364 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="iflist" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=iflist - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "iflist.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "iflist.mak" CFG="iflist - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "iflist - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "iflist - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "iflist - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "iflist - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "iflist - Win32 Release" +# Name "iflist - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\iflist.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsw new file mode 100644 index 0000000..1425db2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/iflist/iflist.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "iflist"=.\iflist.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/GNUmakefile new file mode 100644 index 0000000..2252393 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = pcap_filter.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o pf.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} pf.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.c b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.c new file mode 100644 index 0000000..d2f6e36 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.c @@ -0,0 +1,179 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include + +#include + +#define MAX_PRINT 80 +#define MAX_LINE 16 + + +void usage(); + + +int main(int argc, char **argv) +{ + pcap_t *fp; + char errbuf[PCAP_ERRBUF_SIZE]; + char *source = NULL; + char *ofilename = NULL; + char *filter = NULL; + int i; + pcap_dumper_t *dumpfile; + struct bpf_program fcode; + bpf_u_int32 NetMask; + int res; + struct pcap_pkthdr *header; + const u_char *pkt_data; + + if (argc == 1) + { + usage(); + return -1; + } + + /* Parse parameters */ + for(i=1;i < argc; i+= 2) + { + switch (argv[i] [1]) + { + case 's': + { + source=argv[i+1]; + }; + break; + + case 'o': + { + ofilename=argv[i+1]; + }; + break; + + case 'f': + { + filter=argv[i+1]; + }; + break; + } + } + + // open a capture from the network + if (source != NULL) + { + if ((fp = pcap_open_live(source, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter.\n"); + return -2; + } + } + else usage(); + + if (filter != NULL) + { + // We should loop through the adapters returned by the pcap_findalldevs_ex() + // in order to locate the correct one. + // + // Let's do things simpler: we suppose to be in a C class network ;-) + NetMask=0xffffff; + + //compile the filter + if(pcap_compile(fp, &fcode, filter, 1, NetMask) < 0) + { + fprintf(stderr,"\nError compiling filter: wrong syntax.\n"); + + pcap_close(fp); + return -3; + } + + //set the filter + if(pcap_setfilter(fp, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter\n"); + + pcap_close(fp); + return -4; + } + + } + + //open the dump file + if (ofilename != NULL) + { + dumpfile= pcap_dump_open(fp, ofilename); + + if (dumpfile == NULL) + { + fprintf(stderr,"\nError opening output file\n"); + + pcap_close(fp); + return -5; + } + } + else usage(); + + //start the capture + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) + { + + if(res == 0) + /* Timeout elapsed */ + continue; + + //save the packet on the dump file + pcap_dump((unsigned char *) dumpfile, header, pkt_data); + + } + + pcap_close(fp); + pcap_dump_close(dumpfile); + + return 0; +} + + +void usage() +{ + + printf("\npf - Generic Packet Filter.\n"); + printf("\nUsage:\npf -s source -o output_file_name [-f filter_string]\n\n"); + exit(0); +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsp new file mode 100644 index 0000000..c01d2e7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="pcap_filter" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pcap_filter - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pcap_filter.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pcap_filter.mak" CFG="pcap_filter - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pcap_filter - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pcap_filter - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pcap_filter - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"Release/pf.exe" + +!ELSEIF "$(CFG)" == "pcap_filter - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/pf.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pcap_filter - Win32 Release" +# Name "pcap_filter - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\pcap_filter.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsw new file mode 100644 index 0000000..1d39119 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pcap_filter/pcap_filter.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "pcap_filter"=.\pcap_filter.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/GNUmakefile new file mode 100644 index 0000000..db276c5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/GNUmakefile @@ -0,0 +1,14 @@ +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = pktdump_ex.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o pktdump_ex.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} pktdump_ex.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.c b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.c new file mode 100644 index 0000000..383eaa9 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.c @@ -0,0 +1,166 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include +#include + +#include + +#define LINE_LEN 16 + + +int main(int argc, char **argv) +{ + pcap_if_t *alldevs, *d; + pcap_t *fp; + u_int inum, i=0; + char errbuf[PCAP_ERRBUF_SIZE]; + int res; + struct pcap_pkthdr *header; + const u_char *pkt_data; + + printf("pktdump_ex: prints the packets of the network using WinPcap.\n"); + printf(" Usage: pktdump_ex [-s source]\n\n" + " Examples:\n" + " pktdump_ex -s file.acp\n" + " pktdump_ex -s \\Device\\NPF_{C8736017-F3C3-4373-94AC-9A34B7DAD998}\n\n"); + + if(argc < 3) + { + printf("\nNo adapter selected: printing the device list:\n"); + /* The user didn't provide a packet source: Retrieve the local device list */ + if(pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s\n ", ++i, d->name); + + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if (i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf("%d", &inum); + + if (inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for (d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the adapter */ + if ((fp = pcap_open_live(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nError opening adapter\n"); + return -1; + } + } + else + { + /* Do not check for the switch type ('-s') */ + if ((fp = pcap_open_live(argv[2], // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nError opening adapter\n"); + return -1; + } + } + + /* Read the packets */ + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) + { + + if(res == 0) + /* Timeout elapsed */ + continue; + + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + } + + if(res == -1) + { + printf("Error reading the packets: %s\n", pcap_geterr(fp)); + return -1; + } + + pcap_close(fp); + return 0; +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsp new file mode 100644 index 0000000..a9800e6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="pktdump_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pktdump_ex - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pktdump_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pktdump_ex.mak" CFG="pktdump_ex - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pktdump_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pktdump_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pktdump_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "pktdump_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pktdump_ex - Win32 Release" +# Name "pktdump_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\pktdump_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsw new file mode 100644 index 0000000..ec24733 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/pktdump_ex/pktdump_ex.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "pktdump_ex"=.\pktdump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/GNUmakefile new file mode 100644 index 0000000..967bc18 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = readfile.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o readfile.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} readfile.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.c b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.c new file mode 100644 index 0000000..c62dc46 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.c @@ -0,0 +1,61 @@ +#include +#include + +#define LINE_LEN 16 + +void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); + +int main(int argc, char **argv) +{ + pcap_t *fp; + char errbuf[PCAP_ERRBUF_SIZE]; + + if(argc != 2) + { + printf("usage: %s filename", argv[0]); + return -1; + + } + + /* Open the capture file */ + if ((fp = pcap_open_offline(argv[1], // name of the device + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]); + return -1; + } + + /* read and dispatch packets until EOF is reached */ + pcap_loop(fp, 0, dispatcher_handler, NULL); + + pcap_close(fp); + return 0; +} + + + +void dispatcher_handler(u_char *temp1, + const struct pcap_pkthdr *header, + const u_char *pkt_data) +{ + u_int i=0; + + /* + * unused variable + */ + (VOID*)temp1; + + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsp new file mode 100644 index 0000000..5d45bde --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="readfile" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=readfile - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "readfile.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "readfile.mak" CFG="readfile - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "readfile - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "readfile - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "readfile - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "readfile - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "readfile - Win32 Release" +# Name "readfile - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\readfile.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsw new file mode 100644 index 0000000..7565dbd --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile/readfile.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "readfile"=.\readfile.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/GNUmakefile new file mode 100644 index 0000000..3eaba96 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = readfile_ex.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o readfile_ex.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} readfile_ex.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.c b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.c new file mode 100644 index 0000000..9b6e9ed --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.c @@ -0,0 +1,56 @@ +#include +#include + +#define LINE_LEN 16 + +int main(int argc, char **argv) +{ + pcap_t *fp; + char errbuf[PCAP_ERRBUF_SIZE]; + struct pcap_pkthdr *header; + const u_char *pkt_data; + u_int i=0; + int res; + + if(argc != 2) + { + printf("usage: %s filename", argv[0]); + return -1; + + } + + /* Open the capture file */ + if ((fp = pcap_open_offline(argv[1], // name of the device + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the file %s.\n", argv[1]); + return -1; + } + + /* Retrieve the packets from the file */ + while((res = pcap_next_ex(fp, &header, &pkt_data)) >= 0) + { + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + } + + + if (res == -1) + { + printf("Error reading the packets: %s\n", pcap_geterr(fp)); + } + + pcap_close(fp); + return 0; +} + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsp new file mode 100644 index 0000000..07dcf9f --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="readfile_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=readfile_ex - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "readfile_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "readfile_ex.mak" CFG="readfile_ex - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "readfile_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "readfile_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "readfile_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "readfile_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "readfile_ex - Win32 Release" +# Name "readfile_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\readfile_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsw new file mode 100644 index 0000000..8e4c306 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/readfile_ex/readfile_ex.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "readfile_ex"=.\readfile_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/savedump/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/GNUmakefile new file mode 100644 index 0000000..86bbaa0 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = savedump.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o savedump.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} savedump.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.c b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.c new file mode 100644 index 0000000..17456a7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.c @@ -0,0 +1,111 @@ +#ifdef _MSC_VER +/* + * we do not want the warnings about the old deprecated and unsecure CRT functions + * since these examples can be compiled under *nix as well + */ +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "pcap.h" + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int main(int argc, char **argv) +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int inum; + int i=0; + pcap_t *adhandle; + char errbuf[PCAP_ERRBUF_SIZE]; + pcap_dumper_t *dumpfile; + + + /* Check command line */ + if(argc != 2) + { + printf("usage: %s filename", argv[0]); + return -1; + } + + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs(&alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + + /* Open the adapter */ + if ((adhandle= pcap_open_live(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Open the dump file */ + dumpfile = pcap_dump_open(adhandle, argv[1]); + + if(dumpfile==NULL) + { + fprintf(stderr,"\nError opening output file\n"); + return -1; + } + + printf("\nlistening on %s... Press Ctrl+C to stop...\n", d->description); + + /* At this point, we no longer need the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, (unsigned char *)dumpfile); + + pcap_close(adhandle); + return 0; +} + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *dumpfile, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + /* save the packet on the dump file */ + pcap_dump(dumpfile, header, pkt_data); +} diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsp new file mode 100644 index 0000000..22d5d39 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="savedump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=savedump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "savedump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "savedump.mak" CFG="savedump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "savedump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "savedump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "savedump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "savedump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "savedump - Win32 Release" +# Name "savedump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\savedump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsw new file mode 100644 index 0000000..b0e9fc6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/savedump/savedump.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "savedump"=.\savedump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/GNUmakefile b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/GNUmakefile new file mode 100644 index 0000000..60fd211 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/GNUmakefile @@ -0,0 +1,17 @@ +# Makefile for cygwin gcc +# Nate Lawson + +PCAP_PATH = ../../lib +CFLAGS = -g -O -mno-cygwin -I ../../include + +OBJS = sendpack.o +LIBS = -L ${PCAP_PATH} -lwpcap + +all: ${OBJS} + ${CC} ${CFLAGS} -o sendpack.exe ${OBJS} ${LIBS} + +clean: + rm -f ${OBJS} sendpack.exe + +.c.o: + ${CC} ${CFLAGS} -c -o $*.o $< diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.c b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.c new file mode 100644 index 0000000..7c68c91 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.c @@ -0,0 +1,68 @@ +#include +#include + +#include + + +int main(int argc, char **argv) +{ + pcap_t *fp; + char errbuf[PCAP_ERRBUF_SIZE]; + u_char packet[100]; + int i; + + /* Check the validity of the command line */ + if (argc != 2) + { + printf("usage: %s interface", argv[0]); + return 1; + } + + /* Open the adapter */ + if ((fp = pcap_open_live(argv[1], // name of the device + 65536, // portion of the packet to capture. It doesn't matter in this case + 1, // promiscuous mode (nonzero means promiscuous) + 1000, // read timeout + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", argv[1]); + return 2; + } + + /* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */ + packet[0]=1; + packet[1]=1; + packet[2]=1; + packet[3]=1; + packet[4]=1; + packet[5]=1; + + /* set mac source to 2:2:2:2:2:2 */ + packet[6]=2; + packet[7]=2; + packet[8]=2; + packet[9]=2; + packet[10]=2; + packet[11]=2; + + /* Fill the rest of the packet */ + for(i=12;i<100;i++) + { + packet[i]= (u_char)i; + } + + /* Send down the packet */ + if (pcap_sendpacket(fp, // Adapter + packet, // buffer with the packet + 100 // size + ) != 0) + { + fprintf(stderr,"\nError sending the packet: %s\n", pcap_geterr(fp)); + return 3; + } + + pcap_close(fp); + return 0; +} + diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsp b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsp new file mode 100644 index 0000000..95022e3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="sendpack" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=sendpack - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "sendpack.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "sendpack.mak" CFG="sendpack - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sendpack - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "sendpack - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "sendpack - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "sendpack - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "sendpack - Win32 Release" +# Name "sendpack - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\sendpack.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsw b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsw new file mode 100644 index 0000000..1ccadc7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-pcap/sendpack/sendpack.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "sendpack"=.\sendpack.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/MakeaAll.dsw b/ledset/WpdPack_4_1_2/Examples-remote/MakeaAll.dsw new file mode 100644 index 0000000..3236b64 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/MakeaAll.dsw @@ -0,0 +1,221 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "GetMacAddress"=".\PacketDriver\GetMacAddress\GetMacAddress.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "TestPacketCapture"=".\PacketDriver\TestPacketCapture\TestPacketCapture.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "TestPacketSend"=".\PacketDriver\TestPacketSend\TestPacketSend.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "UDPdump"=".\UDPdump\UDPdump.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "UserBridge"=".\UserLevelBridge\UserBridge.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "basic_dump"=".\misc\basic_dump.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "basic_dump_ex"=".\misc\basic_dump_ex.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "iflist"=".\iflist\iflist.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pcap_filter"=".\pcap_filter\pcap_filter.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "pktdump_ex"=".\pktdump_ex\pktdump_ex.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile"=".\misc\readfile.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile_ex"=".\misc\readfile_ex.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "savedump"=".\misc\savedump.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "sendcap"=".\sendcap\sendcap.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "sendpack"=".\misc\sendpack.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "smp_1"=".\smp_1\smp_1.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "tcptop"=".\tcptop\tcptop.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.c b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.c new file mode 100644 index 0000000..014da74 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include "..\..\..\Include\packet32.h" +#include + +#define Max_Num_Adapter 10 +char AdapterList[Max_Num_Adapter][1024]; + +int main() +{ + LPADAPTER lpAdapter = 0; + int i; + DWORD dwErrorCode; + char AdapterName[8192]; + char *temp,*temp1; + int AdapterNum=0,Open; + ULONG AdapterLength; + PPACKET_OID_DATA OidData; + BOOLEAN Status; + + // + // Obtain the name of the adapters installed on this machine + // + + printf("Packet.dll test application. Library version:%s\n", PacketGetVersion()); + + printf("Adapters installed:\n"); + i=0; + + AdapterLength = sizeof(AdapterName); + + if(PacketGetAdapterNames(AdapterName,&AdapterLength)==FALSE){ + printf("Unable to retrieve the list of the adapters!\n"); + return -1; + } + temp=AdapterName; + temp1=AdapterName; + + while ((*temp!='\0')||(*(temp-1)!='\0')) + { + if (*temp=='\0') + { + memcpy(AdapterList[i],temp1,temp-temp1); + temp1=temp+1; + i++; + } + temp++; + } + + AdapterNum=i; + for (i=0;iAdapterNum) printf("\nThe number must be smaller than %d",AdapterNum); + } while (Open>AdapterNum); + + + // + // Open the selected adapter + // + + lpAdapter = PacketOpenAdapter(AdapterList[Open-1]); + + if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) + { + dwErrorCode=GetLastError(); + printf("Unable to open the adapter, Error Code : %lx\n",dwErrorCode); + + return -1; + } + + // + // Allocate a buffer to get the MAC adress + // + + OidData = malloc(6 + sizeof(PACKET_OID_DATA)); + if (OidData == NULL) + { + printf("error allocating memory!\n"); + PacketCloseAdapter(lpAdapter); + return -1; + } + + // + // Retrieve the adapter MAC querying the NIC driver + // + + OidData->Oid = OID_802_3_CURRENT_ADDRESS; + + OidData->Length = 6; + ZeroMemory(OidData->Data, 6); + + Status = PacketRequest(lpAdapter, FALSE, OidData); + if(Status) + { + printf("The MAC address of the adapter is %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + (OidData->Data)[0], + (OidData->Data)[1], + (OidData->Data)[2], + (OidData->Data)[3], + (OidData->Data)[4], + (OidData->Data)[5]); + } + else + { + printf("error retrieving the MAC address of the adapter!\n"); + } + + free(OidData); + PacketCloseAdapter(lpAdapter); + return (0); +} + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.dsp b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.dsp new file mode 100644 index 0000000..d701290 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/GetMacAddress/GetMacAddress.dsp @@ -0,0 +1,105 @@ +# Microsoft Developer Studio Project File - Name="GetMacAddress" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=GetMacAddress - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "GetMacAddress.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "GetMacAddress.mak" CFG="GetMacAddress - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "GetMacAddress - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "GetMacAddress - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "GetMacAddress - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "GetMacAddress - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "GetMacAddress - Win32 Release" +# Name "GetMacAddress - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\GetMacAddress.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\..\lib\Packet.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketCapture/TestPacketCapture.c b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketCapture/TestPacketCapture.c new file mode 100644 index 0000000..4bc676d --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketCapture/TestPacketCapture.c @@ -0,0 +1,244 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include + + +#include "..\..\..\Include\packet32.h" +#include + +#define Max_Num_Adapter 10 + +// Prototypes + +void PrintPackets(LPPACKET lpPacket); + +char AdapterList[Max_Num_Adapter][1024]; + +int main() +{ +//define a pointer to an ADAPTER structure + +LPADAPTER lpAdapter = 0; + +//define a pointer to a PACKET structure + +LPPACKET lpPacket; + +int i; +DWORD dwErrorCode; + +//ascii strings +char AdapterName[8192]; // string that contains a list of the network adapters +char *temp,*temp1; + + +int AdapterNum=0,Open; +ULONG AdapterLength; + +char buffer[256000]; // buffer to hold the data coming from the driver + +struct bpf_stat stat; + + // + // Obtain the name of the adapters installed on this machine + // + printf("Packet.dll test application. Library version:%s\n", PacketGetVersion()); + + printf("Adapters installed:\n"); + i=0; + + AdapterLength = sizeof(AdapterName); + + if(PacketGetAdapterNames(AdapterName,&AdapterLength)==FALSE){ + printf("Unable to retrieve the list of the adapters!\n"); + return -1; + } + temp=AdapterName; + temp1=AdapterName; + + while ((*temp!='\0')||(*(temp-1)!='\0')) + { + if (*temp=='\0') + { + memcpy(AdapterList[i],temp1,temp-temp1); + temp1=temp+1; + i++; + } + temp++; + } + + AdapterNum=i; + for (i=0;iAdapterNum) printf("\nThe number must be smaller than %d",AdapterNum); + } while (Open>AdapterNum); + + + + + lpAdapter = PacketOpenAdapter(AdapterList[Open-1]); + + if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) + { + dwErrorCode=GetLastError(); + printf("Unable to open the adapter, Error Code : %lx\n",dwErrorCode); + + return -1; + } + + // set the network adapter in promiscuous mode + + if(PacketSetHwFilter(lpAdapter,NDIS_PACKET_TYPE_PROMISCUOUS)==FALSE){ + printf("Warning: unable to set promiscuous mode!\n"); + } + + // set a 512K buffer in the driver + if(PacketSetBuff(lpAdapter,512000)==FALSE){ + printf("Unable to set the kernel buffer!\n"); + return -1; + } + + // set a 1 second read timeout + if(PacketSetReadTimeout(lpAdapter,1000)==FALSE){ + printf("Warning: unable to set the read tiemout!\n"); + } + + //allocate and initialize a packet structure that will be used to + //receive the packets. + if((lpPacket = PacketAllocatePacket())==NULL){ + printf("\nError: failed to allocate the LPPACKET structure."); + return (-1); + } + PacketInitPacket(lpPacket,(char*)buffer,256000); + + //main capture loop + while(!_kbhit()) + { + // capture the packets + if(PacketReceivePacket(lpAdapter,lpPacket,TRUE)==FALSE){ + printf("Error: PacketReceivePacket failed"); + return (-1); + } + + PrintPackets(lpPacket); + } + + + //print the capture statistics + if(PacketGetStats(lpAdapter,&stat)==FALSE){ + printf("Warning: unable to get stats from the kernel!\n"); + } + else + printf("\n\n%d packets received.\n%d Packets lost",stat.bs_recv,stat.bs_drop); + + PacketFreePacket(lpPacket); + + // close the adapter and exit + + PacketCloseAdapter(lpAdapter); + return (0); +} + +// this function prints the content of a block of packets received from the driver + +void PrintPackets(LPPACKET lpPacket) +{ + + ULONG i, j, ulLines, ulen, ulBytesReceived; + char *pChar, *pLine, *base; + char *buf; + u_int off=0; + u_int tlen,tlen1; + struct bpf_hdr *hdr; + + ulBytesReceived = lpPacket->ulBytesReceived; + + + buf = lpPacket->Buffer; + + off=0; + + while(offbh_datalen; + tlen=hdr->bh_caplen; + printf("Packet length, captured portion: %ld, %ld\n", tlen1, tlen); + off+=hdr->bh_hdrlen; + + ulLines = (tlen + 15) / 16; + + pChar =(char*)(buf+off); + base=pChar; + off=Packet_WORDALIGN(off+tlen); + + for ( i=0; i 16 ) ? 16 : ulen; + tlen -= ulen; + + for ( j=0; j +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestPacketCapture - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestPacketCapture.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestPacketCapture.mak" CFG="TestPacketCapture - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestPacketCapture - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestPacketCapture - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestPacketCapture - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "TestPacketCapture - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "TestPacketCapture - Win32 Release" +# Name "TestPacketCapture - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestPacketCapture.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\..\lib\Packet.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.c b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.c new file mode 100644 index 0000000..b4a73bc --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.c @@ -0,0 +1,235 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include + +#include "..\..\..\Include\packet32.h" + + +#define Max_Num_Adapter 10 + +// Prototypes + +void PrintPackets(LPPACKET lpPacket); + +char AdapterList[Max_Num_Adapter][8192]; + + + +int main(int argc, char **argv) +{ +char packetbuff[5000]; + +// define a pointer to a ADAPTER structure + +LPADAPTER lpAdapter = 0; + +// define a pointer to a PACKET structure + +LPPACKET lpPacket; + +int i,npacks,Snaplen; +DWORD dwErrorCode; + +//ascii strings +char AdapterName[8192]; // string that contains a list of the network adapters +char *temp,*temp1; + +int AdapterNum=0,Open; +ULONG AdapterLength; + +float cpu_time; + + printf("Traffic Generator v 0.9999\nCopyright 1999 Loris Degioanni (loris@netgroup-serv.polito.it)"); + printf("\nSends a set of packets to the network using packet.dll API.\n"); + + if (argc == 1){ + printf("\n\n Usage: TestpacketSend [-i adapter] -n npacks -s size"); + printf("\n size is between 60 and 1514\n\n"); + return -1; + } + + + AdapterName[0]=0; + + //get the command line parameters + for(i=1;iAdapterNum) printf("\nThe number must be smaller than %d",AdapterNum); + } while (Open>AdapterNum); + + + + + lpAdapter = PacketOpenAdapter(AdapterList[Open-1]); + + if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) + { + dwErrorCode=GetLastError(); + printf("Unable to open the driver, Error Code : %lx\n",dwErrorCode); + + return(-1); + } + + } + else{ + + lpAdapter = PacketOpenAdapter(AdapterName); + + if (!lpAdapter || (lpAdapter->hFile == INVALID_HANDLE_VALUE)) + { + dwErrorCode=GetLastError(); + printf("Unable to open the driver, Error Code : %lx\n",dwErrorCode); + + return(-1); + } + + } + + if((lpPacket = PacketAllocatePacket())==NULL){ + printf("\nError:failed to allocate the LPPACKET structure."); + return (-1); + } + + packetbuff[0]=1; + packetbuff[1]=1; + packetbuff[2]=1; + packetbuff[3]=1; + packetbuff[4]=1; + packetbuff[5]=1; + + packetbuff[6]=2; + packetbuff[7]=2; + packetbuff[8]=2; + packetbuff[9]=2; + packetbuff[10]=2; + packetbuff[11]=2; + + for(i=12;i<1514;i++){ + packetbuff[i]= (char)i; + } + + PacketInitPacket(lpPacket,packetbuff,Snaplen); + // capture the packet + + + if(PacketSetNumWrites(lpAdapter,npacks)==FALSE){ + printf("warning: Unable to send more than one packet in a single write!\n"); + } + + printf("\n\nGenerating %d packets...",npacks); + + cpu_time = (float)clock (); + + if(PacketSendPacket(lpAdapter,lpPacket,TRUE)==FALSE){ + printf("Error sending the packets!\n"); + return -1; + } + + cpu_time = (clock() - cpu_time)/CLK_TCK; + + printf ("\n\nElapsed time: %5.3f\n", cpu_time); + printf ("\nTotal packets generated = %d", npacks); + printf ("\nTotal bytes generated = %d", (Snaplen+24)*npacks); + printf ("\nTotal bits generated = %d", (Snaplen+24)*npacks*8); + printf ("\nAverage packets per second = %d", (int)((double)npacks/cpu_time)); + printf ("\nAverage bytes per second = %d", (int)((double)((Snaplen+24)*npacks)/cpu_time)); + printf ("\nAverage bits per second = %d", (int)((double)((Snaplen+24)*npacks*8)/cpu_time)); + printf ("\n"); + + PacketFreePacket(lpPacket); + + // close the adapter and exit + + PacketCloseAdapter(lpAdapter); + return (0); +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.dsp b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.dsp new file mode 100644 index 0000000..ee2c6f4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/TestPacketSend/TestPacketSend.dsp @@ -0,0 +1,107 @@ +# Microsoft Developer Studio Project File - Name="TestPacketSend" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestPacketSend - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestPacketSend.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestPacketSend.mak" CFG="TestPacketSend - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestPacketSend - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestPacketSend - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestPacketSend - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:"Release/TestPacketSend.exe" /machine:I386 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "TestPacketSend - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "TestPacketSend - Win32 Release" +# Name "TestPacketSend - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestPacketSend.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\..\lib\Packet.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/readme.txt b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/readme.txt new file mode 100644 index 0000000..e64371e --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/PacketDriver/readme.txt @@ -0,0 +1,2 @@ +These files use the packet.dll API instead of wpcap.dll. +The use of packet.dll API is strongly discouraged. diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsp b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsp new file mode 100644 index 0000000..b955312 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="UDPdump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=UDPdump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "UDPdump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "UDPdump.mak" CFG="UDPdump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "UDPdump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "UDPdump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "UDPdump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "UDPdump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "UDPdump - Win32 Release" +# Name "UDPdump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\udpdump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsw b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsw new file mode 100644 index 0000000..8981cf4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/UDPdump.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "UDPdump"=.\UDPdump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/udpdump.c b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/udpdump.c new file mode 100644 index 0000000..f6479ea --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UDPdump/udpdump.c @@ -0,0 +1,230 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "pcap.h" + +/* 4 bytes IP address */ +typedef struct ip_address{ + u_char byte1; + u_char byte2; + u_char byte3; + u_char byte4; +}ip_address; + +/* IPv4 header */ +typedef struct ip_header{ + u_char ver_ihl; // Version (4 bits) + Internet header length (4 bits) + u_char tos; // Type of service + u_short tlen; // Total length + u_short identification; // Identification + u_short flags_fo; // Flags (3 bits) + Fragment offset (13 bits) + u_char ttl; // Time to live + u_char proto; // Protocol + u_short crc; // Header checksum + ip_address saddr; // Source address + ip_address daddr; // Destination address + u_int op_pad; // Option + Padding +}ip_header; + +/* UDP header*/ +typedef struct udp_header{ + u_short sport; // Source port + u_short dport; // Destination port + u_short len; // Datagram length + u_short crc; // Checksum +}udp_header; + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + + +int main() +{ +pcap_if_t *alldevs; +pcap_if_t *d; +int inum; +int i=0; +pcap_t *adhandle; +char errbuf[PCAP_ERRBUF_SIZE]; +u_int netmask; +char packet_filter[] = "ip and udp"; +struct bpf_program fcode; + + /* Retrieve the device list */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the adapter */ + if ( (adhandle= pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on all the MACs. + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // remote authentication + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Check the link layer. We support only Ethernet for simplicity. */ + if(pcap_datalink(adhandle) != DLT_EN10MB) + { + fprintf(stderr,"\nThis program works only on Ethernet networks.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + if(d->addresses != NULL) + /* Retrieve the mask of the first address of the interface */ + netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; + else + /* If the interface is without addresses we suppose to be in a C class network */ + netmask=0xffffff; + + + //compile the filter + if (pcap_compile(adhandle, &fcode, packet_filter, 1, netmask) <0 ) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + //set the filter + if (pcap_setfilter(adhandle, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, NULL); + + return 0; +} + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + struct tm ltime; + char timestr[16]; + ip_header *ih; + udp_header *uh; + u_int ip_len; + u_short sport,dport; + time_t local_tv_sec; + + /* + * Unused variable + */ + (VOID)(param); + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + localtime_s(<ime, &local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", <ime); + + /* print timestamp and length of the packet */ + printf("%s.%.6d len:%d ", timestr, header->ts.tv_usec, header->len); + + /* retireve the position of the ip header */ + ih = (ip_header *) (pkt_data + + 14); //length of ethernet header + + /* retireve the position of the udp header */ + ip_len = (ih->ver_ihl & 0xf) * 4; + uh = (udp_header *) ((u_char*)ih + ip_len); + + /* convert from network byte order to host byte order */ + sport = ntohs( uh->sport ); + dport = ntohs( uh->dport ); + + /* print ip addresses and udp ports */ + printf("%d.%d.%d.%d.%d -> %d.%d.%d.%d.%d\n", + ih->saddr.byte1, + ih->saddr.byte2, + ih->saddr.byte3, + ih->saddr.byte4, + sport, + ih->daddr.byte1, + ih->daddr.byte2, + ih->daddr.byte3, + ih->daddr.byte4, + dport); +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.c b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.c new file mode 100644 index 0000000..471f850 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.c @@ -0,0 +1,467 @@ +/* + * Copyright (c) 2005 - 2006 + * CACE Technologies, Davis, CA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CACE Technologies nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* + * This simple program implements a user-level bridge. + * It opens two adapters specified by the user and starts two threads. + * The first thread receives packets from adapter 1 and sends them down to + * adapter 2. The second thread does the same, but in the opposite + * direction. + */ + +#include +#include "pcap.h" + +/* Storage data structure used to pass parameters to the threads */ +typedef struct _in_out_adapters +{ + unsigned int state; /* Some simple state information */ + pcap_t *input_adapter; + pcap_t *output_adapter; +}in_out_adapters; + +/* Prototypes */ +DWORD WINAPI CaptureAndForwardThread(LPVOID lpParameter); +void ctrlc_handler(int sig); + +/* This prevents the two threads to mess-up when they do printfs */ +CRITICAL_SECTION print_cs; + +/* Thread handlers. Global because we wait on the threads from the CTRL+C handler */ +HANDLE threads[2]; + +/* This global variable tells the forwarder threads they must terminate */ +volatile int kill_forwaders = 0; + + +/*******************************************************************/ + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + int inum1, inum2; + int i=0; + pcap_t *adhandle1, *adhandle2; + char errbuf[PCAP_ERRBUF_SIZE]; + u_int netmask1, netmask2; + char packet_filter[256]; + struct bpf_program fcode; + in_out_adapters couple0, couple1; + + /* + * Retrieve the device list + */ + + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. ", ++i); + if (d->description) + printf("%s\n", d->description); + else + printf("\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + + /* + * Get input from the user + */ + + /* Get the filter*/ + printf("\nSpecify filter (hit return for no filter):"); + + fgets(packet_filter, sizeof(packet_filter), stdin); + + /* Get the first interface number*/ + printf("\nEnter the number of the first interface to use (1-%d):",i); + scanf_s("%d", &inum1); + + if(inum1 < 1 || inum1 > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Get the second interface number*/ + printf("Enter the number of the first interface to use (1-%d):",i); + scanf_s("%d", &inum2); + + if(inum2 < 1 || inum2 > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + if(inum1 == inum2 ) + { + printf("\nCannot bridge packets on the same interface.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + + /* + * Open the specified couple of adapters + */ + + /* Jump to the first selected adapter */ + for(d = alldevs, i = 0; i< inum1 - 1 ;d = d->next, i++); + + /* + * Open the first adapter. + * *NOTICE* the flags we are using, they are important for the behavior of the prgram: + * - PCAP_OPENFLAG_PROMISCUOUS: tells the adapter to go in promiscuous mode. + * This means that we are capturing all the traffic, not only the one to or from + * this machine. + * - PCAP_OPENFLAG_NOCAPTURE_LOCAL: prevents the adapter from capturing again the packets + * transmitted by itself. This avoids annoying loops. + * - PCAP_OPENFLAG_MAX_RESPONSIVENESS: configures the adapter to provide minimum latency, + * at the cost of higher CPU usage. + */ + if((adhandle1 = pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on every link layer. + PCAP_OPENFLAG_PROMISCUOUS | // flags. We specify that we don't want to capture loopback packets, and that the driver should deliver us the packets as fast as possible + PCAP_OPENFLAG_NOCAPTURE_LOCAL | + PCAP_OPENFLAG_MAX_RESPONSIVENESS, + 500, // read timeout + NULL, // remote authentication + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->description); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + if(d->addresses != NULL) + { + /* Retrieve the mask of the first address of the interface */ + netmask1 = ((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; + } + else + { + /* If the interface is without addresses we suppose to be in a C class network */ + netmask1 = 0xffffff; + } + + /* Jump to the second selected adapter */ + for(d = alldevs, i = 0; i< inum2 - 1 ;d = d->next, i++); + + /* Open the second adapter */ + if((adhandle2 = pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 grants that the whole packet will be captured on every link layer. + PCAP_OPENFLAG_PROMISCUOUS | // flags. We specify that we don't want to capture loopback packets, and that the driver should deliver us the packets as fast as possible + PCAP_OPENFLAG_NOCAPTURE_LOCAL | + PCAP_OPENFLAG_MAX_RESPONSIVENESS, + 500, // read timeout + NULL, // remote authentication + errbuf // error buffer + )) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->description); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + if(d->addresses != NULL) + { + /* Retrieve the mask of the first address of the interface */ + netmask2 = ((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr; + } + else + { + /* If the interface is without addresses we suppose to be in a C class network */ + netmask2 = 0xffffff; + } + + + /* + * Compile and set the filters + */ + + /* compile the filter for the first adapter */ + if (pcap_compile(adhandle1, &fcode, packet_filter, 1, netmask1) <0 ) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* set the filter for the first adapter*/ + if (pcap_setfilter(adhandle1, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter.\n"); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* compile the filter for the second adapter */ + if (pcap_compile(adhandle2, &fcode, packet_filter, 1, netmask2) <0 ) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* set the filter for the second adapter*/ + if (pcap_setfilter(adhandle2, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter.\n"); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* At this point, we don't need the device list any more. Free it */ + pcap_freealldevs(alldevs); + + /* + * Start the threads that will forward the packets + */ + + /* Initialize the critical section that will be used by the threads for console output */ + InitializeCriticalSection(&print_cs); + + /* Init input parameters of the threads */ + couple0.state = 0; + couple0.input_adapter = adhandle1; + couple0.output_adapter = adhandle2; + couple1.state = 1; + couple1.input_adapter = adhandle2; + couple1.output_adapter = adhandle1; + + /* Start first thread */ + if((threads[0] = CreateThread( + NULL, + 0, + CaptureAndForwardThread, + &couple0, + 0, + NULL)) == NULL) + { + fprintf(stderr, "error creating the first forward thread"); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Start second thread */ + if((threads[1] = CreateThread( + NULL, + 0, + CaptureAndForwardThread, + &couple1, + 0, + NULL)) == NULL) + { + fprintf(stderr, "error creating the second forward thread"); + + /* Kill the first thread. Not very gentle at all...*/ + TerminateThread(threads[0], 0); + + /* Close the adapters */ + pcap_close(adhandle1); + pcap_close(adhandle2); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* + * Install a CTRL+C handler that will do the cleanups on exit + */ + signal(SIGINT, ctrlc_handler); + + /* + * Done! + * Wait for the Greek calends... + */ + printf("\nStart bridging the two adapters...\n", d->description); + Sleep(INFINITE); + return 0; +} + +/******************************************************************* + * Forwarding thread. + * Gets the packets from the input adapter and sends them to the output one. + *******************************************************************/ +DWORD WINAPI CaptureAndForwardThread(LPVOID lpParameter) +{ + struct pcap_pkthdr *header; + const u_char *pkt_data; + int res = 0; + in_out_adapters* ad_couple = lpParameter; + unsigned int n_fwd = 0; + + /* + * Loop receiving packets from the first input adapter + */ + + while((!kill_forwaders) && (res = pcap_next_ex(ad_couple->input_adapter, &header, &pkt_data)) >= 0) + { + if(res != 0) /* Note: res=0 means "read timeout elapsed"*/ + { + /* + * Print something, just to show when we have activity. + * BEWARE: acquiring a critical section and printing strings with printf + * is something inefficient that you seriously want to avoid in your packet loop! + * However, since this is a *sample program*, we privilege visual output to efficiency. + */ + EnterCriticalSection(&print_cs); + + if(ad_couple->state == 0) + printf(">> Len: %u\n", header->caplen); + else + printf("<< Len: %u\n", header->caplen); + + LeaveCriticalSection(&print_cs); + + /* + * Send the just received packet to the output adaper + */ + if(pcap_sendpacket(ad_couple->output_adapter, pkt_data, header->caplen) != 0) + { + EnterCriticalSection(&print_cs); + + printf("Error sending a %u bytes packets on interface %u: %s\n", + header->caplen, + ad_couple->state, + pcap_geterr(ad_couple->output_adapter)); + + LeaveCriticalSection(&print_cs); + } + else + { + n_fwd++; + } + } + } + + /* + * We're out of the main loop. Check the reason. + */ + if(res < 0) + { + EnterCriticalSection(&print_cs); + + printf("Error capturing the packets: %s\n", pcap_geterr(ad_couple->input_adapter)); + fflush(stdout); + + LeaveCriticalSection(&print_cs); + } + else + { + EnterCriticalSection(&print_cs); + + printf("End of bridging on interface %u. Forwarded packets:%u\n", + ad_couple->state, + n_fwd); + fflush(stdout); + + LeaveCriticalSection(&print_cs); + } + + return 0; +} + +/******************************************************************* + * CTRL+C hanlder. + * We order the threads to die and then we patiently wait for their + * suicide. + *******************************************************************/ +void ctrlc_handler(int sig) +{ + /* + * unused variable + */ + (VOID)(sig); + + kill_forwaders = 1; + + WaitForMultipleObjects(2, + threads, + TRUE, /* Wait for all the handles */ + 5000); /* Timeout */ + + exit(0); +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsp b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsp new file mode 100644 index 0000000..f8ef34a --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsp @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="UserBridge" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=UserBridge - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "UserBridge.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "UserBridge.mak" CFG="UserBridge - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "UserBridge - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "UserBridge - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "UserBridge - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "UserBridge - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "UserBridge - Win32 Release" +# Name "UserBridge - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\UserBridge.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsw b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsw new file mode 100644 index 0000000..7104a54 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/UserLevelBridge/UserBridge.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "UserBridge"=.\UserBridge.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.c b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.c new file mode 100644 index 0000000..391dda1 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.c @@ -0,0 +1,176 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include + +#include "pcap.h" + +#ifndef WIN32 + #include + #include +#else + #include +#endif + + +// Function prototypes +void ifprint(pcap_if_t *d); +char *iptos(u_long in); +char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen); + + +int main() +{ + pcap_if_t *alldevs; + pcap_if_t *d; + char errbuf[PCAP_ERRBUF_SIZE+1]; + char source[PCAP_ERRBUF_SIZE+1]; + + printf("Enter the device you want to list:\n" + "rpcap:// ==> lists interfaces in the local machine\n" + "rpcap://hostname:port ==> lists interfaces in a remote machine\n" + " (rpcapd daemon must be up and running\n" + " and it must accept 'null' authentication)\n" + "file://foldername ==> lists all pcap files in the give folder\n\n" + "Enter your choice: "); + + fgets(source, PCAP_ERRBUF_SIZE, stdin); + source[PCAP_ERRBUF_SIZE] = '\0'; + + /* Retrieve the interfaces list */ + if (pcap_findalldevs_ex(source, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n",errbuf); + exit(1); + } + + /* Scan the list printing every entry */ + for(d=alldevs;d;d=d->next) + { + ifprint(d); + } + + pcap_freealldevs(alldevs); + + return 1; +} + + + +/* Print all the available information on the given interface */ +void ifprint(pcap_if_t *d) +{ + pcap_addr_t *a; + char ip6str[128]; + + /* Name */ + printf("%s\n",d->name); + + /* Description */ + if (d->description) + printf("\tDescription: %s\n",d->description); + + /* Loopback Address*/ + printf("\tLoopback: %s\n",(d->flags & PCAP_IF_LOOPBACK)?"yes":"no"); + + /* IP addresses */ + for(a=d->addresses;a;a=a->next) { + printf("\tAddress Family: #%d\n",a->addr->sa_family); + + switch(a->addr->sa_family) + { + case AF_INET: + printf("\tAddress Family Name: AF_INET\n"); + if (a->addr) + printf("\tAddress: %s\n",iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr)); + if (a->netmask) + printf("\tNetmask: %s\n",iptos(((struct sockaddr_in *)a->netmask)->sin_addr.s_addr)); + if (a->broadaddr) + printf("\tBroadcast Address: %s\n",iptos(((struct sockaddr_in *)a->broadaddr)->sin_addr.s_addr)); + if (a->dstaddr) + printf("\tDestination Address: %s\n",iptos(((struct sockaddr_in *)a->dstaddr)->sin_addr.s_addr)); + break; + + case AF_INET6: + printf("\tAddress Family Name: AF_INET6\n"); + if (a->addr) + printf("\tAddress: %s\n", ip6tos(a->addr, ip6str, sizeof(ip6str))); + break; + + default: + printf("\tAddress Family Name: Unknown\n"); + break; + } + } + printf("\n"); +} + + + +/* From tcptraceroute, convert a numeric IP address to a string */ +#define IPTOSBUFFERS 12 +char *iptos(u_long in) +{ + static char output[IPTOSBUFFERS][3*4+3+1]; + static short which; + u_char *p; + + p = (u_char *)∈ + which = (which + 1 == IPTOSBUFFERS ? 0 : which + 1); + _snprintf_s(output[which], sizeof(output[which]), sizeof(output[which]),"%d.%d.%d.%d", p[0], p[1], p[2], p[3]); + return output[which]; +} + +char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen) +{ + socklen_t sockaddrlen; + + #ifdef WIN32 + sockaddrlen = sizeof(struct sockaddr_in6); + #else + sockaddrlen = sizeof(struct sockaddr_storage); + #endif + + + if(getnameinfo(sockaddr, + sockaddrlen, + address, + addrlen, + NULL, + 0, + NI_NUMERICHOST) != 0) address = NULL; + + return address; +} + + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsp b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsp new file mode 100644 index 0000000..4182364 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="iflist" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=iflist - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "iflist.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "iflist.mak" CFG="iflist - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "iflist - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "iflist - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "iflist - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "iflist - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "iflist - Win32 Release" +# Name "iflist - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\iflist.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsw b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsw new file mode 100644 index 0000000..1425db2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/iflist/iflist.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "iflist"=.\iflist.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/MakeaAll.dsw b/ledset/WpdPack_4_1_2/Examples-remote/misc/MakeaAll.dsw new file mode 100644 index 0000000..8223f54 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/MakeaAll.dsw @@ -0,0 +1,89 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "basic_dump"=.\basic_dump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "basic_dump_ex"=.\basic_dump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile"=.\readfile.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "readfile_ex"=.\readfile_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "savedump"=.\savedump.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "sendpack"=.\sendpack.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.c new file mode 100644 index 0000000..8c660f3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.c @@ -0,0 +1,100 @@ +#include "pcap.h" + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int main() +{ +pcap_if_t *alldevs; +pcap_if_t *d; +int inum; +int i=0; +pcap_t *adhandle; +char errbuf[PCAP_ERRBUF_SIZE]; + + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the device */ + if ( (adhandle= pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture + // 65536 guarantees that the whole packet will be captured on all the link layers + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, NULL); + + return 0; +} + + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + struct tm ltime; + char timestr[16]; + time_t local_tv_sec; + + /* + * unused variables + */ + (VOID)(param); + (VOID)(pkt_data); + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + localtime_s(<ime, &local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", <ime); + + printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); + +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.dsp new file mode 100644 index 0000000..7e74aaa --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="basic_dump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=basic_dump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "basic_dump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "basic_dump.mak" CFG="basic_dump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "basic_dump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "basic_dump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "basic_dump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "basic_dump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "basic_dump - Win32 Release" +# Name "basic_dump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\basic_dump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.c new file mode 100644 index 0000000..ec047b3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.c @@ -0,0 +1,99 @@ +#include "pcap.h" + + +int main() +{ +pcap_if_t *alldevs; +pcap_if_t *d; +int inum; +int i=0; +pcap_t *adhandle; +int res; +char errbuf[PCAP_ERRBUF_SIZE]; +struct tm ltime; +char timestr[16]; +struct pcap_pkthdr *header; +const u_char *pkt_data; +time_t local_tv_sec; + + + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the device */ + if ( (adhandle= pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture. + // 65536 guarantees that the whole packet will be captured on all the link layers + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + printf("\nlistening on %s...\n", d->description); + + /* At this point, we don't need any more the device list. Free it */ + pcap_freealldevs(alldevs); + + /* Retrieve the packets */ + while((res = pcap_next_ex( adhandle, &header, &pkt_data)) >= 0){ + + if(res == 0) + /* Timeout elapsed */ + continue; + + /* convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + localtime_s(<ime, &local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", <ime); + + printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len); + } + + if(res == -1){ + printf("Error reading the packets: %s\n", pcap_geterr(adhandle)); + return -1; + } + + return 0; +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.dsp new file mode 100644 index 0000000..0405d29 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/basic_dump_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="basic_dump_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=basic_dump_ex - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "basic_dump_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "basic_dump_ex.mak" CFG="basic_dump_ex - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "basic_dump_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "basic_dump_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "basic_dump_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "basic_dump_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "basic_dump_ex - Win32 Release" +# Name "basic_dump_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\basic_dump_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.c new file mode 100644 index 0000000..7db43b4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.c @@ -0,0 +1,78 @@ +#include +#include + +#define LINE_LEN 16 + +void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); + +int main(int argc, char **argv) +{ +pcap_t *fp; +char errbuf[PCAP_ERRBUF_SIZE]; +char source[PCAP_BUF_SIZE]; + + if(argc != 2){ + + printf("usage: %s filename", argv[0]); + return -1; + + } + + /* Create the source string according to the new WinPcap syntax */ + if ( pcap_createsrcstr( source, // variable that will keep the source string + PCAP_SRC_FILE, // we want to open a file + NULL, // remote host + NULL, // port on the remote host + argv[1], // name of the file we want to open + errbuf // error buffer + ) != 0) + { + fprintf(stderr,"\nError creating a source string\n"); + return -1; + } + + /* Open the capture file */ + if ( (fp= pcap_open(source, // name of the device + 65536, // portion of the packet to capture + // 65536 guarantees that the whole packet will be captured on all the link layers + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the file %s.\n", source); + return -1; + } + + // read and dispatch packets until EOF is reached + pcap_loop(fp, 0, dispatcher_handler, NULL); + + return 0; +} + + + +void dispatcher_handler(u_char *temp1, + const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + u_int i=0; + + /* + * Unused variable + */ + (VOID)temp1; + + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.dsp new file mode 100644 index 0000000..5d45bde --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="readfile" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=readfile - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "readfile.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "readfile.mak" CFG="readfile - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "readfile - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "readfile - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "readfile - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "readfile - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "readfile - Win32 Release" +# Name "readfile - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\readfile.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.c new file mode 100644 index 0000000..622bc9e --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.c @@ -0,0 +1,73 @@ +#include +#include + +#define LINE_LEN 16 + +int main(int argc, char **argv) +{ +pcap_t *fp; +char errbuf[PCAP_ERRBUF_SIZE]; +char source[PCAP_BUF_SIZE]; +struct pcap_pkthdr *header; +const u_char *pkt_data; +u_int i=0; +int res; + + if(argc != 2) + { + printf("usage: %s filename", argv[0]); + return -1; + } + + /* Create the source string according to the new WinPcap syntax */ + if ( pcap_createsrcstr( source, // variable that will keep the source string + PCAP_SRC_FILE, // we want to open a file + NULL, // remote host + NULL, // port on the remote host + argv[1], // name of the file we want to open + errbuf // error buffer + ) != 0) + { + fprintf(stderr,"\nError creating a source string\n"); + return -1; + } + + /* Open the capture file */ + if ( (fp= pcap_open(source, // name of the device + 65536, // portion of the packet to capture + // 65536 guarantees that the whole packet will be captured on all the link layers + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the file %s.\n", source); + return -1; + } + + /* Retrieve the packets from the file */ + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) + { + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + } + + + if (res == -1) + { + printf("Error reading the packets: %s\n", pcap_geterr(fp)); + } + + return 0; +} + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.dsp new file mode 100644 index 0000000..07dcf9f --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/readfile_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="readfile_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=readfile_ex - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "readfile_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "readfile_ex.mak" CFG="readfile_ex - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "readfile_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "readfile_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "readfile_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "readfile_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "readfile_ex - Win32 Release" +# Name "readfile_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\readfile_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.c new file mode 100644 index 0000000..6316939 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.c @@ -0,0 +1,104 @@ +#include "pcap.h" + +/* prototype of the packet handler */ +void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int main(int argc, char **argv) +{ +pcap_if_t *alldevs; +pcap_if_t *d; +int inum; +int i=0; +pcap_t *adhandle; +char errbuf[PCAP_ERRBUF_SIZE]; +pcap_dumper_t *dumpfile; + + + + /* Check command line */ + if(argc != 2) + { + printf("usage: %s filename", argv[0]); + return -1; + } + + /* Retrieve the device list on the local machine */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + + /* Open the device */ + if ( (adhandle= pcap_open(d->name, // name of the device + 65536, // portion of the packet to capture + // 65536 guarantees that the whole packet will be captured on all the link layers + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Open the dump file */ + dumpfile = pcap_dump_open(adhandle, argv[1]); + + if(dumpfile==NULL) + { + fprintf(stderr,"\nError opening output file\n"); + return -1; + } + + printf("\nlistening on %s... Press Ctrl+C to stop...\n", d->description); + + /* At this point, we no longer need the device list. Free it */ + pcap_freealldevs(alldevs); + + /* start the capture */ + pcap_loop(adhandle, 0, packet_handler, (unsigned char *)dumpfile); + + return 0; +} + +/* Callback function invoked by libpcap for every incoming packet */ +void packet_handler(u_char *dumpfile, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + /* save the packet on the dump file */ + pcap_dump(dumpfile, header, pkt_data); +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.dsp new file mode 100644 index 0000000..22d5d39 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/savedump.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="savedump" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=savedump - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "savedump.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "savedump.mak" CFG="savedump - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "savedump - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "savedump - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "savedump - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "savedump - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "savedump - Win32 Release" +# Name "savedump - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\savedump.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.c b/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.c new file mode 100644 index 0000000..55b1a5b --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.c @@ -0,0 +1,64 @@ +#include +#include + +#include + + +void main(int argc, char **argv) +{ +pcap_t *fp; +char errbuf[PCAP_ERRBUF_SIZE]; +u_char packet[100]; +int i; + + /* Check the validity of the command line */ + if (argc != 2) + { + printf("usage: %s interface (e.g. 'rpcap://eth0')", argv[0]); + return; + } + + /* Open the output device */ + if ( (fp= pcap_open(argv[1], // name of the device + 100, // portion of the packet to capture (only the first 100 bytes) + PCAP_OPENFLAG_PROMISCUOUS, // promiscuous mode + 1000, // read timeout + NULL, // authentication on the remote machine + errbuf // error buffer + ) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", argv[1]); + return; + } + + /* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */ + packet[0]=1; + packet[1]=1; + packet[2]=1; + packet[3]=1; + packet[4]=1; + packet[5]=1; + + /* set mac source to 2:2:2:2:2:2 */ + packet[6]=2; + packet[7]=2; + packet[8]=2; + packet[9]=2; + packet[10]=2; + packet[11]=2; + + /* Fill the rest of the packet */ + for(i=12;i<100;i++) + { + packet[i]=(u_char)i; + } + + /* Send down the packet */ + if (pcap_sendpacket(fp, packet, 100 /* size */) != 0) + { + fprintf(stderr,"\nError sending the packet: %s\n", pcap_geterr(fp)); + return; + } + + return; +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.dsp b/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.dsp new file mode 100644 index 0000000..95022e3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/misc/sendpack.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="sendpack" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=sendpack - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "sendpack.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "sendpack.mak" CFG="sendpack - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sendpack - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "sendpack - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "sendpack - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "sendpack - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /I "D:/Program Files/Microsoft Platform SDK/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ws2_32.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "sendpack - Win32 Release" +# Name "sendpack - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\sendpack.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.c b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.c new file mode 100644 index 0000000..ad83a16 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.c @@ -0,0 +1,169 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include + +#include + +#define MAX_PRINT 80 +#define MAX_LINE 16 + + +void usage(); + + +void main(int argc, char **argv) +{ +pcap_t *fp; +char errbuf[PCAP_ERRBUF_SIZE]; +char *source=NULL; +char *ofilename=NULL; +char *filter=NULL; +int i; +pcap_dumper_t *dumpfile; +struct bpf_program fcode; +bpf_u_int32 NetMask; +int res; +struct pcap_pkthdr *header; +const u_char *pkt_data; + + if (argc == 1) + { + usage(); + return; + } + + for(i=1;i < argc; i+= 2) + { + + switch (argv[i] [1]) + { + case 's': + { + source=argv[i+1]; + }; + break; + + case 'o': + { + ofilename=argv[i+1]; + }; + break; + + case 'f': + { + filter=argv[i+1]; + }; + break; + } + } + + // open a capture from the network + if (source != NULL) + { + if ( (fp= pcap_open(source, + 1514 /*snaplen*/, + PCAP_OPENFLAG_PROMISCUOUS /*flags*/, + 20 /*read timeout*/, + NULL /* remote authentication */, + errbuf) + ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter.\n"); + return; + } + } + + else usage(); + + if (filter != NULL) + { + // We should loop through the adapters returned by the pcap_findalldevs_ex() + // in order to locate the correct one. + // + // Let's do things simpler: we suppose to be in a C class network ;-) + NetMask=0xffffff; + + //compile the filter + if(pcap_compile(fp, &fcode, filter, 1, NetMask) < 0) + { + fprintf(stderr,"\nError compiling filter: wrong syntax.\n"); + return; + } + + //set the filter + if(pcap_setfilter(fp, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter\n"); + return; + } + + } + + //open the dump file + if (ofilename != NULL) + { + dumpfile= pcap_dump_open(fp, ofilename); + + if (dumpfile == NULL) + { + fprintf(stderr,"\nError opening output file\n"); + return; + } + } + else usage(); + + //start the capture + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) + { + + if(res == 0) + /* Timeout elapsed */ + continue; + + //save the packet on the dump file + pcap_dump((unsigned char *) dumpfile, header, pkt_data); + + } +} + + +void usage() +{ + + printf("\npf - Generic Packet Filter.\n"); + printf("\nUsage:\npf -s source -o output_file_name [-f filter_string]\n\n"); + exit(0); +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsp b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsp new file mode 100644 index 0000000..c01d2e7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="pcap_filter" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pcap_filter - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pcap_filter.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pcap_filter.mak" CFG="pcap_filter - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pcap_filter - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pcap_filter - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pcap_filter - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"Release/pf.exe" + +!ELSEIF "$(CFG)" == "pcap_filter - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/pf.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pcap_filter - Win32 Release" +# Name "pcap_filter - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\pcap_filter.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsw b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsw new file mode 100644 index 0000000..1d39119 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pcap_filter/pcap_filter.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "pcap_filter"=.\pcap_filter.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pcap_fopen/pcap_fopen.cpp b/ledset/WpdPack_4_1_2/Examples-remote/pcap_fopen/pcap_fopen.cpp new file mode 100644 index 0000000..0476e40 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pcap_fopen/pcap_fopen.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CACE Technologies nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This sample was contributed by + * Marcin Okraszewski (Marcin.OkraszewskiATpl.compuware.com) + * + */ + +#include +#include +#include + +/** Prints packet timestaps regardless of format*/ +int _tmain(int argc, _TCHAR* argv[]) +{ + char errbuf[PCAP_ERRBUF_SIZE]; + wchar_t cmd[1024]; + wchar_t tshark_path[MAX_PATH]; + wchar_t file_path[MAX_PATH]; + + if ( argc != 3 ) { + wprintf(L"Prints packet timestaps regardless of format.\n"); + wprintf(L"Usage:\n\t%ls \n", argv[0]); + return 1; + } + + // conversion to short path name in case there are spaces + if ( ! GetShortPathNameW(argv[1], tshark_path, MAX_PATH) || + ! GetShortPathNameW(argv[2], file_path, MAX_PATH) ) + { + printf("Failed to convert paths to short form."); + return 1; + } + + // create tshark command, which will make the trace conversion and print in libpcap format to stdout + if ( swprintf_s(cmd, 1024, L"%ls -r %ls -w - -F libpcap", tshark_path, file_path) < 0 ) { + wprintf(L"Failed to create command\n"); + return 1; + } + + // start tshark + FILE *tshark_out = _wpopen(cmd, L"rb"); + if ( tshark_out == NULL ) { + strerror_s(errbuf, PCAP_ERRBUF_SIZE, errno); + printf("Failed run tshark: %s\n", errbuf); + wprintf(L"Command: %ls", cmd); + return 1; + } + + // open stdout from tshark + pcap_t *pcap = pcap_fopen_offline(tshark_out, errbuf); + if ( pcap == NULL ) { + printf("Error opening stream from tshark: %s\n", errbuf); + return 1; + } + + // print information about every packet int trace + struct pcap_pkthdr hdr; + while ( pcap_next(pcap, &hdr) ) { + printf("packet: ts: %u.%06u, len: %4u, caplen: %4u\n", hdr.ts.tv_sec, hdr.ts.tv_usec, hdr.len, hdr.caplen); + } + + // clean up + pcap_close(pcap); + _pclose(tshark_out); + return 0; +} + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.c b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.c new file mode 100644 index 0000000..6198e7d --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.c @@ -0,0 +1,163 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include + +// +// NOTE: remember to include WPCAP and HAVE_REMOTE among your +// preprocessor definitions. +// + +#include + +#define LINE_LEN 16 + +int main(int argc, char **argv) +{ +pcap_if_t *alldevs, *d; +pcap_t *fp; +u_int inum, i=0; +char errbuf[PCAP_ERRBUF_SIZE]; +int res; +struct pcap_pkthdr *header; +const u_char *pkt_data; + + printf("pktdump_ex: prints the packets of the network using WinPcap.\n"); + printf(" Usage: pktdump_ex [-s source]\n\n" + " Examples:\n" + " pktdump_ex -s file://c:/temp/file.acp\n" + " pktdump_ex -s rpcap://\\Device\\NPF_{C8736017-F3C3-4373-94AC-9A34B7DAD998}\n\n"); + + if(argc < 3) + { + + printf("\nNo adapter selected: printing the device list:\n"); + /* The user didn't provide a packet source: Retrieve the local device list */ + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf); + return -1; + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s\n ", ++i, d->name); + + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if (i==0) + { + fprintf(stderr,"No interfaces found! Exiting.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if (inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for (d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the device */ + if ( (fp= pcap_open(d->name, + 100 /*snaplen*/, + PCAP_OPENFLAG_PROMISCUOUS /*flags*/, + 20 /*read timeout*/, + NULL /* remote authentication */, + errbuf) + ) == NULL) + { + fprintf(stderr,"\nError opening adapter\n"); + return -1; + } + } + else + { + // Do not check for the switch type ('-s') + if ( (fp= pcap_open(argv[2], + 100 /*snaplen*/, + PCAP_OPENFLAG_PROMISCUOUS /*flags*/, + 20 /*read timeout*/, + NULL /* remote authentication */, + errbuf) + ) == NULL) + { + fprintf(stderr,"\nError opening source: %s\n", errbuf); + return -1; + } + } + + /* Read the packets */ + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0) + { + + if(res == 0) + /* Timeout elapsed */ + continue; + + /* print pkt timestamp and pkt len */ + printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len); + + /* Print the packet */ + for (i=1; (i < header->caplen + 1 ) ; i++) + { + printf("%.2x ", pkt_data[i-1]); + if ( (i % LINE_LEN) == 0) printf("\n"); + } + + printf("\n\n"); + } + + if(res == -1) + { + fprintf(stderr, "Error reading the packets: %s\n", pcap_geterr(fp)); + return -1; + } + + return 0; +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsp b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsp new file mode 100644 index 0000000..a9800e6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="pktdump_ex" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=pktdump_ex - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "pktdump_ex.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "pktdump_ex.mak" CFG="pktdump_ex - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "pktdump_ex - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "pktdump_ex - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "pktdump_ex - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "pktdump_ex - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "pktdump_ex - Win32 Release" +# Name "pktdump_ex - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\pktdump_ex.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsw b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsw new file mode 100644 index 0000000..ec24733 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/pktdump_ex/pktdump_ex.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "pktdump_ex"=.\pktdump_ex.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sencap.dsw b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sencap.dsw new file mode 100644 index 0000000..eae0bc2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sencap.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "sendcap"=.\sendcap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.c b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.c new file mode 100644 index 0000000..876c6d8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include + +void usage(); + +void main(int argc, char **argv) +{ + pcap_t *indesc,*outdesc; + char errbuf[PCAP_ERRBUF_SIZE]; + char source[PCAP_BUF_SIZE]; + FILE *capfile; + int caplen, sync; + u_int res; + pcap_send_queue *squeue; + struct pcap_pkthdr *pktheader; + u_char *pktdata; + float cpu_time; + u_int npacks = 0; + errno_t fopen_error; + + /* Check the validity of the command line */ + if (argc <= 2 || argc >= 5) + { + usage(); + return; + } + + /* Retrieve the length of the capture file */ + fopen_error = fopen_s(&capfile, argv[1],"rb"); + if(fopen_error != 0){ + printf("Error opening the file, errno %d.\n", fopen_error); + return; + } + + fseek(capfile , 0, SEEK_END); + caplen= ftell(capfile)- sizeof(struct pcap_file_header); + fclose(capfile); + + /* Chek if the timestamps must be respected */ + if(argc == 4 && argv[3][0] == 's') + sync = TRUE; + else + sync = FALSE; + + /* Open the capture */ + /* Create the source string according to the new WinPcap syntax */ + if ( pcap_createsrcstr( source, // variable that will keep the source string + PCAP_SRC_FILE, // we want to open a file + NULL, // remote host + NULL, // port on the remote host + argv[1], // name of the file we want to open + errbuf // error buffer + ) != 0) + { + fprintf(stderr,"\nError creating a source string\n"); + return; + } + + /* Open the capture file */ + if ( (indesc= pcap_open(source, 65536, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL) + { + fprintf(stderr,"\nUnable to open the file %s.\n", source); + return; + } + + /* Open the output adapter */ + if ( (outdesc= pcap_open(argv[2], 100, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL) + { + fprintf(stderr,"\nUnable to open adapter %s.\n", source); + return; + } + + /* Check the MAC type */ + if (pcap_datalink(indesc) != pcap_datalink(outdesc)) + { + printf("Warning: the datalink of the capture differs from the one of the selected interface.\n"); + printf("Press a key to continue, or CTRL+C to stop.\n"); + getchar(); + } + + /* Allocate a send queue */ + squeue = pcap_sendqueue_alloc(caplen); + + /* Fill the queue with the packets from the file */ + while ((res = pcap_next_ex( indesc, &pktheader, &pktdata)) == 1) + { + if (pcap_sendqueue_queue(squeue, pktheader, pktdata) == -1) + { + printf("Warning: packet buffer too small, not all the packets will be sent.\n"); + break; + } + + npacks++; + } + + if (res == -1) + { + printf("Corrupted input file.\n"); + pcap_sendqueue_destroy(squeue); + return; + } + + /* Transmit the queue */ + + cpu_time = (float)clock (); + + if ((res = pcap_sendqueue_transmit(outdesc, squeue, sync)) < squeue->len) + { + printf("An error occurred sending the packets: %s. Only %d bytes were sent\n", pcap_geterr(outdesc), res); + } + + cpu_time = (clock() - cpu_time)/CLK_TCK; + + printf ("\n\nElapsed time: %5.3f\n", cpu_time); + printf ("\nTotal packets generated = %d", npacks); + printf ("\nAverage packets per second = %d", (int)((double)npacks/cpu_time)); + printf ("\n"); + + /* free the send queue */ + pcap_sendqueue_destroy(squeue); + + /* Close the input file */ + pcap_close(indesc); + + /* + * lose the output adapter + * IMPORTANT: remember to close the adapter, otherwise there will be no guarantee that all the + * packets will be sent! + */ + pcap_close(outdesc); + + + return; +} + + +void usage() +{ + + printf("\nSendcap, sends a libpcap/tcpdump capture file to the net. Copyright (C) 2002 Loris Degioanni.\n"); + printf("\nUsage:\n"); + printf("\t sendcap file_name adapter [s]\n"); + printf("\nParameters:\n"); + printf("\nfile_name: the name of the dump file that will be sent to the network\n"); + printf("\nadapter: the device to use. Use \"WinDump -D\" for a list of valid devices\n"); + printf("\ns: if present, forces the packets to be sent synchronously, i.e. respecting the timestamps in the dump file. This option will work only under Windows NTx.\n\n"); + + exit(0); +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.dsp b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.dsp new file mode 100644 index 0000000..230d09b --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/sendcap/sendcap.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="sendcap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=sendcap - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "sendcap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "sendcap.mak" CFG="sendcap - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sendcap - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "sendcap - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "sendcap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "PCAP_DONT_INCLUDE_PCAP_BPF_H" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "sendcap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "PCAP_DONT_INCLUDE_PCAP_BPF_H" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "sendcap - Win32 Release" +# Name "sendcap - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\sendcap.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.c b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.c new file mode 100644 index 0000000..9b99114 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.c @@ -0,0 +1,134 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#include +#include +#include + +#include + + +int main() +{ +pcap_if_t *alldevs, *d; +pcap_t *fp; +u_int inum, i=0; +char errbuf[PCAP_ERRBUF_SIZE]; +int res; +struct pcap_pkthdr *header; +const u_char *pkt_data; +struct pcap_pkthdr old; + + printf("SMP_1\n"); + printf("\nThis program tests the WinPcap kernel driver on SMP machines.\n"); + printf("The program tests that timestamps on the captured packets are consistent,\n"); + printf("and that the caplen is equal to the packet length.\n"); + printf("If there is an error, it will print out a message saying \"Inconsistent XXX\"\n"); + + if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) + { + fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf); + exit(1); + } + + /* Print the list */ + for(d=alldevs; d; d=d->next) + { + printf("%d. %s", ++i, d->name); + if (d->description) + printf(" (%s)\n", d->description); + else + printf(" (No description available)\n"); + } + + if(i==0) + { + printf("\nNo interfaces found! Make sure WinPcap is installed.\n"); + return -1; + } + + printf("Enter the interface number (1-%d):",i); + scanf_s("%d", &inum); + + if(inum < 1 || inum > i) + { + printf("\nInterface number out of range.\n"); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + /* Jump to the selected adapter */ + for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++); + + /* Open the device */ + if ( (fp= pcap_open(d->name, 65536, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL) + { + fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); + /* Free the device list */ + pcap_freealldevs(alldevs); + return -1; + } + + old.ts.tv_sec=0; + old.ts.tv_usec=0; + + + /* Read the packets */ + while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0){ + + if(res == 0) + continue; + + //check that caplen is equal to packet length + if (header->caplen!=header->len) + printf("Inconsistent header: CapLen %d\t Len %d\n",header->caplen,header->len); + + //check that timestamps always grow + if ( old.ts.tv_sec > header->ts.tv_sec || (old.ts.tv_sec == header->ts.tv_sec && old.ts.tv_usec > header->ts.tv_usec)) + printf("Inconsistent Timestamps! Old was %d.%.06d - New is %d.%.06d\n",old.ts.tv_sec,old.ts.tv_usec, header->ts.tv_sec,header->ts.tv_usec); + + old=*header; + + } + + if(res == -1){ + printf("Error reading the packets: %s\n", pcap_geterr(fp)); + return -1; + } + + _getch(); + + return 0; +} diff --git a/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsp b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsp new file mode 100644 index 0000000..e759c30 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsp @@ -0,0 +1,102 @@ +# Microsoft Developer Studio Project File - Name="smp_1" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=smp_1 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "smp_1.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "smp_1.mak" CFG="smp_1 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "smp_1 - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "smp_1 - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "smp_1 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wpcap.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\lib" + +!ELSEIF "$(CFG)" == "smp_1 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wpcap.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\lib" + +!ENDIF + +# Begin Target + +# Name "smp_1 - Win32 Release" +# Name "smp_1 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\SMP_1.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsw b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsw new file mode 100644 index 0000000..36c8e46 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/smp_1/smp_1.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "smp_1"=.\smp_1.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.c b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.c new file mode 100644 index 0000000..2d83c3f --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include + +void usage(); + +void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); + + +void main(int argc, char **argv) +{ +pcap_t *fp; +char errbuf[PCAP_ERRBUF_SIZE]; +struct timeval st_ts; +u_int netmask; +struct bpf_program fcode; + + /* Check the validity of the command line */ + if (argc != 2) + { + usage(); + return; + } + + /* Open the output adapter */ + if ( (fp= pcap_open(argv[1], 100, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL) + { + fprintf(stderr,"\nUnable to open adapter %s.\n", errbuf); + return; + } + + /* Don't care about netmask, it won't be used for this filter */ + netmask=0xffffff; + + //compile the filter + if (pcap_compile(fp, &fcode, "tcp", 1, netmask) <0 ) + { + fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n"); + /* Free the device list */ + return; + } + + //set the filter + if (pcap_setfilter(fp, &fcode)<0) + { + fprintf(stderr,"\nError setting the filter.\n"); + pcap_close(fp); + /* Free the device list */ + return; + } + + /* Put the interface in statstics mode */ + if (pcap_setmode(fp, MODE_STAT)<0) + { + fprintf(stderr,"\nError setting the mode.\n"); + pcap_close(fp); + /* Free the device list */ + return; + } + + + printf("TCP traffic summary:\n"); + + /* Start the main loop */ + pcap_loop(fp, 0, dispatcher_handler, (PUCHAR)&st_ts); + + pcap_close(fp); + return; +} + +void dispatcher_handler(u_char *state, const struct pcap_pkthdr *header, const u_char *pkt_data) +{ + struct timeval *old_ts = (struct timeval *)state; + u_int delay; + LARGE_INTEGER Bps,Pps; + struct tm ltime; + char timestr[16]; + time_t local_tv_sec; + + /* Calculate the delay in microseconds from the last sample. */ + /* This value is obtained from the timestamp that the associated with the sample. */ + delay=(header->ts.tv_sec - old_ts->tv_sec) * 1000000 - old_ts->tv_usec + header->ts.tv_usec; + /* Get the number of Bits per second */ + Bps.QuadPart=(((*(LONGLONG*)(pkt_data + 8)) * 8 * 1000000) / (delay)); + /* ^ ^ + | | + | | + | | + converts bytes in bits -- | + | + delay is expressed in microseconds -- + */ + + /* Get the number of Packets per second */ + Pps.QuadPart=(((*(LONGLONG*)(pkt_data)) * 1000000) / (delay)); + + /* Convert the timestamp to readable format */ + local_tv_sec = header->ts.tv_sec; + localtime_s(<ime, &local_tv_sec); + strftime( timestr, sizeof timestr, "%H:%M:%S", <ime); + + /* Print timestamp*/ + printf("%s ", timestr); + + /* Print the samples */ + printf("BPS=%I64u ", Bps.QuadPart); + printf("PPS=%I64u\n", Pps.QuadPart); + + //store current timestamp + old_ts->tv_sec=header->ts.tv_sec; + old_ts->tv_usec=header->ts.tv_usec; +} + + +void usage() +{ + + printf("\nShows the TCP traffic load, in bits per second and packets per second.\nCopyright (C) 2002 Loris Degioanni.\n"); + printf("\nUsage:\n"); + printf("\t tcptop adapter\n"); + printf("\t You can use \"WinDump -D\" if you don't know the name of your adapters.\n"); + + exit(0); +} \ No newline at end of file diff --git a/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsp b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsp new file mode 100644 index 0000000..95d9fcc --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsp @@ -0,0 +1,110 @@ +# Microsoft Developer Studio Project File - Name="tcptop" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=tcptop - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tcptop.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tcptop.mak" CFG="tcptop - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tcptop - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "tcptop - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tcptop - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /c +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x410 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "tcptop - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../" /I "../bpf/" /I "../lbl/" /I "../../Include/" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_UNICODE" /D "WPCAP" /D "HAVE_REMOTE" /YX /FD /GZ /c +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x410 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "tcptop - Win32 Release" +# Name "tcptop - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\tcptop.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\pcap.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=..\..\lib\Wpcap.lib +# End Source File +# End Target +# End Project diff --git a/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsw b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsw new file mode 100644 index 0000000..d680f73 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Examples-remote/tcptop/tcptop.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "tcptop"=.\tcptop.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/ledset/WpdPack_4_1_2/Include/Packet32.h b/ledset/WpdPack_4_1_2/Include/Packet32.h new file mode 100644 index 0000000..64be055 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/Packet32.h @@ -0,0 +1,359 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2007 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/** @ingroup packetapi + * @{ + */ + +/** @defgroup packet32h Packet.dll definitions and data structures + * Packet32.h contains the data structures and the definitions used by packet.dll. + * The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included + * by the applications that use the functions of this library + * @{ + */ + +#ifndef __PACKET32 +#define __PACKET32 + +#include + +#ifdef HAVE_AIRPCAP_API +#include +#else +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ +typedef struct _AirpcapHandle *PAirpcapHandle; +#endif /* AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ */ +#endif /* HAVE_AIRPCAP_API */ + +#ifdef HAVE_DAG_API +#include +#endif /* HAVE_DAG_API */ + +// Working modes +#define PACKET_MODE_CAPT 0x0 ///< Capture mode +#define PACKET_MODE_STAT 0x1 ///< Statistical mode +#define PACKET_MODE_MON 0x2 ///< Monitoring mode +#define PACKET_MODE_DUMP 0x10 ///< Dump mode +#define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode + + +/// Alignment macro. Defines the alignment size. +#define Packet_ALIGNMENT sizeof(int) +/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. +#define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1)) + +#define NdisMediumNull -1 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumCHDLC -2 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumPPPSerial -3 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumBare80211 -4 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumRadio80211 -5 ///< Custom linktype: NDIS doesn't provide an equivalent +#define NdisMediumPpi -6 ///< Custom linktype: NDIS doesn't provide an equivalent + +// Loopback behaviour definitions +#define NPF_DISABLE_LOOPBACK 1 ///< Drop the packets sent by the NPF driver +#define NPF_ENABLE_LOOPBACK 2 ///< Capture the packets sent by the NPF driver + +/*! + \brief Network type structure. + + This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed. +*/ +typedef struct NetType +{ + UINT LinkType; ///< The MAC of the current network adapter (see function PacketGetNetType() for more information) + ULONGLONG LinkSpeed; ///< The speed of the network in bits per second +}NetType; + + +//some definitions stolen from libpcap + +#ifndef BPF_MAJOR_VERSION + +/*! + \brief A BPF pseudo-assembly program. + + The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. +*/ +struct bpf_program +{ + UINT bf_len; ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow. + struct bpf_insn *bf_insns; ///< A pointer to the first instruction of the program. +}; + +/*! + \brief A single BPF pseudo-instruction. + + bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver. +*/ +struct bpf_insn +{ + USHORT code; ///< Instruction type and addressing mode. + UCHAR jt; ///< Jump if true + UCHAR jf; ///< Jump if false + int k; ///< Generic field used for various purposes. +}; + +/*! + \brief Structure that contains a couple of statistics values on the current capture. + + It is used by packet.dll to return statistics about a capture session. +*/ +struct bpf_stat +{ + UINT bs_recv; ///< Number of packets that the driver received from the network adapter + ///< from the beginning of the current capture. This value includes the packets + ///< lost by the driver. + UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture. + ///< Basically, a packet is lost when the the buffer of the driver is full. + ///< In this situation the packet cannot be stored and the driver rejects it. + UINT ps_ifdrop; ///< drops by interface. XXX not yet supported + UINT bs_capt; ///< number of packets that pass the filter, find place in the kernel buffer and + ///< thus reach the application. +}; + +/*! + \brief Packet header. + + This structure defines the header associated with every packet delivered to the application. +*/ +struct bpf_hdr +{ + struct timeval bh_tstamp; ///< The timestamp associated with the captured packet. + ///< It is stored in a TimeVal structure. + UINT bh_caplen; ///< Length of captured portion. The captured portion can be different + ///< from the original packet, because it is possible (with a proper filter) + ///< to instruct the driver to capture only a portion of the packets. + UINT bh_datalen; ///< Original length of packet + USHORT bh_hdrlen; ///< Length of bpf header (this struct plus alignment padding). In some cases, + ///< a padding could be added between the end of this structure and the packet + ///< data for performance reasons. This filed can be used to retrieve the actual data + ///< of the packet. +}; + +/*! + \brief Dump packet header. + + This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets(). + It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a + packet in a dump file. This makes straightforward sending WinPcap dump files to the network. +*/ +struct dump_bpf_hdr{ + struct timeval ts; ///< Time stamp of the packet + UINT caplen; ///< Length of captured portion. The captured portion can smaller than the + ///< the original packet, because it is possible (with a proper filter) to + ///< instruct the driver to capture only a portion of the packets. + UINT len; ///< Length of the original packet (off wire). +}; + + +#endif + +struct bpf_stat; + +#define DOSNAMEPREFIX TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices +#define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links +#define NMAX_PACKET 65535 + +/*! + \brief Addresses of a network adapter. + + This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with + an adapter. +*/ +typedef struct npf_if_addr { + struct sockaddr_storage IPAddress; ///< IP address. + struct sockaddr_storage SubnetMask; ///< Netmask for that address. + struct sockaddr_storage Broadcast; ///< Broadcast address. +}npf_if_addr; + + +#define ADAPTER_NAME_LENGTH 256 + 12 ///< Maximum length for the name of an adapter. The value is the same used by the IP Helper API. +#define ADAPTER_DESC_LENGTH 128 ///< Maximum length for the description of an adapter. The value is the same used by the IP Helper API. +#define MAX_MAC_ADDR_LENGTH 8 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API. +#define MAX_NETWORK_ADDRESSES 16 ///< Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API. + + +typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API +typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API + +#define INFO_FLAG_NDIS_ADAPTER 0 ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter +#define INFO_FLAG_NDISWAN_ADAPTER 1 ///< Flag for ADAPTER_INFO: this is a NdisWan adapter, and it's managed by WANPACKET +#define INFO_FLAG_DAG_CARD 2 ///< Flag for ADAPTER_INFO: this is a DAG card +#define INFO_FLAG_DAG_FILE 6 ///< Flag for ADAPTER_INFO: this is a DAG file +#define INFO_FLAG_DONT_EXPORT 8 ///< Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones. +#define INFO_FLAG_AIRPCAP_CARD 16 ///< Flag for ADAPTER_INFO: this is an airpcap card +#define INFO_FLAG_NPFIM_DEVICE 32 + +/*! + \brief Describes an opened network adapter. + + This structure is the most important for the functioning of packet.dll, but the great part of its fields + should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters +*/ +typedef struct _ADAPTER { + HANDLE hFile; ///< \internal Handle to an open instance of the NPF driver. + CHAR SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened. + int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated + ///< on the wire. + HANDLE ReadEvent; ///< A notification event associated with the read calls on the adapter. + ///< It can be passed to standard Win32 functions (like WaitForSingleObject + ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some + ///< data. It is particularly useful in GUI applications that need to wait + ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy() + ///< function can be used to define the minimum amount of data in the kernel buffer + ///< that will cause the event to be signalled. + + UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and + ///< ReadEvent will be signaled, also if no packets were captured + CHAR Name[ADAPTER_NAME_LENGTH]; + PWAN_ADAPTER pWanAdapter; + UINT Flags; ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API. + +#ifdef HAVE_AIRPCAP_API + PAirpcapHandle AirpcapAd; +#endif // HAVE_AIRPCAP_API + +#ifdef HAVE_NPFIM_API + void* NpfImHandle; +#endif // HAVE_NPFIM_API + +#ifdef HAVE_DAG_API + dagc_t *pDagCard; ///< Pointer to the dagc API adapter descriptor for this adapter + PCHAR DagBuffer; ///< Pointer to the buffer with the packets that is received from the DAG card + struct timeval DagReadTimeout; ///< Read timeout. The dagc API requires a timeval structure + unsigned DagFcsLen; ///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry + DWORD DagFastProcess; ///< True if the user requests fast capture processing on this card. Higher level applications can use this value to provide a faster but possibly unprecise capture (for example, libpcap doesn't convert the timestamps). +#endif // HAVE_DAG_API +} ADAPTER, *LPADAPTER; + +/*! + \brief Structure that contains a group of packets coming from the driver. + + This structure defines the header associated with every packet delivered to the application. +*/ +typedef struct _PACKET { + HANDLE hEvent; ///< \deprecated Still present for compatibility with old applications. + OVERLAPPED OverLapped; ///< \deprecated Still present for compatibility with old applications. + PVOID Buffer; ///< Buffer with containing the packets. See the PacketReceivePacket() for + ///< details about the organization of the data in this buffer + UINT Length; ///< Length of the buffer + DWORD ulBytesReceived; ///< Number of valid bytes present in the buffer, i.e. amount of data + ///< received by the last call to PacketReceivePacket() + BOOLEAN bIoComplete; ///< \deprecated Still present for compatibility with old applications. +} PACKET, *LPPACKET; + +/*! + \brief Structure containing an OID request. + + It is used by the PacketRequest() function to send an OID to the interface card driver. + It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, + the list of the multicast groups defined on it, and so on. +*/ +struct _PACKET_OID_DATA { + ULONG Oid; ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h + ///< for a complete list of valid codes. + ULONG Length; ///< Length of the data field + UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received + ///< from the adapter. +}; +typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @} + */ + +/* +BOOLEAN QueryWinPcapRegistryStringA(CHAR *SubKeyName, + CHAR *Value, + UINT *pValueLen, + CHAR *DefaultVal); + +BOOLEAN QueryWinPcapRegistryStringW(WCHAR *SubKeyName, + WCHAR *Value, + UINT *pValueLen, + WCHAR *DefaultVal); +*/ + +//--------------------------------------------------------------------------- +// EXPORTED FUNCTIONS +//--------------------------------------------------------------------------- + +PCHAR PacketGetVersion(); +PCHAR PacketGetDriverVersion(); +BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes); +BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites); +BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode); +BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout); +BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp); +BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior); +INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen); +BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s); +BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s); +BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim); +BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type); +LPADAPTER PacketOpenAdapter(PCHAR AdapterName); +BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync); +INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync); +LPPACKET PacketAllocatePacket(void); +VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length); +VOID PacketFreePacket(LPPACKET lpPacket); +BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync); +BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter); +BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize); +BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries); +BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData); +HANDLE PacketGetReadEvent(LPADAPTER AdapterObject); +BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len); +BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks); +BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync); +BOOL PacketStopDriver(); +VOID PacketCloseAdapter(LPADAPTER lpAdapter); +BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength); +BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags); +PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject); + +// +// Used by PacketStartOemEx +// +#define PACKET_START_OEM_NO_NETMON 0x00000001 + +#ifdef __cplusplus +} +#endif + +#endif //__PACKET32 diff --git a/ledset/WpdPack_4_1_2/Include/Win32-Extensions.h b/ledset/WpdPack_4_1_2/Include/Win32-Extensions.h new file mode 100644 index 0000000..ad3be25 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/Win32-Extensions.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino, CACE Technologies + * nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __WIN32_EXTENSIONS_H__ +#define __WIN32_EXTENSIONS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Definitions */ + +/*! + \brief A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit(). +*/ +struct pcap_send_queue +{ + u_int maxlen; ///< Maximum size of the the queue, in bytes. This variable contains the size of the buffer field. + u_int len; ///< Current size of the queue, in bytes. + char *buffer; ///< Buffer containing the packets to be sent. +}; + +typedef struct pcap_send_queue pcap_send_queue; + +/*! + \brief This typedef is a support for the pcap_get_airpcap_handle() function +*/ +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ +typedef struct _AirpcapHandle *PAirpcapHandle; +#endif + +#define BPF_MEM_EX_IMM 0xc0 +#define BPF_MEM_EX_IND 0xe0 + +/*used for ST*/ +#define BPF_MEM_EX 0xc0 +#define BPF_TME 0x08 + +#define BPF_LOOKUP 0x90 +#define BPF_EXECUTE 0xa0 +#define BPF_INIT 0xb0 +#define BPF_VALIDATE 0xc0 +#define BPF_SET_ACTIVE 0xd0 +#define BPF_RESET 0xe0 +#define BPF_SET_MEMORY 0x80 +#define BPF_GET_REGISTER_VALUE 0x70 +#define BPF_SET_REGISTER_VALUE 0x60 +#define BPF_SET_WORKING 0x50 +#define BPF_SET_ACTIVE_READ 0x40 +#define BPF_SET_AUTODELETION 0x30 +#define BPF_SEPARATION 0xff + +/* Prototypes */ +pcap_send_queue* pcap_sendqueue_alloc(u_int memsize); + +void pcap_sendqueue_destroy(pcap_send_queue* queue); + +int pcap_sendqueue_queue(pcap_send_queue* queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data); + +u_int pcap_sendqueue_transmit(pcap_t *p, pcap_send_queue* queue, int sync); + +HANDLE pcap_getevent(pcap_t *p); + +struct pcap_stat *pcap_stats_ex(pcap_t *p, int *pcap_stat_size); + +int pcap_setuserbuffer(pcap_t *p, int size); + +int pcap_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks); + +int pcap_live_dump_ended(pcap_t *p, int sync); + +int pcap_offline_filter(struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data); + +int pcap_start_oem(char* err_str, int flags); + +PAirpcapHandle pcap_get_airpcap_handle(pcap_t *p); + +#ifdef __cplusplus +} +#endif + +#endif //__WIN32_EXTENSIONS_H__ diff --git a/ledset/WpdPack_4_1_2/Include/bittypes.h b/ledset/WpdPack_4_1_2/Include/bittypes.h new file mode 100644 index 0000000..558a0b5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/bittypes.h @@ -0,0 +1,137 @@ +/* + * Copyright (C) 1999 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _BITTYPES_H +#define _BITTYPES_H + +#ifndef HAVE_U_INT8_T + +#if SIZEOF_CHAR == 1 +typedef unsigned char u_int8_t; +typedef signed char int8_t; +#elif SIZEOF_INT == 1 +typedef unsigned int u_int8_t; +typedef signed int int8_t; +#else /* XXX */ +#error "there's no appropriate type for u_int8_t" +#endif +#define HAVE_U_INT8_T 1 +#define HAVE_INT8_T 1 + +#endif /* HAVE_U_INT8_T */ + +#ifndef HAVE_U_INT16_T + +#if SIZEOF_SHORT == 2 +typedef unsigned short u_int16_t; +typedef signed short int16_t; +#elif SIZEOF_INT == 2 +typedef unsigned int u_int16_t; +typedef signed int int16_t; +#elif SIZEOF_CHAR == 2 +typedef unsigned char u_int16_t; +typedef signed char int16_t; +#else /* XXX */ +#error "there's no appropriate type for u_int16_t" +#endif +#define HAVE_U_INT16_T 1 +#define HAVE_INT16_T 1 + +#endif /* HAVE_U_INT16_T */ + +#ifndef HAVE_U_INT32_T + +#if SIZEOF_INT == 4 +typedef unsigned int u_int32_t; +typedef signed int int32_t; +#elif SIZEOF_LONG == 4 +typedef unsigned long u_int32_t; +typedef signed long int32_t; +#elif SIZEOF_SHORT == 4 +typedef unsigned short u_int32_t; +typedef signed short int32_t; +#else /* XXX */ +#error "there's no appropriate type for u_int32_t" +#endif +#define HAVE_U_INT32_T 1 +#define HAVE_INT32_T 1 + +#endif /* HAVE_U_INT32_T */ + +#ifndef HAVE_U_INT64_T +#if SIZEOF_LONG_LONG == 8 +typedef unsigned long long u_int64_t; +typedef long long int64_t; +#elif defined(_MSC_EXTENSIONS) +typedef unsigned _int64 u_int64_t; +typedef _int64 int64_t; +#elif SIZEOF_INT == 8 +typedef unsigned int u_int64_t; +#elif SIZEOF_LONG == 8 +typedef unsigned long u_int64_t; +#elif SIZEOF_SHORT == 8 +typedef unsigned short u_int64_t; +#else /* XXX */ +#error "there's no appropriate type for u_int64_t" +#endif + +#endif /* HAVE_U_INT64_T */ + +#ifndef PRId64 +#ifdef _MSC_EXTENSIONS +#define PRId64 "I64d" +#else /* _MSC_EXTENSIONS */ +#define PRId64 "lld" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRId64 */ + +#ifndef PRIo64 +#ifdef _MSC_EXTENSIONS +#define PRIo64 "I64o" +#else /* _MSC_EXTENSIONS */ +#define PRIo64 "llo" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIo64 */ + +#ifndef PRIx64 +#ifdef _MSC_EXTENSIONS +#define PRIx64 "I64x" +#else /* _MSC_EXTENSIONS */ +#define PRIx64 "llx" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIx64 */ + +#ifndef PRIu64 +#ifdef _MSC_EXTENSIONS +#define PRIu64 "I64u" +#else /* _MSC_EXTENSIONS */ +#define PRIu64 "llu" +#endif /* _MSC_EXTENSIONS */ +#endif /* PRIu64 */ + +#endif /* _BITTYPES_H */ diff --git a/ledset/WpdPack_4_1_2/Include/ip6_misc.h b/ledset/WpdPack_4_1_2/Include/ip6_misc.h new file mode 100644 index 0000000..562fa61 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/ip6_misc.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) 1993, 1994, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code distributions + * retain the above copyright notice and this paragraph in its entirety, (2) + * distributions including binary code include the above copyright notice and + * this paragraph in its entirety in the documentation or other materials + * provided with the distribution, and (3) all advertising materials mentioning + * features or use of this software display the following acknowledgement: + * ``This product includes software developed by the University of California, + * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of + * the University nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#) $Header: /tcpdump/master/libpcap/Win32/Include/ip6_misc.h,v 1.5 2006-01-22 18:02:18 gianluca Exp $ (LBL) + */ + +/* + * This file contains a collage of declarations for IPv6 from FreeBSD not present in Windows + */ + +#include + +#include + +#ifndef __MINGW32__ +#define IN_MULTICAST(a) IN_CLASSD(a) +#endif + +#define IN_EXPERIMENTAL(a) ((((u_int32_t) (a)) & 0xf0000000) == 0xf0000000) + +#define IN_LOOPBACKNET 127 + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) +/* IPv6 address */ +struct in6_addr + { + union + { + u_int8_t u6_addr8[16]; + u_int16_t u6_addr16[8]; + u_int32_t u6_addr32[4]; + } in6_u; +#define s6_addr in6_u.u6_addr8 +#define s6_addr16 in6_u.u6_addr16 +#define s6_addr32 in6_u.u6_addr32 +#define s6_addr64 in6_u.u6_addr64 + }; + +#define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#endif /* __MINGW32__ */ + + +#if (defined _MSC_VER) || (defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)) +typedef unsigned short sa_family_t; +#endif + + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) + +#define __SOCKADDR_COMMON(sa_prefix) \ + sa_family_t sa_prefix##family + +/* Ditto, for IPv6. */ +struct sockaddr_in6 + { + __SOCKADDR_COMMON (sin6_); + u_int16_t sin6_port; /* Transport layer port # */ + u_int32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + }; + +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \ + (((u_int32_t *) (a))[2] == htonl (0xffff))) + +#define IN6_IS_ADDR_MULTICAST(a) (((u_int8_t *) (a))[0] == 0xff) + +#define IN6_IS_ADDR_LINKLOCAL(a) \ + ((((u_int32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000)) + +#define IN6_IS_ADDR_LOOPBACK(a) \ + (((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \ + ((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1)) +#endif /* __MINGW32__ */ + +#define ip6_vfc ip6_ctlun.ip6_un2_vfc +#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow +#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen +#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt +#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim +#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim + +#define nd_rd_type nd_rd_hdr.icmp6_type +#define nd_rd_code nd_rd_hdr.icmp6_code +#define nd_rd_cksum nd_rd_hdr.icmp6_cksum +#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] + +/* + * IPV6 extension headers + */ +#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ +#define IPPROTO_IPV6 41 /* IPv6 header. */ +#define IPPROTO_ROUTING 43 /* IPv6 routing header */ +#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ +#define IPPROTO_ESP 50 /* encapsulating security payload */ +#define IPPROTO_AH 51 /* authentication header */ +#define IPPROTO_ICMPV6 58 /* ICMPv6 */ +#define IPPROTO_NONE 59 /* IPv6 no next header */ +#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ +#define IPPROTO_PIM 103 /* Protocol Independent Multicast. */ + +#define IPV6_RTHDR_TYPE_0 0 + +/* Option types and related macros */ +#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ +#define IP6OPT_PADN 0x01 /* 00 0 00001 */ +#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ +#define IP6OPT_JUMBO_LEN 6 +#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 */ + +#define IP6OPT_RTALERT_LEN 4 +#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ +#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ +#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ +#define IP6OPT_MINLEN 2 + +#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */ +#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */ +#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */ +#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */ +#define IP6OPT_EID 0x8a /* 10 0 01010 */ + +#define IP6OPT_TYPE(o) ((o) & 0xC0) +#define IP6OPT_TYPE_SKIP 0x00 +#define IP6OPT_TYPE_DISCARD 0x40 +#define IP6OPT_TYPE_FORCEICMP 0x80 +#define IP6OPT_TYPE_ICMP 0xC0 + +#define IP6OPT_MUTABLE 0x20 + + +#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) +#ifndef EAI_ADDRFAMILY +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + size_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ +}; +#endif +#endif /* __MINGW32__ */ diff --git a/ledset/WpdPack_4_1_2/Include/pcap-bpf.h b/ledset/WpdPack_4_1_2/Include/pcap-bpf.h new file mode 100644 index 0000000..5fe129d --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap-bpf.h @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.50 2007/04/01 21:43:55 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Some applications + * might expect to be able to include . + */ +#include diff --git a/ledset/WpdPack_4_1_2/Include/pcap-namedb.h b/ledset/WpdPack_4_1_2/Include/pcap-namedb.h new file mode 100644 index 0000000..80a2f00 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap-namedb.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1994, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-namedb.h,v 1.13 2006/10/04 18:13:32 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Some applications + * might expect to be able to include . + */ +#include diff --git a/ledset/WpdPack_4_1_2/Include/pcap-stdinc.h b/ledset/WpdPack_4_1_2/Include/pcap-stdinc.h new file mode 100644 index 0000000..4176041 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap-stdinc.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy) + * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL) + */ + +#define SIZEOF_CHAR 1 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#ifndef _MSC_EXTENSIONS +#define SIZEOF_LONG_LONG 8 +#endif + +/* + * Avoids a compiler warning in case this was already defined + * (someone defined _WINSOCKAPI_ when including 'windows.h', in order + * to prevent it from including 'winsock.h') + */ +#ifdef _WINSOCKAPI_ +#undef _WINSOCKAPI_ +#endif +#include + +#include + +#include "bittypes.h" +#include +#include + +#ifndef __MINGW32__ +#include "IP6_misc.h" +#endif + +#define caddr_t char* + +#if _MSC_VER < 1500 +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#define strdup _strdup +#endif + +#define inline __inline + +#ifdef __MINGW32__ +#include +#else /*__MINGW32__*/ +/* MSVC compiler */ +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef _W64 unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + +#ifndef _INTPTR_T_DEFINED +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef _W64 int intptr_t; +#endif +#define _INTPTR_T_DEFINED +#endif + +#endif /*__MINGW32__*/ diff --git a/ledset/WpdPack_4_1_2/Include/pcap.h b/ledset/WpdPack_4_1_2/Include/pcap.h new file mode 100644 index 0000000..935f949 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.59 2006/10/04 18:09:22 guy Exp $ (LBL) + */ + +/* + * For backwards compatibility. + * + * Note to OS vendors: do NOT get rid of this file! Many applications + * expect to be able to include , and at least some of them + * go through contortions in their configure scripts to try to detect + * OSes that have "helpfully" moved pcap.h to without + * leaving behind a file. + */ +#include diff --git a/ledset/WpdPack_4_1_2/Include/pcap/bluetooth.h b/ledset/WpdPack_4_1_2/Include/pcap/bluetooth.h new file mode 100644 index 0000000..7bf65df --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/bluetooth.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2006 Paolo Abeni (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * bluetooth data struct + * By Paolo Abeni + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/bluetooth.h,v 1.1 2007/09/22 02:10:17 guy Exp $ + */ + +#ifndef _PCAP_BLUETOOTH_STRUCTS_H__ +#define _PCAP_BLUETOOTH_STRUCTS_H__ + +/* + * Header prepended libpcap to each bluetooth h:4 frame. + * fields are in network byte order + */ +typedef struct _pcap_bluetooth_h4_header { + u_int32_t direction; /* if first bit is set direction is incoming */ +} pcap_bluetooth_h4_header; + + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/bpf.h b/ledset/WpdPack_4_1_2/Include/pcap/bpf.h new file mode 100644 index 0000000..9f4ca33 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/bpf.h @@ -0,0 +1,934 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)bpf.h 7.1 (Berkeley) 5/7/91 + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.8 2008-09-22 20:16:01 guy Exp $ (LBL) + */ + +/* + * This is libpcap's cut-down version of bpf.h; it includes only + * the stuff needed for the code generator and the userland BPF + * interpreter, and the libpcap APIs for setting filters, etc.. + * + * "pcap-bpf.c" will include the native OS version, as it deals with + * the OS's BPF implementation. + * + * XXX - should this all just be moved to "pcap.h"? + */ + +#ifndef BPF_MAJOR_VERSION + +#ifdef __cplusplus +extern "C" { +#endif + +/* BSD style release date */ +#define BPF_RELEASE 199606 + +#ifdef MSDOS /* must be 32-bit */ +typedef long bpf_int32; +typedef unsigned long bpf_u_int32; +#else +typedef int bpf_int32; +typedef u_int bpf_u_int32; +#endif + +/* + * Alignment macros. BPF_WORDALIGN rounds up to the next + * even multiple of BPF_ALIGNMENT. + */ +#ifndef __NetBSD__ +#define BPF_ALIGNMENT sizeof(bpf_int32) +#else +#define BPF_ALIGNMENT sizeof(long) +#endif +#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1)) + +#define BPF_MAXBUFSIZE 0x8000 +#define BPF_MINBUFSIZE 32 + +/* + * Structure for "pcap_compile()", "pcap_setfilter()", etc.. + */ +struct bpf_program { + u_int bf_len; + struct bpf_insn *bf_insns; +}; + +/* + * Struct return by BIOCVERSION. This represents the version number of + * the filter language described by the instruction encodings below. + * bpf understands a program iff kernel_major == filter_major && + * kernel_minor >= filter_minor, that is, if the value returned by the + * running kernel has the same major number and a minor number equal + * equal to or less than the filter being downloaded. Otherwise, the + * results are undefined, meaning an error may be returned or packets + * may be accepted haphazardly. + * It has nothing to do with the source code version. + */ +struct bpf_version { + u_short bv_major; + u_short bv_minor; +}; +/* Current version number of filter architecture. */ +#define BPF_MAJOR_VERSION 1 +#define BPF_MINOR_VERSION 1 + +/* + * Data-link level type codes. + * + * Do *NOT* add new values to this list without asking + * "tcpdump-workers@lists.tcpdump.org" for a value. Otherwise, you run + * the risk of using a value that's already being used for some other + * purpose, and of having tools that read libpcap-format captures not + * being able to handle captures with your new DLT_ value, with no hope + * that they will ever be changed to do so (as that would destroy their + * ability to read captures using that value for that other purpose). + */ + +/* + * These are the types that are the same on all platforms, and that + * have been defined by for ages. + */ +#define DLT_NULL 0 /* BSD loopback encapsulation */ +#define DLT_EN10MB 1 /* Ethernet (10Mb) */ +#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */ +#define DLT_AX25 3 /* Amateur Radio AX.25 */ +#define DLT_PRONET 4 /* Proteon ProNET Token Ring */ +#define DLT_CHAOS 5 /* Chaos */ +#define DLT_IEEE802 6 /* 802.5 Token Ring */ +#define DLT_ARCNET 7 /* ARCNET, with BSD-style header */ +#define DLT_SLIP 8 /* Serial Line IP */ +#define DLT_PPP 9 /* Point-to-point Protocol */ +#define DLT_FDDI 10 /* FDDI */ + +/* + * These are types that are different on some platforms, and that + * have been defined by for ages. We use #ifdefs to + * detect the BSDs that define them differently from the traditional + * libpcap + * + * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS, + * but I don't know what the right #define is for BSD/OS. + */ +#define DLT_ATM_RFC1483 11 /* LLC-encapsulated ATM */ + +#ifdef __OpenBSD__ +#define DLT_RAW 14 /* raw IP */ +#else +#define DLT_RAW 12 /* raw IP */ +#endif + +/* + * Given that the only OS that currently generates BSD/OS SLIP or PPP + * is, well, BSD/OS, arguably everybody should have chosen its values + * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they + * didn't. So it goes. + */ +#if defined(__NetBSD__) || defined(__FreeBSD__) +#ifndef DLT_SLIP_BSDOS +#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */ +#endif +#else +#define DLT_SLIP_BSDOS 15 /* BSD/OS Serial Line IP */ +#define DLT_PPP_BSDOS 16 /* BSD/OS Point-to-point Protocol */ +#endif + +/* + * 17 is used for DLT_OLD_PFLOG in OpenBSD; + * OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below. + * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else. + */ + +#define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */ + +/* + * Apparently Redback uses this for its SmartEdge 400/800. I hope + * nobody else decided to use it, too. + */ +#define DLT_REDBACK_SMARTEDGE 32 + +/* + * These values are defined by NetBSD; other platforms should refrain from + * using them for other purposes, so that NetBSD savefiles with link + * types of 50 or 51 can be read as this type on all platforms. + */ +#define DLT_PPP_SERIAL 50 /* PPP over serial with HDLC encapsulation */ +#define DLT_PPP_ETHER 51 /* PPP over Ethernet */ + +/* + * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses + * a link-layer type of 99 for the tcpdump it supplies. The link-layer + * header has 6 bytes of unknown data, something that appears to be an + * Ethernet type, and 36 bytes that appear to be 0 in at least one capture + * I've seen. + */ +#define DLT_SYMANTEC_FIREWALL 99 + +/* + * Values between 100 and 103 are used in capture file headers as + * link-layer types corresponding to DLT_ types that differ + * between platforms; don't use those values for new DLT_ new types. + */ + +/* + * This value was defined by libpcap 0.5; platforms that have defined + * it with a different value should define it here with that value - + * a link type of 104 in a save file will be mapped to DLT_C_HDLC, + * whatever value that happens to be, so programs will correctly + * handle files with that link type regardless of the value of + * DLT_C_HDLC. + * + * The name DLT_C_HDLC was used by BSD/OS; we use that name for source + * compatibility with programs written for BSD/OS. + * + * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well, + * for source compatibility with programs written for libpcap 0.5. + */ +#define DLT_C_HDLC 104 /* Cisco HDLC */ +#define DLT_CHDLC DLT_C_HDLC + +#define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */ + +/* + * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW, + * except when it isn't. (I.e., sometimes it's just raw IP, and + * sometimes it isn't.) We currently handle it as DLT_LINUX_SLL, + * so that we don't have to worry about the link-layer header.) + */ + +/* + * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides + * with other values. + * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header + * (DLCI, etc.). + */ +#define DLT_FRELAY 107 + +/* + * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except + * that the AF_ type in the link-layer header is in network byte order. + * + * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so + * we don't use 12 for it in OSes other than OpenBSD. + */ +#ifdef __OpenBSD__ +#define DLT_LOOP 12 +#else +#define DLT_LOOP 108 +#endif + +/* + * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's + * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other + * than OpenBSD. + */ +#ifdef __OpenBSD__ +#define DLT_ENC 13 +#else +#define DLT_ENC 109 +#endif + +/* + * Values between 110 and 112 are reserved for use in capture file headers + * as link-layer types corresponding to DLT_ types that might differ + * between platforms; don't use those values for new DLT_ types + * other than the corresponding DLT_ types. + */ + +/* + * This is for Linux cooked sockets. + */ +#define DLT_LINUX_SLL 113 + +/* + * Apple LocalTalk hardware. + */ +#define DLT_LTALK 114 + +/* + * Acorn Econet. + */ +#define DLT_ECONET 115 + +/* + * Reserved for use with OpenBSD ipfilter. + */ +#define DLT_IPFILTER 116 + +/* + * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023 + * in SuSE 6.3, so we can't use 17 for it in capture-file headers. + * + * XXX: is there a conflict with DLT_PFSYNC 18 as well? + */ +#ifdef __OpenBSD__ +#define DLT_OLD_PFLOG 17 +#define DLT_PFSYNC 18 +#endif +#define DLT_PFLOG 117 + +/* + * Registered for Cisco-internal use. + */ +#define DLT_CISCO_IOS 118 + +/* + * For 802.11 cards using the Prism II chips, with a link-layer + * header including Prism monitor mode information plus an 802.11 + * header. + */ +#define DLT_PRISM_HEADER 119 + +/* + * Reserved for Aironet 802.11 cards, with an Aironet link-layer header + * (see Doug Ambrisko's FreeBSD patches). + */ +#define DLT_AIRONET_HEADER 120 + +/* + * Reserved for Siemens HiPath HDLC. + */ +#define DLT_HHDLC 121 + +/* + * This is for RFC 2625 IP-over-Fibre Channel. + * + * This is not for use with raw Fibre Channel, where the link-layer + * header starts with a Fibre Channel frame header; it's for IP-over-FC, + * where the link-layer header starts with an RFC 2625 Network_Header + * field. + */ +#define DLT_IP_OVER_FC 122 + +/* + * This is for Full Frontal ATM on Solaris with SunATM, with a + * pseudo-header followed by an AALn PDU. + * + * There may be other forms of Full Frontal ATM on other OSes, + * with different pseudo-headers. + * + * If ATM software returns a pseudo-header with VPI/VCI information + * (and, ideally, packet type information, e.g. signalling, ILMI, + * LANE, LLC-multiplexed traffic, etc.), it should not use + * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump + * and the like don't have to infer the presence or absence of a + * pseudo-header and the form of the pseudo-header. + */ +#define DLT_SUNATM 123 /* Solaris+SunATM */ + +/* + * Reserved as per request from Kent Dahlgren + * for private use. + */ +#define DLT_RIO 124 /* RapidIO */ +#define DLT_PCI_EXP 125 /* PCI Express */ +#define DLT_AURORA 126 /* Xilinx Aurora link layer */ + +/* + * Header for 802.11 plus a number of bits of link-layer information + * including radio information, used by some recent BSD drivers as + * well as the madwifi Atheros driver for Linux. + */ +#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus radiotap radio header */ + +/* + * Reserved for the TZSP encapsulation, as per request from + * Chris Waters + * TZSP is a generic encapsulation for any other link type, + * which includes a means to include meta-information + * with the packet, e.g. signal strength and channel + * for 802.11 packets. + */ +#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */ + +/* + * BSD's ARCNET headers have the source host, destination host, + * and type at the beginning of the packet; that's what's handed + * up to userland via BPF. + * + * Linux's ARCNET headers, however, have a 2-byte offset field + * between the host IDs and the type; that's what's handed up + * to userland via PF_PACKET sockets. + * + * We therefore have to have separate DLT_ values for them. + */ +#define DLT_ARCNET_LINUX 129 /* ARCNET */ + +/* + * Juniper-private data link types, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, etc.. + */ +#define DLT_JUNIPER_MLPPP 130 +#define DLT_JUNIPER_MLFR 131 +#define DLT_JUNIPER_ES 132 +#define DLT_JUNIPER_GGSN 133 +#define DLT_JUNIPER_MFR 134 +#define DLT_JUNIPER_ATM2 135 +#define DLT_JUNIPER_SERVICES 136 +#define DLT_JUNIPER_ATM1 137 + +/* + * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund + * . The header that's presented is an Ethernet-like + * header: + * + * #define FIREWIRE_EUI64_LEN 8 + * struct firewire_header { + * u_char firewire_dhost[FIREWIRE_EUI64_LEN]; + * u_char firewire_shost[FIREWIRE_EUI64_LEN]; + * u_short firewire_type; + * }; + * + * with "firewire_type" being an Ethernet type value, rather than, + * for example, raw GASP frames being handed up. + */ +#define DLT_APPLE_IP_OVER_IEEE1394 138 + +/* + * Various SS7 encapsulations, as per a request from Jeff Morriss + * and subsequent discussions. + */ +#define DLT_MTP2_WITH_PHDR 139 /* pseudo-header with various info, followed by MTP2 */ +#define DLT_MTP2 140 /* MTP2, without pseudo-header */ +#define DLT_MTP3 141 /* MTP3, without pseudo-header or MTP2 */ +#define DLT_SCCP 142 /* SCCP, without pseudo-header or MTP2 or MTP3 */ + +/* + * DOCSIS MAC frames. + */ +#define DLT_DOCSIS 143 + +/* + * Linux-IrDA packets. Protocol defined at http://www.irda.org. + * Those packets include IrLAP headers and above (IrLMP...), but + * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy + * framing can be handled by the hardware and depend on the bitrate. + * This is exactly the format you would get capturing on a Linux-IrDA + * interface (irdaX), but not on a raw serial port. + * Note the capture is done in "Linux-cooked" mode, so each packet include + * a fake packet header (struct sll_header). This is because IrDA packet + * decoding is dependant on the direction of the packet (incomming or + * outgoing). + * When/if other platform implement IrDA capture, we may revisit the + * issue and define a real DLT_IRDA... + * Jean II + */ +#define DLT_LINUX_IRDA 144 + +/* + * Reserved for IBM SP switch and IBM Next Federation switch. + */ +#define DLT_IBM_SP 145 +#define DLT_IBM_SN 146 + +/* + * Reserved for private use. If you have some link-layer header type + * that you want to use within your organization, with the capture files + * using that link-layer header type not ever be sent outside your + * organization, you can use these values. + * + * No libpcap release will use these for any purpose, nor will any + * tcpdump release use them, either. + * + * Do *NOT* use these in capture files that you expect anybody not using + * your private versions of capture-file-reading tools to read; in + * particular, do *NOT* use them in products, otherwise you may find that + * people won't be able to use tcpdump, or snort, or Ethereal, or... to + * read capture files from your firewall/intrusion detection/traffic + * monitoring/etc. appliance, or whatever product uses that DLT_ value, + * and you may also find that the developers of those applications will + * not accept patches to let them read those files. + * + * Also, do not use them if somebody might send you a capture using them + * for *their* private type and tools using them for *your* private type + * would have to read them. + * + * Instead, ask "tcpdump-workers@lists.tcpdump.org" for a new DLT_ value, + * as per the comment above, and use the type you're given. + */ +#define DLT_USER0 147 +#define DLT_USER1 148 +#define DLT_USER2 149 +#define DLT_USER3 150 +#define DLT_USER4 151 +#define DLT_USER5 152 +#define DLT_USER6 153 +#define DLT_USER7 154 +#define DLT_USER8 155 +#define DLT_USER9 156 +#define DLT_USER10 157 +#define DLT_USER11 158 +#define DLT_USER12 159 +#define DLT_USER13 160 +#define DLT_USER14 161 +#define DLT_USER15 162 + +/* + * For future use with 802.11 captures - defined by AbsoluteValue + * Systems to store a number of bits of link-layer information + * including radio information: + * + * http://www.shaftnet.org/~pizza/software/capturefrm.txt + * + * but it might be used by some non-AVS drivers now or in the + * future. + */ +#define DLT_IEEE802_11_RADIO_AVS 163 /* 802.11 plus AVS radio header */ + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, etc.. + */ +#define DLT_JUNIPER_MONITOR 164 + +/* + * Reserved for BACnet MS/TP. + */ +#define DLT_BACNET_MS_TP 165 + +/* + * Another PPP variant as per request from Karsten Keil . + * + * This is used in some OSes to allow a kernel socket filter to distinguish + * between incoming and outgoing packets, on a socket intended to + * supply pppd with outgoing packets so it can do dial-on-demand and + * hangup-on-lack-of-demand; incoming packets are filtered out so they + * don't cause pppd to hold the connection up (you don't want random + * input packets such as port scans, packets from old lost connections, + * etc. to force the connection to stay up). + * + * The first byte of the PPP header (0xff03) is modified to accomodate + * the direction - 0x00 = IN, 0x01 = OUT. + */ +#define DLT_PPP_PPPD 166 + +/* + * Names for backwards compatibility with older versions of some PPP + * software; new software should use DLT_PPP_PPPD. + */ +#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD +#define DLT_LINUX_PPP_WITHDIRECTION DLT_PPP_PPPD + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_s are used + * for passing on chassis-internal metainformation such as + * QOS profiles, cookies, etc.. + */ +#define DLT_JUNIPER_PPPOE 167 +#define DLT_JUNIPER_PPPOE_ATM 168 + +#define DLT_GPRS_LLC 169 /* GPRS LLC */ +#define DLT_GPF_T 170 /* GPF-T (ITU-T G.7041/Y.1303) */ +#define DLT_GPF_F 171 /* GPF-F (ITU-T G.7041/Y.1303) */ + +/* + * Requested by Oolan Zimmer for use in Gcom's T1/E1 line + * monitoring equipment. + */ +#define DLT_GCOM_T1E1 172 +#define DLT_GCOM_SERIAL 173 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . The DLT_ is used + * for internal communication to Physical Interface Cards (PIC) + */ +#define DLT_JUNIPER_PIC_PEER 174 + +/* + * Link types requested by Gregor Maier of Endace + * Measurement Systems. They add an ERF header (see + * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of + * the link-layer header. + */ +#define DLT_ERF_ETH 175 /* Ethernet */ +#define DLT_ERF_POS 176 /* Packet-over-SONET */ + +/* + * Requested by Daniele Orlandi for raw LAPD + * for vISDN (http://www.orlandi.com/visdn/). Its link-layer header + * includes additional information before the LAPD header, so it's + * not necessarily a generic LAPD header. + */ +#define DLT_LINUX_LAPD 177 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ are used for prepending meta-information + * like interface index, interface name + * before standard Ethernet, PPP, Frelay & C-HDLC Frames + */ +#define DLT_JUNIPER_ETHER 178 +#define DLT_JUNIPER_PPP 179 +#define DLT_JUNIPER_FRELAY 180 +#define DLT_JUNIPER_CHDLC 181 + +/* + * Multi Link Frame Relay (FRF.16) + */ +#define DLT_MFR 182 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for internal communication with a + * voice Adapter Card (PIC) + */ +#define DLT_JUNIPER_VP 183 + +/* + * Arinc 429 frames. + * DLT_ requested by Gianluca Varenni . + * Every frame contains a 32bit A429 label. + * More documentation on Arinc 429 can be found at + * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf + */ +#define DLT_A429 184 + +/* + * Arinc 653 Interpartition Communication messages. + * DLT_ requested by Gianluca Varenni . + * Please refer to the A653-1 standard for more information. + */ +#define DLT_A653_ICM 185 + +/* + * USB packets, beginning with a USB setup header; requested by + * Paolo Abeni . + */ +#define DLT_USB 186 + +/* + * Bluetooth HCI UART transport layer (part H:4); requested by + * Paolo Abeni. + */ +#define DLT_BLUETOOTH_HCI_H4 187 + +/* + * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz + * . + */ +#define DLT_IEEE802_16_MAC_CPS 188 + +/* + * USB packets, beginning with a Linux USB header; requested by + * Paolo Abeni . + */ +#define DLT_USB_LINUX 189 + +/* + * Controller Area Network (CAN) v. 2.0B packets. + * DLT_ requested by Gianluca Varenni . + * Used to dump CAN packets coming from a CAN Vector board. + * More documentation on the CAN v2.0B frames can be found at + * http://www.can-cia.org/downloads/?269 + */ +#define DLT_CAN20B 190 + +/* + * IEEE 802.15.4, with address fields padded, as is done by Linux + * drivers; requested by Juergen Schimmer. + */ +#define DLT_IEEE802_15_4_LINUX 191 + +/* + * Per Packet Information encapsulated packets. + * DLT_ requested by Gianluca Varenni . + */ +#define DLT_PPI 192 + +/* + * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header; + * requested by Charles Clancy. + */ +#define DLT_IEEE802_16_MAC_CPS_RADIO 193 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for internal communication with a + * integrated service module (ISM). + */ +#define DLT_JUNIPER_ISM 194 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing); requested by Mikko Saarnivala . + */ +#define DLT_IEEE802_15_4 195 + +/* + * Various link-layer types, with a pseudo-header, for SITA + * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com). + */ +#define DLT_SITA 196 + +/* + * Various link-layer types, with a pseudo-header, for Endace DAG cards; + * encapsulates Endace ERF records. Requested by Stephen Donnelly + * . + */ +#define DLT_ERF 197 + +/* + * Special header prepended to Ethernet packets when capturing from a + * u10 Networks board. Requested by Phil Mulholland + * . + */ +#define DLT_RAIF1 198 + +/* + * IPMB packet for IPMI, beginning with the I2C slave address, followed + * by the netFn and LUN, etc.. Requested by Chanthy Toeung + * . + */ +#define DLT_IPMB 199 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + * The DLT_ is used for capturing data on a secure tunnel interface. + */ +#define DLT_JUNIPER_ST 200 + +/* + * Bluetooth HCI UART transport layer (part H:4), with pseudo-header + * that includes direction information; requested by Paolo Abeni. + */ +#define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201 + +/* + * AX.25 packet with a 1-byte KISS header; see + * + * http://www.ax25.net/kiss.htm + * + * as per Richard Stearn . + */ +#define DLT_AX25_KISS 202 + +/* + * LAPD packets from an ISDN channel, starting with the address field, + * with no pseudo-header. + * Requested by Varuna De Silva . + */ +#define DLT_LAPD 203 + +/* + * Variants of various link-layer headers, with a one-byte direction + * pseudo-header prepended - zero means "received by this host", + * non-zero (any non-zero value) means "sent by this host" - as per + * Will Barker . + */ +#define DLT_PPP_WITH_DIR 204 /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */ +#define DLT_C_HDLC_WITH_DIR 205 /* Cisco HDLC */ +#define DLT_FRELAY_WITH_DIR 206 /* Frame Relay */ +#define DLT_LAPB_WITH_DIR 207 /* LAPB */ + +/* + * 208 is reserved for an as-yet-unspecified proprietary link-layer + * type, as requested by Will Barker. + */ + +/* + * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman + * . + */ +#define DLT_IPMB_LINUX 209 + +/* + * FlexRay automotive bus - http://www.flexray.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_FLEXRAY 210 + +/* + * Media Oriented Systems Transport (MOST) bus for multimedia + * transport - http://www.mostcooperation.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_MOST 211 + +/* + * Local Interconnect Network (LIN) bus for vehicle networks - + * http://www.lin-subbus.org/ - as requested by Hannes Kaelber + * . + */ +#define DLT_LIN 212 + +/* + * X2E-private data link type used for serial line capture, + * as requested by Hannes Kaelber . + */ +#define DLT_X2E_SERIAL 213 + +/* + * X2E-private data link type used for the Xoraya data logger + * family, as requested by Hannes Kaelber . + */ +#define DLT_X2E_XORAYA 214 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing), but with the PHY-level data for non-ASK PHYs (4 octets + * of 0 as preamble, one octet of SFD, one octet of frame length+ + * reserved bit, and then the MAC-layer data, starting with the + * frame control field). + * + * Requested by Max Filippov . + */ +#define DLT_IEEE802_15_4_NONASK_PHY 215 + + +/* + * DLT and savefile link type values are split into a class and + * a member of that class. A class value of 0 indicates a regular + * DLT_/LINKTYPE_ value. + */ +#define DLT_CLASS(x) ((x) & 0x03ff0000) + +/* + * NetBSD-specific generic "raw" link type. The class value indicates + * that this is the generic raw type, and the lower 16 bits are the + * address family we're dealing with. Those values are NetBSD-specific; + * do not assume that they correspond to AF_ values for your operating + * system. + */ +#define DLT_CLASS_NETBSD_RAWAF 0x02240000 +#define DLT_NETBSD_RAWAF(af) (DLT_CLASS_NETBSD_RAWAF | (af)) +#define DLT_NETBSD_RAWAF_AF(x) ((x) & 0x0000ffff) +#define DLT_IS_NETBSD_RAWAF(x) (DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF) + + +/* + * The instruction encodings. + */ +/* instruction classes */ +#define BPF_CLASS(code) ((code) & 0x07) +#define BPF_LD 0x00 +#define BPF_LDX 0x01 +#define BPF_ST 0x02 +#define BPF_STX 0x03 +#define BPF_ALU 0x04 +#define BPF_JMP 0x05 +#define BPF_RET 0x06 +#define BPF_MISC 0x07 + +/* ld/ldx fields */ +#define BPF_SIZE(code) ((code) & 0x18) +#define BPF_W 0x00 +#define BPF_H 0x08 +#define BPF_B 0x10 +#define BPF_MODE(code) ((code) & 0xe0) +#define BPF_IMM 0x00 +#define BPF_ABS 0x20 +#define BPF_IND 0x40 +#define BPF_MEM 0x60 +#define BPF_LEN 0x80 +#define BPF_MSH 0xa0 + +/* alu/jmp fields */ +#define BPF_OP(code) ((code) & 0xf0) +#define BPF_ADD 0x00 +#define BPF_SUB 0x10 +#define BPF_MUL 0x20 +#define BPF_DIV 0x30 +#define BPF_OR 0x40 +#define BPF_AND 0x50 +#define BPF_LSH 0x60 +#define BPF_RSH 0x70 +#define BPF_NEG 0x80 +#define BPF_JA 0x00 +#define BPF_JEQ 0x10 +#define BPF_JGT 0x20 +#define BPF_JGE 0x30 +#define BPF_JSET 0x40 +#define BPF_SRC(code) ((code) & 0x08) +#define BPF_K 0x00 +#define BPF_X 0x08 + +/* ret - BPF_K and BPF_X also apply */ +#define BPF_RVAL(code) ((code) & 0x18) +#define BPF_A 0x10 + +/* misc */ +#define BPF_MISCOP(code) ((code) & 0xf8) +#define BPF_TAX 0x00 +#define BPF_TXA 0x80 + +/* + * The instruction data structure. + */ +struct bpf_insn { + u_short code; + u_char jt; + u_char jf; + bpf_u_int32 k; +}; + +/* + * Macros for insn array initializers. + */ +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } + +#if __STDC__ || defined(__cplusplus) +extern int bpf_validate(const struct bpf_insn *, int); +extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +#else +extern int bpf_validate(); +extern u_int bpf_filter(); +#endif + +/* + * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). + */ +#define BPF_MEMWORDS 16 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/namedb.h b/ledset/WpdPack_4_1_2/Include/pcap/namedb.h new file mode 100644 index 0000000..9002c75 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/namedb.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1994, 1996 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/namedb.h,v 1.1 2006/10/04 18:09:22 guy Exp $ (LBL) + */ + +#ifndef lib_pcap_namedb_h +#define lib_pcap_namedb_h + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * As returned by the pcap_next_etherent() + * XXX this stuff doesn't belong in this interface, but this + * library already must do name to address translation, so + * on systems that don't have support for /etc/ethers, we + * export these hooks since they'll + */ +struct pcap_etherent { + u_char addr[6]; + char name[122]; +}; +#ifndef PCAP_ETHERS_FILE +#define PCAP_ETHERS_FILE "/etc/ethers" +#endif +struct pcap_etherent *pcap_next_etherent(FILE *); +u_char *pcap_ether_hostton(const char*); +u_char *pcap_ether_aton(const char *); + +bpf_u_int32 **pcap_nametoaddr(const char *); +#ifdef INET6 +struct addrinfo *pcap_nametoaddrinfo(const char *); +#endif +bpf_u_int32 pcap_nametonetaddr(const char *); + +int pcap_nametoport(const char *, int *, int *); +int pcap_nametoportrange(const char *, int *, int *, int *); +int pcap_nametoproto(const char *); +int pcap_nametoeproto(const char *); +int pcap_nametollc(const char *); +/* + * If a protocol is unknown, PROTO_UNDEF is returned. + * Also, pcap_nametoport() returns the protocol along with the port number. + * If there are ambiguous entried in /etc/services (i.e. domain + * can be either tcp or udp) PROTO_UNDEF is returned. + */ +#define PROTO_UNDEF -1 + +/* XXX move these to pcap-int.h? */ +int __pcap_atodn(const char *, bpf_u_int32 *); +int __pcap_atoin(const char *, bpf_u_int32 *); +u_short __pcap_nametodnaddr(const char *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/pcap.h b/ledset/WpdPack_4_1_2/Include/pcap/pcap.h new file mode 100644 index 0000000..ad8fc40 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/pcap.h @@ -0,0 +1,407 @@ +/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */ +/* + * Copyright (c) 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Computer Systems + * Engineering Group at Lawrence Berkeley Laboratory. + * 4. Neither the name of the University nor of the Laboratory may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/pcap.h,v 1.4.2.11 2008-10-06 15:38:39 gianluca Exp $ (LBL) + */ + +#ifndef lib_pcap_pcap_h +#define lib_pcap_pcap_h + +#if defined(WIN32) + #include +#elif defined(MSDOS) + #include + #include /* u_int, u_char etc. */ +#else /* UN*X */ + #include + #include +#endif /* WIN32/MSDOS/UN*X */ + +#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#endif + +#include + +#ifdef HAVE_REMOTE + // We have to define the SOCKET here, although it has been defined in sockutils.h + // This is to avoid the distribution of the 'sockutils.h' file around + // (for example in the WinPcap developer's pack) + #ifndef SOCKET + #ifdef WIN32 + #define SOCKET unsigned int + #else + #define SOCKET int + #endif + #endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define PCAP_VERSION_MAJOR 2 +#define PCAP_VERSION_MINOR 4 + +#define PCAP_ERRBUF_SIZE 256 + +/* + * Compatibility for systems that have a bpf.h that + * predates the bpf typedefs for 64-bit support. + */ +#if BPF_RELEASE - 0 < 199406 +typedef int bpf_int32; +typedef u_int bpf_u_int32; +#endif + +typedef struct pcap pcap_t; +typedef struct pcap_dumper pcap_dumper_t; +typedef struct pcap_if pcap_if_t; +typedef struct pcap_addr pcap_addr_t; + +/* + * The first record in the file contains saved values for some + * of the flags used in the printout phases of tcpdump. + * Many fields here are 32 bit ints so compilers won't insert unwanted + * padding; these files need to be interchangeable across architectures. + * + * Do not change the layout of this structure, in any way (this includes + * changes that only affect the length of fields in this structure). + * + * Also, do not change the interpretation of any of the members of this + * structure, in any way (this includes using values other than + * LINKTYPE_ values, as defined in "savefile.c", in the "linktype" + * field). + * + * Instead: + * + * introduce a new structure for the new format, if the layout + * of the structure changed; + * + * send mail to "tcpdump-workers@lists.tcpdump.org", requesting + * a new magic number for your new capture file format, and, when + * you get the new magic number, put it in "savefile.c"; + * + * use that magic number for save files with the changed file + * header; + * + * make the code in "savefile.c" capable of reading files with + * the old file header as well as files with the new file header + * (using the magic number to determine the header format). + * + * Then supply the changes as a patch at + * + * http://sourceforge.net/projects/libpcap/ + * + * so that future versions of libpcap and programs that use it (such as + * tcpdump) will be able to read your new capture file format. + */ +struct pcap_file_header { + bpf_u_int32 magic; + u_short version_major; + u_short version_minor; + bpf_int32 thiszone; /* gmt to local correction */ + bpf_u_int32 sigfigs; /* accuracy of timestamps */ + bpf_u_int32 snaplen; /* max length saved portion of each pkt */ + bpf_u_int32 linktype; /* data link type (LINKTYPE_*) */ +}; + +/* + * Macros for the value returned by pcap_datalink_ext(). + * + * If LT_FCS_LENGTH_PRESENT(x) is true, the LT_FCS_LENGTH(x) macro + * gives the FCS length of packets in the capture. + */ +#define LT_FCS_LENGTH_PRESENT(x) ((x) & 0x04000000) +#define LT_FCS_LENGTH(x) (((x) & 0xF0000000) >> 28) +#define LT_FCS_DATALINK_EXT(x) ((((x) & 0xF) << 28) | 0x04000000) + +typedef enum { + PCAP_D_INOUT = 0, + PCAP_D_IN, + PCAP_D_OUT +} pcap_direction_t; + +/* + * Generic per-packet information, as supplied by libpcap. + * + * The time stamp can and should be a "struct timeval", regardless of + * whether your system supports 32-bit tv_sec in "struct timeval", + * 64-bit tv_sec in "struct timeval", or both if it supports both 32-bit + * and 64-bit applications. The on-disk format of savefiles uses 32-bit + * tv_sec (and tv_usec); this structure is irrelevant to that. 32-bit + * and 64-bit versions of libpcap, even if they're on the same platform, + * should supply the appropriate version of "struct timeval", even if + * that's not what the underlying packet capture mechanism supplies. + */ +struct pcap_pkthdr { + struct timeval ts; /* time stamp */ + bpf_u_int32 caplen; /* length of portion present */ + bpf_u_int32 len; /* length this packet (off wire) */ +}; + +/* + * As returned by the pcap_stats() + */ +struct pcap_stat { + u_int ps_recv; /* number of packets received */ + u_int ps_drop; /* number of packets dropped */ + u_int ps_ifdrop; /* drops by interface XXX not yet supported */ +#ifdef HAVE_REMOTE + u_int ps_capt; /* number of packets that are received by the application; please get rid off the Win32 ifdef */ + u_int ps_sent; /* number of packets sent by the server on the network */ + u_int ps_netdrop; /* number of packets lost on the network */ +#endif /* HAVE_REMOTE */ +}; + +#ifdef MSDOS +/* + * As returned by the pcap_stats_ex() + */ +struct pcap_stat_ex { + u_long rx_packets; /* total packets received */ + u_long tx_packets; /* total packets transmitted */ + u_long rx_bytes; /* total bytes received */ + u_long tx_bytes; /* total bytes transmitted */ + u_long rx_errors; /* bad packets received */ + u_long tx_errors; /* packet transmit problems */ + u_long rx_dropped; /* no space in Rx buffers */ + u_long tx_dropped; /* no space available for Tx */ + u_long multicast; /* multicast packets received */ + u_long collisions; + + /* detailed rx_errors: */ + u_long rx_length_errors; + u_long rx_over_errors; /* receiver ring buff overflow */ + u_long rx_crc_errors; /* recv'd pkt with crc error */ + u_long rx_frame_errors; /* recv'd frame alignment error */ + u_long rx_fifo_errors; /* recv'r fifo overrun */ + u_long rx_missed_errors; /* recv'r missed packet */ + + /* detailed tx_errors */ + u_long tx_aborted_errors; + u_long tx_carrier_errors; + u_long tx_fifo_errors; + u_long tx_heartbeat_errors; + u_long tx_window_errors; + }; +#endif + +/* + * Item in a list of interfaces. + */ +struct pcap_if { + struct pcap_if *next; + char *name; /* name to hand to "pcap_open_live()" */ + char *description; /* textual description of interface, or NULL */ + struct pcap_addr *addresses; + bpf_u_int32 flags; /* PCAP_IF_ interface flags */ +}; + +#define PCAP_IF_LOOPBACK 0x00000001 /* interface is loopback */ + +/* + * Representation of an interface address. + */ +struct pcap_addr { + struct pcap_addr *next; + struct sockaddr *addr; /* address */ + struct sockaddr *netmask; /* netmask for that address */ + struct sockaddr *broadaddr; /* broadcast address for that address */ + struct sockaddr *dstaddr; /* P2P destination address for that address */ +}; + +typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *, + const u_char *); + +/* + * Error codes for the pcap API. + * These will all be negative, so you can check for the success or + * failure of a call that returns these codes by checking for a + * negative value. + */ +#define PCAP_ERROR -1 /* generic error code */ +#define PCAP_ERROR_BREAK -2 /* loop terminated by pcap_breakloop */ +#define PCAP_ERROR_NOT_ACTIVATED -3 /* the capture needs to be activated */ +#define PCAP_ERROR_ACTIVATED -4 /* the operation can't be performed on already activated captures */ +#define PCAP_ERROR_NO_SUCH_DEVICE -5 /* no such device exists */ +#define PCAP_ERROR_RFMON_NOTSUP -6 /* this device doesn't support rfmon (monitor) mode */ +#define PCAP_ERROR_NOT_RFMON -7 /* operation supported only in monitor mode */ +#define PCAP_ERROR_PERM_DENIED -8 /* no permission to open the device */ +#define PCAP_ERROR_IFACE_NOT_UP -9 /* interface isn't up */ + +/* + * Warning codes for the pcap API. + * These will all be positive and non-zero, so they won't look like + * errors. + */ +#define PCAP_WARNING 1 /* generic warning code */ +#define PCAP_WARNING_PROMISC_NOTSUP 2 /* this device doesn't support promiscuous mode */ + +char *pcap_lookupdev(char *); +int pcap_lookupnet(const char *, bpf_u_int32 *, bpf_u_int32 *, char *); + +pcap_t *pcap_create(const char *, char *); +int pcap_set_snaplen(pcap_t *, int); +int pcap_set_promisc(pcap_t *, int); +int pcap_can_set_rfmon(pcap_t *); +int pcap_set_rfmon(pcap_t *, int); +int pcap_set_timeout(pcap_t *, int); +int pcap_set_buffer_size(pcap_t *, int); +int pcap_activate(pcap_t *); + +pcap_t *pcap_open_live(const char *, int, int, int, char *); +pcap_t *pcap_open_dead(int, int); +pcap_t *pcap_open_offline(const char *, char *); +#if defined(WIN32) +pcap_t *pcap_hopen_offline(intptr_t, char *); +#if !defined(LIBPCAP_EXPORTS) +#define pcap_fopen_offline(f,b) \ + pcap_hopen_offline(_get_osfhandle(_fileno(f)), b) +#else /*LIBPCAP_EXPORTS*/ +static pcap_t *pcap_fopen_offline(FILE *, char *); +#endif +#else /*WIN32*/ +pcap_t *pcap_fopen_offline(FILE *, char *); +#endif /*WIN32*/ + +void pcap_close(pcap_t *); +int pcap_loop(pcap_t *, int, pcap_handler, u_char *); +int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *); +const u_char* + pcap_next(pcap_t *, struct pcap_pkthdr *); +int pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **); +void pcap_breakloop(pcap_t *); +int pcap_stats(pcap_t *, struct pcap_stat *); +int pcap_setfilter(pcap_t *, struct bpf_program *); +int pcap_setdirection(pcap_t *, pcap_direction_t); +int pcap_getnonblock(pcap_t *, char *); +int pcap_setnonblock(pcap_t *, int, char *); +int pcap_inject(pcap_t *, const void *, size_t); +int pcap_sendpacket(pcap_t *, const u_char *, int); +const char *pcap_statustostr(int); +const char *pcap_strerror(int); +char *pcap_geterr(pcap_t *); +void pcap_perror(pcap_t *, char *); +int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, + bpf_u_int32); +int pcap_compile_nopcap(int, int, struct bpf_program *, + const char *, int, bpf_u_int32); +void pcap_freecode(struct bpf_program *); +int pcap_offline_filter(struct bpf_program *, const struct pcap_pkthdr *, + const u_char *); +int pcap_datalink(pcap_t *); +int pcap_datalink_ext(pcap_t *); +int pcap_list_datalinks(pcap_t *, int **); +int pcap_set_datalink(pcap_t *, int); +void pcap_free_datalinks(int *); +int pcap_datalink_name_to_val(const char *); +const char *pcap_datalink_val_to_name(int); +const char *pcap_datalink_val_to_description(int); +int pcap_snapshot(pcap_t *); +int pcap_is_swapped(pcap_t *); +int pcap_major_version(pcap_t *); +int pcap_minor_version(pcap_t *); + +/* XXX */ +FILE *pcap_file(pcap_t *); +int pcap_fileno(pcap_t *); + +pcap_dumper_t *pcap_dump_open(pcap_t *, const char *); +pcap_dumper_t *pcap_dump_fopen(pcap_t *, FILE *fp); +FILE *pcap_dump_file(pcap_dumper_t *); +long pcap_dump_ftell(pcap_dumper_t *); +int pcap_dump_flush(pcap_dumper_t *); +void pcap_dump_close(pcap_dumper_t *); +void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *); + +int pcap_findalldevs(pcap_if_t **, char *); +void pcap_freealldevs(pcap_if_t *); + +const char *pcap_lib_version(void); + +/* XXX this guy lives in the bpf tree */ +u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); +int bpf_validate(const struct bpf_insn *f, int len); +char *bpf_image(const struct bpf_insn *, int); +void bpf_dump(const struct bpf_program *, int); + +#if defined(WIN32) + +/* + * Win32 definitions + */ + +int pcap_setbuff(pcap_t *p, int dim); +int pcap_setmode(pcap_t *p, int mode); +int pcap_setmintocopy(pcap_t *p, int size); + +#ifdef WPCAP +/* Include file with the wpcap-specific extensions */ +#include +#endif /* WPCAP */ + +#define MODE_CAPT 0 +#define MODE_STAT 1 +#define MODE_MON 2 + +#elif defined(MSDOS) + +/* + * MS-DOS definitions + */ + +int pcap_stats_ex (pcap_t *, struct pcap_stat_ex *); +void pcap_set_wait (pcap_t *p, void (*yield)(void), int wait); +u_long pcap_mac_packets (void); + +#else /* UN*X */ + +/* + * UN*X definitions + */ + +int pcap_get_selectable_fd(pcap_t *); + +#endif /* WIN32/MSDOS/UN*X */ + +#ifdef HAVE_REMOTE +/* Includes most of the public stuff that is needed for the remote capture */ +#include +#endif /* HAVE_REMOTE */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/sll.h b/ledset/WpdPack_4_1_2/Include/pcap/sll.h new file mode 100644 index 0000000..e9d5452 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/sll.h @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from the Stanford/CMU enet packet filter, + * (net/enet.c) distributed as part of 4.3BSD, and code contributed + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence + * Berkeley Laboratory. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/sll.h,v 1.2.2.1 2008-05-30 01:36:06 guy Exp $ (LBL) + */ + +/* + * For captures on Linux cooked sockets, we construct a fake header + * that includes: + * + * a 2-byte "packet type" which is one of: + * + * LINUX_SLL_HOST packet was sent to us + * LINUX_SLL_BROADCAST packet was broadcast + * LINUX_SLL_MULTICAST packet was multicast + * LINUX_SLL_OTHERHOST packet was sent to somebody else + * LINUX_SLL_OUTGOING packet was sent *by* us; + * + * a 2-byte Ethernet protocol field; + * + * a 2-byte link-layer type; + * + * a 2-byte link-layer address length; + * + * an 8-byte source link-layer address, whose actual length is + * specified by the previous value. + * + * All fields except for the link-layer address are in network byte order. + * + * DO NOT change the layout of this structure, or change any of the + * LINUX_SLL_ values below. If you must change the link-layer header + * for a "cooked" Linux capture, introduce a new DLT_ type (ask + * "tcpdump-workers@lists.tcpdump.org" for one, so that you don't give it + * a value that collides with a value already being used), and use the + * new header in captures of that type, so that programs that can + * handle DLT_LINUX_SLL captures will continue to handle them correctly + * without any change, and so that capture files with different headers + * can be told apart and programs that read them can dissect the + * packets in them. + */ + +#ifndef lib_pcap_sll_h +#define lib_pcap_sll_h + +/* + * A DLT_LINUX_SLL fake link-layer header. + */ +#define SLL_HDR_LEN 16 /* total header length */ +#define SLL_ADDRLEN 8 /* length of address field */ + +struct sll_header { + u_int16_t sll_pkttype; /* packet type */ + u_int16_t sll_hatype; /* link-layer address type */ + u_int16_t sll_halen; /* link-layer address length */ + u_int8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */ + u_int16_t sll_protocol; /* protocol */ +}; + +/* + * The LINUX_SLL_ values for "sll_pkttype"; these correspond to the + * PACKET_ values on Linux, but are defined here so that they're + * available even on systems other than Linux, and so that they + * don't change even if the PACKET_ values change. + */ +#define LINUX_SLL_HOST 0 +#define LINUX_SLL_BROADCAST 1 +#define LINUX_SLL_MULTICAST 2 +#define LINUX_SLL_OTHERHOST 3 +#define LINUX_SLL_OUTGOING 4 + +/* + * The LINUX_SLL_ values for "sll_protocol"; these correspond to the + * ETH_P_ values on Linux, but are defined here so that they're + * available even on systems other than Linux. We assume, for now, + * that the ETH_P_ values won't change in Linux; if they do, then: + * + * if we don't translate them in "pcap-linux.c", capture files + * won't necessarily be readable if captured on a system that + * defines ETH_P_ values that don't match these values; + * + * if we do translate them in "pcap-linux.c", that makes life + * unpleasant for the BPF code generator, as the values you test + * for in the kernel aren't the values that you test for when + * reading a capture file, so the fixup code run on BPF programs + * handed to the kernel ends up having to do more work. + * + * Add other values here as necessary, for handling packet types that + * might show up on non-Ethernet, non-802.x networks. (Not all the ones + * in the Linux "if_ether.h" will, I suspect, actually show up in + * captures.) + */ +#define LINUX_SLL_P_802_3 0x0001 /* Novell 802.3 frames without 802.2 LLC header */ +#define LINUX_SLL_P_802_2 0x0004 /* 802.2 frames (not D/I/X Ethernet) */ + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/usb.h b/ledset/WpdPack_4_1_2/Include/pcap/usb.h new file mode 100644 index 0000000..adcd19c --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/usb.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2006 Paolo Abeni (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Basic USB data struct + * By Paolo Abeni + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/usb.h,v 1.6 2007/09/22 02:06:08 guy Exp $ + */ + +#ifndef _PCAP_USB_STRUCTS_H__ +#define _PCAP_USB_STRUCTS_H__ + +/* + * possible transfer mode + */ +#define URB_TRANSFER_IN 0x80 +#define URB_ISOCHRONOUS 0x0 +#define URB_INTERRUPT 0x1 +#define URB_CONTROL 0x2 +#define URB_BULK 0x3 + +/* + * possible event type + */ +#define URB_SUBMIT 'S' +#define URB_COMPLETE 'C' +#define URB_ERROR 'E' + +/* + * USB setup header as defined in USB specification. + * Appears at the front of each packet in DLT_USB captures. + */ +typedef struct _usb_setup { + u_int8_t bmRequestType; + u_int8_t bRequest; + u_int16_t wValue; + u_int16_t wIndex; + u_int16_t wLength; +} pcap_usb_setup; + + +/* + * Header prepended by linux kernel to each event. + * Appears at the front of each packet in DLT_USB_LINUX captures. + */ +typedef struct _usb_header { + u_int64_t id; + u_int8_t event_type; + u_int8_t transfer_type; + u_int8_t endpoint_number; + u_int8_t device_address; + u_int16_t bus_id; + char setup_flag;/*if !=0 the urb setup header is not present*/ + char data_flag; /*if !=0 no urb data is present*/ + int64_t ts_sec; + int32_t ts_usec; + int32_t status; + u_int32_t urb_len; + u_int32_t data_len; /* amount of urb data really present in this event*/ + pcap_usb_setup setup; +} pcap_usb_header; + + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/pcap/vlan.h b/ledset/WpdPack_4_1_2/Include/pcap/vlan.h new file mode 100644 index 0000000..b0cb794 --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/pcap/vlan.h @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#) $Header: /tcpdump/master/libpcap/pcap/vlan.h,v 1.1.2.2 2008-08-06 07:45:59 guy Exp $ + */ + +#ifndef lib_pcap_vlan_h +#define lib_pcap_vlan_h + +struct vlan_tag { + u_int16_t vlan_tpid; /* ETH_P_8021Q */ + u_int16_t vlan_tci; /* VLAN TCI */ +}; + +#define VLAN_TAG_LEN 4 + +#endif diff --git a/ledset/WpdPack_4_1_2/Include/remote-ext.h b/ledset/WpdPack_4_1_2/Include/remote-ext.h new file mode 100644 index 0000000..35a2fff --- /dev/null +++ b/ledset/WpdPack_4_1_2/Include/remote-ext.h @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2002 - 2003 + * NetGroup, Politecnico di Torino (Italy) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Politecnico di Torino nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#ifndef __REMOTE_EXT_H__ +#define __REMOTE_EXT_H__ + + +#ifndef HAVE_REMOTE +#error Please do not include this file directly. Just define HAVE_REMOTE and then include pcap.h +#endif + +// Definition for Microsoft Visual Studio +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + \file remote-ext.h + + The goal of this file it to include most of the new definitions that should be + placed into the pcap.h file. + + It includes all new definitions (structures and functions like pcap_open(). + Some of the functions are not really a remote feature, but, right now, + they are placed here. +*/ + + + +// All this stuff is public +/*! \addtogroup remote_struct + \{ +*/ + + + + +/*! + \brief Defines the maximum buffer size in which address, port, interface names are kept. + + In case the adapter name or such is larger than this value, it is truncated. + This is not used by the user; however it must be aware that an hostname / interface + name longer than this value will be truncated. +*/ +#define PCAP_BUF_SIZE 1024 + + +/*! \addtogroup remote_source_ID + \{ +*/ + + +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a file, i.e. the user want to open a capture from a local file. +*/ +#define PCAP_SRC_FILE 2 +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a local interface, i.e. the user want to open a capture from + a local interface. This does not involve the RPCAP protocol. +*/ +#define PCAP_SRC_IFLOCAL 3 +/*! + \brief Internal representation of the type of source in use (file, + remote/local interface). + + This indicates a remote interface, i.e. the user want to open a capture from + an interface on a remote host. This does involve the RPCAP protocol. +*/ +#define PCAP_SRC_IFREMOTE 4 + +/*! + \} +*/ + + + +/*! \addtogroup remote_source_string + + The formats allowed by the pcap_open() are the following: + - file://path_and_filename [opens a local file] + - rpcap://devicename [opens the selected device devices available on the local host, without using the RPCAP protocol] + - rpcap://host/devicename [opens the selected device available on a remote host] + - rpcap://host:port/devicename [opens the selected device available on a remote host, using a non-standard port for RPCAP] + - adaptername [to open a local adapter; kept for compability, but it is strongly discouraged] + - (NULL) [to open the first local adapter; kept for compability, but it is strongly discouraged] + + The formats allowed by the pcap_findalldevs_ex() are the following: + - file://folder/ [lists all the files in the given folder] + - rpcap:// [lists all local adapters] + - rpcap://host:port/ [lists the devices available on a remote host] + + Referring to the 'host' and 'port' paramters, they can be either numeric or literal. Since + IPv6 is fully supported, these are the allowed formats: + + - host (literal): e.g. host.foo.bar + - host (numeric IPv4): e.g. 10.11.12.13 + - host (numeric IPv4, IPv6 style): e.g. [10.11.12.13] + - host (numeric IPv6): e.g. [1:2:3::4] + - port: can be either numeric (e.g. '80') or literal (e.g. 'http') + + Here you find some allowed examples: + - rpcap://host.foo.bar/devicename [everything literal, no port number] + - rpcap://host.foo.bar:1234/devicename [everything literal, with port number] + - rpcap://10.11.12.13/devicename [IPv4 numeric, no port number] + - rpcap://10.11.12.13:1234/devicename [IPv4 numeric, with port number] + - rpcap://[10.11.12.13]:1234/devicename [IPv4 numeric with IPv6 format, with port number] + - rpcap://[1:2:3::4]/devicename [IPv6 numeric, no port number] + - rpcap://[1:2:3::4]:1234/devicename [IPv6 numeric, with port number] + - rpcap://[1:2:3::4]:http/devicename [IPv6 numeric, with literal port number] + + \{ +*/ + + +/*! + \brief String that will be used to determine the type of source in use (file, + remote/local interface). + + This string will be prepended to the interface name in order to create a string + that contains all the information required to open the source. + + This string indicates that the user wants to open a capture from a local file. +*/ +#define PCAP_SRC_FILE_STRING "file://" +/*! + \brief String that will be used to determine the type of source in use (file, + remote/local interface). + + This string will be prepended to the interface name in order to create a string + that contains all the information required to open the source. + + This string indicates that the user wants to open a capture from a network interface. + This string does not necessarily involve the use of the RPCAP protocol. If the + interface required resides on the local host, the RPCAP protocol is not involved + and the local functions are used. +*/ +#define PCAP_SRC_IF_STRING "rpcap://" + +/*! + \} +*/ + + + + + +/*! + \addtogroup remote_open_flags + \{ +*/ + +/*! + \brief Defines if the adapter has to go in promiscuous mode. + + It is '1' if you have to open the adapter in promiscuous mode, '0' otherwise. + Note that even if this parameter is false, the interface could well be in promiscuous + mode for some other reason (for example because another capture process with + promiscuous mode enabled is currently using that interface). + On on Linux systems with 2.2 or later kernels (that have the "any" device), this + flag does not work on the "any" device; if an argument of "any" is supplied, + the 'promisc' flag is ignored. +*/ +#define PCAP_OPENFLAG_PROMISCUOUS 1 + +/*! + \brief Defines if the data trasfer (in case of a remote + capture) has to be done with UDP protocol. + + If it is '1' if you want a UDP data connection, '0' if you want + a TCP data connection; control connection is always TCP-based. + A UDP connection is much lighter, but it does not guarantee that all + the captured packets arrive to the client workstation. Moreover, + it could be harmful in case of network congestion. + This flag is meaningless if the source is not a remote interface. + In that case, it is simply ignored. +*/ +#define PCAP_OPENFLAG_DATATX_UDP 2 + + +/*! + \brief Defines if the remote probe will capture its own generated traffic. + + In case the remote probe uses the same interface to capture traffic and to send + data back to the caller, the captured traffic includes the RPCAP traffic as well. + If this flag is turned on, the RPCAP traffic is excluded from the capture, so that + the trace returned back to the collector is does not include this traffic. +*/ +#define PCAP_OPENFLAG_NOCAPTURE_RPCAP 4 + +/*! + \brief Defines if the local adapter will capture its own generated traffic. + + This flag tells the underlying capture driver to drop the packets that were sent by itself. + This is usefult when building applications like bridges, that should ignore the traffic + they just sent. +*/ +#define PCAP_OPENFLAG_NOCAPTURE_LOCAL 8 + +/*! + \brief This flag configures the adapter for maximum responsiveness. + + In presence of a large value for nbytes, WinPcap waits for the arrival of several packets before + copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, + i.e. better performance, which is good for applications like sniffers. If the user sets the + PCAP_OPENFLAG_MAX_RESPONSIVENESS flag, the capture driver will copy the packets as soon as the application + is ready to receive them. This is suggested for real time applications (like, for example, a bridge) + that need the best responsiveness.*/ +#define PCAP_OPENFLAG_MAX_RESPONSIVENESS 16 + +/*! + \} +*/ + + +/*! + \addtogroup remote_samp_methods + \{ +*/ + +/*! + \brief No sampling has to be done on the current capture. + + In this case, no sampling algorithms are applied to the current capture. +*/ +#define PCAP_SAMP_NOSAMP 0 + +/*! + \brief It defines that only 1 out of N packets must be returned to the user. + + In this case, the 'value' field of the 'pcap_samp' structure indicates the + number of packets (minus 1) that must be discarded before one packet got accepted. + In other words, if 'value = 10', the first packet is returned to the caller, while + the following 9 are discarded. +*/ +#define PCAP_SAMP_1_EVERY_N 1 + +/*! + \brief It defines that we have to return 1 packet every N milliseconds. + + In this case, the 'value' field of the 'pcap_samp' structure indicates the 'waiting + time' in milliseconds before one packet got accepted. + In other words, if 'value = 10', the first packet is returned to the caller; the next + returned one will be the first packet that arrives when 10ms have elapsed. +*/ +#define PCAP_SAMP_FIRST_AFTER_N_MS 2 + +/*! + \} +*/ + + +/*! + \addtogroup remote_auth_methods + \{ +*/ + +/*! + \brief It defines the NULL authentication. + + This value has to be used within the 'type' member of the pcap_rmtauth structure. + The 'NULL' authentication has to be equal to 'zero', so that old applications + can just put every field of struct pcap_rmtauth to zero, and it does work. +*/ +#define RPCAP_RMTAUTH_NULL 0 +/*! + \brief It defines the username/password authentication. + + With this type of authentication, the RPCAP protocol will use the username/ + password provided to authenticate the user on the remote machine. If the + authentication is successful (and the user has the right to open network devices) + the RPCAP connection will continue; otherwise it will be dropped. + + This value has to be used within the 'type' member of the pcap_rmtauth structure. +*/ +#define RPCAP_RMTAUTH_PWD 1 + +/*! + \} +*/ + + + + +/*! + + \brief This structure keeps the information needed to autheticate + the user on a remote machine. + + The remote machine can either grant or refuse the access according + to the information provided. + In case the NULL authentication is required, both 'username' and + 'password' can be NULL pointers. + + This structure is meaningless if the source is not a remote interface; + in that case, the functions which requires such a structure can accept + a NULL pointer as well. +*/ +struct pcap_rmtauth +{ + /*! + \brief Type of the authentication required. + + In order to provide maximum flexibility, we can support different types + of authentication based on the value of this 'type' variable. The currently + supported authentication methods are defined into the + \link remote_auth_methods Remote Authentication Methods Section\endlink. + + */ + int type; + /*! + \brief Zero-terminated string containing the username that has to be + used on the remote machine for authentication. + + This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication + and it can be NULL. + */ + char *username; + /*! + \brief Zero-terminated string containing the password that has to be + used on the remote machine for authentication. + + This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication + and it can be NULL. + */ + char *password; +}; + + +/*! + \brief This structure defines the information related to sampling. + + In case the sampling is requested, the capturing device should read + only a subset of the packets coming from the source. The returned packets depend + on the sampling parameters. + + \warning The sampling process is applied after the filtering process. + In other words, packets are filtered first, then the sampling process selects a + subset of the 'filtered' packets and it returns them to the caller. +*/ +struct pcap_samp +{ + /*! + Method used for sampling. Currently, the supported methods are listed in the + \link remote_samp_methods Sampling Methods Section\endlink. + */ + int method; + + /*! + This value depends on the sampling method defined. For its meaning, please check + at the \link remote_samp_methods Sampling Methods Section\endlink. + */ + int value; +}; + + + + +//! Maximum lenght of an host name (needed for the RPCAP active mode) +#define RPCAP_HOSTLIST_SIZE 1024 + + +/*! + \} +*/ // end of public documentation + + +// Exported functions + + + +/** \name New WinPcap functions + + This section lists the new functions that are able to help considerably in writing + WinPcap programs because of their easiness of use. + */ +//\{ +pcap_t *pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf); +int pcap_createsrcstr(char *source, int type, const char *host, const char *port, const char *name, char *errbuf); +int pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf); +int pcap_findalldevs_ex(char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf); +struct pcap_samp *pcap_setsampling(pcap_t *p); + +//\} +// End of new winpcap functions + + + +/** \name Remote Capture functions + */ +//\{ +SOCKET pcap_remoteact_accept(const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf); +int pcap_remoteact_list(char *hostlist, char sep, int size, char *errbuf); +int pcap_remoteact_close(const char *host, char *errbuf); +void pcap_remoteact_cleanup(); +//\} +// End of remote capture functions + +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/ledset/WpdPack_4_1_2/Lib/Packet.lib b/ledset/WpdPack_4_1_2/Lib/Packet.lib new file mode 100644 index 0000000000000000000000000000000000000000..81618bc8ca221dd99e52b0289ae4692a01f63d0b GIT binary patch literal 8450 zcmcIp&2JM|5TAVT(Lh5&zQ0XCKra-6O@f4?d{QEu5ZR{XW;XVwEVaE`+o450^v0>; z#EE+)#EAo!-Z*ih5|!wsQV*5*6LR22XZG#BuYFz|oUAnQ?##UTy^onU^IlF}v#N!A z^Icyj)aTO7>}+x_nY?^a<%ge_X6J&}yIlaV4A5N#=y?jz`xanip3%@Q0MWo5Mk6nf zk2Ly$(bzTsQQtJ9;Vl57{!T`tlcDC1hSB7G!G_lL5|2_8W zeLlaozIiK?%df0vmosadxm%gMXBB?1>yXcH+)k&Xa`=@gFmdk2?TwrHmBrj5 zX=kfyRUdw9S8I-2K{HO-%Quj*7T?%)qqfZFnk!Z3fn9B+uSr>}Tb^B6ELvXOuBzQp z1WY$;SBmUSRh9X=X04Gb3YhLQ%ui8etGM{N??1GJx zXELjan96d=t=YzjQzcA0Yu9i5bloXMW?2z1U0m6~?uJ#iwfTz(S(}XgeTf`K}AU-_jawa z?HWdg{S77D_PSHaxy!EiP#qn0LP)r68pG-XyP}N_XHAj>w(G9PLSM5i@p&&+cFG>P zou+Eng+S3wJ7q^-V(c<$ha#rGRwLeOrDzvb+lqkOPP?wRghE*w+w1GsVd(W3wdA>Z23A5S_@U#cuZ7;z52*BRG<^~oGiSrXFB&_VNhyMKiK$qTqDfO% zVoHIo z{sJUkwc~FuW<+|r#GuYYU(XR_kvV#(o9AAiTz3jpx8`ow6X!EuCDLmfH+`x8hrp;M zS-`~azhRYtiI{i-1-npi%O3Xi-0NT9BleHsQ44ygbL|igc>%!h?!A!X4~|-Ngq$Sl zAOpBgN^ppewFH02I=~$NCag{T+RuZpG^Ne?$xJG|n;<`F_x=f%P82zLu4S`-I zKe-%=$WML`KZ0NK6SBMS>)*_(V%3H--QXTUxJZ+;Hai=MuD=l=Zq{O=D-}$T@46IS z@*_o8GUSuP{uO=%zxz77&CDp)!woNB_UwnL%i)a~-HcIarrT)GI^~bMx=Ql@mJijb$1uZTrjw)!P z*lh(b8E&Ln6ygCLs{|f}{CLp<_qsWT0x45xRYXJ;;<-I9rxnDwN^ep@3~!MR3T;Y46L(WG+W!N((TxBA literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/Lib/wpcap.lib b/ledset/WpdPack_4_1_2/Lib/wpcap.lib new file mode 100644 index 0000000000000000000000000000000000000000..f832e0445b5c7dafe5a0f887262064265ba2b293 GIT binary patch literal 19320 zcmdU0O>9(05-uRW4k3h)gbS|j4}Uz#t>t&Y%Y)S%rl;4JTp5pCTuoh zr6{Lp73IKQa^QrbD7U>tdx#=VoK`4`_7Fwch+_^p| zS6BDfKh<5`)$NUA`Fde~ylZ#2`x_V>8Oe?2azi67zdwrRhWbZ!@NyRb{1af)Ai(As zfGr;YjQ*f$?=%3>0gMxkW0+_MhKYuM)O4~3fN1X*n)>bm5FNa!=@dc`jeVwR->(2f zr@qm2dK`f0IF?CtuvgRRPmzx_yk67JDF8*E;}+y2(SaM92H(eeAPs$`X>=9#JJEGb+ptfFdaw>e+iq*x`Yiy_8LSsk zPhHb?lqKrHekD4vPE+rP*gr_)Sa+hqpEMo(8T%RO(3GZ$?*SB*@r$$_@rd?+t!Zo@ zjvvxV99NR-y@~cP&F-(99u}FD=x9fbs_AYW3=3tr%W|L_8r?37d|TiVLY~ zEvy9P(zP&>67jfHb#AU)syKqo60(JIwPA#!ut>cUHY?T2Y`I#v8X-CyA=yYsIvgR1 z{ec~7x`z7J_EoXesO6i5`6%5+g-kun7o&6?6lsXL*a+*hi*s{fJrauXgmly&fhf^s z3E4_`-3*NminK;E-)tB(9ge34;dLpXqEaSo&XvkdS!WX$Qnj#NubO6=h)8cV>r%o- zg$#}#%0zWB5s_Y~F4Rh8)(8_zN(7avo*HT-qioC+@^ketEL4l8NE;P0#e6f5+G>={ zMukkHlCL%9t7a5zRLGPXLF4Uwtri*$kqjZXkpEM)9$X9SjZ(D|bw-RQrAw8hw96CH zIB?un6^x}-su3UwQbeQ|7jfC3NgauZcw9Wn7pTvr=@psX2-v zPKxSZ5_y=PnoE_N$P;l>b2RJuN@JnKx{58)m9q&VA1x?B*qjgRVZ~&L@q{!@+G|$O zMuiOZZ>iF(7OFMdSjiHy%7zr}qAKD-YOYi%Vt=CNK_NilssaMOp#PS~G0a z3#jr@2fHjGTg%rQuBgKil48`YO^Y*yd_7#KHp6_O8RQFvux8Xd$xh8vE;W)lG&5CR zE{YZ+xiZSMFke|T8koY@IHd|2`Ept5435N=dVT?dRHmqxp2NoQb4*B>?S@fVJ*ax; z#(FH|ab7p_3pF&AS9m=V93eT2qkmOwwM1MS~zh^OYj+6w(qzK0R@x9xxG+j`OQ@O)YAwXd4wWGVhD0>`FwwU%QhSy`Bsht3yBaP(% ze(43MpxoU(=zYOFA0d4{0I&g1$&>iKwHu(>kDdVhcHwsomUZU@z?X;clzbTAW2BWw z0NzC^?gw}e%b&*d8(7cxv5c>V09Ik$uOp3b!!mjRZsYgctytC>fI7y0LnY-36{Zf7=>XNfjzJf#$Z1jgA3T1 zPr!??4yIuo*25%B!C6=dn_&}df!E4q}7h2Vp-SXex#;FLwXebxMB`=5C9I^9PV8s(AynihM(q47Hlj}F34Yx5 z5?lA>X`GVyBqM>5uRR)q`2Y)!$;$8I=7z=ffJr=%AQ6tTb`!4lnRETAExQINoiFRt&`kb6)zb#5OTk(WXF`3LzuyeV>Hxo-xE;5&wx*TA8>_O0# zmkw~5!tPVa^mwZsG2>X)OyT6P_FY#r`5rUt)woR?W2mOSw@rK-bJ`>O{@4yI%WYCPuf1kaI9X$ zNp*3w@H`qDr?aNs+&Oo2#&Hz0Why()^2D`)wqGhaX1N5xvM@q!8M4BUSkpzx4EynIBam!|lli=G+Mk}qYj1rahg&EpnNTMnkZ z6X;YS&b;BMmJ!Md!^x2hGOWz7`V;-AEPO=~#ptsfeItO|rMA!b4@pA?b9;q` zELR%xFI6w99i(bVQ6qBcEkNU%@)Gd`Z&9+L3Wy4UP

ii zt(#u7(X5F2?uWKuz$0Zt8OJO)7!6qr;{`-mW-ub#&;iOoI?D5ivfQBP z?YRYMzrS+nDC-bqg+bw+zXjsZL+Gm53p&N2Dhi z$sPL*kF_J!=aoO!_oo5a`Wl^G6SWCz8X~fDnjyWbFWEo#2>_LrfpY(yof(M2GuM&^&tn45RTGq64I1es%5IBD_q*{iK;u2FYa$7I6mN$G=TOG^=4LlDoZVf8Mpw z8`>v5@1R6iH=VS|vlhSLVkx(ih2l^~-N<=b^b_Mk`m)-zIUnA+Dq&#M2jgMyAnZo(4AD0*qp9b5G`pq6hCIM%0W!8nw$ z=X{p)l{75!sW3?UZSYVll0YzKHbPhY;~;29sU1>;c0zRY>-XSai;ZdbYZCG=to zq}NeHHZoF*W4Z&(oJadNNlfy2cY@QRZM55d-N8}r^iGgGy0KXzv2)UbaVVp147WIa zljmv+W4U(#jA6SoBbv{mY-KcYyI`T(Ull#QxQ(&o#f1gqP{wxoR*xQmS-4#qq68LyTjtHxo|KwtJB;6=J(Y@(tt?ceEx_3CTXEKlvOJ{NFy#1JrL^z$>YNrb&<@)H8*An#mck^5f7vwn&$@= zl0z9sY}m8Q7*9o{hYgHkLs{`!j2wCD52oO$CleN~{Wa0!-I!oJ@fxE8EMH$9a z4-3eltbOUxmcuD{<_QVov_E zH5QOV8As7)wU0Y^#`|rDZ3!!<#~Pe)(9AO+ZjXh{+AKB$jT}9S zHBXm1z-lq?X#aRxVyQ<_9pHHO31=jZeQssJ+SYsD$#znrB{r%InpH16?K&%w>>DwL zSc1lTMr+DJqo>Fgh(lRh<ClhvL%JxCqKEC=kR{Bh7JE3l N*?W_a?2Af)@;}RMSJ?mn literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/Lib/x64/Packet.lib b/ledset/WpdPack_4_1_2/Lib/x64/Packet.lib new file mode 100644 index 0000000000000000000000000000000000000000..30c15405037e32d45233593bb67ac27f66c5f3de GIT binary patch literal 8290 zcmcIo&2JM|5FZl0Y6v88zCR75f?g;IHVINyIbSpZCs?*=Z=v-t?kgF9x8D_ z2yx3zRz869X45Mw7WC&=J!5k-pqR^zA_r6 zt*>KWCe&wkZhk(wkW8hLD*v4KJ3BvnfqveI0l+dq&s%`rF@U}-z{pcd!&?A^23}Jd zodO^TJbHp}q`}LSCb18MhGr;Dzejzfi8~(k;~QxNu?S6Gr!;`$ z8mJVD>l@jtxk7PeHNTu&&laxcijGnG!E8aXxOpv;@yp>?szAkswQHMKiYtqSMaa7C zGSCIYSk_oEi=HXCZZbab*mMiE3v8cQo{_gDY2&Ol2~}9G+D$WPsuTg$&6};YpDtNdeO6^Y)x<^gY;GDgQ=KtgMqA{}AGggWaX#TT zjK|TJwks7y1Cd>x&~W?;$l~&R-EcCd>YZqWv8f*RFyAs-zHU>dsyl*+vC>N}nX>Y63fc=w2Tz|tZt42}L<#CP8?b>$@tEDXfstJMI%k_H2 z_Kyeq=?S>q4Xa+Tmu=^^GA07g1>7#_`syvSu8s-kNeDc9bBJT9 zie`)R70rxQv$Vy;t`c2OLbcbMgtb~Pn`OnW%;$D9w(Z=+ZEwlkGHzM6y33$-pPaTN zzHc?MCBs=W>gB3B0H1K@`EHKqyHf!0wg)p;FF>{r;OPj!)-b^90n8$!02RzEFOeQ& zhIobidvSmV$RES^n+bq-`2K+ZkH!JgNcX1!9u6T7>DeIa;r|k5$tOsc@&DB%zzoXX zBmWMz??*}_=5^#(5EGLx#NZelg78NM9i_hl_>({}ze8I(Ho?U^T1YDA<^mKiZFmgLP?-MW1N=>@49 z=**-@K%CPi)UdU_8xa=SGkH^e8$^Y`omNc`d9fpXN);t%IISR%MT#%V0?8v~w(gg@ zENt6ReN<~HJk>7<%4@=FHU0KE)t_{jAIl~rZ&uiC_HE6xW zMB%t6inHZvmFB?zJLx4a&U$CQ8?o};ZixLelR2^vFq_clY}vfI{rybd`-MgPz$2UT zq@j1|tW`Ez#>^ZOVB&&5kpA@;-S|$!x#ynV1&@tc4d5dZ(8-bc7IK;v`>~Dc!)&Umy zKf%i4-=}Pu?c79~($4&3F2(K!h@W6JfqwEkc8YcuAjnV3(h$g}LGRjj&jrrVt3g^P4JYYQn~bp4G0VY3zzT`6yZ+~_3HB|m9Mv*=1PK8fPL z*pK%ndb>Wmoy;uOwQVm#cI=O-Id5VUp20ltNwCOMifP21hg=JIi#Vvm1hL3ut+#8V~KJ$0$S2LmnXEi z!vi>02Q2RR`7R1lNX*52NLYC95!MkIi&gV`gmsi-Nk@bzSQmr$5|UJV1eSE}kid4n zkA&oaV;oI8%}9Xav$I_!88W)#98W$X2?V)_?F=o&3Ukf#NvYV&(bR)i6ucxWRWv-j z%EC&FMH;)hh=ddpY5g2YoCYIBTF9Ek1F)Jh*p59i*(T56bspZsu{re4v(glb&(3@! zY^??r9CAn&)_2znhh!w_=p6+wEXIa)JoiAqS7;+L8owrpf|i;O-W@+j?--TQe3uWA zP}#vvi)&K3j>)LvN<)GZpV2*YTtOrEB*OY9cxK4BCS)XW`y#=K&(6jbcHWqj(c~)~ c0V0jGGrX{hZc4^u_e6VyH7&5j<&%WA5NCuq?tv3xC4^R-P!0$og!X`Ph*m332ysA&6DQcOU)9zB{PXiq#vFE}^50!u z-CsYdySl5}>kkwf#o0s4clC$Aq2WDya^tztvEh)v+eULkBRLa%aXAtFlc@g|(T1Oi z1_p`tOk4UAU(kW)E#1TywDm1RxtE9(op{~Q_!yC*oim0Gp=d=XUofP%aqtxFU1n%E zc$(hF7qsiPp+VF`(XOS2c7BEWg9d@CXtH7G#9FiyG%;Z5ZG08|V(3VnNYgj?g7%_( zMY%ph$3H~-K>L3%G_-<9(ePD6V{Z~^LL0|G8^1TS=_4Xd7w`pbe8bS`S@aKRGwP)2 zTYMG0W@!K4fdkq;Xy_omiiTb_bf|>!0UiF>(g}P)hrTwnWr|4AzEhS^_kExfKN{M) z0pkH0TVv?xO(I1*`YfRhI}~BO6^(viXjdKm3>w*HXxrx)PtcZ63>`xqHNA^3XmY8c zqZd&=D0j=yVPn z#${?VGnH~xiaCyuELLhwD`J8o?RwOz)~eH$TJeU#k_;i&jLS)ekV6mDxnZg=xo=A4 zX1&lV&YDz?35iBjD4A3p5-9+iZ$^#j`I(uhVMIcfkhL9<_oW3KAz6)Hv4fyPBBj|X zw3-%22jgk^=oOKyVp1Y%&6F!GQBxZgGWDp@sM)62ut;sT8X}!zLIT4C2~!6f7OBPB zT)kXzV{Rku>G^6+YrIxgo5%5l^h_g)inWq0j$=ZiRA?2ThgO9+CM25GLcKX#v;EC6 zAyIDTn=cpY^~maghzqH?!b`PAej#c!%eAU$e#nxtd*7he3UO#u&_9^YDqE^Gpo0y|gZnnv5UZS*E(tPo4>zYi83e|b5U+rvz zQLe)HRw{Wl!07nvjlvuy@kEWxEVTyNMMS!@|5hE%_?eB9Q&Ay}S=ubj)nU%AyH&+A zgxoa7`G()__^6OkeV2FU&`#4BPe=oqg&Ep&grqAnUoFfFK$%#d|*eKUqY=;@z79a&gIhFEsXul;x$Qc9HiYl&U+8*k-kixvp7s?Girn7}= z$yxCPzQ|=}q-nPei&V^=@`75Lbg3K@5^AKNoO9(STQ|>$$*H{#b`7R5mC-R`a;@@Q zRGVkB)XFo|LkjT6o6Lk&UYw6{27L!~;yBT}2ayiPz&7>Cw29~f=naHtQJ=M&iM|EB2Kqbl45B`RsOzi9TS9w2K8*TeiI6XY8_hW3G$qW%{le+%`zjqrEC zfh&jZqCOg@QQAXew2uzZemYK<&|%ByF?yUXqHEXC6rH29^Z*Ue2HHr^&;?pgPg6e) z(F9$iVS0j|qep3w?xW{vEuE)lX@qigH{C<`(^IsLR?<#7K_}@UI!L=|Dcwtl>0x@1 zj?g3>qocHiw$e7*PCMw2bcQa|6}n2B=ufnocF|^9PN!%EJxPC{RrCn${XeVi6715u z_BEL47Te{hs5N3fJ-$7{>T5PuMx<@i6W`9X?R#OC*V${Vkzl-=xkq> zJ8h$!-3bmu_COjKNP+9}D8s4DUNu>#nD^#kjI`X z!46HFNJ#b{bl7Zk-jwm_M%Is+!I4MXSMLH8burAClTYs*g-}L6hR6|jTZPBfm|$#N zW1C_j>{8-RxVW!w{MX3zNsgS{Qk(e*Z8IiKjQ%P>El5J9aw@(dlesdQZN^7T4$ntx|kRRA5 zJtI&F@Ae3VwX-Q?CCzb^z(=xBT6l$Jf^#-XUPnJ}AY}cnhUa|=Y>0&kRzdHjV6!U> zt~a&9$R?TB@Sve%-lXcNIBPpIYWT*v>%6vxr#%qzbR)eHtS4I5#R5YarX-liL;-P> zbY{`Wu}?|cEYT8g1X<8}JViWq0@SOJPS(bbL*7N(*)8V1C*f(u6e7$SGrZe7!Gvik zYrHrdxByw1b#iE`G)ovM9hc_GGLk$9$)38vDVKB;B`=+<8zwY58WNK=?l#wkMkj_Q zMzE~=#TgH~3}^wz)2q1Qu*2LN5l)C-d^y9R1*FL^3~^E70lX1Nc7i$6po{RrLN`5A zn*%K<3<1Z@I-lt1c8h;Z*7&AlOkVIUKRnVi(@j_JO>oOQi#YcJGn^m6F@hTazl^(N zIdZ|$?F51wf>6WdLhZ!G5^Y#+aW=8oO&d>9zVz~oaEJR>eJeXys#L7g;WuA1jE~uO z4KFS)y|IK={dZt$*J=pJT=x@88%%H)&`G7-y+dXD0+Q-ADFm5!GqHl{v(@HPa77*AB~B zJ2K9z;qejCYi3^k2MA_-lY1>?Ucr-PerjH-c_n`nG~wnIyjkX_ZM<7wpsAe{@qkg+7`Y)kbTN!afN>Yr4YBR* z1;srmi=n7_(PvT2j@pB8D5DnUoD#+`9s|Y_i@|$!E_`u&>~7$QV?Zw`DLr=`F58E) zqU=dt-_>4!tw-_hM-SC?ucg_?rxLJ~+r-0hC}Ydg(AF_p=rd&ukDC!Km(q_z!#6-T);pX87c%2?--{_azd<0Xo7EmrIYAt*q!f$4Qy@u)6~krKh?F@z=rF>&Er#e`E7%u{n|KDpr#O>SelUfI+3F(VGg-A3AbF5fH; zW$nY1^S*lfsC`ThOS0WI+c07Kg;vqS-2xEBMBZjYE7~~Gt$&~f~gv4|HWUrMzl(B7T z=dY6z%RSlYrClku=9I*8uYrCitkV+9Jv8bCtHYdAJH=-OmVU$33r>n&oDn$wd6Wm^ zP*%N2*;h>othNnl*DF>orB!DIl7EiNZRuXyQ%35X#8UrH?qRxbQ;Mda7dVUJ8A`#r zAh7r`axd*lIl(?Bu*CDZUeG$M^vaKSk +function redirt(thisarea) { thisurl = '' + thisarea; window.location=thisurl; } + + + + + + + diff --git a/ledset/WpdPack_4_1_2/docs/html/Packet_8h.html b/ledset/WpdPack_4_1_2/docs/html/Packet_8h.html new file mode 100644 index 0000000..7f1f95d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/Packet_8h.html @@ -0,0 +1,201 @@ + + + + +WinPcap: Packet.h File Reference + + + + + +

+
+

Packet.h File Reference

#include "win_bpf.h"
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  packet_file_header
 Header of a libpcap dump file. More...
struct  sf_pkthdr
 Header associated to a packet in the driver's buffer when the driver is in dump mode. Similar to the bpf_hdr structure, but simpler. More...
struct  _PACKET_OID_DATA
 Structure containing an OID request. More...
struct  _INTERNAL_REQUEST
 Stores an OID request. More...
struct  _PACKET_RESERVED
 Contains a NDIS packet. More...
struct  _DEVICE_EXTENSION
 Port device extension. More...
struct  __CPU_Private_Data
 Kernel buffer of each CPU. More...
struct  _OPEN_INSTANCE
 Contains the state of a running instance of the NPF driver. More...
struct  PacketHeader
 Structure prepended to each packet in the kernel buffer pool. More...

Defines

#define MAX_REQUESTS   32
 Maximum number of simultaneous IOCTL requests.
#define Packet_ALIGNMENT   sizeof(int)
 Alignment macro. Defines the alignment size.
#define Packet_WORDALIGN(x)   (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
 even multiple of Packet_ALIGNMENT.
#define KERNEL_EVENT_NAMESPACE   L"\\BaseNamedObjects\\"
#define MODE_CAPT   0x0
 Capture working mode.
#define MODE_STAT   0x1
 Statistical working mode.
#define MODE_MON   0x2
 Kernel monitoring mode.
#define MODE_DUMP   0x10
 Kernel dump working mode.
#define IMMEDIATE   1
 Immediate timeout. Forces a read call to return immediately.
#define NDIS_FLAGS_SKIP_LOOPBACK_W2K   0x400
 This is an undocumented flag for NdisSetPacketFlags() that allows to disable loopback reception.
#define TCPDUMP_MAGIC   0xa1b2c3d4
 Libpcap magic number. Used by programs like tcpdump to recognize a driver's generated dump file.
#define PCAP_VERSION_MAJOR   2
 Major libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.
#define PCAP_VERSION_MINOR   4
 Minor libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.
#define NPF_DISABLE_LOOPBACK   1
 Tells the driver to drop the packets sent by itself. This is usefult when building applications like bridges.
#define NPF_ENABLE_LOOPBACK   2
 Tells the driver to capture the packets sent by itself.
#define C_ASSERT(a)
#define RESERVED(_p)   ((PPACKET_RESERVED)((_p)->ProtocolReserved))
 Macro to obtain a NDIS_PACKET from a PACKET_RESERVED.
#define TRANSMIT_PACKETS   256
 of packets that can be transmitted at the same time or with a single call to NdisSendPackets.
#define EXIT_SUCCESS(quantity)
 Macro used in the I/O routines to return the control to user-mode with a success status.
#define EXIT_FAILURE(quantity)
 Macro used in the I/O routines to return the control to user-mode with a failure status.

Typedefs

typedef struct _PACKET_OID_DATA PACKET_OID_DATA
 Structure containing an OID request.
typedef struct _PACKET_OID_DATAPPACKET_OID_DATA
typedef struct _INTERNAL_REQUEST INTERNAL_REQUEST
 Stores an OID request.
typedef struct _INTERNAL_REQUESTPINTERNAL_REQUEST
typedef struct _PACKET_RESERVED PACKET_RESERVED
 Contains a NDIS packet.
typedef struct _PACKET_RESERVEDPPACKET_RESERVED
typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
 Port device extension.
typedef struct _DEVICE_EXTENSIONPDEVICE_EXTENSION
typedef struct __CPU_Private_Data CpuPrivateData
 Kernel buffer of each CPU.
typedef struct _OPEN_INSTANCE OPEN_INSTANCE
 Contains the state of a running instance of the NPF driver.
typedef struct _OPEN_INSTANCEPOPEN_INSTANCE

Enumerations

enum  ADAPTER_BINDING_STATUS { ADAPTER_UNBOUND, +ADAPTER_BOUND, +ADAPTER_UNBINDING + }

Functions

 C_ASSERT (sizeof(PACKET_OID_DATA)==12)
NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 The initialization routine of the driver.
PWCHAR getAdaptersList (VOID)
 Returns the list of the MACs available on the system.
PKEY_VALUE_PARTIAL_INFORMATION getTcpBindings (VOID)
 Returns the MACs that bind to TCP/IP.
BOOLEAN NPF_CreateDevice (IN OUT PDRIVER_OBJECT adriverObjectP, IN PUNICODE_STRING amacNameP)
 Creates a device for a given MAC.
NTSTATUS NPF_Open (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Opens a new instance of the driver.
VOID NPF_OpenAdapterComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status, IN NDIS_STATUS OpenErrorStatus)
 Ends the opening of an adapter.
NTSTATUS NPF_Cleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Closes an instance of the driver.
NTSTATUS NPF_Close (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NPF_CloseAdapterComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status)
 Ends the closing of an adapter.
NDIS_STATUS NPF_tap (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_HANDLE MacReceiveContext, IN PVOID HeaderBuffer, IN UINT HeaderBufferSize, IN PVOID LookAheadBuffer, IN UINT LookaheadBufferSize, IN UINT PacketSize)
 Callback invoked by NDIS when a packet arrives from the network.
VOID NPF_TransferDataComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status, IN UINT BytesTransferred)
 Ends the transfer of a packet.
VOID NPF_ReceiveComplete (IN NDIS_HANDLE ProtocolBindingContext)
 Callback function that signals the end of a packet reception.
NTSTATUS NPF_IoControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Handles the IOCTL calls.
VOID NPF_RequestComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_REQUEST pRequest, IN NDIS_STATUS Status)
 Ends an OID request.
NTSTATUS NPF_Write (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Writes a raw packet to the network.
INT NPF_BufferedWrite (IN PIRP Irp, IN PCHAR UserBuff, IN ULONG UserBuffSize, BOOLEAN sync)
 Writes a buffer of raw packets to the network.
VOID NPF_WaitEndOfBufferedWrite (POPEN_INSTANCE Open)
 Waits the completion of all the sends performed by NPF_BufferedWrite.
VOID NPF_SendComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_PACKET pPacket, IN NDIS_STATUS Status)
 Ends a send operation.
VOID NPF_ResetComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status)
 Ends a reset of the adapter.
VOID NPF_Status (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status, IN PVOID StatusBuffer, IN UINT StatusBufferSize)
 Callback for NDIS StatusHandler. Not used by NPF.
VOID NPF_StatusComplete (IN NDIS_HANDLE ProtocolBindingContext)
 Callback for NDIS StatusCompleteHandler. Not used by NPF.
VOID NPF_Unload (IN PDRIVER_OBJECT DriverObject)
 Function called by the OS when NPF is unloaded.
NTSTATUS NPF_Read (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Function that serves the user's reads.
NTSTATUS NPF_ReadRegistry (IN PWSTR *MacDriverName, IN PWSTR *PacketDriverName, IN PUNICODE_STRING RegistryPath)
 Reads the registry keys associated woth NPF if the driver is manually installed via the control panel.
NTSTATUS NPF_QueryRegistryRoutine (IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
 Function used by NPF_ReadRegistry() to quesry the registry keys associated woth NPF if the driver is manually installed via the control panel.
VOID NPF_BindAdapter (OUT PNDIS_STATUS Status, IN NDIS_HANDLE BindContext, IN PNDIS_STRING DeviceName, IN PVOID SystemSpecific1, IN PVOID SystemSpecific2)
 Callback for NDIS BindAdapterHandler. Not used by NPF.
VOID NPF_UnbindAdapter (OUT PNDIS_STATUS Status, IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_HANDLE UnbindContext)
 Callback for NDIS UnbindAdapterHandler.
NTSTATUS NPF_OpenDumpFile (POPEN_INSTANCE Open, PUNICODE_STRING fileName, BOOLEAN append)
 Creates the file that will receive the packets when the driver is in dump mode.
NTSTATUS NPF_StartDump (POPEN_INSTANCE Open)
 Starts dump to file.
VOID NPF_DumpThread (PVOID Open)
 The dump thread.
NTSTATUS NPF_SaveCurrentBuffer (POPEN_INSTANCE Open)
 Saves the content of the packet buffer to the file associated with current instance.
VOID NPF_WriteDumpFile (PFILE_OBJECT FileObject, PLARGE_INTEGER Offset, ULONG Length, PMDL Mdl, PIO_STATUS_BLOCK IoStatusBlock)
 Writes a block of packets on the dump file.
NTSTATUS NPF_CloseDumpFile (POPEN_INSTANCE Open)
 Closes the dump file associated with an instance of the driver.
BOOLEAN NPF_StartUsingBinding (IN POPEN_INSTANCE pOpen)
VOID NPF_StopUsingBinding (IN POPEN_INSTANCE pOpen)
VOID NPF_CloseBinding (IN POPEN_INSTANCE pOpen)
BOOLEAN NPF_StartUsingOpenInstance (IN POPEN_INSTANCE pOpen)
VOID NPF_StopUsingOpenInstance (IN POPEN_INSTANCE pOpen)
VOID NPF_CloseOpenInstance (IN POPEN_INSTANCE pOpen)
NTSTATUS NPF_GetDeviceMTU (IN POPEN_INSTANCE pOpen, IN PIRP pIrp, OUT PUINT pMtu)
UINT GetBuffOccupation (POPEN_INSTANCE Open)
 Returns the amount of bytes present in the packet buffer.

Variables

ULONG g_NCpu
NDIS_HANDLE g_NdisProtocolHandle
struct time_conv G_Start_Time
UINT g_SendPacketFlags
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/Packet_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/Packet_8h_source.html new file mode 100644 index 0000000..f4293eb --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/Packet_8h_source.html @@ -0,0 +1,572 @@ + + + + +WinPcap: Packet.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h.html b/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h.html new file mode 100644 index 0000000..038ab6d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h.html @@ -0,0 +1,700 @@ + + + + +WinPcap: Win32-Extensions.h File Reference + + + + + + +
+

Win32-Extensions.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  pcap_send_queue
 A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit(). More...

Defines

#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
 This typedef is a support for the pcap_get_airpcap_handle() function.
#define BPF_MEM_EX_IMM   0xc0
#define BPF_MEM_EX_IND   0xe0
#define BPF_MEM_EX   0xc0
#define BPF_TME   0x08
#define BPF_LOOKUP   0x90
#define BPF_EXECUTE   0xa0
#define BPF_INIT   0xb0
#define BPF_VALIDATE   0xc0
#define BPF_SET_ACTIVE   0xd0
#define BPF_RESET   0xe0
#define BPF_SET_MEMORY   0x80
#define BPF_GET_REGISTER_VALUE   0x70
#define BPF_SET_REGISTER_VALUE   0x60
#define BPF_SET_WORKING   0x50
#define BPF_SET_ACTIVE_READ   0x40
#define BPF_SET_AUTODELETION   0x30
#define BPF_SEPARATION   0xff

Typedefs

typedef struct pcap_send_queue pcap_send_queue
typedef struct _AirpcapHandle * PAirpcapHandle

Functions

pcap_send_queuepcap_sendqueue_alloc (u_int memsize)
void pcap_sendqueue_destroy (pcap_send_queue *queue)
int pcap_sendqueue_queue (pcap_send_queue *queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
u_int pcap_sendqueue_transmit (pcap_t *p, pcap_send_queue *queue, int sync)
HANDLE pcap_getevent (pcap_t *p)
struct pcap_statpcap_stats_ex (pcap_t *p, int *pcap_stat_size)
int pcap_setuserbuffer (pcap_t *p, int size)
int pcap_live_dump (pcap_t *p, char *filename, int maxsize, int maxpacks)
int pcap_live_dump_ended (pcap_t *p, int sync)
int pcap_offline_filter (struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data)
int pcap_start_oem (char *err_str, int flags)
PAirpcapHandle pcap_get_airpcap_handle (pcap_t *p)
+

Define Documentation

+ +
+
+ + + + +
#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
+
+
+ +

This typedef is a support for the pcap_get_airpcap_handle() function.

+ +

Definition at line 59 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_EXECUTE   0xa0
+
+
+ +

Definition at line 71 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_GET_REGISTER_VALUE   0x70
+
+
+ +

Definition at line 77 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_INIT   0xb0
+
+
+ +

Definition at line 72 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_LOOKUP   0x90
+
+
+ +

Definition at line 70 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_MEM_EX   0xc0
+
+
+ +

Definition at line 67 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_MEM_EX_IMM   0xc0
+
+
+ +

Definition at line 63 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_MEM_EX_IND   0xe0
+
+
+ +

Definition at line 64 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_RESET   0xe0
+
+
+ +

Definition at line 75 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SEPARATION   0xff
+
+
+ +

Definition at line 82 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_ACTIVE   0xd0
+
+
+ +

Definition at line 74 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_ACTIVE_READ   0x40
+
+
+ +

Definition at line 80 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_AUTODELETION   0x30
+
+
+ +

Definition at line 81 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_MEMORY   0x80
+
+
+ +

Definition at line 76 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_REGISTER_VALUE   0x60
+
+
+ +

Definition at line 78 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_SET_WORKING   0x50
+
+
+ +

Definition at line 79 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_TME   0x08
+
+
+ +

Definition at line 68 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
#define BPF_VALIDATE   0xc0
+
+
+ +

Definition at line 73 of file Win32-Extensions.h.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef struct _AirpcapHandle* PAirpcapHandle
+
+
+ +

Definition at line 60 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
typedef struct pcap_send_queue pcap_send_queue
+
+
+ +

Definition at line 53 of file Win32-Extensions.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + +
PAirpcapHandle pcap_get_airpcap_handle (pcap_t p ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
HANDLE pcap_getevent (pcap_t p ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_live_dump (pcap_t p,
char *  filename,
int  maxsize,
int  maxpacks 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_live_dump_ended (pcap_t p,
int  sync 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_offline_filter (struct bpf_program *  prog,
const struct pcap_pkthdr header,
const u_char *  pkt_data 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + +
pcap_send_queue* pcap_sendqueue_alloc (u_int  memsize ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_sendqueue_destroy (pcap_send_queue queue ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_sendqueue_queue (pcap_send_queue queue,
const struct pcap_pkthdr pkt_header,
const u_char *  pkt_data 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
u_int pcap_sendqueue_transmit (pcap_t p,
pcap_send_queue queue,
int  sync 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setuserbuffer (pcap_t p,
int  size 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_start_oem (char *  err_str,
int  flags 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
struct pcap_stat* pcap_stats_ex (pcap_t p,
int *  pcap_stat_size 
) [read]
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h_source.html new file mode 100644 index 0000000..aaf8804 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/Win32-Extensions_8h_source.html @@ -0,0 +1,139 @@ + + + + +WinPcap: Win32-Extensions.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/annotated.html b/ledset/WpdPack_4_1_2/docs/html/annotated.html new file mode 100644 index 0000000..5db948a --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/annotated.html @@ -0,0 +1,70 @@ + + + + +WinPcap: Data Structures + + + + + + +
+

Data Structures

Here are the data structures with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
__CPU_Private_DataKernel buffer of each CPU
_DEVICE_EXTENSIONPort device extension
_INTERNAL_REQUESTStores an OID request
_OPEN_INSTANCEContains the state of a running instance of the NPF driver
_PACKET_OID_DATAStructure containing an OID request
_PACKET_RESERVEDContains a NDIS packet
active_pars
activehostsKeeps a list of all the opened connections in the active mode
binary_streamA stream of X86 binary code
daemon_slparsStructure that keeps the parameters needed by the daemon_serviceloop() function
JIT_BPF_FilterStructure describing a x86 filtering program created by the jitter
packet_file_headerHeader of a libpcap dump file
PacketHeaderStructure prepended to each packet in the kernel buffer pool
pcap_addrRepresentation of an interface address, used by pcap_findalldevs()
pcap_file_headerHeader of a libpcap dump file
pcap_ifItem in a list of interfaces, used by pcap_findalldevs()
pcap_pkthdrHeader of a packet in the dump file
pcap_rmtauthThis structure keeps the information needed to autheticate the user on a remote machine
pcap_sampThis structure defines the information related to sampling
pcap_send_queueA queue of raw packets that will be sent to the network with pcap_sendqueue_transmit()
pcap_statStructure that keeps statistical values on an interface
rpcap_authStructure that keeps the data required for the authentication on the remote host
rpcap_filterGeneral header used for the pcap_setfilter() command; keeps just the number of BPF instructions
rpcap_filterbpf_insnStructure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header
rpcap_findalldevs_ifFormat of the message for the interface description (findalldevs command)
rpcap_findalldevs_ifaddrFormat of the message for the address listing (findalldevs command)
rpcap_headerCommon header for all the RPCAP messages
rpcap_openreplyFormat of the message of the connection opening reply (open command)
rpcap_pkthdrFormat of the header which encapsulates captured packets when transmitted on the network
rpcap_samplingStructure that is needed to set sampling parameters
rpcap_startcapreplyFormat of the reply message that devoted to start a remote capture (startcap reply command)
rpcap_startcapreqFormat of the message that starts a remote capture (startcap command)
rpcap_statsStructure that keeps the statistics about the number of packets captured, dropped, etc
sf_pkthdrHeader associated to a packet in the driver's buffer when the driver is in dump mode. Similar to the bpf_hdr structure, but simpler
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/classes.html b/ledset/WpdPack_4_1_2/docs/html/classes.html new file mode 100644 index 0000000..8ed33f1 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/classes.html @@ -0,0 +1,45 @@ + + + + +WinPcap: Alphabetical List + + + + + + +
+

Data Structure Index

A | B | D | J | P | R | S | _
+ +
  A  
+
  P  
+
pcap_send_queue   rpcap_header   sf_pkthdr   
active_pars   packet_file_header   pcap_stat   rpcap_openreply   
  _  
+
activehosts   PacketHeader   
  R  
+
rpcap_pkthdr   __CPU_Private_Data   
  B  
+
pcap_addr   rpcap_auth   rpcap_sampling   _DEVICE_EXTENSION   
binary_stream   pcap_file_header   rpcap_filter   rpcap_startcapreply   _INTERNAL_REQUEST   
  D  
+
pcap_if   rpcap_filterbpf_insn   rpcap_startcapreq   _OPEN_INSTANCE   
daemon_slpars   pcap_pkthdr   rpcap_findalldevs_if   rpcap_stats   _PACKET_OID_DATA   
  J  
+
pcap_rmtauth   rpcap_findalldevs_ifaddr   
  S  
+
_PACKET_RESERVED   
JIT_BPF_Filter   pcap_samp   
A | B | D | J | P | R | S | _
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/daemon_8h.html b/ledset/WpdPack_4_1_2/docs/html/daemon_8h.html new file mode 100644 index 0000000..9356c74 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/daemon_8h.html @@ -0,0 +1,81 @@ + + + + +WinPcap: daemon.h File Reference + + + + + + +
+

daemon.h File Reference

+

Go to the source code of this file.

+ + + + + + + +

Data Structures

struct  daemon_slpars
 Structure that keeps the parameters needed by the daemon_serviceloop() function. More...

Functions

void daemon_serviceloop (void *ptr)
void pthread_suspend (int msec)
+

Function Documentation

+ +
+
+ + + + + + + + + +
void daemon_serviceloop (void *  ptr ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
void pthread_suspend (int  msec ) 
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/daemon_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/daemon_8h_source.html new file mode 100644 index 0000000..c1676ed --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/daemon_8h_source.html @@ -0,0 +1,82 @@ + + + + +WinPcap: daemon.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/deprecated.html b/ledset/WpdPack_4_1_2/docs/html/deprecated.html new file mode 100644 index 0000000..b6e9016 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/deprecated.html @@ -0,0 +1,51 @@ + + + + +WinPcap: Deprecated List + + + + + + +
+ + +

Deprecated List

+
+
Global pcap_file
+

Due to incompatibilities between the C Runtime (CRT) used to compile WinPcap and the one used by WinPcap-based applications, this function may return an invalid FILE pointer, i.e. a descriptor that causes all the standard I/O stream functions (ftell, fseek, fclose...) to fail. The function is still available for backwards binary compatibility, only.

+

+
+
+

+
+
Global pcap_lookupdev
+

Use pcap_findalldevs() or pcap_findalldevs_ex() instead.

+

+
+
+

+
+
Global pcap_lookupnet
+

Use pcap_findalldevs() or pcap_findalldevs_ex() instead.

+

+
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/doxygen.png b/ledset/WpdPack_4_1_2/docs/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..f0a274bbaffdd67f6d784c894d9cf28729db0e14 GIT binary patch literal 1281 zcmaJ>ZA?>F7(Vx-ms?uoS`b@hdRtpo6o^%HU>M$hfGrBvQnk$LE?p^P!kn&ikhyq! zX~V@&tPF5Qt@V?oTL96Bi%aRiwbe1)9DWQI#?)=HxS7QSw`J`5fAJ*eJbB;uNuKA& zdERDo*{Y<(If(#(B$Lr#;nB(8Y#ia=ZCeW?JfPLuQY`=@cW$k}Rivq|vbxGrRq1Tl9;+(gNt?}UtVKM2`T5t1jLzuL@0UIs`S#vlhl4)^ zLgSYrPj@$+`|j?eSbXTmiHGkWxV8V}BzNR?pl9k_s4pDu9vd5a_UzZEPk)}Ad{AV_ zzddrjrh4=Imr`E06;LY{)YYt?o}L~H@7C}F^WB!Ra=v`Q0bj{>5&$66CWF>mf6vjP z2N>RRY6ZYa=K`76>+|_)Xdwko+7wv}7cN|btOhWb(*{sta~6b?S8Omrxw}!4`NhGr zZVpNqpu1@BE`QGWNTpEpcJVW5izu~2B^GlM?1(OPg)zwW;QcP@Ltcclm>XbJL9C|j z=9!2?ua=uIlf0%AndzHsRC}IyTL$EhAee(fdKB`?27KeS^2M8M_7b~PiCFO&r5LC7 z7gl1*a<8;SjNaw#h=843_AV9iZbWQOAp5YOC^&_F*9K0> zB|6%IDb?aM#3viTxkLU4aXg&@+CkNTOnQ1iMP*^?b|^lJy$4C)Zk4isV!|RZ*XhXh zw8q3$=*0LeGC!XI_Wc?dkT~3+*Gu%%yIqP+Wr3H$=&ROMQU6q}Ag^P~>c5vAEO;a- z_dK-3PPeKar%)6$j~vI2#*-YH!1h6HYVtwCX5_wM`iF#UKz&&@9Oo5w3%XGYrX zW>dY~)SG-((Yim%`InwgTvyRC?e=Wh^8KCao!R6Eg&TpVWUY1sN~4G}V?nFnEGo-; zHZ_$eW9-GnC%^WS9b z@p;-$oH#MtC0v>Q$HX%4^JdFdO$0cbv-W)Q TtK}Eh@>>I#ipmV1>S*>q-hkC} literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/doxygen__groups_8txt.html b/ledset/WpdPack_4_1_2/docs/html/doxygen__groups_8txt.html new file mode 100644 index 0000000..8935e3b --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/doxygen__groups_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: doxygen_groups.txt File Reference + + + + + + +
+

doxygen_groups.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/dump.gif b/ledset/WpdPack_4_1_2/docs/html/dump.gif new file mode 100644 index 0000000000000000000000000000000000000000..dfc0af8710ebd421e94f20cf015adf014495cec6 GIT binary patch literal 6353 zcmeH`i8~XH&M0?|B;_s@xh19Cipni#mhdS@xz(rK#>^bs%ze#$gxQ#*oHO^$ zoWpEJ?hW(%e*cc&_w|0B_aE?jp4W2&eN{Cl=((ro4w?Q79DfG?&+sm1|M~y%KLh`t z3`o$J&oMDwWRm}H3IA<^=`w@q++~p$RoQL-UcM%4*Ikv<5ydTO2)C+=_!B1}=RDh8 zo!6CkLoZgupeDZuENua0ewJ_uDuo_J*@=U{@a?;Wr5C6CJ-mv7Fu>MapWFse90%fE7t+Ov(jbKO7hW^rL? zyX1)ItDGUYoE{#5JF^C`lu+Oq@y>!* z)24uJxc0?p(Dw@}M`Na!hJV=p_}5+~$yi{gEBo1X_4S-k&6m-O#y4M$K_B1J_ppz7 z=|8y`b6@fVz|xOPxzZAG<|x7C#OLK-C3Kmqe&hn5DXO?eK2~B)1F7Gi8csH+ zOA!+c#NHOzKQ)ap2fq{(S_L~3RwR==3P)$b7D23Tpf`V}R)4%vCfmk&@(YjdWasc3$(9y5H-4;L=jYDK9N%C=R)o+|fPy>i>RyFYpLP}k1+OqtJZmoJIVglV6h$R<8vFTd+5ah+3c z*g&$;FV94SQ)cv~4ut#N?FU|?ac|_J{Ks8kw*HeIK>LGf3$FNp_z$)A0Yg3=3Wswx zX!{06)TialhjYQZn}-YB8=^-Mq1OoF3sI64N6VJsbE@$%dKF^J;N`a{;-V7*6%6wQ zX0BzW2{f$_fE?7n@cyFG$yHs7#}pQ!mY^?nYZb>-%ppE$v%%tv`bKAo7-sUfulLE{ zF)1I~4sJ#TvwQKpcBa5;<#jhvjj{wpqkCiFfA?KR;%Mu7iRS2TZz+%D6iTd=uX49>&?_)p zBsEo^)zAX?DzVPb+3X~}_r|aF*z(c*d%@{_rs~zexD`S9iPwfM+U$_#QMPg3+qjSY z_d$HYMCEhD8eQ347|zl)E?datv8hxvJ5RoJk@5rH1DxCEvdQ$10Z$Y&;uDJ)nzm{R z7oNNa0^!H5W;!~8{0^6RrIqAS>mJd{XE<$biU#M_x#ayIsNu%*0~7m$JG)c3+nY@5?$tjGw6b zjl*(ZmuWw{Y&(!Vj&gpjZ)-AO|HyIz<*qDgk>F{AH+-9S{&IQvMatVLw#oQ=D%I~q z%bYIS{=s}-tME=Rb`ocwYE?E_BXnG3jUtjc-Y*j!)F9{zucKg4OQr_X8KR zs6zD9it~r1q(ZAdH(Wl&snMMU&5*zPIIEpGYg&b8CS~uZmdJ)1!y#;_g9Cak>q{V&@kEM8VBgox`v4?|yMN47h@)aHBN1%uey=j4+lx>W z{S{(*4QVbR+qbJI^WnC(o`L-GmRZ zV>WI(l!rMhR>p4btcjZ7;zxhg0CsCld7+vQuO{w!>UZsoB$Tzf(? zTGs7`0&J-o8Pmr6_w@kMQ4Ja(E4XiS22Sz=6ur1!__c|_@+?0l9KFOAcPRM`Vb&ux zna4cS<@ddVC0oEo<;2%f30DnW74!vUsVI_2@Vf z6mp4k%n+P0qAxoCn}61W0tL#O{uO2n*)nk~1p6Sl%Dkwla}Ep92aE$Z-O zRXm!8+w$AnBVqJ(%;pCx#rF9uPj#)&Y$gW84t%Ra9|L@>=eEFyf%~Cq->|P2pM#G~ zmBa3W#4U+M$+U<5+EO`ZuSjPgy3DUIVIRic?%nnnd;ou5PD;X>?+krt>z4J>UjN5U z3!cHFgF~em`+uI52Bl|rHa3J?pWSZ4MsIih15MTgTK-d_qBzF?Ij%6AUG?FZ-_4qa zU=G!=3m#rSdG(JTeN6HyS=(dj8RG z)Z|CXv%rV`yAxq|R6}Hr6n@v3Dn>uZbTvLHjQCUN{Xp;6>pq~TKez?{^-MQfT>9qoB8>0Q&{_3~ ztA~PbG$1hj({z5Mb+ngPcNl-ek1Ofl{3mr8R^5irRKqPjqGKk*BZ|K*?L_Xq`Wd%+ zOXg6 zM5b-fE$iglfyvSt$+D~<3AIE?RPsF`2Kc@j_@Mzvfdss34OT~iHK)M*fnZWPSX(XS zsdb7RYs!jriasjEcq&B)m9)K>@=6V25tA}soFWY1))4}+DuFHzB}tZW^P#xk8E~J! zk?KrKatus$i{XAxN|gmb#-btDWw-?ZX;)*?+ zdzGX{l%)FzrI}9&NR_0i7-Rrx>1i<;P}bBh2I)Z=;A~cCnh-RkCtY3*`fUpInKhv# z29(+ZfyF>GdNQJ?px;YUe`Tck#iSY1pmiCr1^`qV1?}^I=>T9(G-wJ6-q{1QHb_rL z!G>wD=s@_Wb!N3%28bbJ0*--CPNjwk!Ce5ULMV8oT4sn4qBaB3i%LyGWk!rF5S3mqmDNnkTFJ<2C&8v!v&yBiASA?CVAi@&=0FTAd@B2bETWwi&S#h{ zZUFD}fG-C^qiC5~fUKM9&`j2xS`zHgAS(foD-o1(DJc6^4_tgB{k~xi)H+X8J#T`R zIT@3u)szd1$wAU`>7X2YTIxP2%_b(F35fuZAZER(@dgOvrhFbG;x!#&WLR*~FyB!R z@=mx=uOtW7o#Px-=%JqPKraAH7kUfldG;3ie8^`}D$+M7H1{YBXet8478Mp1g$NhF z+bCjWuoQm}DmF1F4u4-9Jze~?q}aWy7^q&N!CG?nPDu*1hN31@FgBgE!EQZLK5M#9+2 zKoVt^HWgEVw6l!zJ8Zd<>ev*Q?%uBOz(CRhT z?6*NM^mKuKUlLTd(ApMaJ0oOI{xzXq=p@JMa=p+|4kAHz2N*$qZxnjTz4x(g&{Aty zc5eu>1%LJQVWBld$T_?>O8REo7&)Wb-4M&NN{(sfj_1}eoCl^TpnhoPWo z6uhr7wC_{q^`=~nrhMC`!r&(0G3r@VQ`t;Y#c@-W1`0XjS8a=~4@Nh7qH0V1Q8Vb4 zV{`=??ZblkZHwuQL$wEg=|W?0eV87ybEYSE3OiFGj2pzT<&HCIW|KhATxXg@H_wq# z%%J8e&*t&qrU4_DTsdw?UrQ3Xg=pJ6D%Y}0Zr=CAZU$p73^nf0U{B>*PD-)oBBkX%rA;1(lF|&mBac3Sbui=FI4SKTrC6nt7M1vp zt7Yh2x!9eI?Q{O{$N-_J4FG;-@T%@vSj(BCk(cT;e;- zMOv5pe%r_Y-YfkbfN6Uv-z;#_sbSm>!0|FX<*}3OZR#AI592X@b}f z&5lV zLf@PCA=`L#jYtnRcyMB3$V7zEwSmF8e{9nT>BQmw9DCxF?7Pt+=-bVq(q6r1!F_+_ zx>m@8Z#g=S$epq99=(q^U1N;eX_%;1w*jSBZ?ijhwpU4W^zCV@zCzE<=Aj#+=xdy< zP4dmdWqmnz-EFv@0r?U4(?Raju`16Io&GkM@raw(*!%KvJ>%|wPWyeDNBo*69`*O4 zjE9rUMzuNnBtwTBI49FZ#;1?5R$gO|`+xsv9*q{AdTKw)l`xWEKg?#*_Rs9FZpa^R zyUu%F6VCP>49}6c&57OF3FH2O8U?%wXT-AIjB)wQT*!>eCN*eT7*5$_*2n^^V$o{4h!q2^IGl;Y%L2MgavZK z!o|HgF6~8LhsE<;i%ho``CAr62#Z&!V`5@UHx-uzD|Cbzgi9d89WDZ^6X9ap(uHhp z7R6;HQ*LD-_oFawhS#zZeo29_bYj1>SGy!_y0W6ctr)iSqGfqWi+i_xMIXOnRIeMl zXGJ1Sbd|CGVD$=hO$)yoz_s=gvF62CGocdSx2*e{uEh|DPl0O@1VV_SHduREHf;Gh zo*3XjFbX4msaQwg*P{reJi@x4;`)I-Y4*Z~0fMC5LefMKH%^yaO^H^f8yeJ=ItOyC zHW4GXa-(G<%zM3AaXs04Im?vPNL_9UqXbbYm=?;bijBkmjfv%rqA-Fwfm}`9B$#eS zhY|5Dn`2^|C5nq6Z^}Du%1**sqV_t4K>9(QZxP!ntk~E#-GUR=_Z2BVp_}j)>H?4= z$Ji_t zHQV>dQu|sJG`((Q?EQsaG`ls(mWOEXZQmP1YPRvK+=>R zu-Hcv;tMWV;+?aj1;+R)Y(=KUnz`T_*<@^`d#CO!KXVZbY0DQubb%99n*!B=HP*%X)al zAVuc&2VRdMqEWh%8$Mr+XW0<0=1*Oj8d>X1RsP8(Wiu*m%wzyjbekR}Sror4FfFhd h+jw1O{p-Hg^ceYVmD3-fl{RM6| zmJMaxG{ut*eaeTiN{)%{Kq77=59GSCFhrEoFVKm)P|Jm^oG6t;OWBf;rJr%IQXPzu zAnhyOGRkg*BuJgAvv&-O(NKc-q&doE!E>k9tuoF{u(SP|qT9UlGv1hN!+Or=g^!%8 zo58~8dm-oLZsfFX%}0q(tNK6A*t0E6T!!G{VIDT^?>J=EP(r(KvI1A|)00Dj(^P;l zTHpQ7Px4fQ-v^zMXAJt%UoP`@?nnEGUILBo+>z)BPqjX+3umx?Sk1}_`R)xJhzIX@Oi^I_ zX%&n9XCqtff~XDH!ia>sSF?Oz*V>jNuCbcOF`%*r4qr_q}++u z(s61V-@l?YKUX@Wn4fT#nQ8OQzS1+4ty)WetV&zUfawF*GdXze*WX$?SFLB+_|w+0 z_OZZ?Y^O*dEax?@Y9rUZWoSJI(GR5NBeS?%3IaE(D)It$Xw-KRh*_7SXrV-EQLHS! zGB;k4{=L*r^#ZLd)5wTcj zU;=iIuF%+!%hgJ}CbHMiTf zCRIad0$e_(H7~G(y?c4oI(I%EP&VrbBXrT-oE6A%{U_;=t<9lwtE4?r6`s5|oYukf zll-E@_zp>RY3t3XW=?c)>!|wFh(Vt=k9lb``wL1?02`bJl06mdT=^J{ANlMVwa*oDRQ; zI9v|Cl6<(5M63;5O*P;dlki62{c2M^CS>b{g<75wEz^RGNUQ}@@Yq|dZ;N?dsJql9y|B%~ zb)R~tgs-FDo$wFpaL6X3zJQ9@FRJ&Pn5RaZNEdSKwrDdZ>w`I+iU1GedwAK$qy09& zoq=-p0u;TXZ-JMoFhe!LWI~L9%<`#MJhTVy<<3$Svu7Q)LM3CB;uOKxc{SSfy1f-c zL79}3GES%rMA=JMPxQNvx*qkE_D zFnMG#D-#Wo{Q8bt_^Y-60Hy@eD+T}tiv}LRAR4)2!9oIeCGR;K8VkUJ`SuHh+RNeW zq)|5=fdcs$ppO`RB!^;F(zk}wFMlKx8uq+G_W>S=p$q*1EHf~|RGH4V8{u{ui!E+E zGb09z*11jM?JzeiKZ-nQ^nq79+di`z!w7KqAN)Wc^|y zQWaKVdwJlTIT!=rv6h`@nGM(&H_qX*OtKgmgAsm&cvnzsB>+(fnNmvgb8Sj~yWJD^ zW+AuPzkaC~i?lXgp!S10x*6DBDbL2xjx)V&Xp1CFQmc%pXK>f=MOVKXOJY}D zkh%Hd_Kv?pSUEU^@mqnlGu_R{;S~l*s+#AYdD?r=tAMA*URk-V$Jt0JdUgLBmxM*H zkaLEO8hM#7q|Gfo(@6#@*8WFEpf6hchoouEtA{Otsj^|p;&Af7)i2q}YNMqXUlc@q z+Iv99d4)-~&=N5sq=65l&z`ufDMA__{G>thXyJ-l7vIr2PTDzE!IT&nvSSxx)4Ff+;JdP@DMcOm5}W5GpPXl@)S zZku^8@Dp@^5PwdlDQhu%V`%mlMq6wJAiYi9FxNyFjH*bxSzW)6TCh0Yx{7nwzvgXe + + + +WinPcap: fileconf.h File Reference + + + + + + +
+

fileconf.h File Reference

+

Go to the source code of this file.

+ + + + +

Functions

void fileconf_read (int sign)
int fileconf_save (const char *savefile)
+

Function Documentation

+ +
+
+ + + + + + + + + +
void fileconf_read (int  sign ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
int fileconf_save (const char *  savefile ) 
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/fileconf_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/fileconf_8h_source.html new file mode 100644 index 0000000..6981255 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/fileconf_8h_source.html @@ -0,0 +1,74 @@ + + + + +WinPcap: fileconf.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/files.html b/ledset/WpdPack_4_1_2/docs/html/files.html new file mode 100644 index 0000000..aedd63d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/files.html @@ -0,0 +1,50 @@ + + + + +WinPcap: File Index + + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2blank.png b/ledset/WpdPack_4_1_2/docs/html/ftv2blank.png new file mode 100644 index 0000000000000000000000000000000000000000..493c3c0b615ade5b22027bde773faf2c0e076d66 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr2qYM%T@!Q%(o7{me!&ckj8p!u14)&*MwA5S zr6z#mEsk^N1FBF3sc_EE%}vcKVF=AhO-xa6_jFST&P^;T z2~I3aEm8;rVk12R#UIz>f`J-DJY5_^DsClP9B62eH+WF*G=YJMp~A-KbWwke5Kx}M M)78&qol`;+0EL(^EC2ui literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2doc.png b/ledset/WpdPack_4_1_2/docs/html/ftv2doc.png new file mode 100644 index 0000000000000000000000000000000000000000..f72999f92172cca6edaa2538286b3e369bec9f49 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^5yjnX4egh%q=bp-`Pe zR7&bp17l3gfhmh7Fm(iZ2eAfco|q!h5)>qKG?UBh!IC9QGMbJAHf6IEiufk_g|d7~ qkWqJ4k(|I-Aeo-5U~n{Fnc?dN!3Uwu?t6hQVDNPHb6Mw<&;$TLIZ`G7 literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2folderclosed.png b/ledset/WpdPack_4_1_2/docs/html/ftv2folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d063440cbf13c4128dacd96661b6fce58abf26 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^55uo^`BphW;jCHO69?}tw{JfcdnZ<*@N=4I z?xF5Qc|QYEmKAIZ;JRGVHe=bn*tx1_|J^^vyg*oVM#A1kZlFULJYD@<);T3K0RTgB BWg7qh literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2folderopen.png b/ledset/WpdPack_4_1_2/docs/html/ftv2folderopen.png new file mode 100644 index 0000000000000000000000000000000000000000..bbe2c913cf493ee37ad8e3a5132382138d93ac92 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^5u(C zYP)Mg%H-DB+{J~>rPn_#pYTax?r*V6ubqGX{lvROQ{?n5_cbm+cQAOm`njxgN@xNA D92;js literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2lastnode.png b/ledset/WpdPack_4_1_2/docs/html/ftv2lastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..e7b9ba90cb0cf71c8ce662956bfee7d64cf60fa6 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6UZ?L@CkAK|NlRbNhD}!Xpp$P zU;Pg)ksC(lf|p%(p+w2Gk+!>EaktaVt4N i!r*{E4>QXNV>t$uAA#a^n)TVt_DW*G8-srQl%FeIsRSdYm zeDdtWec}u&7@8h5rqv#p7g*pRdwwmugmlS-+cHV~j}#7`Nwj9m+AU)JGGo`8z_}`K z?s#Xsy%Z;1_jl5Y+?Gum8WyK6`MBvup0SAOKJ)mWcHyteJ?WLL>>-)=?&<$H&t5oH Vd!azZ1yDdSc)I$ztaD0e0sw}(dc*(# literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2mlastnode.png b/ledset/WpdPack_4_1_2/docs/html/ftv2mlastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..09ceb6adb01054ce799ad20c0e818ab9272f2df2 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr#LU3Jc=+&fg$isFPOjJ*AaIJQGm()YSDb0rfjgNefXW#>UHx3vIVCg! E0ORy6RsaA1 literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2mnode.png b/ledset/WpdPack_4_1_2/docs/html/ftv2mnode.png new file mode 100644 index 0000000000000000000000000000000000000000..3254c05112199fbc80aad313611c58a5b388792d GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6Ub2s@Ck7}aNq!ti3c<^Gz9OH zn+a6GSQ6wH%;50sMjDVKR^l2_5}cn_Ql40p%8;I!W>k=uu3)5RqGz-?&YcgaLd(;| zF{I*Fa>4?=2W(CyOv{5p*uLi}G<-ambjQcb>&~4!CzK3KXWY6d$*{eWU47N}X+XCz OFnGH9xvXPg)ksC(lf|p%(p+w2Gk+y>EaktaVt4N l!r*{E4>Lv;t literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2plastnode.png b/ledset/WpdPack_4_1_2/docs/html/ftv2plastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..0b07e00913d8069ebbb51bd7fd6d70d8bba88f75 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr#LU3Jc=+&MJ literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2pnode.png b/ledset/WpdPack_4_1_2/docs/html/ftv2pnode.png new file mode 100644 index 0000000000000000000000000000000000000000..2001b797ba2b98a4127f1d3efca64aef08bf6d51 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6Ub2s@Ck7}aNq!ti3c<^Gz9OH zn+a6GSQ6wH%;50sMjDVKR^l2_5}cn_Ql40p%8;I!W>k=uu3)5RqGz-?&Ycga!obtT zF{I*Fa>4?=2W(Dkd1@Anj~<0|oqBMOmqox%*rjK-r)THv+0v0L%h-agt(X~hWwYzA SIxU|Ma*U^|pUXO@geCywmoZiV literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ftv2vertline.png b/ledset/WpdPack_4_1_2/docs/html/ftv2vertline.png new file mode 100644 index 0000000000000000000000000000000000000000..b330f3a33c0085c183ff39fc56b1b274160c1da0 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6UZ?L@CkAK|NlRbNhD}!Xpp$P zU;Pg)ksC(lf|p%(p+w2Gqgt>EaktaVt4N e!r*{^G#i7W2*a|cHZQDzQVgE1elF{r5}E+)J2fZ( literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h.html b/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h.html new file mode 100644 index 0000000..f289707 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h.html @@ -0,0 +1,176 @@ + + + + +WinPcap: pcap.h File Reference + + + + + + +
+

pcap.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

Windows-specific Extensions

The functions in this section extend libpcap to offer advanced functionalities (like remote packet capture, packet buffer size variation or high-precision packet injection). Howerver, at the moment they can be used only in Windows.

+

PAirpcapHandle pcap_get_airpcap_handle (pcap_t *p)
 Returns the AirPcap handler associated with an adapter. This handler can be used to change the wireless-related settings of the CACE Technologies AirPcap wireless capture adapters.
int pcap_offline_filter (struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data)
 Returns if a given filter applies to an offline packet.
int pcap_live_dump (pcap_t *p, char *filename, int maxsize, int maxpacks)
 Save a capture to file.
int pcap_live_dump_ended (pcap_t *p, int sync)
 Return the status of the kernel dump process, i.e. tells if one of the limits defined with pcap_live_dump() has been reached.
struct pcap_statpcap_stats_ex (pcap_t *p, int *pcap_stat_size)
 Return statistics on current capture.
int pcap_setbuff (pcap_t *p, int dim)
 Set the size of the kernel buffer associated with an adapter.
int pcap_setmode (pcap_t *p, int mode)
 Set the working mode of the interface p to mode.
int pcap_setmintocopy (pcap_t *p, int size)
 Set the minumum amount of data received by the kernel in a single call.
HANDLE pcap_getevent (pcap_t *p)
 Return the handle of the event associated with the interface p.
pcap_send_queuepcap_sendqueue_alloc (u_int memsize)
 Allocate a send queue.
void pcap_sendqueue_destroy (pcap_send_queue *queue)
 Destroy a send queue.
int pcap_sendqueue_queue (pcap_send_queue *queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
 Add a packet to a send queue.
u_int pcap_sendqueue_transmit (pcap_t *p, pcap_send_queue *queue, int sync)
 Send a queue of raw packets to the network.
int pcap_findalldevs_ex (char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
 Create a list of network devices that can be opened with pcap_open().
int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
 Accept a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0').
int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
 Parse the source string and returns the pieces in which the source can be split.
pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
 Open a generic source in order to capture / send (WinPcap only) traffic.
struct pcap_samppcap_setsampling (pcap_t *p)
 Define a sampling method for packet capture.
SOCKET pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
 Block until a network connection is accepted (active mode only).
int pcap_remoteact_close (const char *host, char *errbuf)
 Drop an active connection (active mode only).
void pcap_remoteact_cleanup ()
 Clean the socket that is currently used in waiting active connections.
int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
 Return the hostname of the host that have an active connection with us (active mode only).

Unix-compatible Functions

These functions are part of the libpcap library, and therefore work both on Windows and on Linux.

+
Note:
errbuf in pcap_open_live(), pcap_open_dead(), pcap_open_offline(), pcap_setnonblock(), pcap_getnonblock(), pcap_findalldevs(), pcap_lookupdev(), and pcap_lookupnet() is assumed to be able to hold at least PCAP_ERRBUF_SIZE chars.
+

typedef void(* pcap_handler )(u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
 Prototype of the callback function that receives the packets.
pcap_tpcap_open_live (const char *device, int snaplen, int promisc, int to_ms, char *ebuf)
 Open a live capture from the network.
pcap_tpcap_open_dead (int linktype, int snaplen)
 Create a pcap_t structure without starting a capture.
pcap_tpcap_open_offline (const char *fname, char *errbuf)
 Open a savefile in the tcpdump/libpcap format to read packets.
pcap_dumper_tpcap_dump_open (pcap_t *p, const char *fname)
 Open a file to write packets.
int pcap_setnonblock (pcap_t *p, int nonblock, char *errbuf)
 Switch between blocking and nonblocking mode.
int pcap_getnonblock (pcap_t *p, char *errbuf)
 Get the "non-blocking" state of an interface.
int pcap_findalldevs (pcap_if_t **alldevsp, char *errbuf)
 Construct a list of network devices that can be opened with pcap_open_live().
void pcap_freealldevs (pcap_if_t *alldevsp)
 Free an interface list returned by pcap_findalldevs().
char * pcap_lookupdev (char *errbuf)
 Return the first valid device in the system.
int pcap_lookupnet (const char *device, bpf_u_int32 *netp, bpf_u_int32 *maskp, char *errbuf)
 Return the subnet and netmask of an interface.
int pcap_dispatch (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 Collect a group of packets.
int pcap_loop (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 Collect a group of packets.
u_char * pcap_next (pcap_t *p, struct pcap_pkthdr *h)
 Return the next available packet.
int pcap_next_ex (pcap_t *p, struct pcap_pkthdr **pkt_header, const u_char **pkt_data)
 Read a packet from an interface or from an offline capture.
void pcap_breakloop (pcap_t *)
 set a flag that will force pcap_dispatch() or pcap_loop() to return rather than looping.
int pcap_sendpacket (pcap_t *p, u_char *buf, int size)
 Send a raw packet.
void pcap_dump (u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
 Save a packet to disk.
long pcap_dump_ftell (pcap_dumper_t *)
 Return the file position for a "savefile".
int pcap_compile (pcap_t *p, struct bpf_program *fp, char *str, int optimize, bpf_u_int32 netmask)
 Compile a packet filter, converting an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.
int pcap_compile_nopcap (int snaplen_arg, int linktype_arg, struct bpf_program *program, char *buf, int optimize, bpf_u_int32 mask)
 Compile a packet filter without the need of opening an adapter. This function converts an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.
int pcap_setfilter (pcap_t *p, struct bpf_program *fp)
 Associate a filter to a capture.
void pcap_freecode (struct bpf_program *fp)
 Free a filter.
int pcap_datalink (pcap_t *p)
 Return the link layer of an adapter.
int pcap_list_datalinks (pcap_t *p, int **dlt_buf)
 list datalinks
int pcap_set_datalink (pcap_t *p, int dlt)
 Set the current data link type of the pcap descriptor to the type specified by dlt. -1 is returned on failure.
int pcap_datalink_name_to_val (const char *name)
 Translates a data link type name, which is a DLT_ name with the DLT_ removed, to the corresponding data link type value. The translation is case-insensitive. -1 is returned on failure.
const char * pcap_datalink_val_to_name (int dlt)
 Translates a data link type value to the corresponding data link type name. NULL is returned on failure.
const char * pcap_datalink_val_to_description (int dlt)
 Translates a data link type value to a short description of that data link type. NULL is returned on failure.
int pcap_snapshot (pcap_t *p)
 Return the dimension of the packet portion (in bytes) that is delivered to the application.
int pcap_is_swapped (pcap_t *p)
 returns true if the current savefile uses a different byte order than the current system.
int pcap_major_version (pcap_t *p)
 return the major version number of the pcap library used to write the savefile.
int pcap_minor_version (pcap_t *p)
 return the minor version number of the pcap library used to write the savefile.
FILE * pcap_file (pcap_t *p)
 Return the standard stream of an offline capture.
int pcap_stats (pcap_t *p, struct pcap_stat *ps)
 Return statistics on current capture.
void pcap_perror (pcap_t *p, char *prefix)
 print the text of the last pcap library error on stderr, prefixed by prefix.
char * pcap_geterr (pcap_t *p)
 return the error text pertaining to the last pcap library error.
char * pcap_strerror (int error)
 Provided in case strerror() isn't available.
const char * pcap_lib_version (void)
 Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number.
void pcap_close (pcap_t *p)
 close the files associated with p and deallocates resources.
FILE * pcap_dump_file (pcap_dumper_t *p)
 return the standard I/O stream of the 'savefile' opened by pcap_dump_open().
int pcap_dump_flush (pcap_dumper_t *p)
 Flushes the output buffer to the ``savefile,'' so that any packets written with pcap_dump() but not yet written to the ``savefile'' will be written. -1 is returned on error, 0 on success.
void pcap_dump_close (pcap_dumper_t *p)
 Closes a savefile.
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h_source.html new file mode 100644 index 0000000..487998c --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/funcs_2pcap_8h_source.html @@ -0,0 +1,206 @@ + + + + +WinPcap: pcap.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/functions.html b/ledset/WpdPack_4_1_2/docs/html/functions.html new file mode 100644 index 0000000..fa463f1 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/functions.html @@ -0,0 +1,627 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all struct and union fields with links to the structures/unions they belong to: + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/functions_vars.html b/ledset/WpdPack_4_1_2/docs/html/functions_vars.html new file mode 100644 index 0000000..c399dc5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/functions_vars.html @@ -0,0 +1,627 @@ + + + + +WinPcap: Data Fields - Variables + + + + + + +
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- i -

+ + +

- j -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals.html b/ledset/WpdPack_4_1_2/docs/html/globals.html new file mode 100644 index 0000000..82c8e27 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals.html @@ -0,0 +1,114 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- a -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x62.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x62.html new file mode 100644 index 0000000..84f8b42 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x62.html @@ -0,0 +1,204 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- b -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x63.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x63.html new file mode 100644 index 0000000..22b4d5a --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x63.html @@ -0,0 +1,99 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- c -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x64.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x64.html new file mode 100644 index 0000000..434d731 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x64.html @@ -0,0 +1,96 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- d -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x65.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x65.html new file mode 100644 index 0000000..e911826 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x65.html @@ -0,0 +1,105 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- e -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x66.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x66.html new file mode 100644 index 0000000..a1e55ee --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x66.html @@ -0,0 +1,78 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- f -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x67.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x67.html new file mode 100644 index 0000000..f4747df --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x67.html @@ -0,0 +1,96 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- g -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x68.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x68.html new file mode 100644 index 0000000..a43c30e --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x68.html @@ -0,0 +1,75 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- h -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x69.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x69.html new file mode 100644 index 0000000..e9ad145 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x69.html @@ -0,0 +1,81 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- i -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x6a.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x6a.html new file mode 100644 index 0000000..444b087 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x6a.html @@ -0,0 +1,99 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- j -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x6b.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x6b.html new file mode 100644 index 0000000..0ea7464 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x6b.html @@ -0,0 +1,75 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- k -

    +
  • KERNEL_EVENT_NAMESPACE +: Packet.h +
  • +
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x6d.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x6d.html new file mode 100644 index 0000000..480309d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x6d.html @@ -0,0 +1,128 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- m -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x6e.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x6e.html new file mode 100644 index 0000000..386c495 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x6e.html @@ -0,0 +1,195 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- n -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x6f.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x6f.html new file mode 100644 index 0000000..087e6cb --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x6f.html @@ -0,0 +1,81 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- o -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x70.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x70.html new file mode 100644 index 0000000..9232ad9 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x70.html @@ -0,0 +1,486 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- p -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x72.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x72.html new file mode 100644 index 0000000..2cb12b2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x72.html @@ -0,0 +1,210 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- r -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x73.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x73.html new file mode 100644 index 0000000..440d773 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x73.html @@ -0,0 +1,105 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- s -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x74.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x74.html new file mode 100644 index 0000000..41cda97 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x74.html @@ -0,0 +1,81 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- t -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_0x75.html b/ledset/WpdPack_4_1_2/docs/html/globals_0x75.html new file mode 100644 index 0000000..b0b5663 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_0x75.html @@ -0,0 +1,81 @@ + + + + +WinPcap: Data Fields + + + + + + +
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to: + +

- u -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_defs.html b/ledset/WpdPack_4_1_2/docs/html/globals_defs.html new file mode 100644 index 0000000..7647ce8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_defs.html @@ -0,0 +1,707 @@ + + + + +WinPcap: Data Fields + + + + + + +
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- i -

+ + +

- j -

+ + +

- k -

    +
  • KERNEL_EVENT_NAMESPACE +: Packet.h +
  • +
+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_enum.html b/ledset/WpdPack_4_1_2/docs/html/globals_enum.html new file mode 100644 index 0000000..1170e26 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_enum.html @@ -0,0 +1,50 @@ + + + + +WinPcap: Data Fields + + + + + + +
    +
  • ADAPTER_BINDING_STATUS +: Packet.h +
  • +
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_eval.html b/ledset/WpdPack_4_1_2/docs/html/globals_eval.html new file mode 100644 index 0000000..d5b0973 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_eval.html @@ -0,0 +1,56 @@ + + + + +WinPcap: Data Fields + + + + + + +
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_func.html b/ledset/WpdPack_4_1_2/docs/html/globals_func.html new file mode 100644 index 0000000..781f9da --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_func.html @@ -0,0 +1,526 @@ + + + + +WinPcap: Data Fields + + + + + + +
+  + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- g -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_type.html b/ledset/WpdPack_4_1_2/docs/html/globals_type.html new file mode 100644 index 0000000..a5c8547 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_type.html @@ -0,0 +1,125 @@ + + + + +WinPcap: Data Fields + + + + + + +
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/globals_vars.html b/ledset/WpdPack_4_1_2/docs/html/globals_vars.html new file mode 100644 index 0000000..1af4db9 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/globals_vars.html @@ -0,0 +1,71 @@ + + + + +WinPcap: Data Fields + + + + + + +
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__NPF.html b/ledset/WpdPack_4_1_2/docs/html/group__NPF.html new file mode 100644 index 0000000..f3514d7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__NPF.html @@ -0,0 +1,301 @@ + + + + +WinPcap: NPF driver internals manual + + + + + + +
+

NPF driver internals manual
+ +[WinPcap internals] +

+ + + + + +

Modules

 NPF I/O control codes
 NPF structures and definitions
 NPF functions
 NPF Just-in-time compiler definitions
+

Detailed Description

+ + + + + + + + + + + +

This section documents the internals of the Netgroup Packet Filter (NPF), the kernel +portion of WinPcap. Normal users are probably interested in how to use WinPcap +and not in its internal structure. Therefore +the information present in this module is destined mainly to WinPcap developers and maintainers, or to +the people interested in how the driver works. In particular, a good knowledge +of OSes, networking and Win32 kernel programming and device drivers development +is required to profitably read this section. 

+

NPF is the WinPcap component that does the hard work, processing the packets +that transit on the network and exporting capture, injection and analysis +capabilities to user-level.

+

The following paragraphs will describe the interaction of NPF with the +OS and its basic structure.

+

NPF and NDIS

+

NDIS (Network Driver Interface Specification) is a standard that defines the +communication between a network adapter (or, better, the driver that manages it) +and the protocol drivers (that implement for example TCP/IP). Main NDIS purpose +is to act as a wrapper that allows protocol drivers to send and receive packets +onto a network (LAN or WAN) without caring either the particular adapter or the +particular Win32 operating system.

+

NDIS supports three types of network drivers:

+
    +
  1. Network interface card or NIC drivers. NIC drivers + directly manage network interface cards, referred to as NICs. The NIC + drivers interface directly to the hardware at their lower edge and at their + upper edge present an interface to allow upper layers to send packets on the + network, to handle interrupts, to reset the NIC, to halt the NIC and to + query and set the operational characteristics of the driver. NIC drivers can + be either miniports or legacy full NIC drivers. +
      +
    • Miniport drivers implement only the hardware-specific operations + necessary to manage a NIC, including sending and receiving data on the + NIC. Operations common to all lowest level NIC drivers, such as + synchronization, is provided by NDIS. Miniports do not call operating + system routines directly; their interface to the operating system is + NDIS.
      + A miniport does not keep track of bindings. It merely passes packets up + to NDIS and NDIS makes sure that these packets are passed to the correct + protocols. +
    • Full NIC drivers have been written to perform both hardware-specific + operations and all the synchronization and queuing operations usually + done by NDIS. Full NIC drivers, for instance, maintain their own binding + information for indicating received data. 
    • +
    +
  2. Intermediate drivers. Intermediate drivers interface + between an upper-level driver such as a protocol driver and a miniport. To + the upper-level driver, an intermediate driver looks like a miniport. To a + miniport, the intermediate driver looks like a protocol driver. An + intermediate protocol driver can layer on top of another intermediate driver + although such layering could have a negative effect on system performance. A + typical reason for developing an intermediate driver is to perform media + translation between an existing legacy protocol driver and a miniport that + manages a NIC for a new media type unknown to the protocol driver. For + instance, an intermediate driver could translate from LAN protocol to ATM + protocol. An intermediate driver cannot communicate with user-mode + applications, but only with other NDIS drivers. +
  3. Transport drivers or protocol drivers. A protocol driver implements + a network protocol stack such as IPX/SPX or TCP/IP, offering its services + over one or more network interface cards. A protocol driver services + application-layer clients at its upper edge and connects to one or more NIC + driver(s) or intermediate NDIS driver(s) at its lower edge.
  4. +
+

NPF is implemented as a protocol driver. This is not the best possible choice +from the performance point of view, but allows reasonable independence from the +MAC layer and as well as complete access to the raw traffic.

+

Notice that the various Win32 operating systems have different versions of +NDIS: NPF is NDIS 5 compliant under Windows 2000 and its derivations (like +Windows XP), NDIS 3 +compliant on the other Win32 platforms. 

+

Next figure shows the position of NPF inside the NDIS stack:

+

+

Figure 1: NPF inside NDIS.

+

The interaction with the OS is normally asynchronous. This means that the +driver provides a set of callback functions that are invoked by the system when +some operation is required to NPF. NPF exports callback functions for all the I/O operations of the +applications: open, close, read, write, ioctl, etc.

+

The interaction with NDIS is asynchronous as well: events +like the arrival of a new packet are notified to NPF through a callback +function (Packet_tap() in this case). Furthermore, the interaction with NDIS and +the NIC +driver takes always place by means of non blocking functions: when NPF invokes a +NDIS function, the call returns immediately; when the processing ends, NDIS invokes +a specific NPF +callback to inform that the function has finished. The +driver exports a callback for any low-level operation, like sending packets, +setting or requesting parameters on the NIC, etc.

+ +

NPF structure basics

+ +

Next figure shows the structure of WinPcap, with particular reference to the +NPF driver.

+ +

+ +

Figure 2: NPF device driver. + +

NPF is able to +perform a number of different operations: capture, monitoring, dump to disk, +packet injection. The following paragraphs will describe shortly each of these +operations.

+

Packet Capture

+

The most important operation of NPF is packet capture. +During a capture, the driver sniffs the packets using a network interface and delivers them intact to the +user-level applications.  +

+

The capture process relies on two main components:

+
    +
  • +

    A packet filter that decides if an + incoming packet has to be accepted and copied to the listening application. + Most applications using NPF reject far more packets than those accepted, + therefore a versatile and efficient packet filter is critical for good + over-all performance. A packet filter is a function with boolean output + that is applied to a packet. If the value of the function is true the + capture driver copies + the packet to the application; if it is false the packet is discarded. NPF + packet filter is a bit more complex, because it determines not only if the + packet should be kept, but also the amount of bytes to keep. The filtering + system adopted by NPF derives from the BSD Packet Filter (BPF), a + virtual processor able to execute filtering programs expressed in a + pseudo-assembler and created at user level. The application takes a user-defined filter (e.g. pick up all UDP packets) + and, using wpcap.dll, compiles them into a BPF program (e.g. if the + packet is IP and the protocol type field is equal to 17, then return + true). Then, the application uses the BIOCSETF + IOCTL to inject the filter in the kernel. At this point, the program + is executed for every incoming packet, and only the conformant packets are + accepted. Unlike traditional solutions, NPF does not interpret + the filters, but it executes them. For performance reasons, before using the + filter NPF feeds it to a JIT compiler that translates it into a native 80x86 + function. When a packet is captured, NPF calls this native function instead + of invoking the filter interpreter, and this makes the process very fast. + The concept behind this optimization is very similar to the one of Java + jitters.

  • +
  • +

    A circular buffer to store the + packets and avoid loss. A packet is stored in the buffer with a header that + maintains information like the timestamp and the size of the packet. + Moreover, an alignment padding is inserted between the packets in order to + speed-up the access to their data by the applications. Groups of  packets can be copied + with a single operation from the NPF buffer to the applications. This + improves performances because it minimizes the number of reads. If the + buffer is full when a new packet arrives, the packet is discarded and + hence it's lost. Both kernel and user buffer can be +changed at runtime for maximum versatility: packet.dll and wpcap.dll provide functions for this purpose.

  • +
+

The size of the user buffer is very +important because it determines the maximum amount of data that can be +copied from kernel space to user space within a single system call. On the other +hand, it can be noticed that also the minimum amount of data that can be copied +in a single call is extremely important. In presence of a large value for this +variable, the kernel waits for the arrival of several packets before copying the +data to the user. This guarantees a low number of system calls, i.e. low +processor usage, which is a good setting for applications like sniffers. On the +other side, a small value means that the kernel will copy the packets as soon as +the application is ready to receive them. This is excellent for real time +applications (like, for example, ARP redirectors or bridges) that need the better +responsiveness from the kernel. +From this point of view, NPF has a configurable behavior, that allows users to choose between +best efficiency or best responsiveness (or any intermediate situation). 

+

The wpcap library includes a couple of system calls that can be used both to set the timeout after +which a read expires and the minimum amount of data that can be transferred to +the application. By default, the read timeout is 1 second, and the minimum +amount of data copied between the kernel and the application is 16K.

+

Packet injection

+

NPF allows to write raw packets to the network. To send data, a +user-level application performs a WriteFile() system call on the NPF device file. The data is sent to the network as is, without encapsulating it in +any protocol, therefore the application will have to build the various headers +for each packet. The application usually does not need to generate the FCS +because it is calculated by the network adapter hardware and it is attached +automatically at the end of a packet before sending it to the network.

+

In normal situations, the sending rate of the packets to the network is not +very high because of the need of a system call for each packet. For this reason, +the possibility to send a single packet more than once with a single write +system call has been added. The user-level application can set, with an IOCTL +call (code pBIOCSWRITEREP), the number of times a single packet will be +repeated: for example, if this value is set to 1000, every raw packet written by +the application on the driver's device file will be sent 1000 times. This +feature can be used to generate high speed traffic for testing purposes: the +overload of context switches is no longer present, so performance is remarkably +better. 

+ +

Network monitoring

+

WinPcap offers a kernel-level programmable monitoring +module, able to calculate simple statistics on the network traffic. The +idea behind this module is shown in Figure +2: the statistics can be gathered without the need to copy the packets to +the application, that simply receives and displays the results obtained from the +monitoring engine. This allows to avoid great part of the capture overhead in +terms of memory and CPU clocks.

+

The monitoring engine is +made of a classifier followed by a counter. The packets are +classified using the filtering engine of NPF, that provides a configurable way +to select a subset of the traffic. The data that pass the filter go to the +counter, that keeps some variables like the number of packets and +the amount of bytes accepted by the filter and updates them with the data of the +incoming packets. These variables are passed to the user-level application at +regular intervals whose period can be configured by the user. No buffers are +allocated at kernel and user level.

+

Dump to disk

+

The dump to disk +capability can be used to save the network data to disk directly from kernel +mode. +

+

+

+

Figure 3: packet capture versus kernel-level dump. +

+

In +traditional systems, the path covered by the packets that are saved to disk is +the one followed by the black arrows in Figure +3: every packet is copied several times, and normally 4 buffers are +allocated: the one of the capture driver, the one in the application that keeps +the captured data, the one of the stdio functions (or similar) that are used by +the application to write on file, and finally the one of the file system. + +

+

When the +kernel-level traffic logging feature of NPF is enabled, the capture driver +addresses the file system directly, hence the path covered by the packets is the +one of the red dotted arrow: only two buffers and a single copy are necessary, +the number of system call is drastically reduced, therefore the performance is +considerably better. + +

+

Current +implementation dumps the to disk in the widely used libpcap format. It gives +also the possibility to filter the traffic before the dump process in order to +select the packet that will go to the disk. +

+

Further reading

+

The structure of NPF and its filtering engine derive directly from the one of +the BSD Packet Filter (BPF), so if you are interested the subject you can read +the following papers:

+

- S. McCanne and V. Jacobson, The +BSD Packet Filter: A New Architecture for User-level Packet Capture. +Proceedings of the 1993 Winter USENIX Technical Conference (San Diego, CA, Jan. +1993), USENIX. 

+

- A. Begel, S. McCanne, S.L.Graham, BPF+: Exploiting +Global Data-flow Optimization in a Generalized Packet Filter Architecture, +Proceedings of ACM SIGCOMM '99, pages 123-134, Conference on Applications, +technologies, architectures, and protocols for computer communications, August +30 - September 3, 1999, Cambridge, USA

+

Note

+

The code documented in this manual is the one of the Windows NTx version of +NPF. The Windows 9x code is very similar, but it is less efficient and +lacks advanced features like kernel-mode dump.

+

+ + + + + +

+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__NPF__code.html b/ledset/WpdPack_4_1_2/docs/html/group__NPF__code.html new file mode 100644 index 0000000..3001a53 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__NPF__code.html @@ -0,0 +1,1667 @@ + + + + +WinPcap: NPF functions + + + + + + +
+

NPF functions
+ +[NPF driver internals manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 The initialization routine of the driver.
PWCHAR getAdaptersList (VOID)
 Returns the list of the MACs available on the system.
PKEY_VALUE_PARTIAL_INFORMATION getTcpBindings (VOID)
 Returns the MACs that bind to TCP/IP.
BOOLEAN NPF_CreateDevice (IN OUT PDRIVER_OBJECT adriverObjectP, IN PUNICODE_STRING amacNameP)
 Creates a device for a given MAC.
NTSTATUS NPF_Open (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Opens a new instance of the driver.
VOID NPF_OpenAdapterComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status, IN NDIS_STATUS OpenErrorStatus)
 Ends the opening of an adapter.
NTSTATUS NPF_Cleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Closes an instance of the driver.
NTSTATUS NPF_Close (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NPF_CloseAdapterComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status)
 Ends the closing of an adapter.
NDIS_STATUS NPF_tap (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_HANDLE MacReceiveContext, IN PVOID HeaderBuffer, IN UINT HeaderBufferSize, IN PVOID LookAheadBuffer, IN UINT LookaheadBufferSize, IN UINT PacketSize)
 Callback invoked by NDIS when a packet arrives from the network.
VOID NPF_TransferDataComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status, IN UINT BytesTransferred)
 Ends the transfer of a packet.
VOID NPF_ReceiveComplete (IN NDIS_HANDLE ProtocolBindingContext)
 Callback function that signals the end of a packet reception.
NTSTATUS NPF_IoControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Handles the IOCTL calls.
VOID NPF_RequestComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_REQUEST pRequest, IN NDIS_STATUS Status)
 Ends an OID request.
NTSTATUS NPF_Write (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Writes a raw packet to the network.
INT NPF_BufferedWrite (IN PIRP Irp, IN PCHAR UserBuff, IN ULONG UserBuffSize, BOOLEAN sync)
 Writes a buffer of raw packets to the network.
VOID NPF_WaitEndOfBufferedWrite (POPEN_INSTANCE Open)
 Waits the completion of all the sends performed by NPF_BufferedWrite.
VOID NPF_SendComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_PACKET pPacket, IN NDIS_STATUS Status)
 Ends a send operation.
VOID NPF_ResetComplete (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status)
 Ends a reset of the adapter.
VOID NPF_Status (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status, IN PVOID StatusBuffer, IN UINT StatusBufferSize)
 Callback for NDIS StatusHandler. Not used by NPF.
VOID NPF_StatusComplete (IN NDIS_HANDLE ProtocolBindingContext)
 Callback for NDIS StatusCompleteHandler. Not used by NPF.
VOID NPF_Unload (IN PDRIVER_OBJECT DriverObject)
 Function called by the OS when NPF is unloaded.
NTSTATUS NPF_Read (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 Function that serves the user's reads.
NTSTATUS NPF_ReadRegistry (IN PWSTR *MacDriverName, IN PWSTR *PacketDriverName, IN PUNICODE_STRING RegistryPath)
 Reads the registry keys associated woth NPF if the driver is manually installed via the control panel.
NTSTATUS NPF_QueryRegistryRoutine (IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
 Function used by NPF_ReadRegistry() to quesry the registry keys associated woth NPF if the driver is manually installed via the control panel.
VOID NPF_BindAdapter (OUT PNDIS_STATUS Status, IN NDIS_HANDLE BindContext, IN PNDIS_STRING DeviceName, IN PVOID SystemSpecific1, IN PVOID SystemSpecific2)
 Callback for NDIS BindAdapterHandler. Not used by NPF.
VOID NPF_UnbindAdapter (OUT PNDIS_STATUS Status, IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_HANDLE UnbindContext)
 Callback for NDIS UnbindAdapterHandler.
NTSTATUS NPF_OpenDumpFile (POPEN_INSTANCE Open, PUNICODE_STRING fileName, BOOLEAN append)
 Creates the file that will receive the packets when the driver is in dump mode.
NTSTATUS NPF_StartDump (POPEN_INSTANCE Open)
 Starts dump to file.
VOID NPF_DumpThread (PVOID Open)
 The dump thread.
NTSTATUS NPF_SaveCurrentBuffer (POPEN_INSTANCE Open)
 Saves the content of the packet buffer to the file associated with current instance.
VOID NPF_WriteDumpFile (PFILE_OBJECT FileObject, PLARGE_INTEGER Offset, ULONG Length, PMDL Mdl, PIO_STATUS_BLOCK IoStatusBlock)
 Writes a block of packets on the dump file.
NTSTATUS NPF_CloseDumpFile (POPEN_INSTANCE Open)
 Closes the dump file associated with an instance of the driver.
BOOLEAN NPF_StartUsingBinding (IN POPEN_INSTANCE pOpen)
VOID NPF_StopUsingBinding (IN POPEN_INSTANCE pOpen)
VOID NPF_CloseBinding (IN POPEN_INSTANCE pOpen)
BOOLEAN NPF_StartUsingOpenInstance (IN POPEN_INSTANCE pOpen)
VOID NPF_StopUsingOpenInstance (IN POPEN_INSTANCE pOpen)
VOID NPF_CloseOpenInstance (IN POPEN_INSTANCE pOpen)
NTSTATUS NPF_GetDeviceMTU (IN POPEN_INSTANCE pOpen, IN PIRP pIrp, OUT PUINT pMtu)
UINT GetBuffOccupation (POPEN_INSTANCE Open)
 Returns the amount of bytes present in the packet buffer.
JIT_BPF_FilterBPF_jitter (struct bpf_insn *fp, INT nins)
 BPF jitter, builds an x86 function from a BPF program.
BPF_filter_function BPFtoX86 (struct bpf_insn *ins, UINT nins, INT *mem)
 Translates a set of BPF instructions in a set of x86 ones.
void BPF_Destroy_JIT_Filter (JIT_BPF_Filter *Filter)
 Deletes a filtering function that was previously created by BPF_jitter().
+

Function Documentation

+ +
+
+ + + + + + + + + +
void BPF_Destroy_JIT_Filter (JIT_BPF_Filter Filter ) 
+
+
+ +

Deletes a filtering function that was previously created by BPF_jitter().

+
Parameters:
+ + +
Filter The filter to destroy.
+
+
+

This function frees the variuos buffers (code, memory, etc.) associated with a filtering function.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
JIT_BPF_Filter* BPF_jitter (struct bpf_insn *  fp,
INT  nins 
)
+
+
+ +

BPF jitter, builds an x86 function from a BPF program.

+
Parameters:
+ + + +
fp The BPF pseudo-assembly filter that will be translated into x86 code.
nins Number of instructions of the input filter.
+
+
+
Returns:
The JIT_BPF_Filter structure containing the x86 filtering binary.
+

BPF_jitter allocates the buffers for the new native filter and then translates the program pointed by fp calling BPFtoX86().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
BPF_filter_function BPFtoX86 (struct bpf_insn *  ins,
UINT  nins,
INT *  mem 
)
+
+
+ +

Translates a set of BPF instructions in a set of x86 ones.

+
Parameters:
+ + + + +
ins Pointer to the BPF instructions that will be translated into x86 code.
nins Number of instructions to translate.
mem Memory used by the x86 function to emulate the RAM of the BPF pseudo processor.
+
+
+
Returns:
The x86 filtering function.
+

This function does the hard work for the JIT compilation. It takes a group of BPF pseudo instructions and through the instruction macros defined in jitter.h it is able to create an function directly executable by NPF.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS DriverEntry (IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)
+
+
+ +

The initialization routine of the driver.

+
Parameters:
+ + + +
DriverObject The driver object of NPF created by the system.
RegistryPath The registry path containing the keys related to the driver.
+
+
+
Returns:
A string containing a list of network adapters.
+

DriverEntry is a mandatory function in a device driver. Like the main() of a user level program, it is called by the system when the driver is loaded in memory and started. Its purpose is to initialize the driver, performing all the allocations and the setup. In particular, DriverEntry registers all the driver's I/O callbacks, creates the devices, defines NPF as a protocol inside NDIS.

+ +
+
+ +
+
+ + + + + + + + + +
PWCHAR getAdaptersList (VOID  ) 
+
+
+ +

Returns the list of the MACs available on the system.

+
Returns:
A string containing a list of network adapters.
+

The list of adapters is retrieved from the SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318} registry key. NPF tries to create its bindings from this list. In this way it is possible to be loaded and unloaded dynamically without passing from the control panel.

+ +
+
+ +
+
+ + + + + + + + + +
UINT GetBuffOccupation (POPEN_INSTANCE  Open ) 
+
+
+ +

Returns the amount of bytes present in the packet buffer.

+
Parameters:
+ + +
Open The NPF instance that closes the file.
+
+
+ +
+
+ +
+
+ + + + + + + + + +
PKEY_VALUE_PARTIAL_INFORMATION getTcpBindings (VOID  ) 
+
+
+ +

Returns the MACs that bind to TCP/IP.

+
Returns:
Pointer to the registry key containing the list of adapters on which TCP/IP is bound.
+

If getAdaptersList() fails, NPF tries to obtain the TCP/IP bindings through this function.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_BindAdapter (OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  BindContext,
IN PNDIS_STRING  DeviceName,
IN PVOID  SystemSpecific1,
IN PVOID  SystemSpecific2 
)
+
+
+ +

Callback for NDIS BindAdapterHandler. Not used by NPF.

+

Function called by NDIS when a new adapter is installed on the machine With Plug and Play.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
INT NPF_BufferedWrite (IN PIRP  Irp,
IN PCHAR  UserBuff,
IN ULONG  UserBuffSize,
BOOLEAN  sync 
)
+
+
+ +

Writes a buffer of raw packets to the network.

+
Parameters:
+ + + + + +
Irp Pointer to the IRP containing the user request.
UserBuff Pointer to the buffer containing the packets to send.
UserBuffSize Size of the buffer with the packets.
sync If set to TRUE, the packets are transmitted respecting their timestamps.
+
+
+
Returns:
The amount of bytes actually sent. If the return value is smaller than the Size parameter, an error occurred during the send. The error can be caused by an adapter problem or by an inconsistent/bogus user buffer.
+

This function is called by the OS in consequence of a BIOCSENDPACKETSNOSYNC or a BIOCSENDPACKETSSYNC IOCTL. The buffer received as input parameter contains an arbitrary number of packets, each of which preceded by a sf_pkthdr structure. NPF_BufferedWrite() scans the buffer and sends every packet via the NdisSend() function. When Sync is set to TRUE, the packets are synchronized with the KeQueryPerformanceCounter() function. This requires a remarkable amount of CPU, but allows to respect the timestamps associated with packets with a precision of some microseconds (depending on the precision of the performance counter of the machine). If Sync is false, the timestamps are ignored and the packets are sent as fat as possible.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_Cleanup (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +

Closes an instance of the driver.

+
Parameters:
+ + + +
DeviceObject Pointer to the device object utilized by the user.
Irp Pointer to the IRP containing the user request.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

This function is called when a running instance of the driver is closed by the user with a CloseHandle(). It stops the capture/monitoring/dump process, deallocates the memory and the objects associated with the instance and closing the files. The network adapter is then closed with a call to NdisCloseAdapter.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_Close (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
VOID NPF_CloseAdapterComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_STATUS  Status 
)
+
+
+ +

Ends the closing of an adapter.

+
Parameters:
+ + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
Status Status of the close operation performed by NDIS.
+
+
+

Callback function associated with the NdisCloseAdapter() NDIS function. It is invoked by NDIS when the NIC driver has finished a close operation that was previously started by NPF_Close().

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_CloseBinding (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
NTSTATUS NPF_CloseDumpFile (POPEN_INSTANCE  Open ) 
+
+
+ +

Closes the dump file associated with an instance of the driver.

+
Parameters:
+ + +
Open The NPF instance that closes the file.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_CloseOpenInstance (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
BOOLEAN NPF_CreateDevice (IN OUT PDRIVER_OBJECT  adriverObjectP,
IN PUNICODE_STRING  amacNameP 
)
+
+
+ +

Creates a device for a given MAC.

+
Parameters:
+ + + +
adriverObjectP The driver object that will be associated with the device, i.e. the one of NPF.
amacNameP The name of the network interface that the device will point.
+
+
+
Returns:
If the function succeeds, the return value is nonzero.
+

NPF creates a device for every valid network adapter. The new device points to the NPF driver, but contains information about the original device. In this way, when the user opens the new device, NPF will be able to determine the correct adapter to use.

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_DumpThread (PVOID  Open ) 
+
+
+ +

The dump thread.

+
Parameters:
+ + +
Open The NPF instance that creates the thread.
+
+
+

This function moves the content of the NPF kernel buffer to file. It runs in the user context, so at lower priority than the TAP.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_GetDeviceMTU (IN POPEN_INSTANCE  pOpen,
IN PIRP  pIrp,
OUT PUINT  pMtu 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_IoControl (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +

Handles the IOCTL calls.

+
Parameters:
+ + + +
DeviceObject Pointer to the device object utilized by the user.
Irp Pointer to the IRP containing the user request.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

Once the packet capture driver is opened it can be configured from user-level applications with IOCTL commands using the DeviceIoControl() system call. NPF_IoControl receives and serves all the IOCTL calls directed to NPF. The following commands are recognized:

+ + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_Open (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +

Opens a new instance of the driver.

+
Parameters:
+ + + +
DeviceObject Pointer to the device object utilized by the user.
Irp Pointer to the IRP containing the user request.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

This function is called by the OS when a new instance of the driver is opened, i.e. when a user application performs a CreateFile on a device created by NPF. NPF_Open allocates and initializes variables, objects and buffers needed by the new instance, fills the OPEN_INSTANCE structure associated with it and opens the adapter with a call to NdisOpenAdapter.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_OpenAdapterComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_STATUS  Status,
IN NDIS_STATUS  OpenErrorStatus 
)
+
+
+ +

Ends the opening of an adapter.

+
Parameters:
+ + + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
Status Status of the opening operation performed by NDIS.
OpenErrorStatus not used by NPF.
+
+
+

Callback function associated with the NdisOpenAdapter() NDIS function. It is invoked by NDIS when the NIC driver has finished an open operation that was previously started by NPF_Open().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_OpenDumpFile (POPEN_INSTANCE  Open,
PUNICODE_STRING  fileName,
BOOLEAN  append 
)
+
+
+ +

Creates the file that will receive the packets when the driver is in dump mode.

+
Parameters:
+ + + + +
Open The NPF instance that opens the file.
fileName Pointer to a UNICODE string containing the name of the file.
append Boolean value that specifies if the data must be appended to the file.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_QueryRegistryRoutine (IN PWSTR  ValueName,
IN ULONG  ValueType,
IN PVOID  ValueData,
IN ULONG  ValueLength,
IN PVOID  Context,
IN PVOID  EntryContext 
)
+
+
+ +

Function used by NPF_ReadRegistry() to quesry the registry keys associated woth NPF if the driver is manually installed via the control panel.

+

Normally not used in recent versions of NPF.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_Read (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +

Function that serves the user's reads.

+
Parameters:
+ + + +
DeviceObject Pointer to the device used by the user.
Irp Pointer to the IRP containing the user request.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

This function is called by the OS in consequence of user ReadFile() call. It moves the data present in the kernel buffer to the user buffer associated with Irp. First of all, NPF_Read checks the amount of data in kernel buffer associated with current NPF instance.

+
    +
  • If the instance is in capture mode and the buffer contains more than OPEN_INSTANCE::MinToCopy bytes, NPF_Read moves the data in the user buffer and returns immediatly. In this way, the read performed by the user is not blocking.
  • +
  • If the buffer contains less than MinToCopy bytes, the application's request isn't satisfied immediately, but it's blocked until at least MinToCopy bytes arrive from the net or the timeout on this read expires. The timeout is kept in the OPEN_INSTANCE::TimeOut field.
  • +
  • If the instance is in statistical mode or in dump mode, the application's request is blocked until the timeout kept in OPEN_INSTANCE::TimeOut expires.
  • +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_ReadRegistry (IN PWSTR *  MacDriverName,
IN PWSTR *  PacketDriverName,
IN PUNICODE_STRING  RegistryPath 
)
+
+
+ +

Reads the registry keys associated woth NPF if the driver is manually installed via the control panel.

+

Normally not used in recent versions of NPF.

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_ReceiveComplete (IN NDIS_HANDLE  ProtocolBindingContext ) 
+
+
+ +

Callback function that signals the end of a packet reception.

+
Parameters:
+ + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
+
+
+

does nothing in NPF

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_RequestComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN PNDIS_REQUEST  pRequest,
IN NDIS_STATUS  Status 
)
+
+
+ +

Ends an OID request.

+
Parameters:
+ + + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
pRequest Pointer to the completed OID request.
Status Status of the operation.
+
+
+

Callback function associated with the NdisRequest() NDIS function. It is invoked by NDIS when the NIC driver has finished an OID request operation that was previously started by NPF_IoControl().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
VOID NPF_ResetComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_STATUS  Status 
)
+
+
+ +

Ends a reset of the adapter.

+
Parameters:
+ + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
Status Status of the operation.
+
+
+

Callback function associated with the NdisReset() NDIS function. It is invoked by NDIS when the NIC driver has finished an OID request operation that was previously started by NPF_IoControl(), in an IOCTL_PROTOCOL_RESET command.

+ +
+
+ +
+
+ + + + + + + + + +
NTSTATUS NPF_SaveCurrentBuffer (POPEN_INSTANCE  Open ) 
+
+
+ +

Saves the content of the packet buffer to the file associated with current instance.

+
Parameters:
+ + +
Open The NPF instance that creates the thread.
+
+
+

Used by NPF_DumpThread() and NPF_CloseDumpFile().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_SendComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN PNDIS_PACKET  pPacket,
IN NDIS_STATUS  Status 
)
+
+
+ +

Ends a send operation.

+
Parameters:
+ + + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
pPacket Pointer to the NDIS PACKET structure used by NPF_Write() to send the packet.
Status Status of the operation.
+
+
+

Callback function associated with the NdisSend() NDIS function. It is invoked by NDIS when the NIC driver has finished an OID request operation that was previously started by NPF_Write().

+ +
+
+ +
+
+ + + + + + + + + +
NTSTATUS NPF_StartDump (POPEN_INSTANCE  Open ) 
+
+
+ +

Starts dump to file.

+
Parameters:
+ + +
Open The NPF instance that opens the file.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

This function performs two operations. First, it writes the libpcap header at the beginning of the file. Second, it starts the thread that asynchronously dumps the network data to the file.

+ +
+
+ +
+
+ + + + + + + + + +
BOOLEAN NPF_StartUsingBinding (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
BOOLEAN NPF_StartUsingOpenInstance (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_Status (IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_STATUS  Status,
IN PVOID  StatusBuffer,
IN UINT  StatusBufferSize 
)
+
+
+ +

Callback for NDIS StatusHandler. Not used by NPF.

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_StatusComplete (IN NDIS_HANDLE  ProtocolBindingContext ) 
+
+
+ +

Callback for NDIS StatusCompleteHandler. Not used by NPF.

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_StopUsingBinding (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_StopUsingOpenInstance (IN POPEN_INSTANCE  pOpen ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NDIS_STATUS NPF_tap (IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_HANDLE  MacReceiveContext,
IN PVOID  HeaderBuffer,
IN UINT  HeaderBufferSize,
IN PVOID  LookAheadBuffer,
IN UINT  LookaheadBufferSize,
IN UINT  PacketSize 
)
+
+
+ +

Callback invoked by NDIS when a packet arrives from the network.

+
Parameters:
+ + + + + + + + +
ProtocolBindingContext Context of the function. Points to a OPEN_INSTANCE structure that identifies the NPF instance to which the packets are destined.
MacReceiveContext Handle that identifies the underlying NIC driver that generated the request. This value must be used when the packet is transferred from the NIC driver with NdisTransferData().
HeaderBuffer Pointer to the buffer in the NIC driver memory that contains the header of the packet.
HeaderBufferSize Size in bytes of the header.
LookAheadBuffer Pointer to the buffer in the NIC driver's memory that contains the incoming packet's data available to NPF. This value does not necessarily coincide with the actual size of the packet, since only a portion can be available at this time. The remaining portion can be obtained with the NdisTransferData() NDIS function.
LookaheadBufferSize Size in bytes of the lookahead buffer.
PacketSize Total size of the incoming packet, excluded the header.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

NPF_tap() is called by the underlying NIC for every incoming packet. It is the most important and one of the most complex functions of NPF: it executes the filter, runs the statistical engine (if the instance is in statistical mode), gathers the timestamp, moves the packet in the buffer. NPF_tap() is the only function, along with the filtering ones, that is executed for every incoming packet, therefore it is carefully optimized.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_TransferDataComplete (IN NDIS_HANDLE  ProtocolBindingContext,
IN PNDIS_PACKET  Packet,
IN NDIS_STATUS  Status,
IN UINT  BytesTransferred 
)
+
+
+ +

Ends the transfer of a packet.

+
Parameters:
+ + + + + +
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with the current instance.
Packet Pointer to the NDIS_PACKET structure that received the packet data.
Status Status of the transfer operation.
BytesTransferred Amount of bytes transferred.
+
+
+

Callback function associated with the NdisTransferData() NDIS function. It is invoked by NDIS when the NIC driver has finished the transfer of a packet from the NIC driver memory to the NPF circular buffer.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_UnbindAdapter (OUT PNDIS_STATUS  Status,
IN NDIS_HANDLE  ProtocolBindingContext,
IN NDIS_HANDLE  UnbindContext 
)
+
+
+ +

Callback for NDIS UnbindAdapterHandler.

+
Parameters:
+ + + + +
Status out variable filled by NPF_UnbindAdapter with the status of the unbind operation.
ProtocolBindingContext Context of the function. Contains a pointer to the OPEN_INSTANCE structure associated with current instance.
UnbindContext Specifies a handle, supplied by NDIS, that NPF can use to complete the opration.
+
+
+

Function called by NDIS when a new adapter is removed from the machine without shutting it down. NPF_UnbindAdapter closes the adapter calling NdisCloseAdapter() and frees the memory and the structures associated with it. It also releases the waiting user-level app and closes the dump thread if the instance is in dump mode.

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_Unload (IN PDRIVER_OBJECT  DriverObject ) 
+
+
+ +

Function called by the OS when NPF is unloaded.

+
Parameters:
+ + +
DriverObject The driver object of NPF created by the system.
+
+
+

This is the last function executed when the driver is unloaded from the system. It frees global resources, delete the devices and deregisters the protocol. The driver can be unloaded by the user stopping the NPF service (from control panel or with a console 'net stop npf').

+ +
+
+ +
+
+ + + + + + + + + +
VOID NPF_WaitEndOfBufferedWrite (POPEN_INSTANCE  Open ) 
+
+
+ +

Waits the completion of all the sends performed by NPF_BufferedWrite.

+
Parameters:
+ + +
Open Pointer to open context structure
+
+
+

Used by NPF_BufferedWrite to wait the completion of all the sends before returning the control to the user.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
NTSTATUS NPF_Write (IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
+
+
+ +

Writes a raw packet to the network.

+
Parameters:
+ + + +
DeviceObject Pointer to the device object on which the user wrote the packet.
Irp Pointer to the IRP containing the user request.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

This function is called by the OS in consequence of user WriteFile() call, with the data of the packet that must be sent on the net. The data is contained in the buffer associated with Irp, NPF_Write takes it and delivers it to the NIC driver via the NdisSend() function. The Nwrites field of the OPEN_INSTANCE structure associated with Irp indicates the number of copies of the packet that will be sent: more than one copy of the packet can be sent for performance reasons.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VOID NPF_WriteDumpFile (PFILE_OBJECT  FileObject,
PLARGE_INTEGER  Offset,
ULONG  Length,
PMDL  Mdl,
PIO_STATUS_BLOCK  IoStatusBlock 
)
+
+
+ +

Writes a block of packets on the dump file.

+
Parameters:
+ + + + + + +
FileObject The file object that will receive the packets.
Offset The offset in the file where the packets will be put.
Length The amount of bytes to write.
Mdl MDL mapping the memory buffer that will be written to disk.
IoStatusBlock Used by the function to return the status of the operation.
+
+
+
Returns:
The status of the operation. See ntstatus.h in the DDK.
+

NPF_WriteDumpFile addresses directly the file system, creating a custom IRP and using it to send a portion of the NPF circular buffer to disk. This function is used by NPF_DumpThread().

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__NPF__include.html b/ledset/WpdPack_4_1_2/docs/html/group__NPF__include.html new file mode 100644 index 0000000..22a6c5f --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__NPF__include.html @@ -0,0 +1,756 @@ + + + + +WinPcap: NPF structures and definitions + + + + + + +
+

NPF structures and definitions
+ +[NPF driver internals manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  packet_file_header
 Header of a libpcap dump file. More...
struct  sf_pkthdr
 Header associated to a packet in the driver's buffer when the driver is in dump mode. Similar to the bpf_hdr structure, but simpler. More...
struct  _PACKET_OID_DATA
 Structure containing an OID request. More...
struct  _INTERNAL_REQUEST
 Stores an OID request. More...
struct  _PACKET_RESERVED
 Contains a NDIS packet. More...
struct  _DEVICE_EXTENSION
 Port device extension. More...
struct  __CPU_Private_Data
 Kernel buffer of each CPU. More...
struct  _OPEN_INSTANCE
 Contains the state of a running instance of the NPF driver. More...
struct  PacketHeader
 Structure prepended to each packet in the kernel buffer pool. More...

Defines

#define MAX_REQUESTS   32
 Maximum number of simultaneous IOCTL requests.
#define Packet_ALIGNMENT   sizeof(int)
 Alignment macro. Defines the alignment size.
#define Packet_WORDALIGN(x)   (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
 even multiple of Packet_ALIGNMENT.
#define KERNEL_EVENT_NAMESPACE   L"\\BaseNamedObjects\\"
#define MODE_CAPT   0x0
 Capture working mode.
#define MODE_STAT   0x1
 Statistical working mode.
#define MODE_MON   0x2
 Kernel monitoring mode.
#define MODE_DUMP   0x10
 Kernel dump working mode.
#define IMMEDIATE   1
 Immediate timeout. Forces a read call to return immediately.
#define NDIS_FLAGS_SKIP_LOOPBACK_W2K   0x400
 This is an undocumented flag for NdisSetPacketFlags() that allows to disable loopback reception.
#define TCPDUMP_MAGIC   0xa1b2c3d4
 Libpcap magic number. Used by programs like tcpdump to recognize a driver's generated dump file.
#define PCAP_VERSION_MAJOR   2
 Major libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.
#define PCAP_VERSION_MINOR   4
 Minor libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.
#define NPF_DISABLE_LOOPBACK   1
 Tells the driver to drop the packets sent by itself. This is usefult when building applications like bridges.
#define NPF_ENABLE_LOOPBACK   2
 Tells the driver to capture the packets sent by itself.
#define C_ASSERT(a)
#define RESERVED(_p)   ((PPACKET_RESERVED)((_p)->ProtocolReserved))
 Macro to obtain a NDIS_PACKET from a PACKET_RESERVED.
#define TRANSMIT_PACKETS   256
 of packets that can be transmitted at the same time or with a single call to NdisSendPackets.
#define EXIT_SUCCESS(quantity)
 Macro used in the I/O routines to return the control to user-mode with a success status.
#define EXIT_FAILURE(quantity)
 Macro used in the I/O routines to return the control to user-mode with a failure status.

Typedefs

typedef struct _PACKET_OID_DATA PACKET_OID_DATA
 Structure containing an OID request.
typedef struct _PACKET_OID_DATAPPACKET_OID_DATA
typedef struct _INTERNAL_REQUEST INTERNAL_REQUEST
 Stores an OID request.
typedef struct _INTERNAL_REQUESTPINTERNAL_REQUEST
typedef struct _PACKET_RESERVED PACKET_RESERVED
 Contains a NDIS packet.
typedef struct _PACKET_RESERVEDPPACKET_RESERVED
typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
 Port device extension.
typedef struct _DEVICE_EXTENSIONPDEVICE_EXTENSION
typedef struct __CPU_Private_Data CpuPrivateData
 Kernel buffer of each CPU.
typedef struct _OPEN_INSTANCE OPEN_INSTANCE
 Contains the state of a running instance of the NPF driver.
typedef struct _OPEN_INSTANCEPOPEN_INSTANCE

Enumerations

enum  ADAPTER_BINDING_STATUS { ADAPTER_UNBOUND, +ADAPTER_BOUND, +ADAPTER_UNBINDING + }

Functions

 C_ASSERT (sizeof(PACKET_OID_DATA)==12)

Variables

ULONG g_NCpu
NDIS_HANDLE g_NdisProtocolHandle
struct time_conv G_Start_Time
UINT g_SendPacketFlags
+

Define Documentation

+ +
+
+ + + + + + + + + +
#define C_ASSERT( ) 
+
+
+ +

Definition at line 133 of file Packet.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define EXIT_FAILURE(quantity  ) 
+
+
+Value:
Irp->IoStatus.Information=quantity;\
+    Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;\
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);\
+    return STATUS_UNSUCCESSFUL;\
+
+

Macro used in the I/O routines to return the control to user-mode with a failure status.

+ +

Definition at line 363 of file Packet.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define EXIT_SUCCESS(quantity  ) 
+
+
+Value:
Irp->IoStatus.Information=quantity;\
+    Irp->IoStatus.Status = STATUS_SUCCESS;\
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);\
+    return STATUS_SUCCESS;\
+
+

Macro used in the I/O routines to return the control to user-mode with a success status.

+ +

Definition at line 357 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define IMMEDIATE   1
+
+
+ +

Immediate timeout. Forces a read call to return immediately.

+ +

Definition at line 87 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define KERNEL_EVENT_NAMESPACE   L"\\BaseNamedObjects\\"
+
+
+ +

Definition at line 77 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define MAX_REQUESTS   32
+
+
+ +

Maximum number of simultaneous IOCTL requests.

+ +

Definition at line 71 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define MODE_CAPT   0x0
+
+
+ +

Capture working mode.

+ +

Definition at line 81 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define MODE_DUMP   0x10
+
+
+ +

Kernel dump working mode.

+ +

Definition at line 84 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define MODE_MON   0x2
+
+
+ +

Kernel monitoring mode.

+ +

Definition at line 83 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define MODE_STAT   0x1
+
+
+ +

Statistical working mode.

+ +

Definition at line 82 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define NDIS_FLAGS_SKIP_LOOPBACK_W2K   0x400
+
+
+ +

This is an undocumented flag for NdisSetPacketFlags() that allows to disable loopback reception.

+ +

Definition at line 89 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define NPF_DISABLE_LOOPBACK   1
+
+
+ +

Tells the driver to drop the packets sent by itself. This is usefult when building applications like bridges.

+ +

Definition at line 98 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define NPF_ENABLE_LOOPBACK   2
+
+
+ +

Tells the driver to capture the packets sent by itself.

+ +

Definition at line 99 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define Packet_ALIGNMENT   sizeof(int)
+
+
+ +

Alignment macro. Defines the alignment size.

+ +

Definition at line 73 of file Packet.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define Packet_WORDALIGN( )    (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
+
+
+ +

even multiple of Packet_ALIGNMENT.

+

Alignment macro. Rounds up to the next

+ +

Definition at line 74 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_VERSION_MAJOR   2
+
+
+ +

Major libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.

+ +

Definition at line 94 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_VERSION_MINOR   4
+
+
+ +

Minor libpcap version of the dump file. Used by programs like tcpdump to recognize a driver's generated dump file.

+ +

Definition at line 95 of file Packet.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define RESERVED(_p  )    ((PPACKET_RESERVED)((_p)->ProtocolReserved))
+
+
+ +

Macro to obtain a NDIS_PACKET from a PACKET_RESERVED.

+ +

Definition at line 189 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define TCPDUMP_MAGIC   0xa1b2c3d4
+
+
+ +

Libpcap magic number. Used by programs like tcpdump to recognize a driver's generated dump file.

+ +

Definition at line 93 of file Packet.h.

+ +
+
+ +
+
+ + + + +
#define TRANSMIT_PACKETS   256
+
+
+ +

of packets that can be transmitted at the same time or with a single call to NdisSendPackets.

+

Maximum number of packets in the transmit packet pool. This value is an upper bound to the number

+ +

Definition at line 352 of file Packet.h.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef struct __CPU_Private_Data + CpuPrivateData
+
+
+ +

Kernel buffer of each CPU.

+

Structure containing the kernel buffer (and other CPU related fields) used to capture packets.

+ +
+
+ +
+
+ + + + +
typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
+
+
+ +

Port device extension.

+

Structure containing some data relative to every adapter on which NPF is bound.

+ +
+
+ +
+
+ + + + +
typedef struct _INTERNAL_REQUEST INTERNAL_REQUEST
+
+
+ +

Stores an OID request.

+

This structure is used by the driver to perform OID query or set operations on the underlying NIC driver. The OID operations be performed usually only by network drivers, but NPF exports this mechanism to user-level applications through an IOCTL interface. The driver uses this structure to wrap a NDIS_REQUEST structure. This allows to handle correctly the callback structure of NdisRequest(), handling multiple requests and maintaining information about the IRPs to complete.

+ +
+
+ +
+
+ + + + +
typedef struct _OPEN_INSTANCE + OPEN_INSTANCE
+
+
+ +

Contains the state of a running instance of the NPF driver.

+

This is the most important structure of NPF: it is used by almost all the functions of the driver. An _OPEN_INSTANCE structure is associated with every user-level session, allowing concurrent access to the driver.

+ +
+
+ +
+
+ + + + +
typedef struct _PACKET_OID_DATA + PACKET_OID_DATA
+
+
+ +

Structure containing an OID request.

+

It is used by the PacketRequest() function to send an OID to the interface card driver. It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, the list of the multicast groups defined on it, and so on.

+ +
+
+ +
+
+ + + + +
typedef struct _PACKET_RESERVED PACKET_RESERVED
+
+
+ +

Contains a NDIS packet.

+

The driver uses this structure to wrap a NDIS_PACKET structure. This allows to handle correctly the callback structure of NdisTransferData(), handling multiple requests and maintaining information about the IRPs to complete.

+ +
+
+ +
+
+ + + + +
typedef struct _DEVICE_EXTENSION * PDEVICE_EXTENSION
+
+
+ +
+
+ +
+
+ + + + +
typedef struct _INTERNAL_REQUEST * PINTERNAL_REQUEST
+
+
+ +
+
+ +
+
+ + + + +
typedef struct _OPEN_INSTANCE * POPEN_INSTANCE
+
+
+ +
+
+ +
+
+ + + + +
typedef struct _PACKET_OID_DATA * PPACKET_OID_DATA
+
+
+ +
+
+ +
+
+ + + + +
typedef struct _PACKET_RESERVED * PPACKET_RESERVED
+
+
+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum ADAPTER_BINDING_STATUS
+
+
+
Enumerator:
+ + + +
ADAPTER_UNBOUND  +
ADAPTER_BOUND  +
ADAPTER_UNBINDING  +
+
+
+ +

Definition at line 327 of file Packet.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + +
C_ASSERT (sizeof(PACKET_OID_DATA = =12 ) 
+
+
+ +
+
+

Variable Documentation

+ +
+
+ + + + +
ULONG g_NCpu
+
+
+ +
+
+ +
+
+ + + + +
NDIS_HANDLE g_NdisProtocolHandle
+
+
+ +
+
+ +
+
+ + + + +
UINT g_SendPacketFlags
+
+
+ +
+
+ +
+
+ + + + +
struct time_conv G_Start_Time
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__NPF__ioctl.html b/ledset/WpdPack_4_1_2/docs/html/group__NPF__ioctl.html new file mode 100644 index 0000000..2548974 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__NPF__ioctl.html @@ -0,0 +1,376 @@ + + + + +WinPcap: NPF I/O control codes + + + + + + +
+

NPF I/O control codes
+ +[NPF driver internals manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Defines

#define BIOCSETBUFFERSIZE   9592
 IOCTL code: set kernel buffer size.
#define BIOCSETF   9030
 IOCTL code: set packet filtering program.
#define BIOCGSTATS   9031
 IOCTL code: get the capture stats.
#define BIOCSRTIMEOUT   7416
 IOCTL code: set the read timeout.
#define BIOCSMODE   7412
 IOCTL code: set working mode.
#define BIOCSWRITEREP   7413
 IOCTL code: set number of physical repetions of every packet written by the app.
#define BIOCSMINTOCOPY   7414
 IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
#define BIOCSETOID   0x80000000
 IOCTL code: set an OID value.
#define BIOCQUERYOID   0x80000004
 IOCTL code: get an OID value.
#define BIOCSETDUMPFILENAME   9029
 IOCTL code: set the name of a the file used by kernel dump mode.
#define BIOCGEVNAME   7415
 IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
#define BIOCSENDPACKETSNOSYNC   9032
 IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps.
#define BIOCSENDPACKETSSYNC   9033
 IOCTL code: Send a buffer containing multiple packets to the network, considering the timestamps.
#define BIOCSETDUMPLIMITS   9034
 IOCTL code: Set the dump file limits.
#define BIOCISDUMPENDED   7411
 IOCTL code: Get the status of the kernel dump process.
#define BIOCISETLOBBEH   7410
 IOCTL code: set the loopback behavior.
#define BIOCSETEVENTHANDLE   7920
 This IOCTL passes the read event HANDLE allocated by the user (packet.dll) to kernel level.
+

Define Documentation

+ +
+
+ + + + +
#define BIOCGEVNAME   7415
+
+
+ +

IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.

+

Command used by the application to retrieve the name of the global event associated with a NPF instance. The event is signaled by the driver when the kernel buffer contains enough data for a transfer.

+ +

Definition at line 137 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCGSTATS   9031
+
+
+ +

IOCTL code: get the capture stats.

+

This command returns to the application the number of packets received and the number of packets dropped by an instance of the driver.

+ +

Definition at line 75 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCISDUMPENDED   7411
+
+
+ +

IOCTL code: Get the status of the kernel dump process.

+

This command returns TRUE if the kernel dump is ended, i.e if one of the limits set with BIOCSETDUMPLIMITS (amount of bytes or number of packets) has been reached.

+ +

Definition at line 172 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCISETLOBBEH   7410
+
+
+ +

IOCTL code: set the loopback behavior.

+

This IOCTL sets the loopback behavior of the driver with packets sent by itself: capture or drop.

+ +

Definition at line 179 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCQUERYOID   0x80000004
+
+
+ +

IOCTL code: get an OID value.

+

This IOCTL is used to perform an OID get operation on the NIC driver.

+ +

Definition at line 120 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSENDPACKETSNOSYNC   9032
+
+
+ +

IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps.

+

Command used to send a buffer of packets in a single system call. Every packet in the buffer is preceded by a sf_pkthdr structure. The timestamps of the packets are ignored, i.e. the packets are sent as fast as possible. The NPF_BufferedWrite() function is invoked to send the packets.

+ +

Definition at line 146 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSENDPACKETSSYNC   9033
+
+
+ +

IOCTL code: Send a buffer containing multiple packets to the network, considering the timestamps.

+

Command used to send a buffer of packets in a single system call. Every packet in the buffer is preceded by a sf_pkthdr structure. The timestamps of the packets are used to synchronize the write, i.e. the packets are sent to the network respecting the intervals specified in the sf_pkthdr structure assiciated with each packet. NPF_BufferedWrite() function is invoked to send the packets.

+ +

Definition at line 156 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETBUFFERSIZE   9592
+
+
+ +

IOCTL code: set kernel buffer size.

+

This IOCTL is used to set a new size of the circular buffer associated with an instance of NPF. When a BIOCSETBUFFERSIZE command is received, the driver frees the old buffer, allocates the new one and resets all the parameters associated with the buffer in the OPEN_INSTANCE structure. The currently buffered packets are lost.

+ +

Definition at line 55 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETDUMPFILENAME   9029
+
+
+ +

IOCTL code: set the name of a the file used by kernel dump mode.

+

This command opens a file whose name is contained in the IOCTL buffer and associates it with current NPf instance. The dump thread uses it to copy the content of the circular buffer to file. If a file was already opened, the driver closes it before opening the new one.

+ +

Definition at line 129 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETDUMPLIMITS   9034
+
+
+ +

IOCTL code: Set the dump file limits.

+

This IOCTL sets the limits (maximum size and maximum number of packets) of the dump file created when the driver works in dump mode.

+ +

Definition at line 164 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETEVENTHANDLE   7920
+
+
+ +

This IOCTL passes the read event HANDLE allocated by the user (packet.dll) to kernel level.

+

Parameter: HANDLE Parameter size: sizeof(HANDLE). If the caller is 32 bit, the parameter size is 4 bytes, even if sizeof(HANDLE) at kernel level is 8 bytes. That's why in this IOCTL code handler we detect a 32bit calling process and do the necessary thunking.

+

TODO GV:I will go to hell for this ugly IOCTL definition. We should use CTL_CODE!!

+ +

Definition at line 190 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETF   9030
+
+
+ +

IOCTL code: set packet filtering program.

+

This IOCTL sets a new packet filter in the driver. Before allocating any memory for the new filter, the bpf_validate() function is called to check the correctness of the filter. If this function returns TRUE, the filter is copied to the driver's memory, its address is stored in the bpfprogram field of the OPEN_INSTANCE structure associated with current instance of the driver, and the filter will be applied to every incoming packet. This command also empties the circular buffer used by current instance to store packets. This is done to avoid the presence in the buffer of packets that do not match the filter.

+ +

Definition at line 67 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSETOID   0x80000000
+
+
+ +

IOCTL code: set an OID value.

+

This IOCTL is used to perform an OID set operation on the NIC driver.

+ +

Definition at line 113 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSMINTOCOPY   7414
+
+
+ +

IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.

+

This command sets the OPEN_INSTANCE::MinToCopy member.

+ +

Definition at line 106 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSMODE   7412
+
+
+ +

IOCTL code: set working mode.

+

This IOCTL can be used to set the working mode of a NPF instance. The new mode, received by the driver in the buffer associated with the IOCTL command, can be MODE_CAPT for capture mode (the default), MODE_STAT for statistical mode or MODE_DUMP for dump mode.

+ +

Definition at line 91 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSRTIMEOUT   7416
+
+
+ +

IOCTL code: set the read timeout.

+

This command sets the maximum timeout after which a read is released, also if no data packets were received.

+ +

Definition at line 82 of file ioctls.h.

+ +
+
+ +
+
+ + + + +
#define BIOCSWRITEREP   7413
+
+
+ +

IOCTL code: set number of physical repetions of every packet written by the app.

+

Sets the number of times a single write call must be repeated. This command sets the OPEN_INSTANCE::Nwrites member, and is used to implement the 'multiple write' feature of the driver.

+ +

Definition at line 99 of file ioctls.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__NPF__jitter.html b/ledset/WpdPack_4_1_2/docs/html/group__NPF__jitter.html new file mode 100644 index 0000000..b3edb27 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__NPF__jitter.html @@ -0,0 +1,1652 @@ + + + + +WinPcap: NPF Just-in-time compiler definitions + + + + + + +
+

NPF Just-in-time compiler definitions
+ +[NPF driver internals manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  binary_stream
 A stream of X86 binary code. More...
struct  JIT_BPF_Filter
 Structure describing a x86 filtering program created by the jitter. More...

Defines

#define EAX   0
#define ECX   1
#define EDX   2
#define EBX   3
#define ESP   4
#define EBP   5
#define ESI   6
#define EDI   7
#define AX   0
#define CX   1
#define DX   2
#define BX   3
#define SP   4
#define BP   5
#define SI   6
#define DI   7
#define AL   0
#define CL   1
#define DL   2
#define BL   3
#define MOVid(r32, i32)   emitm(&stream, 11 << 4 | 1 << 3 | r32 & 0x7, 1); emitm(&stream, i32, 4);
 mov r32,i32
#define MOVrd(dr32, sr32)   emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); emitm(&stream, 3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
 mov dr32,sr32
#define MOVodd(dr32, sr32, off)
 mov dr32,sr32[off]
#define MOVobd(dr32, sr32, or32)
 mov dr32,sr32[or32]
#define MOVobw(dr32, sr32, or32)
 mov dr16,sr32[or32]
#define MOVobb(dr8, sr32, or32)
 mov dr8,sr32[or32]
#define MOVomd(dr32, or32, sr32)
 mov [dr32][or32],sr32
#define BSWAP(dr32)
 bswap dr32
#define SWAP_AX()
 xchg al,ah
#define PUSH(r32)   emitm(&stream, 5 << 4 | 0 << 3 | r32 & 0x7, 1);
 push r32
#define POP(r32)   emitm(&stream, 5 << 4 | 1 << 3 | r32 & 0x7, 1);
 pop r32
#define RET()   emitm(&stream, 12 << 4 | 0 << 3 | 3, 1);
 ret
#define ADDrd(dr32, sr32)
 add dr32,sr32
#define ADD_EAXi(i32)
 add eax,i32
#define ADDid(r32, i32)
 add r32,i32
#define ADDib(r32, i8)
 add r32,i8
#define SUBrd(dr32, sr32)
 sub dr32,sr32
#define SUB_EAXi(i32)
 sub eax,i32
#define MULrd(r32)
 mul r32
#define DIVrd(r32)
 div r32
#define ANDib(r8, i8)
 and r8,i8
#define ANDid(r32, i32)
 and r32,i32
#define ANDrd(dr32, sr32)
 and dr32,sr32
#define ORrd(dr32, sr32)
 or dr32,sr32
#define ORid(r32, i32)
 or r32,i32
#define SHLib(r32, i8)
 shl r32,i8
#define SHL_CLrb(dr32)
 shl dr32,cl
#define SHRib(r32, i8)
 shr r32,i8
#define SHR_CLrb(dr32)
 shr dr32,cl
#define NEGd(r32)
 neg r32
#define CMPodd(dr32, sr32, off)
 cmp dr32,sr32[off]
#define CMPrd(dr32, sr32)
 cmp dr32,sr32
#define CMPid(dr32, i32)
 cmp dr32,i32
#define JNEb(off8)
 jne off32
#define JE(off32)
 je off32
#define JLE(off32)
 jle off32
#define JLEb(off8)
 jle off8
#define JA(off32)
 ja off32
#define JAE(off32)
 jae off32
#define JG(off32)
 jg off32
#define JGE(off32)
 jge off32
#define JMP(off32)
 jmp off32

Typedefs

typedef UINT(__cdecl * BPF_filter_function )(PVOID *, ULONG, UINT)
 Prototype of a filtering function created by the jitter.
typedef void(* emit_func )(binary_stream *stream, ULONG value, UINT n)
 Prototype of the emit functions.
+

Define Documentation

+ +
+
+ + + + + + + + + +
#define ADD_EAXi(i32  ) 
+
+
+Value:
emitm(&stream, 0x05, 1);\
+  emitm(&stream, i32, 4);
+
+

add eax,i32

+ +

Definition at line 175 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ADDib(r32,
i8  ) 
+
+
+Value:
emitm(&stream, 0x83, 1);\
+  emitm(&stream, 24 << 3 | r32, 1);\
+  emitm(&stream, i8, 1);
+
+

add r32,i8

+ +

Definition at line 186 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ADDid(r32,
i32  ) 
+
+
+Value:
emitm(&stream, 0x81, 1);\
+  emitm(&stream, 24 << 3 | r32, 1);\
+  emitm(&stream, i32, 4);
+
+

add r32,i32

+ +

Definition at line 180 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ADDrd(dr32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x03, 1);\
+  emitm(&stream, 3 << 6 | (dr32 & 0x7) << 3 | (sr32 & 0x7), 1);
+
+

add dr32,sr32

+ +

Definition at line 170 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define AL   0
+
+
+ +

Definition at line 63 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ANDib(r8,
i8  ) 
+
+
+Value:
emitm(&stream, 0x80, 1);\
+  emitm(&stream, 7 << 5 | r8, 1);\
+  emitm(&stream, i8, 1);
+
+

and r8,i8

+ +

Definition at line 212 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ANDid(r32,
i32  ) 
+
+
+Value:
if (r32 == EAX){ \
+  emitm(&stream, 0x25, 1);\
+  emitm(&stream, i32, 4);}\
+  else{ \
+  emitm(&stream, 0x81, 1);\
+  emitm(&stream, 7 << 5 | r32, 1);\
+  emitm(&stream, i32, 4);}
+
+

and r32,i32

+ +

Definition at line 218 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ANDrd(dr32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x23, 1);\
+  emitm(&stream,  3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
+
+

and dr32,sr32

+ +

Definition at line 228 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define AX   0
+
+
+ +

Definition at line 54 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define BL   3
+
+
+ +

Definition at line 66 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define BP   5
+
+
+ +

Definition at line 59 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define BSWAP(dr32  ) 
+
+
+Value:
emitm(&stream, 0xf, 1); \
+  emitm(&stream,  0x19 << 3 | dr32 , 1);
+
+

bswap dr32

+ +

Definition at line 148 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define BX   3
+
+
+ +

Definition at line 57 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define CL   1
+
+
+ +

Definition at line 64 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define CMPid(dr32,
i32  ) 
+
+
+Value:
if (dr32 == EAX){ \
+  emitm(&stream, 0x3d, 1); \
+  emitm(&stream,  i32, 4);} \
+  else{ \
+  emitm(&stream, 0x81, 1); \
+  emitm(&stream,  0x1f << 3 | (dr32 & 0x7), 1);\
+  emitm(&stream,  i32, 4);}
+
+

cmp dr32,i32

+ +

Definition at line 286 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define CMPodd(dr32,
sr32,
off  ) 
+
+
+Value:
emitm(&stream, 3 << 4 | 3 | 1 << 3, 1); \
+  emitm(&stream,  1 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);\
+  emitm(&stream,  off, 1);
+
+

cmp dr32,sr32[off]

+ +

Definition at line 275 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define CMPrd(dr32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x3b, 1); \
+  emitm(&stream,  3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
+
+

cmp dr32,sr32

+ +

Definition at line 281 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define CX   1
+
+
+ +

Definition at line 55 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define DI   7
+
+
+ +

Definition at line 61 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define DIVrd(r32  ) 
+
+
+Value:
emitm(&stream, 0xf7, 1);\
+  emitm(&stream, 15 << 4 | (r32 & 0x7), 1);
+
+

div r32

+ +

Definition at line 207 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define DL   2
+
+
+ +

Definition at line 65 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define DX   2
+
+
+ +

Definition at line 56 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define EAX   0
+
+
+ +

Definition at line 45 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define EBP   5
+
+
+ +

Definition at line 50 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define EBX   3
+
+
+ +

Definition at line 48 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define ECX   1
+
+
+ +

Definition at line 46 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define EDI   7
+
+
+ +

Definition at line 52 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define EDX   2
+
+
+ +

Definition at line 47 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define ESI   6
+
+
+ +

Definition at line 51 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define ESP   4
+
+
+ +

Definition at line 49 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JA(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x87, 1);\
+   emitm(&stream, off32, 4);
+
+

ja off32

+ +

Definition at line 318 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JAE(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x83, 1);\
+   emitm(&stream, off32, 4);
+
+

jae off32

+ +

Definition at line 324 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JE(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x84, 1);\
+   emitm(&stream, off32, 4);
+
+

je off32

+ +

Definition at line 301 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JG(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x8f, 1);\
+   emitm(&stream, off32, 4);
+
+

jg off32

+ +

Definition at line 330 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JGE(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x8d, 1);\
+   emitm(&stream, off32, 4);
+
+

jge off32

+ +

Definition at line 336 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JLE(off32  ) 
+
+
+Value:
emitm(&stream, 0x0f, 1);\
+   emitm(&stream, 0x8e, 1);\
+   emitm(&stream, off32, 4);
+
+

jle off32

+ +

Definition at line 307 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JLEb(off8  ) 
+
+
+Value:
emitm(&stream, 0x7e, 1);\
+   emitm(&stream, off8, 1);
+
+

jle off8

+ +

Definition at line 313 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JMP(off32  ) 
+
+
+Value:
emitm(&stream, 0xe9, 1);\
+   emitm(&stream, off32, 4);
+
+

jmp off32

+ +

Definition at line 342 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define JNEb(off8  ) 
+
+
+Value:
emitm(&stream, 0x75, 1);\
+   emitm(&stream, off8, 1);
+
+

jne off32

+ +

Definition at line 296 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define MOVid(r32,
i32  )    emitm(&stream, 11 << 4 | 1 << 3 | r32 & 0x7, 1); emitm(&stream, i32, 4);
+
+
+ +

mov r32,i32

+ +

Definition at line 109 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define MOVobb(dr8,
sr32,
or32  ) 
+
+
+Value:
emitm(&stream, 0x8a, 1); \
+  emitm(&stream,  (dr8 & 0x7) << 3 | 4 , 1);\
+  emitm(&stream,  (or32 & 0x7) << 3 | (sr32 & 0x7) , 1);
+
+

mov dr8,sr32[or32]

+ +

Definition at line 136 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define MOVobd(dr32,
sr32,
or32  ) 
+
+
+Value:
emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); \
+  emitm(&stream,  (dr32 & 0x7) << 3 | 4 , 1);\
+  emitm(&stream,  (or32 & 0x7) << 3 | (sr32 & 0x7) , 1);
+
+

mov dr32,sr32[or32]

+ +

Definition at line 123 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define MOVobw(dr32,
sr32,
or32  ) 
+
+
+Value:
emitm(&stream, 0x66, 1); \
+  emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); \
+  emitm(&stream,  (dr32 & 0x7) << 3 | 4 , 1);\
+  emitm(&stream,  (or32 & 0x7) << 3 | (sr32 & 0x7) , 1);
+
+

mov dr16,sr32[or32]

+ +

Definition at line 129 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define MOVodd(dr32,
sr32,
off  ) 
+
+
+Value:
emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); \
+  emitm(&stream,  1 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);\
+  emitm(&stream,  off, 1);
+
+

mov dr32,sr32[off]

+ +

Definition at line 117 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define MOVomd(dr32,
or32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x89, 1); \
+  emitm(&stream,  (sr32 & 0x7) << 3 | 4 , 1);\
+  emitm(&stream,  (or32 & 0x7) << 3 | (dr32 & 0x7) , 1);
+
+

mov [dr32][or32],sr32

+ +

Definition at line 142 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define MOVrd(dr32,
sr32  )    emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); emitm(&stream, 3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
+
+
+ +

mov dr32,sr32

+ +

Definition at line 113 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define MULrd(r32  ) 
+
+
+Value:
emitm(&stream, 0xf7, 1);\
+  emitm(&stream, 7 << 5 | (r32 & 0x7), 1);
+
+

mul r32

+ +

Definition at line 202 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define NEGd(r32  ) 
+
+
+Value:
emitm(&stream, 0xf7, 1);\
+  emitm(&stream,  27 << 3 | r32 & 0x7, 1);
+
+

neg r32

+ +

Definition at line 270 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ORid(r32,
i32  ) 
+
+
+Value:
if (r32 == EAX){ \
+  emitm(&stream, 0x0d, 1);\
+  emitm(&stream, i32, 4);}\
+  else{ \
+  emitm(&stream, 0x81, 1);\
+  emitm(&stream, 25 << 3 | r32, 1);\
+  emitm(&stream, i32, 4);}
+
+

or r32,i32

+ +

Definition at line 238 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define ORrd(dr32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x0b, 1);\
+  emitm(&stream,  3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
+
+

or dr32,sr32

+ +

Definition at line 233 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define POP(r32  )    emitm(&stream, 5 << 4 | 1 << 3 | r32 & 0x7, 1);
+
+
+ +

pop r32

+ +

Definition at line 162 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define PUSH(r32  )    emitm(&stream, 5 << 4 | 0 << 3 | r32 & 0x7, 1);
+
+
+ +

push r32

+ +

Definition at line 158 of file jitter.h.

+ +
+
+ +
+
+ + + + +  + + + + +
#define RET( )    emitm(&stream, 12 << 4 | 0 << 3 | 3, 1);
+
+
+ +

ret

+ +

Definition at line 166 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define SHL_CLrb(dr32  ) 
+
+
+Value:
emitm(&stream, 0xd3, 1);\
+  emitm(&stream,  7 << 5 | dr32 & 0x7, 1);
+
+

shl dr32,cl

+ +

Definition at line 254 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define SHLib(r32,
i8  ) 
+
+
+Value:
emitm(&stream, 0xc1, 1);\
+  emitm(&stream, 7 << 5 | r32 & 0x7, 1);\
+  emitm(&stream, i8, 1);
+
+

shl r32,i8

+ +

Definition at line 248 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define SHR_CLrb(dr32  ) 
+
+
+Value:
emitm(&stream, 0xd3, 1);\
+  emitm(&stream,  29 << 3 | dr32 & 0x7, 1);
+
+

shr dr32,cl

+ +

Definition at line 265 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define SHRib(r32,
i8  ) 
+
+
+Value:
emitm(&stream, 0xc1, 1);\
+  emitm(&stream, 29 << 3 | r32 & 0x7, 1);\
+  emitm(&stream, i8, 1);
+
+

shr r32,i8

+ +

Definition at line 259 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define SI   6
+
+
+ +

Definition at line 60 of file jitter.h.

+ +
+
+ +
+
+ + + + +
#define SP   4
+
+
+ +

Definition at line 58 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + +
#define SUB_EAXi(i32  ) 
+
+
+Value:
emitm(&stream, 0x2d, 1);\
+  emitm(&stream, i32, 4);
+
+

sub eax,i32

+ +

Definition at line 197 of file jitter.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + +
#define SUBrd(dr32,
sr32  ) 
+
+
+Value:
emitm(&stream, 0x2b, 1);\
+  emitm(&stream, 3 << 6 | (dr32 & 0x7) << 3 | (sr32 & 0x7), 1);
+
+

sub dr32,sr32

+ +

Definition at line 192 of file jitter.h.

+ +
+
+ +
+
+ + + + +  + + + + +
#define SWAP_AX( ) 
+
+
+Value:
emitm(&stream, 0x86, 1); \
+  emitm(&stream,  0xc4 , 1);
+
+

xchg al,ah

+ +

Definition at line 153 of file jitter.h.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef UINT(__cdecl * BPF_filter_function)(PVOID *, ULONG, UINT)
+
+
+ +

Prototype of a filtering function created by the jitter.

+

The syntax and the meaning of the parameters is analogous to the one of bpf_filter(). Notice that the filter is not among the parameters, because it is hardwired in the function.

+ +

Definition at line 82 of file jitter.h.

+ +
+
+ +
+
+ + + + +
typedef void(* emit_func)(binary_stream *stream, ULONG value, UINT n)
+
+
+ +

Prototype of the emit functions.

+

Different emit functions are used to create the reference table and to generate the actual filtering code. This allows to have simpler instruction macros. The first parameter is the stream that will receive the data. The secon one is a variable containing the data, the third one is the length, that can be 1,2 or 4 since it is possible to emit a byte, a short or a work at a time.

+ +

Definition at line 92 of file jitter.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__compilation.html b/ledset/WpdPack_4_1_2/docs/html/group__compilation.html new file mode 100644 index 0000000..8a7e140 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__compilation.html @@ -0,0 +1,242 @@ + + + + +WinPcap: How to compile WinPcap + + + + + + +
+

How to compile WinPcap
+ +[WinPcap internals] +

+
+ + + + + + + + + + +

This section explains how to compile WinPcap, both the kernel level and +the user-level portion, on the various Win32 platforms. The source code can be +found on the WinPcap website.

+

Compiling the driver

+

Two main NPF source trees are available for compilation:  Windows NTx and Windows 9x. Note that, since the NPF +Driver is platform-dependent, it is STRONGLY suggested to compile it for the OS where it will be used, in order to +link the correct DDK libraries. For example, if you compile the +driver with the Windows NT 4 DDK, it will not work properly on Windows 2000 and +vice versa.

+

Compiling the driver for Windows NT4

+

Software requirements:

+
    +
  • Microsoft Driver Developer Kit (DDK) for Windows NT4
  • +
  • A recent version of the Microsoft Platform Software Development Kit + (SDK) that is compatible with Visual Studio 6 (the latest compatible one is + Platform SDK February 2003). This version of the PSDK is available on the + Microsoft web site at + + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm. + It can be ordered online at + + http://www.qmedia.ca/launch/psdk.htm, and it's also available to + Microsoft MSDN subscribers on the Subscribers Downloads web site.
  • Microsoft Visual C++ 6.0 + with Service Pack 5 or 6 (both the service packs are available online on the + Microsoft web site).
+

If your system satisfies these requirements, follow these steps:

+
    +
  1. From the Windows NT Start menu, select the folder Programs and + then Development Kits, then Windows NT4 DDK. From here select the voice + Checked Build + Environment if you want to build a debug version, or Free Build + Environment if you want to build a release version. +
  2. A command prompt will be opened. Move to the directory PacketNTx inside the + WinPcap source folder and type the command

    CompileDriver
    +
    This script will generate the driver (npf.sys). The binary will be put in + one of these folders
      +
    • Free Build Environment: winpcap\PacketNTx\driver\bin\NT4\i386\free
    • +
    • Checked Build Environment: winpcap\PacketNTx\driver\bin\NT4\i386\checked
    • +
    +
+

Warning: sometimes, during the compilation of the driver, a lot of +'last line incomplete' errors are generated. Ignore these errors and let the +compilation process continue, they are due to bugs in some DDK versions.

+

Compiling the driver for Windows 2000/XP/2003/Vista/2008/Win7/2008R2 (x86 and x64)

+

Software requirements:

+
    +
  • Microsoft Windows Driver Kit (WDK) 6001.18002. As of release 4.1, + WinPcap is compiled with WDK 6001.18002.
  • +
+

NOTE: it should be possible to use older DDKs to compile WinPcap, but you +might need to +manually modify the compilation scripts in order to disable PREfast (PREfast is +a static code analysis tool shipped with recent versions of the DDK/WDK).

+

If your system satisfies these requirements, follow these steps:

+
    +
  1. From the Windows Start menu, select the folder Programs and + then Windows Driver K, then WDK 6001.18002, then Build Environments.
      +
    • x86 driver: Choose Windows 2000 and then Windows 2000 x86 Free Build Environment if you want to build a release version or Windows 2000 + x86 Checked Build Environment if you want to build a debug version.
    • +
    • x64 driver: Choose Windows Server 2003 and then Windows + Server 2003 x64 Free Build Environment if you want to build a release version or + Windows Server 2003 + x64 Checked Build Environment if you want to build a debug version.
    • +
    +
  2. A command prompt will be opened. Move to the directory PacketNTx inside the + WinPcap source folder and type the command

    CompileDriver
    +
    This script will generate the driver (npf.sys). The binary will be put in + one of these folders
      +
    • x86 driver (both Free and Checked Build): winpcap\PacketNTx\driver\bin\i386
    • +
    • x64 driver (both Free and Checked Build): winpcap\PacketNTx\driver\bin\amd64
    • +
    +
+

Compiling the driver on Windows 9x

+

NOTE: this Windows platform is no longer supported by +WinPcap. However, the sources for these operating systems are still available in +the sources package.

+

To compile the driver for Windows 9x you will need:

+
    +
  • Driver Developer Kit (DDK) for Windows 95/98/ME +
  • A recent version of the Microsoft Platform Software Development Kit (SDK) + that is compatible with Visual Studio 6 (the latest compatible one is + Platform SDK February 2003). This version of the PSDK is available on the + Microsoft web site at + + http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm. + It can be ordered online at + + http://www.qmedia.ca/launch/psdk.htm, and it's also available to + Microsoft MSDN subscribers on the Subscribers Downloads web site.
  • Microsoft Visual C++ 6.0 + with Service Pack 5 or 6 (both the service packs are available online on the + Microsoft web site).
+

The steps to follow are:

+
    +
  1. Open a DOS shell +
  2. Go to the VisualC++ BIN directory (for example C:\DEVSTUDIO\VC\BIN) and + execute the command
    +
    + Vcvars32
    +
    +
  3. Go to the SDK directory (for example C:\MSSDK) and execute the command
    +
    + Setenv sdk_path
    +
    + where sdk_path is the directory of SDK (for example Setenv C:\MSSDK) +
  4. Go to the DDK directory (for example C:\DDK) and execute the command
    +
    + Ddkenv 32 net
    +
    +
  5. Move to the directory whit the driver's source code and type the command
    +
    + nmake rtl
    +
    +
    to obtain a release version, or
    +
    + nmake
    +
    +
    to obtain a debug version.
    The release version of packet.vxd will be placed in the + retail + directory, the debug version in the debug directory.
  6. +
+

Warning: On some systems the NMAKE utility is not able to +launch ADRC2VXD, this means that the driver binary is generated correctly, but +without the copyright information. We don't know the cause of this problem.

+

Compiling packet.dll

+

The source tree for this DLL is located in PacketNTx\dll\.

+

NOTE: the 9x family of Windows operating systems is no longer supported +by WinPcap. However, the sources for these operating systems are still available +in the sources package.

+

Software requirements:

+
    +
  • Microsoft Visual Studio 2005 SP1. It's theoretically possible to compile + the x86 version with Visual Studio 6, but the project files are no longer + maintained.
  • The AirPcap developer's pack from + + http://www.cacetech.com/products/airpcap.htm. The AirPcap developer's + pack needs to be unzipped in a folder in the same folder where the WinPcap + sources have been unzipped.
+

To compile the PACKET.DLL, load the project packet.sln contained in the directory PacketNTx\dll\project +in Visual Studio 2005. There are several project +configurations, each of them available for the x86 (Win32) and x64 platforms:

+
    +
  • Release: standard release configuration
  • +
  • Debug: standard debug configuration
  • +
  • Release NT4: release configuration able to run on + NT4. It does not include Wan and IP helper API support.
  • +
  • Debug NT4: debug configuration able to run on + NT4. It does not include Wan and IP helper API support.
  • +
  • Release No NetMon: release configuration able to run on + Vista. It + does not include Wan support (with the NetMon API).
  • +
  • Debug No NetMon: debug configuration able to run on + Vista. It + does not include Wan support (with the NetMon API).
  • +
  • Release LOG_TO_FILE: standard release configuration with tracing to + file enabled.
  • +
  • Release NT4 LOG_TO_FILE: release configuration able to run on + NT4 with tracing to file enabled. It does not include Wan and IP helper API support.
  • +
  • Release No NetMon LOG_TO_FILE: release configuration able to run on + Vista with tracing to file enabled. It + does not include Wan support (with the NetMon API).
  • +
+

Choose the desired configuration and build the project to obtain the binary +files.

+

Compiling wpcap.dll

+

wpcap.dll can be compiled for any Win32 platform and the generated dll is system independent.

+

System Requirements:

+
    +
  • Microsoft Visual Studio 2005 SP1. It's theoretically possible to compile + the x86 version with Visual Studio 6, but the project files are no longer + maintained.
  • The AirPcap developer's pack from + + http://www.cacetech.com/products/airpcap.htm. The AirPcap developer's + pack needs to be unzipped in a folder in the same folder where the WinPcap + sources have been unzipped.There are eight build project configurations:
+

To compile the wpcap.dll, load the project wpcap.sln contained in the directory +wpcap\PRJ +in Visual Studio 2005. There are several project +configurations, each of them available for the x86 (Win32) and x64 platforms:

+
    +
  • Release: standard release configuration
  • +
  • Debug: standard debug configuration
  • +
  • Release No AirPcap: release configuration without support for + AirPcap adapters.
  • +
  • Debug No AirPcap: debug configuration without support for AirPcap + adapters.
  • +
+

Choose the desired configuration and build the project to obtain the binary +files.

+

Note: wpcap.dll contains the source code of libpcap from +www.tcpdump.org, with some modifications +for remote capture. You will be able to include and build a different libpcap +version simply copying it in the directory winpcap\wpcap\prj of the +WinPcap source code distribution, but you must use the "Debug" or "Release" +build configurations.

+ + + + +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__internals.html b/ledset/WpdPack_4_1_2/docs/html/group__internals.html new file mode 100644 index 0000000..089963e --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__internals.html @@ -0,0 +1,98 @@ + + + + +WinPcap: WinPcap internals + + + + + + +
+

WinPcap internals

+ + + + +

Modules

 NPF driver internals manual
 How to compile WinPcap
 Packet.dll -- Packet Driver API
+

Detailed Description

+ + + + + + + + + + +This portion of the manual describes the internal structure and interfaces of WinPcap, +starting from the lowest-level module. It is targeted at people that must extend +or modify this software, or to the ones interested in how it works. Therefore, +developers who just want to use WinPcap in their software don't need to read it. + +

WinPcap structure

+

Quoted from the home page of winpcap:

+

WinPcap is an architecture for packet capture and network analysis for the +Win32 platforms. It includes a kernel-level packet filter, a +low-level dynamic link library (packet.dll), and a high-level and +system-independent library (wpcap.dll).

+

Why we use the term "architecture" rather than "library"? Because packet capture is a low level mechanism +that requires a strict interaction with the network adapter and with the +operating system, in particular with its networking implementation, so a simple +library is not sufficient.

+

The following figure shows the various components of WinPcap:

+

+ +

+Main components of WinPcap. +

First, a capture system needs to bypass the operating systems's protocol stack in order to access +the raw data transiting on the network. This requires a portion +running inside the kernel of OS, interacting directly with the network interface +drivers. This portion is very system dependent, and in +our solution it is realized as a device driver, called Netgroup Packet Filter (NPF); +we provide different versions of the driver for Windows 95, Windows 98, Windows ME, +Windows NT 4, +Windows 2000 and Windows XP. These drivers offer both basic features like packet capture +and injection, as well as more advanced ones like a programmable filtering system and a +monitoring engine. The first one can be used to restrict a capture session to a +subset of the network traffic (e.g. it is possible to capture only the ftp +traffic generated by a particular host), the second one provides a powerful but +simple to use mechanism to obtain statistics on the traffic (e.g. it is possible +to obtain the network load or the amount of data exchanged between two hosts).

+

Second, the capture system must export an interface that user-level +applications will use to take advantage of the features provided by the kernel +driver. WinPcap provides two different libraries: packet.dll and wpcap.dll

+

+The first one offers a low-level API that can be used to directly access the +functions of the driver, with a programming interface independent from the +Microsoft OS. 

+

The second one exports a more powerful set of high level capture +primitives that are compatible with libpcap, the well known Unix capture +library. These functions enable packet capture in a manner that is independent +of the +underlying network hardware and operating system.

+

Throughout this documentation we will refer to the Packet Driver API or +packet.dll as the first set of functions, whereas wpcap, wpcap.dll or libpcap + will refer to the to the second one.

+ + + + +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__language.html b/ledset/WpdPack_4_1_2/docs/html/group__language.html new file mode 100644 index 0000000..4dcc1bf --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__language.html @@ -0,0 +1,633 @@ + + + + +WinPcap: Filtering expression syntax + + + + + + +
+

Filtering expression syntax
+ +[WinPcap user's manual] +

+
+ + + + + + + + + + +
+
Note: this document has been drawn from the tcpdump man page. The original version can + be found at  www.tcpdump.org. +
 
+
wpcap filters are based on a declarative predicate syntax. A filter is + an ASCII string containing a filtering expression. pcap_compile() + takes the expression and translates it in a program for the kernel-level + packet filter. +
+

The expression selects which packets will be dumped. +If no expression +is given, all packets on the net will be accepted by the kernel-level filtering +engine. +Otherwise, +only packets for which expression is `true' will be accepted.

+

+ +The expression consists of one or more +primitives. + +Primitives usually consist of an +id + +(name or number) preceded by one or more qualifiers. +There are three +different kinds of qualifier: +

+
type
+qualifiers say what kind of thing the id name or number refers to. +Possible types are +host, + +net + +and +port. + +E.g., `host foo', `net 128.3', `port 20'. +If there is no type +qualifier, +host + +is assumed. +
dir
+qualifiers specify a particular transfer direction to and/or from +id. + +Possible directions are +src, + +dst, + +src or dst + +and +src and + +dst. + +E.g., `src foo', `dst net 128.3', `src or dst port ftp-data'. +If +there is no dir qualifier, +src or dst + +is assumed. +For `null' link layers (i.e. point to point protocols such as slip) the +inbound + +and +outbound + +qualifiers can be used to specify a desired direction. +
proto
+qualifiers restrict the match to a particular protocol. +Possible +protos are: +ether, + +fddi, + +tr, + +ip, + +ip6, + +arp, + +rarp, + +decnet, + +tcp + +and +udp. + +E.g., `ether src foo', `arp net 128.3', `tcp port 21'. +If there is +no proto qualifier, all protocols consistent with the type are +assumed. +E.g., `src foo' means `(ip or arp or rarp) src foo' +(except the latter is not legal syntax), `net bar' means `(ip or +arp or rarp) net bar' and `port 53' means `(tcp or udp) port 53'. +
+

+ +[`fddi' is actually an alias for `ether'; the parser treats them +identically as meaning ``the data link level used on the specified +network interface.'' FDDI headers contain Ethernet-like source +and destination addresses, and often contain Ethernet-like packet +types, so you can filter on these FDDI fields just as with the +analogous Ethernet fields. +FDDI headers also contain other fields, +but you cannot name them explicitly in a filter expression. +

+ +Similarly, `tr' is an alias for `ether'; the previous paragraph's +statements about FDDI headers also apply to Token Ring headers.] +

+ +In addition to the above, there are some special `primitive' keywords +that don't follow the pattern: +gateway, + +broadcast, + +less, + +greater + +and arithmetic expressions. +All of these are described below. +

+ +More complex filter expressions are built up by using the words +and, + +or + +and +not + +to combine primitives. +E.g., `host foo and not port ftp and not port ftp-data'. +To save typing, identical qualifier lists can be omitted. +E.g., +`tcp dst port ftp or ftp-data or domain' is exactly the same as +`tcp dst port ftp or tcp dst port ftp-data or tcp dst port domain'. +

+ +Allowable primitives are: +

+
dst host host
+True if the IPv4/v6 destination field of the packet is host, +which may be either an address or a name. +
src host host
+True if the IPv4/v6 source field of the packet is host. +
host host
+True if either the IPv4/v6 source or destination of the packet is host. +Any of the above host expressions can be prepended with the keywords, +ip, arp, rarp, or ip6 as in: +
+
+ +
ip host host
+ + +
+
+ + +which is equivalent to: +
+
+ +
ether proto \ip and host host
+ + +
+
+ + +If host is a name with multiple IP addresses, each address will +be checked for a match. +
ether dst ehost
+True if the ethernet destination address is ehost. +Ehost +may be either a name from /etc/ethers or a number (see +ethers(3N) + +for numeric format). +
ether src ehost
+True if the ethernet source address is ehost. +
ether host ehost
+True if either the ethernet source or destination address is ehost. +
gateway host
+True if the packet used host as a gateway. +I.e., the ethernet +source or destination address was host but neither the IP source +nor the IP destination was host. +Host must be a name and +must be found both by the machine's host-name-to-IP-address resolution +mechanisms (host name file, DNS, NIS, etc.) and by the machine's +host-name-to-Ethernet-address resolution mechanism (/etc/ethers, etc.). +(An equivalent expression is +
+
+ +
ether host ehost and not host host
+ + +
+
+ + +which can be used with either names or numbers for host / ehost.) +This syntax does not work in IPv6-enabled configuration at this moment. +
dst net net
+True if the IPv4/v6 destination address of the packet has a network +number of net. +Net may be either a name from /etc/networks +or a network number (see networks(4) for details). +
src net net
+True if the IPv4/v6 source address of the packet has a network +number of net. +
net net
+True if either the IPv4/v6 source or destination address of the packet has a network +number of net. +
net net mask netmask
+True if the IP address matches net with the specific netmask. +May be qualified with src or dst. +Note that this syntax is not valid for IPv6 net. +
net net/len
+True if the IPv4/v6 address matches net with a netmask len +bits wide. +May be qualified with src or dst. +
dst port port
+True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a +destination port value of port. +The port can be a number or a name used in /etc/services (see +tcp(4P) + +and +udp(4P)). + +If a name is used, both the port +number and protocol are checked. +If a number or ambiguous name is used, +only the port number is checked (e.g., dst port 513 will print both +tcp/login traffic and udp/who traffic, and port domain will print +both tcp/domain and udp/domain traffic). +
src port port
+True if the packet has a source port value of port. +
port port
+True if either the source or destination port of the packet is port. +Any of the above port expressions can be prepended with the keywords, +tcp or udp, as in: +
+
+ +
tcp src port port
+ + +
+
+ + +which matches only tcp packets whose source port is port. +
less length
+True if the packet has a length less than or equal to length. +This is equivalent to: +
+
+ +
len <= length.
+ + +
+
+ + +
greater length
+True if the packet has a length greater than or equal to length. +This is equivalent to: +
+
+ +
len >= length.
+ + +
+
+ + +
ip proto protocol
+True if the packet is an IP packet (see +ip(4P)) + +of protocol type protocol. +Protocol can be a number or one of the names +icmp, icmp6, igmp, igrp, pim, ah, +esp, vrrp, udp, or tcp. +Note that the identifiers tcp, udp, and icmp are also +keywords and must be escaped via backslash (\), which is \\ in the C-shell. +Note that this primitive does not chase the protocol header chain. +
ip6 proto protocol
+True if the packet is an IPv6 packet of protocol type protocol. +Note that this primitive does not chase the protocol header chain. +
ip6 protochain protocol
+True if the packet is IPv6 packet, +and contains protocol header with type protocol +in its protocol header chain. +For example, +
+
+ +
ip6 protochain 6
+ + +
+
+ + +matches any IPv6 packet with TCP protocol header in the protocol header chain. +The packet may contain, for example, +authentication header, routing header, or hop-by-hop option header, +between IPv6 header and TCP header. +The BPF code emitted by this primitive is complex and +cannot be optimized by BPF optimizer code in tcpdump, +so this can be somewhat slow. +
ip protochain protocol
+Equivalent to ip6 protochain protocol, but this is for IPv4. +
ether broadcast
+True if the packet is an ethernet broadcast packet. +The ether +keyword is optional. +
ip broadcast
+True if the packet is an IP broadcast packet. +It checks for both +the all-zeroes and all-ones broadcast conventions, and looks up +the local subnet mask. +
ether multicast
+True if the packet is an ethernet multicast packet. +The ether +keyword is optional. +This is shorthand for `ether[0] & 1 != 0'. +
ip multicast
+True if the packet is an IP multicast packet. +
ip6 multicast
+True if the packet is an IPv6 multicast packet. +
ether proto protocol
+True if the packet is of ether type protocol. +Protocol can be a number or one of the names +ip, ip6, arp, rarp, atalk, aarp, +decnet, sca, lat, mopdl, moprc, +iso, stp, ipx, or netbeui. +Note these identifiers are also keywords +and must be escaped via backslash (\). +
+[In the case of FDDI (e.g., `fddi protocol arp') and Token Ring +(e.g., `tr protocol arp'), for most of those protocols, the +protocol identification comes from the 802.2 Logical Link Control (LLC) +header, which is usually layered on top of the FDDI or Token Ring +header. +
+When filtering for most protocol identifiers on FDDI or Token Ring, +tcpdump checks only the protocol ID field of an LLC header in +so-called SNAP format with an Organizational Unit Identifier (OUI) of +0x000000, for encapsulated Ethernet; it doesn't check whether the packet +is in SNAP format with an OUI of 0x000000. +
+The exceptions are iso, for which it checks the DSAP (Destination +Service Access Point) and SSAP (Source Service Access Point) fields of +the LLC header, stp and netbeui, where it checks the DSAP of +the LLC header, and atalk, where it checks for a SNAP-format +packet with an OUI of 0x080007 and the Appletalk etype. +
+In the case of Ethernet, tcpdump checks the Ethernet type field +for most of those protocols; the exceptions are iso, sap, +and netbeui, for which it checks for an 802.3 frame and then +checks the LLC header as it does for FDDI and Token Ring, atalk, +where it checks both for the Appletalk etype in an Ethernet frame and +for a SNAP-format packet as it does for FDDI and Token Ring, aarp, +where it checks for the Appletalk ARP etype in either an Ethernet frame +or an 802.2 SNAP frame with an OUI of 0x000000, and ipx, where it +checks for the IPX etype in an Ethernet frame, the IPX DSAP in the LLC +header, the 802.3 with no LLC header encapsulation of IPX, and the IPX +etype in a SNAP frame.] +
decnet src host
+True if the DECNET source address is +host, + +which may be an address of the form ``10.123'', or a DECNET host +name. +[DECNET host name support is only available on Ultrix systems +that are configured to run DECNET.] +
decnet dst host
+True if the DECNET destination address is +host. + +
decnet host host
+True if either the DECNET source or destination address is +host. + +
ip, ip6, arp, rarp, atalk, aarp, decnet, iso, stp, ipx, netbeui
+Abbreviations for: +
+
+ +
ether proto p
+ + +
+
+ + +where p is one of the above protocols. +
lat, moprc, mopdl
+Abbreviations for: +
+
+ +
ether proto p
+ + +
+
+ + +where p is one of the above protocols. +Note that +tcpdump does not currently know how to parse these protocols. +
vlan [vlan_id]
+True if the packet is an IEEE 802.1Q VLAN packet. +If [vlan_id] is specified, only true is the packet has the specified +vlan_id. +Note that the first vlan keyword encountered in expression +changes the decoding offsets for the remainder of expression +on the assumption that the packet is a VLAN packet. +
tcp, udp, icmp
+Abbreviations for: +
+
+ +
ip proto p or ip6 proto p
+ + +
+
+ + +where p is one of the above protocols. +
iso proto protocol
+True if the packet is an OSI packet of protocol type protocol. +Protocol can be a number or one of the names +clnp, esis, or isis. +
clnp, esis, isis
+Abbreviations for: +
+
+ +
iso proto p
+ + +
+
+ + +where p is one of the above protocols. +Note that tcpdump does an incomplete job of parsing these protocols. +
expr relop expr
+True if the relation holds, where relop is one of >, <, >=, <=, =, !=, +and expr is an arithmetic expression composed of integer constants +(expressed in standard C syntax), the normal binary operators +[+, -, *, /, &, |], a length operator, and special packet data accessors. +To access +data inside the packet, use the following syntax: + +
+proto [ expr : size ]
+
+ + +Proto is one of ether, fddi, tr, +ip, arp, rarp, tcp, udp, icmp or ip6, and +indicates the protocol layer for the index operation. +Note that tcp, udp and other upper-layer protocol types only +apply to IPv4, not IPv6 (this will be fixed in the future). +The byte offset, relative to the indicated protocol layer, is +given by expr. +Size is optional and indicates the number of bytes in the +field of interest; it can be either one, two, or four, and defaults to one. +The length operator, indicated by the keyword len, gives the +length of the packet. +

+For example, `ether[0] & 1 != 0' catches all multicast traffic. +The expression `ip[0] & 0xf != 5' +catches all IP packets with options. +The expression +`ip[6:2] & 0x1fff = 0' +catches only unfragmented datagrams and frag zero of fragmented datagrams. +This check is implicitly applied to the tcp and udp +index operations. +For instance, tcp[0] always means the first +byte of the TCP header, and never means the first byte of an +intervening fragment. +

+Some offsets and field values may be expressed as names rather than +as numeric values. +The following protocol header field offsets are +available: icmptype (ICMP type field), icmpcode (ICMP +code field), and tcpflags (TCP flags field). +

+The following ICMP type field values are available: icmp-echoreply, +icmp-unreach, icmp-sourcequench, icmp-redirect, +icmp-echo, icmp-routeradvert, icmp-routersolicit, +icmp-timxceed, icmp-paramprob, icmp-tstamp, +icmp-tstampreply, icmp-ireq, icmp-ireqreply, +icmp-maskreq, icmp-maskreply. +

+The following TCP flags field values are available: tcp-fin, +tcp-syn, tcp-rst, tcp-push, tcp-push, +tcp-ack, tcp-urg. +

+

+ +Primitives may be combined using: +

+
+A parenthesized group of primitives and operators +(parentheses are special to the Shell and must be escaped). +
+Negation (`!' or `not'). +
+Concatenation (`&&' or `and'). +
+Alternation (`||' or `or'). +
+

+ +Negation has highest precedence. +Alternation and concatenation have equal precedence and associate +left to right. +Note that explicit and tokens, not juxtaposition, +are now required for concatenation. +

+ +If an identifier is given without a keyword, the most recent keyword +is assumed. +For example, + +

+ +
not host vs and ace
+ + +
+ + +is short for +
+ +
not host vs and host ace
+ + +
+ + +which should not be confused with +
+ +
not ( host vs or ace )
+ + +
+ + +

+ +Expression arguments can be passed to tcpdump as either a single +argument or as multiple arguments, whichever is more convenient. +Generally, if the expression contains Shell metacharacters, it is +easier to pass it as a single, quoted argument. +Multiple arguments are concatenated with spaces before being parsed. +

+ + + + +

+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__packetapi.html b/ledset/WpdPack_4_1_2/docs/html/group__packetapi.html new file mode 100644 index 0000000..d0f5c9e --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__packetapi.html @@ -0,0 +1,87 @@ + + + + +WinPcap: Packet.dll -- Packet Driver API + + + + + + +
+

Packet.dll -- Packet Driver API
+ +[WinPcap internals] +

+
+ + + + + + + + + + +Packet.dll is a dynamic link library that offers a set of low level functions +to: +
    +
  • install, start and stop the NPF device driver
  • +
  • Receive packets from the NPF driver
  • +
  • send packets to the NPF driver
  • +
  • obtain the list of the available network adapters
  • +
  • retrieve various information about an adapter, like the description and + the list of addresses and netmasks
  • +
  • query and set various low-level parameters of an adapter
  • +
+

There are two versions of packet.dll: the first one runs under Windows 95/98/ME, the second +one is for  Windows +NT/2000/XP.

+

Packet.dll was created to provide a layer to access the low level +functionalities of WinPcap in a system independent way. This library handles all +the system-dependent details (like managing the devices, interacting with the OS +to manage the adapters, looking for the information in the registry and so on), +and exports an API that is uniform across all Windows OSes. In this way, +applications or libraries based on it can run without being recompiled +under any Windows operating system.

+

However, not all of the packet.dll API is totally portable: some advanced features, like kernel-mode dump, are present only in the WinNTx version of WinPcap, +while packet.dll for Win9x does not provide them. On the other side, the NTx +version is a superset of the 9x one, in other words all the function present in +the Win9x version are present in WinNTx too.

+

The other important feature of this library is its ability to handle NPF driver. +Packet.dll transparently installs and starts the driver when an application +attempts to access an adapter. This avoids the manual installation of the driver +through the control panel.

+

Important note, read carefully!

+

The source code of Packet.dll is freely available and completely documented. +However, packet.dll should be considered an internal API, because its purpose +inside WinPcap is to be a building block for the real public API: wpcap.dll.

+

As a consequence, since the normal and suggested way for an +application to use WinPcap is through wpcap.dll, we don't guarantee that the packet.dll +API will not be changed in future releases of winpcap, and we don't provide +support for this API. For the same reason, this manual doesn't contain +any more the Doxygen-generated documentation of Packet.dll: the user will +have to run Doxygen on his own to create it, or read the comments in the source +code.

+ + + + +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote.html b/ledset/WpdPack_4_1_2/docs/html/group__remote.html new file mode 100644 index 0000000..ed69aca --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote.html @@ -0,0 +1,386 @@ + + + + +WinPcap: Remote Capture + + + + + + +
+

Remote Capture

+ + + + + +

Modules

 Exported Structures and Definitions
 Exported Functions
 Internal Functions
 Internal Structures and Definitions
+

Detailed Description

+ + + + + + +Using WinPcap Remote Capture + + + + +
+ +
+

WinPcap comes with Remote Capture capabilities. This is an highly +experimental feature that allows to interact to a remote machine and capture +packets that are being transmitted on the remote network.

+

This requires a remote daemon (called rpcapd) which +performs the capture and sends data back and a local client that sends +the appropriate commands and receives the captured data.

+

WinPcap extends the standard WinPcap code in such a way that all +WinPcap-based tools can expoit remote capture capabilities. For instance, the +capabillity to interact with a remote daemon are added to the client software +without any explicit modification to it. Vice versa, the remote daemon must be +explicitely installed (and configured) on the remote machine.

+

Remote Capture Running Modes

+

The Remote Capture Protocol (RPCAP) can work in two modes:

+
    +
  • Passive Mode (default): the client (e.g. a network sniffer) + connects to the remote daemon, it sends them the appropriate commands, and + it starts the capture.
  • +
  • Active Mode: the remote daemon try to establish a connection toward + the client (e.g. the network sniffer); then, the client sends the + appropriate commands to the daemon and it starts the capture. This name is + due to the fact thet the daemon becomes active instead of waiting + for new connections.
  • +
+

The Active Mode is useful in case the remote daemon is behind a firewall and +it cannot receive connections from the external world. In this case, the daemon +can be configured to establish the connection to a given host, which will have +been configured in order to wait for that connection. After establishing +the connection, the protocol continues its job in almost the same way in both +Active and Passive Mode.

+

Analyzer (http://analyzer.polito.it/30alpha/) +has a set of commands (in the Capture menu) that allows you to accept a +remote connection and then start the capture on the remote device. Currently, +Analyzer is the only tool that is able to work in active mode, since it requires +some modifications to the application code.

+

Configuring the Remote Daemon (rpcapd)

+

The Remote Daemon is a standard Win32 executable running either in console +mode or as a service. The executable can be found in the WinPcap +folder and it has the following syntax:

+
        rpcapd [-b <address>] [-p <port>] [-6] [-l <host_list>] [-a <host,port>] 
+               [-n] [-v] [-d] [-s <file>] [-f <file>]
+

The daemon can be compiled and it is actually working on Linux as well.

+

Here there is a brief description of the allowed commands:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SwitchDescription
+
-b <address>
+
It sets the address the daemon has to bind to (either numeric or + literal). Default: it binds to all local IPv4 and IPv6 addresses.
+
-p <port>
+
It sets the port the daemon has to bind to. Default: it binds to port + 2002.
+
-4
+
It binds only to IPv4 addresses. Default: both IPv4 and IPv6 waiting + sockets are used.
+
-l <host_list_file>
+
It specifies a file that keeps the list of the hosts which are allowed + to connect to this daemon (if more than one, the file keeps them one per + line). We suggest to use literal names (instead of numeric ones) in + order to avoid problems with different address families (IPv4 and IPv6).
+
-n
+
It permits NULL authentication (usually used with '-l', that + guarantees that only the allowed hosts can connect to the daemon). + Default: the username/password authentication mechanism is required.
+
-a <host, port>
+
It forces the daemon to run in active mode and to connect to 'host' on + port 'port'. This does not exclude that the daemon is still able to + accept passive connections.
+
-v
+
It forces the daemon to run in active mode only (default: the daemon + always accepts active connections, even if the '-a' switch is + specified).
+
-d
+
Forces the daemon to run in background, i.e. as a daemon (UNIX only) + or as a service (Win32 only). Warning (Win32): this switch is + provided automatically when WinPcap installs this daemon into the Win32 + services (control panel - administrative tools - services).
+
-s <file>
+
It saves the current configuration to file.
+
-f <file>
+
It loads the current configuration from file; all the switches + specified from the command line are ignored and the file settings are + used instead.
+
-h
+
It prints an help screen.
+
+

Installing the remote daemon

+

The remote daemon is installed automatically when installing WinPcap. The +installation process places the rpcapd file into the WinPcap +folder. This file can be executed either from the command line, or as a service. +For instance, the installation process updates the list of available services +list and it creates a new item (Remote Packet Capture Protocol v.0 +(experimental) ). To avoid security problems, the service is inactive and it +has to be started manually (control panel - administrative tools - services - +start).

+

The service has a set of "standard" parameters, i.e. it it launched +with the "-d" flag (in orde to make it running as a +service) and the "-f rpcapd.ini" flag. The user can +create a file called rpcapd.ini in the same folder of the +executable, and put the configuration commands in there. In order for the +service to execute the commands, you have to stop and restart it again (i.e. the +initialization file is parsed only at the beginning). Viceversa, the UNIX +version of rpcapd is able to read the configuration file when +sending a kill -HUP signal to it. In that case, all the existing connections +remain in place, while the new connections will be created according to the new +parameters.

+

In case the user does not want to create the configuration file manually, it +can launch rpcapd with the requested parameters plus the "-s +filename" one. The daemon will parse all the parameters and save +them into the specified configuration file.

+

Starting the remote daemon as a standard executable

+

The rpcapd executable can be launched directly, i.e. it can run +in the foreground as well (not as a daemon/service). The procedure is quite +simple: you have to invoke the executable from the command line with all the +requested parameters but the "-d" flag. The capture +server will start in the foreground.

+

Starting a capture on a remote machine

+

If you are using a tool that is already aware of the remote capture (like +Analyzer), everything is simple. The capture wizard will help you to locate the +appropriate interface on the remote machine.

+

If your preferred tool is not aware of the remote capture, you can still use +the remote capture. In this case you have to read the next Section.

+

Be carefully: the capture server (rpcapd) must be up and +running on the remote machine.

+

New string specifiers for interface selection

+

If your preferred tool is not aware of the remote capture, the only thing you +must do is to insert, as interface specifier, the indication of the remote +machine you want to contact. The following forms are allowed:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Adapter StringDescription
+
file://filename
+
It opens a local file.
+
rpcap://host.foo.bar/adaptername
+
It opens a remote adapter; the host is specified by means of the + literal name, without port number (i.e. it uses the RPCAP default port).
+
rpcap://host.foo.bar:1234/adaptername
+
It is the same as before, but it uses a different port number.
+
rpcap://10.11.12.13/adaptername
+
It opens a remote adapter, but the host is specified by means of an + IPv4 numeric address, without port number (i.e. it uses the RPCAP + default port).
+
rpcap://10.11.12.13:1234/adaptername
+
It is the same as before, but it uses a different port number.
+
rpcap://[10.11.12.13]:1234/adaptername
+
It is the same as before, but the numeric address is specified within + square brackets (like IPv6 addresses).
+
rpcap://[1:2:3::4]/adaptername
+
It opens a remote adapter, but the host is specified by means of an + IPv6 numeric address, without port number (i.e. it uses the RPCAP + default port). In case of IPv6 addresses you MUST use the square + brackets.
+
rpcap://[1:2:3::4]:1234/adaptername
+
It is the same as before, but it uses a different port number.
+
rpcap://adaptername
+
It opens a local adapter, without using the RPCAP protocol.
+
adaptername
+
It opens a local adapter; it is kept for compability, but it is + strongly discouraged.
+
(NULL)
+
It opens the first local adapter; it is kept for compability, but it + is strongly discouraged.
+
+

The following formats are not allowed:

+ + + + + + + + + + + + + +
Adapter StringDescription
+
rpcap://
+
It cannot be used to open the first local adapter.
+
rpcap://hostname/
+
It cannot be used to open the first remote adapter.
+

Installing the Remote Capture Daemon in UNIX

+

The WinPcap source archive can be compiled in UNIX as well. Currently, remote +capture has been tested on Linux and BSD. What you have to do is:

+
    +
  • download the WinPcap sources
  • +
  • unpack the sources +
      +
    • we suggest to use the unzip -a command in order to + convert DOS files to UNIX ones
    • +
    +
  • +
  • move to the libpcap folder
  • +
  • type: +
      +
    • ./configure
    • +
    • Warning: in case the previous step reports an error, please + regenerate the configure file using automake + (version 2.50 or higher required)
    • +
    • make
    • +
    +
  • +
  • move to the rpcapd folder
  • +
  • type make
  • +
+

The remote capture capabilities are turned on by default on Linux and +FreeBSD. In case you do not want remote capture capabilities in libpcap, you can +type

+
    ./configure --disable-remote
+

at the "configure" step. All the possible flags are +listed when typing ./configure --help.

+

What you obtained right now, is:

+
    +
  • a library file (libpcap.a), which can be linked to other + applications (like tcpdump) in order to enable the remote + capture for them.
  • +
  • an executable (rpcapd) that is the remote daemon
  • +
+

Warning: in order to run the rpcapd daemon, the program +must either

+
    +
  • run as root (or)
  • +
  • run as user, but it must be owned by root and must be SUID root (chmod + u+s rpcapd)
  • +
+

Known bugs

+

FreeBSD: the first time you call the pcap_stat(), the +function takes several seconds to return. Therefore, programs like Analyzer seem +to hang up for 20-30 seconds at the beginning of the capture (if this is done +with BSD as a remote probe). We're investigating to solve this issue.

+

For any question, please refer to the WinPcap help page.

+ + + + +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__auth__methods.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__auth__methods.html new file mode 100644 index 0000000..306547d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__auth__methods.html @@ -0,0 +1,76 @@ + + + + +WinPcap: Authentication methods supported by the RPCAP protocol + + + + + + +
+

Authentication methods supported by the RPCAP protocol
+ +[Exported Structures and Definitions] +

+ + + + + +

Defines

#define RPCAP_RMTAUTH_NULL   0
 It defines the NULL authentication.
#define RPCAP_RMTAUTH_PWD   1
 It defines the username/password authentication.
+

Define Documentation

+ +
+
+ + + + +
#define RPCAP_RMTAUTH_NULL   0
+
+
+ +

It defines the NULL authentication.

+

This value has to be used within the 'type' member of the pcap_rmtauth structure. The 'NULL' authentication has to be equal to 'zero', so that old applications can just put every field of struct pcap_rmtauth to zero, and it does work.

+ +

Definition at line 304 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_RMTAUTH_PWD   1
+
+
+ +

It defines the username/password authentication.

+

With this type of authentication, the RPCAP protocol will use the username/ password provided to authenticate the user on the remote machine. If the authentication is successful (and the user has the right to open network devices) the RPCAP connection will continue; otherwise it will be dropped.

+

This value has to be used within the 'type' member of the pcap_rmtauth structure.

+ +

Definition at line 315 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__open__flags.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__open__flags.html new file mode 100644 index 0000000..44def81 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__open__flags.html @@ -0,0 +1,135 @@ + + + + +WinPcap: Flags defined in the pcap_open() function + + + + + + +
+

Flags defined in the pcap_open() function
+ +[Exported Structures and Definitions] +

+ + + + + + + + + + + +

Defines

#define PCAP_OPENFLAG_PROMISCUOUS   1
 Defines if the adapter has to go in promiscuous mode.
#define PCAP_OPENFLAG_DATATX_UDP   2
 Defines if the data trasfer (in case of a remote capture) has to be done with UDP protocol.
#define PCAP_OPENFLAG_NOCAPTURE_RPCAP   4
 Defines if the remote probe will capture its own generated traffic.
#define PCAP_OPENFLAG_NOCAPTURE_LOCAL   8
 Defines if the local adapter will capture its own generated traffic.
#define PCAP_OPENFLAG_MAX_RESPONSIVENESS   16
 This flag configures the adapter for maximum responsiveness.
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_OPENFLAG_DATATX_UDP   2
+
+
+ +

Defines if the data trasfer (in case of a remote capture) has to be done with UDP protocol.

+

If it is '1' if you want a UDP data connection, '0' if you want a TCP data connection; control connection is always TCP-based. A UDP connection is much lighter, but it does not guarantee that all the captured packets arrive to the client workstation. Moreover, it could be harmful in case of network congestion. This flag is meaningless if the source is not a remote interface. In that case, it is simply ignored.

+ +

Definition at line 217 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_OPENFLAG_MAX_RESPONSIVENESS   16
+
+
+ +

This flag configures the adapter for maximum responsiveness.

+

In presence of a large value for nbytes, WinPcap waits for the arrival of several packets before copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, i.e. better performance, which is good for applications like sniffers. If the user sets the PCAP_OPENFLAG_MAX_RESPONSIVENESS flag, the capture driver will copy the packets as soon as the application is ready to receive them. This is suggested for real time applications (like, for example, a bridge) that need the best responsiveness.

+ +

Definition at line 248 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_OPENFLAG_NOCAPTURE_LOCAL   8
+
+
+ +

Defines if the local adapter will capture its own generated traffic.

+

This flag tells the underlying capture driver to drop the packets that were sent by itself. This is usefult when building applications like bridges, that should ignore the traffic they just sent.

+ +

Definition at line 237 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_OPENFLAG_NOCAPTURE_RPCAP   4
+
+
+ +

Defines if the remote probe will capture its own generated traffic.

+

In case the remote probe uses the same interface to capture traffic and to send data back to the caller, the captured traffic includes the RPCAP traffic as well. If this flag is turned on, the RPCAP traffic is excluded from the capture, so that the trace returned back to the collector is does not include this traffic.

+ +

Definition at line 228 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_OPENFLAG_PROMISCUOUS   1
+
+
+ +

Defines if the adapter has to go in promiscuous mode.

+

It is '1' if you have to open the adapter in promiscuous mode, '0' otherwise. Note that even if this parameter is false, the interface could well be in promiscuous mode for some other reason (for example because another capture process with promiscuous mode enabled is currently using that interface). On on Linux systems with 2.2 or later kernels (that have the "any" device), this flag does not work on the "any" device; if an argument of "any" is supplied, the 'promisc' flag is ignored.

+ +

Definition at line 203 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__func.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__func.html new file mode 100644 index 0000000..718b453 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__func.html @@ -0,0 +1,33 @@ + + + + +WinPcap: Internal Functions + + + + + + +
+

Internal Functions
+ +[Remote Capture] +

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__struct.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__struct.html new file mode 100644 index 0000000..d64b2fc --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__pri__struct.html @@ -0,0 +1,1033 @@ + + + + +WinPcap: Internal Structures and Definitions + + + + + + +
+

Internal Structures and Definitions
+ +[Remote Capture] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  activehosts
 Keeps a list of all the opened connections in the active mode. More...
struct  rpcap_header
 Common header for all the RPCAP messages. More...
struct  rpcap_findalldevs_if
 Format of the message for the interface description (findalldevs command). More...
struct  rpcap_findalldevs_ifaddr
 Format of the message for the address listing (findalldevs command). More...
struct  rpcap_openreply
 Format of the message of the connection opening reply (open command). More...
struct  rpcap_startcapreq
 Format of the message that starts a remote capture (startcap command). More...
struct  rpcap_startcapreply
 Format of the reply message that devoted to start a remote capture (startcap reply command). More...
struct  rpcap_pkthdr
 Format of the header which encapsulates captured packets when transmitted on the network. More...
struct  rpcap_filter
 General header used for the pcap_setfilter() command; keeps just the number of BPF instructions. More...
struct  rpcap_filterbpf_insn
 Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header. More...
struct  rpcap_auth
 Structure that keeps the data required for the authentication on the remote host. More...
struct  rpcap_stats
 Structure that keeps the statistics about the number of packets captured, dropped, etc. More...
struct  rpcap_sampling
 Structure that is needed to set sampling parameters. More...

Defines

#define RPCAP_DEFAULT_NETPORT   "2002"
#define RPCAP_DEFAULT_NETPORT_ACTIVE   "2003"
#define RPCAP_DEFAULT_NETADDR   ""
#define RPCAP_VERSION   0
#define RPCAP_TIMEOUT_INIT   90
#define RPCAP_TIMEOUT_RUNTIME   180
#define RPCAP_ACTIVE_WAIT   30
#define RPCAP_SUSPEND_WRONGAUTH   1
#define RPCAP_NETBUF_SIZE   64000
 Buffer used by socket functions to send-receive packets. In case you plan to have messages larger than this value, you have to increase it.
#define RPCAP_HOSTLIST_SEP   " ,;\n\r"
 Separators used for the host list.
#define RPCAP_MSG_ERROR   1
#define RPCAP_MSG_FINDALLIF_REQ   2
#define RPCAP_MSG_OPEN_REQ   3
#define RPCAP_MSG_STARTCAP_REQ   4
#define RPCAP_MSG_UPDATEFILTER_REQ   5
#define RPCAP_MSG_CLOSE   6
#define RPCAP_MSG_PACKET   7
#define RPCAP_MSG_AUTH_REQ   8
#define RPCAP_MSG_STATS_REQ   9
#define RPCAP_MSG_ENDCAP_REQ   10
#define RPCAP_MSG_SETSAMPLING_REQ   11
#define RPCAP_MSG_FINDALLIF_REPLY   (128+RPCAP_MSG_FINDALLIF_REQ)
#define RPCAP_MSG_OPEN_REPLY   (128+RPCAP_MSG_OPEN_REQ)
#define RPCAP_MSG_STARTCAP_REPLY   (128+RPCAP_MSG_STARTCAP_REQ)
#define RPCAP_MSG_UPDATEFILTER_REPLY   (128+RPCAP_MSG_UPDATEFILTER_REQ)
#define RPCAP_MSG_AUTH_REPLY   (128+RPCAP_MSG_AUTH_REQ)
#define RPCAP_MSG_STATS_REPLY   (128+RPCAP_MSG_STATS_REQ)
#define RPCAP_MSG_ENDCAP_REPLY   (128+RPCAP_MSG_ENDCAP_REQ)
#define RPCAP_MSG_SETSAMPLING_REPLY   (128+RPCAP_MSG_SETSAMPLING_REQ)
#define RPCAP_STARTCAPREQ_FLAG_PROMISC   1
#define RPCAP_STARTCAPREQ_FLAG_DGRAM   2
#define RPCAP_STARTCAPREQ_FLAG_SERVEROPEN   4
#define RPCAP_STARTCAPREQ_FLAG_INBOUND   8
#define RPCAP_STARTCAPREQ_FLAG_OUTBOUND   16
#define RPCAP_UPDATEFILTER_BPF   1
#define PCAP_ERR_NETW   1
#define PCAP_ERR_INITTIMEOUT   2
#define PCAP_ERR_AUTH   3
#define PCAP_ERR_FINDALLIF   4
#define PCAP_ERR_NOREMOTEIF   5
#define PCAP_ERR_OPEN   6
#define PCAP_ERR_UPDATEFILTER   7
#define PCAP_ERR_GETSTATS   8
#define PCAP_ERR_READEX   9
#define PCAP_ERR_HOSTNOAUTH   10
#define PCAP_ERR_REMOTEACCEPT   11
#define PCAP_ERR_STARTCAPTURE   12
#define PCAP_ERR_ENDCAPTURE   13
#define PCAP_ERR_RUNTIMETIMEOUT   14
#define PCAP_ERR_SETSAMPLING   15
#define PCAP_ERR_WRONGMSG   16
#define PCAP_ERR_WRONGVER   17

Typedefs

typedef unsigned char uint8
 Provides an 8-bits unsigned integer.
typedef unsigned short uint16
 Provides a 16-bits unsigned integer.
typedef unsigned int uint32
 Provides a 32-bits unsigned integer.
typedef int int32
 Provides a 32-bits integer.
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_ERR_AUTH   3
+
+
+

Generic authentication error

+ +

Definition at line 313 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_ENDCAPTURE   13
+
+
+

Generic pcap_endcapture error

+ +

Definition at line 323 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_FINDALLIF   4
+
+
+

Generic findalldevs error

+ +

Definition at line 314 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_GETSTATS   8
+
+
+

Generic pcap_stats error

+ +

Definition at line 318 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_HOSTNOAUTH   10
+
+
+

The host is not authorized to connect to this server

+ +

Definition at line 320 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_INITTIMEOUT   2
+
+
+

The RPCAP initial timeout has expired

+ +

Definition at line 312 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_NETW   1
+
+
+

Network error

+ +

Definition at line 311 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_NOREMOTEIF   5
+
+
+

The findalldevs was ok, but the remote end had no interfaces to list

+ +

Definition at line 315 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_OPEN   6
+
+
+

Generic pcap_open error

+ +

Definition at line 316 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_READEX   9
+
+
+

Generic pcap_next_ex error

+ +

Definition at line 319 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_REMOTEACCEPT   11
+
+
+

Generic pcap_remoteaccept error

+ +

Definition at line 321 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_RUNTIMETIMEOUT   14
+
+
+

The RPCAP run-time timeout has expired

+ +

Definition at line 324 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_SETSAMPLING   15
+
+
+

Error diring the settings of sampling parameters

+ +

Definition at line 325 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_STARTCAPTURE   12
+
+
+

Generic pcap_startcapture error

+ +

Definition at line 322 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_UPDATEFILTER   7
+
+
+

Generic updatefilter error

+ +

Definition at line 317 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_WRONGMSG   16
+
+
+

The other end endpoint sent a message which has not been recognized

+ +

Definition at line 326 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERR_WRONGVER   17
+
+
+

The other end endpoint ahs a version number that is not compatible with our

+ +

Definition at line 327 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_ACTIVE_WAIT   30
+
+
+

Waiting time betweek two attempts to open a connection, in active mode (default: 30 sec)

+ +

Definition at line 92 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_DEFAULT_NETADDR   ""
+
+
+

Default network address on which the RPCAP daemon binds to.

+ +

Definition at line 88 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_DEFAULT_NETPORT   "2002"
+
+
+

Default port on which the RPCAP daemon is waiting for connections.

+ +

Definition at line 85 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_DEFAULT_NETPORT_ACTIVE   "2003"
+
+
+

Default port on which the client workstation is waiting for connections in case of active mode.

+ +

Definition at line 87 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_HOSTLIST_SEP   " ,;\n\r"
+
+
+ +

Separators used for the host list.

+

It is used:

+
    +
  • by the rpcapd daemon, when you types a list of allowed connecting hosts
  • +
  • by the rpcap in active mode, when the client waits for incoming connections from other hosts
  • +
+ +

Definition at line 109 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_AUTH_REPLY   (128+RPCAP_MSG_AUTH_REQ)
+
+
+

Sends a message that says 'ok, authorization successful'

+ +

Definition at line 296 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_AUTH_REQ   8
+
+
+

Message that keeps the authentication parameters

+ +

Definition at line 287 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_CLOSE   6
+
+
+

Close the connection with the remote peer

+ +

Definition at line 285 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_ENDCAP_REPLY   (128+RPCAP_MSG_ENDCAP_REQ)
+
+
+

Confirms that the capture stopped succesfully

+ +

Definition at line 298 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_ENDCAP_REQ   10
+
+
+

Stops the current capture, keeping the device open

+ +

Definition at line 289 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_ERROR   1
+
+
+

Message that keeps an error notification

+ +

Definition at line 280 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_FINDALLIF_REPLY   (128+RPCAP_MSG_FINDALLIF_REQ)
+
+
+

Keeps the list of all the remote interfaces

+ +

Definition at line 292 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_FINDALLIF_REQ   2
+
+
+

Request to list all the remote interfaces

+ +

Definition at line 281 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_OPEN_REPLY   (128+RPCAP_MSG_OPEN_REQ)
+
+
+

The remote device has been opened correctly

+ +

Definition at line 293 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_OPEN_REQ   3
+
+
+

Request to open a remote device

+ +

Definition at line 282 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_PACKET   7
+
+
+

This is a 'data' message, which carries a network packet

+ +

Definition at line 286 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_SETSAMPLING_REPLY   (128+RPCAP_MSG_SETSAMPLING_REQ)
+
+
+

Confirms that the capture stopped succesfully

+ +

Definition at line 299 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_SETSAMPLING_REQ   11
+
+
+

Sset sampling parameters

+ +

Definition at line 290 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_STARTCAP_REPLY   (128+RPCAP_MSG_STARTCAP_REQ)
+
+
+

The capture is staarting correctly

+ +

Definition at line 294 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_STARTCAP_REQ   4
+
+
+

Request to start a capture on a remote device

+ +

Definition at line 283 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_STATS_REPLY   (128+RPCAP_MSG_STATS_REQ)
+
+
+

Message that keeps the network statistics

+ +

Definition at line 297 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_STATS_REQ   9
+
+
+

It requires to have network statistics

+ +

Definition at line 288 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_UPDATEFILTER_REPLY   (128+RPCAP_MSG_UPDATEFILTER_REQ)
+
+
+

The filter has been applied correctly on the remote device

+ +

Definition at line 295 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_MSG_UPDATEFILTER_REQ   5
+
+
+

Send a compiled filter into the remote device

+ +

Definition at line 284 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_NETBUF_SIZE   64000
+
+
+ +

Buffer used by socket functions to send-receive packets. In case you plan to have messages larger than this value, you have to increase it.

+ +

Definition at line 99 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_STARTCAPREQ_FLAG_DGRAM   2
+
+
+

Use a datagram (i.e. UDP) connection for the data stream (default: use TCP)

+ +

Definition at line 302 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_STARTCAPREQ_FLAG_INBOUND   8
+
+
+

Capture only inbound packets (take care: the flag has no effects with promiscuous enabled)

+ +

Definition at line 304 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_STARTCAPREQ_FLAG_OUTBOUND   16
+
+
+

Capture only outbound packets (take care: the flag has no effects with promiscuous enabled)

+ +

Definition at line 305 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_STARTCAPREQ_FLAG_PROMISC   1
+
+
+

Enables promiscuous mode (default: disabled)

+ +

Definition at line 301 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_STARTCAPREQ_FLAG_SERVEROPEN   4
+
+
+

The server has to open the data connection toward the client

+ +

Definition at line 303 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_SUSPEND_WRONGAUTH   1
+
+
+

If the authentication is wrong, stops 1 sec before accepting a new auth message

+ +

Definition at line 93 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_TIMEOUT_INIT   90
+
+
+

Initial timeout for RPCAP connections (default: 90 sec)

+ +

Definition at line 90 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_TIMEOUT_RUNTIME   180
+
+
+

Run-time timeout for RPCAP connections (default: 3 min)

+ +

Definition at line 91 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_UPDATEFILTER_BPF   1
+
+
+

This code tells us that the filter is encoded with the BPF/NPF syntax

+ +

Definition at line 307 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_VERSION   0
+
+
+

Present version of the RPCAP protocol (0 = Experimental).

+ +

Definition at line 89 of file pcap-remote.h.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef int int32
+
+
+ +

Provides a 32-bits integer.

+ +

Definition at line 118 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
typedef unsigned short uint16
+
+
+ +

Provides a 16-bits unsigned integer.

+ +

Definition at line 116 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
typedef unsigned int uint32
+
+
+ +

Provides a 32-bits unsigned integer.

+ +

Definition at line 117 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
typedef unsigned char uint8
+
+
+ +

Provides an 8-bits unsigned integer.

+ +

Definition at line 115 of file pcap-remote.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__samp__methods.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__samp__methods.html new file mode 100644 index 0000000..10037d3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__samp__methods.html @@ -0,0 +1,95 @@ + + + + +WinPcap: Sampling methods defined in the pcap_setsampling() function + + + + + + +
+

Sampling methods defined in the pcap_setsampling() function
+ +[Exported Structures and Definitions] +

+ + + + + + + +

Defines

#define PCAP_SAMP_NOSAMP   0
 No sampling has to be done on the current capture.
#define PCAP_SAMP_1_EVERY_N   1
 It defines that only 1 out of N packets must be returned to the user.
#define PCAP_SAMP_FIRST_AFTER_N_MS   2
 It defines that we have to return 1 packet every N milliseconds.
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_SAMP_1_EVERY_N   1
+
+
+ +

It defines that only 1 out of N packets must be returned to the user.

+

In this case, the 'value' field of the 'pcap_samp' structure indicates the number of packets (minus 1) that must be discarded before one packet got accepted. In other words, if 'value = 10', the first packet is returned to the caller, while the following 9 are discarded.

+ +

Definition at line 275 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_SAMP_FIRST_AFTER_N_MS   2
+
+
+ +

It defines that we have to return 1 packet every N milliseconds.

+

In this case, the 'value' field of the 'pcap_samp' structure indicates the 'waiting time' in milliseconds before one packet got accepted. In other words, if 'value = 10', the first packet is returned to the caller; the next returned one will be the first packet that arrives when 10ms have elapsed.

+ +

Definition at line 285 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_SAMP_NOSAMP   0
+
+
+ +

No sampling has to be done on the current capture.

+

In this case, no sampling algorithms are applied to the current capture.

+ +

Definition at line 265 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__source__ID.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__source__ID.html new file mode 100644 index 0000000..f42a634 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__source__ID.html @@ -0,0 +1,95 @@ + + + + +WinPcap: Identifiers related to the new source syntax + + + + + + +
+

Identifiers related to the new source syntax
+ +[Exported Structures and Definitions] +

+ + + + + + + +

Defines

#define PCAP_SRC_FILE   2
 Internal representation of the type of source in use (file, remote/local interface).
#define PCAP_SRC_IFLOCAL   3
 Internal representation of the type of source in use (file, remote/local interface).
#define PCAP_SRC_IFREMOTE   4
 Internal representation of the type of source in use (file, remote/local interface).
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_SRC_FILE   2
+
+
+ +

Internal representation of the type of source in use (file, remote/local interface).

+

This indicates a file, i.e. the user want to open a capture from a local file.

+ +

Definition at line 93 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_SRC_IFLOCAL   3
+
+
+ +

Internal representation of the type of source in use (file, remote/local interface).

+

This indicates a local interface, i.e. the user want to open a capture from a local interface. This does not involve the RPCAP protocol.

+ +

Definition at line 101 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_SRC_IFREMOTE   4
+
+
+ +

Internal representation of the type of source in use (file, remote/local interface).

+

This indicates a remote interface, i.e. the user want to open a capture from an interface on a remote host. This does involve the RPCAP protocol.

+ +

Definition at line 109 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__source__string.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__source__string.html new file mode 100644 index 0000000..eeee55d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__source__string.html @@ -0,0 +1,112 @@ + + + + +WinPcap: Strings related to the new source syntax + + + + + + +
+

Strings related to the new source syntax
+ +[Exported Structures and Definitions] +

+ + + + + +

Defines

#define PCAP_SRC_FILE_STRING   "file://"
 String that will be used to determine the type of source in use (file, remote/local interface).
#define PCAP_SRC_IF_STRING   "rpcap://"
 String that will be used to determine the type of source in use (file, remote/local interface).
+

Detailed Description

+

The formats allowed by the pcap_open() are the following:

+
    +
  • file://path_and_filename [opens a local file]
  • +
  • rpcap://devicename [opens the selected device devices available on the local host, without using the RPCAP protocol]
  • +
  • rpcap://host/devicename [opens the selected device available on a remote host]
  • +
  • rpcap://host:port/devicename [opens the selected device available on a remote host, using a non-standard port for RPCAP]
  • +
  • adaptername [to open a local adapter; kept for compability, but it is strongly discouraged]
  • +
  • (NULL) [to open the first local adapter; kept for compability, but it is strongly discouraged]
  • +
+

The formats allowed by the pcap_findalldevs_ex() are the following:

+
    +
  • file://folder/ [lists all the files in the given folder]
  • +
  • rpcap:// [lists all local adapters]
  • +
  • rpcap://host:port/ [lists the devices available on a remote host]
  • +
+

Referring to the 'host' and 'port' paramters, they can be either numeric or literal. Since IPv6 is fully supported, these are the allowed formats:

+
    +
  • host (literal): e.g. host.foo.bar
  • +
  • host (numeric IPv4): e.g. 10.11.12.13
  • +
  • host (numeric IPv4, IPv6 style): e.g. [10.11.12.13]
  • +
  • host (numeric IPv6): e.g. [1:2:3::4]
  • +
  • port: can be either numeric (e.g. '80') or literal (e.g. 'http')
  • +
+

Here you find some allowed examples:

+
    +
  • rpcap://host.foo.bar/devicename [everything literal, no port number]
  • +
  • rpcap://host.foo.bar:1234/devicename [everything literal, with port number]
  • +
  • rpcap://10.11.12.13/devicename [IPv4 numeric, no port number]
  • +
  • rpcap://10.11.12.13:1234/devicename [IPv4 numeric, with port number]
  • +
  • rpcap://[10.11.12.13]:1234/devicename [IPv4 numeric with IPv6 format, with port number]
  • +
  • rpcap://[1:2:3::4]/devicename [IPv6 numeric, no port number]
  • +
  • rpcap://[1:2:3::4]:1234/devicename [IPv6 numeric, with port number]
  • +
  • rpcap://[1:2:3::4]:http/devicename [IPv6 numeric, with literal port number]
  • +
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_SRC_FILE_STRING   "file://"
+
+
+ +

String that will be used to determine the type of source in use (file, remote/local interface).

+

This string will be prepended to the interface name in order to create a string that contains all the information required to open the source.

+

This string indicates that the user wants to open a capture from a local file.

+ +

Definition at line 164 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_SRC_IF_STRING   "rpcap://"
+
+
+ +

String that will be used to determine the type of source in use (file, remote/local interface).

+

This string will be prepended to the interface name in order to create a string that contains all the information required to open the source.

+

This string indicates that the user wants to open a capture from a network interface. This string does not necessarily involve the use of the RPCAP protocol. If the interface required resides on the local host, the RPCAP protocol is not involved and the local functions are used.

+ +

Definition at line 177 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remote__struct.html b/ledset/WpdPack_4_1_2/docs/html/group__remote__struct.html new file mode 100644 index 0000000..c2434f9 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remote__struct.html @@ -0,0 +1,85 @@ + + + + +WinPcap: Exported Structures and Definitions + + + + + + +
+

Exported Structures and Definitions
+ +[Remote Capture] +

+ + + + + + + + + + + + + + + + +

Data Structures

struct  pcap_rmtauth
 This structure keeps the information needed to autheticate the user on a remote machine. More...
struct  pcap_samp
 This structure defines the information related to sampling. More...

Modules

 Strings related to the new source syntax
 Identifiers related to the new source syntax
 Flags defined in the pcap_open() function
 Sampling methods defined in the pcap_setsampling() function
 Authentication methods supported by the RPCAP protocol

Defines

#define PCAP_BUF_SIZE   1024
 Defines the maximum buffer size in which address, port, interface names are kept.
#define RPCAP_HOSTLIST_SIZE   1024
 Maximum lenght of an host name (needed for the RPCAP active mode).
+

Define Documentation

+ +
+
+ + + + +
#define PCAP_BUF_SIZE   1024
+
+
+ +

Defines the maximum buffer size in which address, port, interface names are kept.

+

In case the adapter name or such is larger than this value, it is truncated. This is not used by the user; however it must be aware that an hostname / interface name longer than this value will be truncated.

+ +

Definition at line 79 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
#define RPCAP_HOSTLIST_SIZE   1024
+
+
+ +

Maximum lenght of an host name (needed for the RPCAP active mode).

+ +

Definition at line 399 of file remote-ext.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__remotefunc.html b/ledset/WpdPack_4_1_2/docs/html/group__remotefunc.html new file mode 100644 index 0000000..ef0aa26 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__remotefunc.html @@ -0,0 +1,33 @@ + + + + +WinPcap: Exported Functions + + + + + + +
+

Exported Functions
+ +[Remote Capture] +

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap.html new file mode 100644 index 0000000..012fdd7 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap.html @@ -0,0 +1,81 @@ + + + + +WinPcap: WinPcap user's manual + + + + + + +
+

WinPcap user's manual

+ + + + + +

Modules

 Definitions
 Exported functions
 Filtering expression syntax
 Using WinPcap in your programs
+

Detailed Description

+ + + + + + + + + + +

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

+
    +
  • obtain the list of the available network adapters +
  • retrieve various information about an adapter, like the description and the list of addresses
  • +
  • sniff the packets using one of the network interface cards of the PC
  • +
  • send packets to the network +
  • efficiently save packets to disk and load them with an interface similar to the one of + live capture
  • +
  • create packet filters using a high level language and apply them to the captured + packets
  • +
+

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

+

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 +are looking for updated docs, you can consult the web site www.tcpdump.org.

+

Note

+

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

+
    +
  • discouraged: the use of another function with similar purpose is + suggested, however this one is still valid.
  • +
  • deprecated: the function is present only for portability and + backward compatibility. It should be avoided, and it is strongly suggested + to use another equivalent function instead.
    +
  • +
+

+ + + +

+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__def.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__def.html new file mode 100644 index 0000000..bcacddd --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__def.html @@ -0,0 +1,279 @@ + + + + +WinPcap: Definitions + + + + + + +
+

Definitions
+ +[WinPcap user's manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  pcap_file_header
 Header of a libpcap dump file. More...
struct  pcap_pkthdr
 Header of a packet in the dump file. More...
struct  pcap_stat
 Structure that keeps statistical values on an interface. More...
struct  pcap_if
 Item in a list of interfaces, used by pcap_findalldevs(). More...
struct  pcap_addr
 Representation of an interface address, used by pcap_findalldevs(). More...

Defines

#define PCAP_VERSION_MAJOR   2
 Major libpcap dump file version.
#define PCAP_VERSION_MINOR   4
 Minor libpcap dump file version.
#define PCAP_ERRBUF_SIZE   256
 Size to use when allocating the buffer that contains the libpcap errors.
#define PCAP_IF_LOOPBACK   0x00000001
 interface is loopback
#define MODE_CAPT   0
 Capture mode, to be used when calling pcap_setmode().
#define MODE_STAT   1
 Statistical mode, to be used when calling pcap_setmode().

Typedefs

typedef int bpf_int32
 32-bit integer
typedef u_int bpf_u_int32
 32-bit unsigned integer
typedef struct pcap pcap_t
 Descriptor of an open capture instance. This structure is opaque to the user, that handles its content through the functions provided by wpcap.dll.
typedef struct pcap_dumper pcap_dumper_t
 libpcap savefile descriptor.
typedef struct pcap_if pcap_if_t
 Item in a list of interfaces, see pcap_if.
typedef struct pcap_addr pcap_addr_t
 Representation of an interface address, see pcap_addr.
+

Detailed Description

+

Definitions for wpcap.dll

+

Define Documentation

+ +
+
+ + + + +
#define MODE_CAPT   0
+
+
+ +

Capture mode, to be used when calling pcap_setmode().

+ +

Definition at line 172 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
#define MODE_STAT   1
+
+
+ +

Statistical mode, to be used when calling pcap_setmode().

+ +

Definition at line 173 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_ERRBUF_SIZE   256
+
+
+ +

Size to use when allocating the buffer that contains the libpcap errors.

+ +

Definition at line 59 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_IF_LOOPBACK   0x00000001
+
+
+ +

interface is loopback

+ +

Definition at line 156 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_VERSION_MAJOR   2
+
+
+ +

Major libpcap dump file version.

+ +

Definition at line 56 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
#define PCAP_VERSION_MINOR   4
+
+
+ +

Minor libpcap dump file version.

+ +

Definition at line 57 of file incs/pcap.h.

+ +
+
+

Typedef Documentation

+ +
+
+ + + + +
typedef int bpf_int32
+
+
+ +

32-bit integer

+

Compatibility for systems that have a bpf.h that predates the bpf typedefs for 64-bit support.

+ +

Definition at line 66 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
typedef u_int bpf_u_int32
+
+
+ +

32-bit unsigned integer

+ +

Definition at line 67 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
typedef struct pcap_addr pcap_addr_t
+
+
+ +

Representation of an interface address, see pcap_addr.

+ +

Definition at line 73 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
typedef struct pcap_dumper pcap_dumper_t
+
+
+ +

libpcap savefile descriptor.

+ +

Definition at line 71 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
typedef struct pcap_if pcap_if_t
+
+
+ +

Item in a list of interfaces, see pcap_if.

+ +

Definition at line 72 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
typedef struct pcap pcap_t
+
+
+ +

Descriptor of an open capture instance. This structure is opaque to the user, that handles its content through the functions provided by wpcap.dll.

+ +

Definition at line 70 of file incs/pcap.h.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut.html new file mode 100644 index 0000000..0d214d8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut.html @@ -0,0 +1,34 @@ + + + + +WinPcap: WinPcap tutorial: a step by step guide to using WinPcap + + + + + + +
+

WinPcap tutorial: a step by step guide to using WinPcap

+
+

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).

+

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.

+

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.

+

Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut1.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut1.html new file mode 100644 index 0000000..3c14d33 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut1.html @@ -0,0 +1,81 @@ + + + + +WinPcap: Obtaining the device list + + + + + + +
+

Obtaining the device list

+
+

Typically, the first thing that a WinPcap-based application does is get a list of attached network adapters. Both libpcap and WinPcap provide the pcap_findalldevs_ex() function for this purpose: this function returns a linked list of pcap_if structures, each of which contains comprehensive information about an attached adapter. In particular, the fields name and description contain the name and a human readable description, respectively, of the corresponding device.

+

The following code retrieves the adapter list and shows it on the screen, printing an error if no adapters are found.

+
#include "pcap.h"
+
+main()
+{
+    pcap_if_t *alldevs;
+    pcap_if_t *d;
+    int i=0;
+    char errbuf[PCAP_ERRBUF_SIZE];
+    
+    /* Retrieve the device list from the local machine */
+    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1)
+    {
+        fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);
+        exit(1);
+    }
+    
+    /* Print the list */
+    for(d= alldevs; d != NULL; d= d->next)
+    {
+        printf("%d. %s", ++i, d->name);
+        if (d->description)
+            printf(" (%s)\n", d->description);
+        else
+            printf(" (No description available)\n");
+    }
+    
+    if (i == 0)
+    {
+        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+        return;
+    }
+
+    /* We don't need any more the device list. Free it */
+    pcap_freealldevs(alldevs);
+}
+

Some comments about this code.

+

First of all, pcap_findalldevs_ex(), like other libpcap functions, has an errbuf parameter. This parameter points to a string filled by libpcap with a description of the error if something goes wrong.

+

Second, remember that not all the OSes supported by libpcap provide a description of the network interfaces, therefore if we want to write a portable application, we must consider the case in which description is null: we print the string "No description available" in that situation.

+

Note finally that we free the list with pcap_freealldevs() once when we have finished with it.

+

Let's try to compile and run the code of this first sample. In order to compile it under Unix or Cygwin, simply type:

+
+  gcc -o testprog testprog.c -lpcap
+

On Windows, you will need to create a project, following the instructions in the Using WinPcap in your programs section of this manual. However, we suggest that you use the WinPcap developer's pack (available at the WinPcap website, http://www.winpcap.org ), since it provides many examples already configured as projects including all the code presented in this tutorial and the includes and libraries needed to compile and run the examples.

+

Assuming we have compiled the program, let's try to run it. On a particular WinXP workstation, the result we optained is

+
+   1. \Device\NPF_{4E273621-5161-46C8-895A-48D0E52A0B83} (Realtek RTL8029(AS) Ethernet Adapter)
+   2. \Device\NPF_{5D24AE04-C486-4A96-83FB-8B5EC6C7F430} (3Com EtherLink PCI) 
+

As you can see, the name of the network adapters (that will be passed to libpcap when opening the devices) under Windows are quite unreadable, so the parenthetical descriptions can be very helpful.

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut2.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut2.html new file mode 100644 index 0000000..910e2df --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut2.html @@ -0,0 +1,216 @@ + + + + +WinPcap: Obtaining advanced information about installed devices + + + + + + +
+

Obtaining advanced information about installed devices

+
+

Lesson 1 (Obtaining the device list) 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:

+
    +
  • a list of addresses for that interface.
  • +
  • a list of netmasks (each of which corresponds to an entry in the addresses list).
  • +
  • a list of broadcast addresses (each of which corresponds to an entry in the addresses list).
  • +
  • a list of destination addresses (each of which corresponds to an entry in the addresses list).
  • +
+

Additionally, pcap_findalldevs_ex() can also return remote adapters and a list of pcap files that are located in a given local folder.

+

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().

+
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+
+#include "pcap.h"
+
+#ifndef WIN32
+    #include <sys/socket.h>
+    #include <netinet/in.h>
+#else
+    #include <winsock.h>
+#endif
+
+
+// Function prototypes
+void ifprint(pcap_if_t *d);
+char *iptos(u_long in);
+char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen);
+
+
+int main()
+{
+  pcap_if_t *alldevs;
+  pcap_if_t *d;
+  char errbuf[PCAP_ERRBUF_SIZE+1];
+  char source[PCAP_ERRBUF_SIZE+1];
+
+  printf("Enter the device you want to list:\n"
+            "rpcap://              ==> lists interfaces in the local machine\n"
+            "rpcap://hostname:port ==> lists interfaces in a remote machine\n"
+            "                          (rpcapd daemon must be up and running\n"
+            "                           and it must accept 'null' authentication)\n"
+            "file://foldername     ==> lists all pcap files in the give folder\n\n"
+            "Enter your choice: ");
+
+  fgets(source, PCAP_ERRBUF_SIZE, stdin);
+  source[PCAP_ERRBUF_SIZE] = '\0';
+
+  /* Retrieve the interfaces list */
+  if (pcap_findalldevs_ex(source, NULL, &alldevs, errbuf) == -1)
+  {
+    fprintf(stderr,"Error in pcap_findalldevs: %s\n",errbuf);
+    exit(1);
+  }
+
+  /* Scan the list printing every entry */
+  for(d=alldevs;d;d=d->next)
+  {
+    ifprint(d);
+  }
+
+  pcap_freealldevs(alldevs);
+
+  return 1;
+}
+
+
+
+/* Print all the available information on the given interface */
+void ifprint(pcap_if_t *d)
+{
+  pcap_addr_t *a;
+  char ip6str[128];
+
+  /* Name */
+  printf("%s\n",d->name);
+
+  /* Description */
+  if (d->description)
+    printf("\tDescription: %s\n",d->description);
+
+  /* Loopback Address*/
+  printf("\tLoopback: %s\n",(d->flags & PCAP_IF_LOOPBACK)?"yes":"no");
+
+  /* IP addresses */
+  for(a=d->addresses;a;a=a->next) {
+    printf("\tAddress Family: #%d\n",a->addr->sa_family);
+  
+    switch(a->addr->sa_family)
+    {
+      case AF_INET:
+        printf("\tAddress Family Name: AF_INET\n");
+        if (a->addr)
+          printf("\tAddress: %s\n",iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr));
+        if (a->netmask)
+          printf("\tNetmask: %s\n",iptos(((struct sockaddr_in *)a->netmask)->sin_addr.s_addr));
+        if (a->broadaddr)
+          printf("\tBroadcast Address: %s\n",iptos(((struct sockaddr_in *)a->broadaddr)->sin_addr.s_addr));
+        if (a->dstaddr)
+          printf("\tDestination Address: %s\n",iptos(((struct sockaddr_in *)a->dstaddr)->sin_addr.s_addr));
+        break;
+
+      case AF_INET6:
+        printf("\tAddress Family Name: AF_INET6\n");
+        if (a->addr)
+          printf("\tAddress: %s\n", ip6tos(a->addr, ip6str, sizeof(ip6str)));
+       break;
+
+      default:
+        printf("\tAddress Family Name: Unknown\n");
+        break;
+    }
+  }
+  printf("\n");
+}
+
+
+
+/* From tcptraceroute, convert a numeric IP address to a string */
+#define IPTOSBUFFERS    12
+char *iptos(u_long in)
+{
+    static char output[IPTOSBUFFERS][3*4+3+1];
+    static short which;
+    u_char *p;
+
+    p = (u_char *)&in;
+    which = (which + 1 == IPTOSBUFFERS ? 0 : which + 1);
+    _snprintf_s(output[which], sizeof(output[which]), sizeof(output[which]),"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+    return output[which];
+}
+
+char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen)
+{
+    socklen_t sockaddrlen;
+
+    #ifdef WIN32
+    sockaddrlen = sizeof(struct sockaddr_in6);
+    #else
+    sockaddrlen = sizeof(struct sockaddr_storage);
+    #endif
+
+
+    if(getnameinfo(sockaddr, 
+        sockaddrlen, 
+        address, 
+        addrlen, 
+        NULL, 
+        0, 
+        NI_NUMERICHOST) != 0) address = NULL;
+
+    return address;
+}
+
+
+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut3.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut3.html new file mode 100644 index 0000000..fd99206 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut3.html @@ -0,0 +1,140 @@ + + + + +WinPcap: Opening an adapter and capturing the packets + + + + + + +
+

Opening an adapter and capturing the packets

+
+

Now that we've seen how to obtain an adapter to play with, let's start the real job, opening an adapter and capturing some traffic. In this lesson we'll write a program that prints some information about each packet flowing through the adapter.

+

The function that opens a capture device is pcap_open(). The parameters, snaplen, flags and to_ms deserve some explanation.

+

snaplen specifies the portion of the packet to capture. On some OSes (like xBSD and Win32), the packet driver can be configured to capture only the initial part of any packet: this decreases the amount of data to copy to the application and therefore improves the efficiency of the capture. In this case we use the value 65536 which is higher than the greatest MTU that we could encounter. In this manner we ensure that the application will always receive the whole packet.

+

flags: the most important flag is the one that indicates if the adapter will be put in promiscuous mode. In normal operation, an adapter only captures packets from the network that are destined to it; the packets exchanged by other hosts are therefore ignored. Instead, when the adapter is in promiscuous mode it captures all packets whether they are destined to it or not. This means that on shared media (like non-switched Ethernet), WinPcap will be able to capture the packets of other hosts. Promiscuous mode is the default for most capture applications, so we enable it in the following example.

+

to_ms specifies the read timeout, in milliseconds. A read on the adapter (for example, with pcap_dispatch() or pcap_next_ex()) will always return after to_ms milliseconds, even if no packets are available from the network. to_ms also defines the interval between statistical reports if the adapter is in statistical mode (see the lesson "\ref wpcap_tut9" for information about statistical mode). Setting to_ms to 0 means no timeout, a read on the adapter never returns if no packets arrive. A -1 timeout on the other side causes a read on the adapter to always return immediately.

+
#include "pcap.h"
+
+/* prototype of the packet handler */
+void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data);
+
+int main()
+{
+pcap_if_t *alldevs;
+pcap_if_t *d;
+int inum;
+int i=0;
+pcap_t *adhandle;
+char errbuf[PCAP_ERRBUF_SIZE];
+    
+    /* Retrieve the device list on the local machine */
+    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
+    {
+        fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
+        exit(1);
+    }
+    
+    /* Print the list */
+    for(d=alldevs; d; d=d->next)
+    {
+        printf("%d. %s", ++i, d->name);
+        if (d->description)
+            printf(" (%s)\n", d->description);
+        else
+            printf(" (No description available)\n");
+    }
+    
+    if(i==0)
+    {
+        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+        return -1;
+    }
+    
+    printf("Enter the interface number (1-%d):",i);
+    scanf_s("%d", &inum);
+    
+    if(inum < 1 || inum > i)
+    {
+        printf("\nInterface number out of range.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    /* Jump to the selected adapter */
+    for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+    
+    /* Open the device */
+    if ( (adhandle= pcap_open(d->name,          // name of the device
+                              65536,            // portion of the packet to capture
+                                                // 65536 guarantees that the whole packet will be captured on all the link layers
+                              PCAP_OPENFLAG_PROMISCUOUS,    // promiscuous mode
+                              1000,             // read timeout
+                              NULL,             // authentication on the remote machine
+                              errbuf            // error buffer
+                              ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    printf("\nlistening on %s...\n", d->description);
+    
+    /* At this point, we don't need any more the device list. Free it */
+    pcap_freealldevs(alldevs);
+    
+    /* start the capture */
+    pcap_loop(adhandle, 0, packet_handler, NULL);
+    
+    return 0;
+}
+
+
+/* Callback function invoked by libpcap for every incoming packet */
+void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
+{
+    struct tm ltime;
+    char timestr[16];
+    time_t local_tv_sec;
+
+    /*
+     * unused variables
+     */
+    (VOID)(param);
+    (VOID)(pkt_data);
+
+    /* convert the timestamp to readable format */
+    local_tv_sec = header->ts.tv_sec;
+    localtime_s(&ltime, &local_tv_sec);
+    strftime( timestr, sizeof timestr, "%H:%M:%S", &ltime);
+    
+    printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len);
+    
+}
+

Once the adapter is opened, the capture can be started with pcap_dispatch() or pcap_loop(). These two functions are very similar, the difference is that pcap_ dispatch() returns (although not guaranteed) when the timeout expires while pcap_loop() doesn't return until cnt packets have been captured, so it can block for an arbitrary period on an under-utilized network. pcap_loop() is enough for the purpose of this sample, while pcap_dispatch() is normally used in a more complex program.

+

Both of these functions have a callback parameter, packet_handler, pointing to a function that will receive the packets. This function is invoked by libpcap for every new packet coming from the network and receives a generic status (corresponding to the user parameter of pcap_loop() and pcap_dispatch()), a header with some information on the packet like the timestamp and the length and the actual data of the packet including all the protocol headers. Note that the frame CRC is normally not present, because it is removed by the network adapter after frame validation. Note also that most adapters discard packets with wrong CRCs, therefore WinPcap is normally not able to capture them.

+

The above example extracts the timestamp and the length of every packet from the pcap_pkthdr header and prints them on the screen.

+

Please note that there may be a drawback using pcap_loop() mainly related to the fact that the handler is called by the packet capture driver; therefore the user application does not have direct control over it. Another approach (and to have more readable programs) is to use the pcap_next_ex() function, which is presented in the next example (Capturing the packets without the callback).

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut4.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut4.html new file mode 100644 index 0000000..ef5ef03 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut4.html @@ -0,0 +1,137 @@ + + + + +WinPcap: Capturing the packets without the callback + + + + + + +
+

Capturing the packets without the callback

+
+

The example program in this lesson behaves exactly like the previous program (Opening an adapter and capturing the packets), but it uses pcap_next_ex() instead of pcap_loop().

+

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.

+

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.

+

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).

+

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().

+
#include "pcap.h"
+
+
+int main()
+{
+pcap_if_t *alldevs;
+pcap_if_t *d;
+int inum;
+int i=0;
+pcap_t *adhandle;
+int res;
+char errbuf[PCAP_ERRBUF_SIZE];
+struct tm ltime;
+char timestr[16];
+struct pcap_pkthdr *header;
+const u_char *pkt_data;
+time_t local_tv_sec;
+    
+    
+    /* Retrieve the device list on the local machine */
+    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
+    {
+        fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
+        exit(1);
+    }
+    
+    /* Print the list */
+    for(d=alldevs; d; d=d->next)
+    {
+        printf("%d. %s", ++i, d->name);
+        if (d->description)
+            printf(" (%s)\n", d->description);
+        else
+            printf(" (No description available)\n");
+    }
+    
+    if(i==0)
+    {
+        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+        return -1;
+    }
+    
+    printf("Enter the interface number (1-%d):",i);
+    scanf_s("%d", &inum);
+    
+    if(inum < 1 || inum > i)
+    {
+        printf("\nInterface number out of range.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    /* Jump to the selected adapter */
+    for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+    
+    /* Open the device */
+    if ( (adhandle= pcap_open(d->name,          // name of the device
+                              65536,            // portion of the packet to capture. 
+                                                // 65536 guarantees that the whole packet will be captured on all the link layers
+                              PCAP_OPENFLAG_PROMISCUOUS,    // promiscuous mode
+                              1000,             // read timeout
+                              NULL,             // authentication on the remote machine
+                              errbuf            // error buffer
+                              ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    printf("\nlistening on %s...\n", d->description);
+    
+    /* At this point, we don't need any more the device list. Free it */
+    pcap_freealldevs(alldevs);
+    
+    /* Retrieve the packets */
+    while((res = pcap_next_ex( adhandle, &header, &pkt_data)) >= 0){
+        
+        if(res == 0)
+            /* Timeout elapsed */
+            continue;
+        
+        /* convert the timestamp to readable format */
+        local_tv_sec = header->ts.tv_sec;
+        localtime_s(&ltime, &local_tv_sec);
+        strftime( timestr, sizeof timestr, "%H:%M:%S", &ltime);
+        
+        printf("%s,%.6d len:%d\n", timestr, header->ts.tv_usec, header->len);
+    }
+    
+    if(res == -1){
+        printf("Error reading the packets: %s\n", pcap_geterr(adhandle));
+        return -1;
+    }
+    
+    return 0;
+}
+

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.

+

Notice also that pcap_next_ex() returns different values for success, timeout elapsed, error and EOF conditions.

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut5.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut5.html new file mode 100644 index 0000000..1c535e4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut5.html @@ -0,0 +1,62 @@ + + + + +WinPcap: Filtering the traffic + + + + + + +
+

Filtering the traffic

+
+

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().

+

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 Filtering expression syntax section of this documentation.

+

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.

+

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.

+

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".

+
    if (d->addresses != NULL)
+        /* Retrieve the mask of the first address of the interface */
+        netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr;
+    else
+        /* If the interface is without an address we suppose to be in a C class network */
+        netmask=0xffffff; 
+
+
+compile the filter
+    if (pcap_compile(adhandle, &fcode, "ip and tcp", 1, netmask) < 0)
+    {
+        fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+set the filter
+    if (pcap_setfilter(adhandle, &fcode) < 0)
+    {
+        fprintf(stderr,"\nError setting the filter.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+

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, Interpreting the packets.

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut6.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut6.html new file mode 100644 index 0000000..91a7f93 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut6.html @@ -0,0 +1,279 @@ + + + + +WinPcap: Interpreting the packets + + + + + + +
+

Interpreting the packets

+
+

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.

+

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. The resulting application, called UDPdump, prints a summary of the UDP traffic on our network.

+

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:

+
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "pcap.h"
+
+/* 4 bytes IP address */
+typedef struct ip_address{
+    u_char byte1;
+    u_char byte2;
+    u_char byte3;
+    u_char byte4;
+}ip_address;
+
+/* IPv4 header */
+typedef struct ip_header{
+    u_char  ver_ihl;        // Version (4 bits) + Internet header length (4 bits)
+    u_char  tos;            // Type of service 
+    u_short tlen;           // Total length 
+    u_short identification; // Identification
+    u_short flags_fo;       // Flags (3 bits) + Fragment offset (13 bits)
+    u_char  ttl;            // Time to live
+    u_char  proto;          // Protocol
+    u_short crc;            // Header checksum
+    ip_address  saddr;      // Source address
+    ip_address  daddr;      // Destination address
+    u_int   op_pad;         // Option + Padding
+}ip_header;
+
+/* UDP header*/
+typedef struct udp_header{
+    u_short sport;          // Source port
+    u_short dport;          // Destination port
+    u_short len;            // Datagram length
+    u_short crc;            // Checksum
+}udp_header;
+
+/* prototype of the packet handler */
+void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data);
+
+
+int main()
+{
+pcap_if_t *alldevs;
+pcap_if_t *d;
+int inum;
+int i=0;
+pcap_t *adhandle;
+char errbuf[PCAP_ERRBUF_SIZE];
+u_int netmask;
+char packet_filter[] = "ip and udp";
+struct bpf_program fcode;
+
+    /* Retrieve the device list */
+    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
+    {
+        fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
+        exit(1);
+    }
+    
+    /* Print the list */
+    for(d=alldevs; d; d=d->next)
+    {
+        printf("%d. %s", ++i, d->name);
+        if (d->description)
+            printf(" (%s)\n", d->description);
+        else
+            printf(" (No description available)\n");
+    }
+
+    if(i==0)
+    {
+        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+        return -1;
+    }
+    
+    printf("Enter the interface number (1-%d):",i);
+    scanf_s("%d", &inum);
+    
+    if(inum < 1 || inum > i)
+    {
+        printf("\nInterface number out of range.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+
+    /* Jump to the selected adapter */
+    for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+    
+    /* Open the adapter */
+    if ( (adhandle= pcap_open(d->name,  // name of the device
+                             65536,     // portion of the packet to capture. 
+                                        // 65536 grants that the whole packet will be captured on all the MACs.
+                             PCAP_OPENFLAG_PROMISCUOUS,         // promiscuous mode
+                             1000,      // read timeout
+                             NULL,      // remote authentication
+                             errbuf     // error buffer
+                             ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    /* Check the link layer. We support only Ethernet for simplicity. */
+    if(pcap_datalink(adhandle) != DLT_EN10MB)
+    {
+        fprintf(stderr,"\nThis program works only on Ethernet networks.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    if(d->addresses != NULL)
+        /* Retrieve the mask of the first address of the interface */
+        netmask=((struct sockaddr_in *)(d->addresses->netmask))->sin_addr.S_un.S_addr;
+    else
+        /* If the interface is without addresses we suppose to be in a C class network */
+        netmask=0xffffff; 
+
+
+    //compile the filter
+    if (pcap_compile(adhandle, &fcode, packet_filter, 1, netmask) <0 )
+    {
+        fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    //set the filter
+    if (pcap_setfilter(adhandle, &fcode)<0)
+    {
+        fprintf(stderr,"\nError setting the filter.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+    
+    printf("\nlistening on %s...\n", d->description);
+    
+    /* At this point, we don't need any more the device list. Free it */
+    pcap_freealldevs(alldevs);
+    
+    /* start the capture */
+    pcap_loop(adhandle, 0, packet_handler, NULL);
+    
+    return 0;
+}
+
+/* Callback function invoked by libpcap for every incoming packet */
+void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
+{
+    struct tm ltime;
+    char timestr[16];
+    ip_header *ih;
+    udp_header *uh;
+    u_int ip_len;
+    u_short sport,dport;
+    time_t local_tv_sec;
+
+    /*
+     * Unused variable
+     */
+    (VOID)(param);
+
+    /* convert the timestamp to readable format */
+    local_tv_sec = header->ts.tv_sec;
+    localtime_s(&ltime, &local_tv_sec);
+    strftime( timestr, sizeof timestr, "%H:%M:%S", &ltime);
+
+    /* print timestamp and length of the packet */
+    printf("%s.%.6d len:%d ", timestr, header->ts.tv_usec, header->len);
+
+    /* retireve the position of the ip header */
+    ih = (ip_header *) (pkt_data +
+        14); //length of ethernet header
+
+    /* retireve the position of the udp header */
+    ip_len = (ih->ver_ihl & 0xf) * 4;
+    uh = (udp_header *) ((u_char*)ih + ip_len);
+
+    /* convert from network byte order to host byte order */
+    sport = ntohs( uh->sport );
+    dport = ntohs( uh->dport );
+
+    /* print ip addresses and udp ports */
+    printf("%d.%d.%d.%d.%d -> %d.%d.%d.%d.%d\n",
+        ih->saddr.byte1,
+        ih->saddr.byte2,
+        ih->saddr.byte3,
+        ih->saddr.byte4,
+        sport,
+        ih->daddr.byte1,
+        ih->daddr.byte2,
+        ih->daddr.byte3,
+        ih->daddr.byte4,
+        dport);
+}
+

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.

+

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.

+

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. For simplicity and before starting the capture, we check the MAC layer with pcap_datalink() to make sure that we are dealing with an Ethernet network. This way we can be sure that the MAC header is exactly 14 bytes.

+

The IP header is located just after the MAC header. We will extract the IP source and destination addresses from the IP header.

+

Reaching the UDP header is a bit more complicated, because the IP header doesn't have a fixed length. Therefore, we use the IP header's length field to know its size. Once we know the location of the UDP header, we extract the source and destination ports.

+

The extracted values are printed on the screen, and the result is something like:

+

1. \Device\Packet_{A7FD048A-5D4B-478E-B3C1-34401AC3B72F} (Xircom t 10/100 Adapter)
+ Enter the interface number (1-2):1
+

+

listening on Xircom CardBus Ethernet 10/100 Adapter...
+ 16:13:15.312784 len:87 130.192.31.67.2682 -> 130.192.3.21.53
+ 16:13:15.314796 len:137 130.192.3.21.53 -> 130.192.31.67.2682
+ 16:13:15.322101 len:78 130.192.31.67.2683 -> 130.192.3.21.53
+

+

Each of the final 3 lines represents a different packet.

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut7.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut7.html new file mode 100644 index 0000000..0e89203 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut7.html @@ -0,0 +1,438 @@ + + + + +WinPcap: Handling offline dump files + + + + + + +
+

Handling offline dump files

+
+

In this lession we are going to learn how to handle packet capture to a file (dump to file). WinPcap offers a wide range of functions to save the network traffic to a file and to read the content of dumps -- this lesson will teach how to use all of these functions. We'll see also how to use the kernel dump feature of WinPcap to obtain high-performance dumps (NOTE: At the moment, due to some problems with the new kernel buffer, this feature has been disabled).

+

The format for dump files is the libpcap one. This format contains the data of the captured packets in binary form and is a standard used by many network tools including WinDump, Ethereal and Snort.

+

Saving packets to a dump file

+

First of all, let's see how to write packets in libpcap format.

+

The following example captures the packets from the selected interface and saves them on a file whose name is provided by the user.

+
#include "pcap.h"
+
+/* prototype of the packet handler */
+void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data);
+
+int main(int argc, char **argv)
+{
+pcap_if_t *alldevs;
+pcap_if_t *d;
+int inum;
+int i=0;
+pcap_t *adhandle;
+char errbuf[PCAP_ERRBUF_SIZE];
+pcap_dumper_t *dumpfile;
+
+
+    
+    /* Check command line */
+    if(argc != 2)
+    {
+        printf("usage: %s filename", argv[0]);
+        return -1;
+    }
+    
+    /* Retrieve the device list on the local machine */
+    if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
+    {
+        fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
+        exit(1);
+    }
+    
+    /* Print the list */
+    for(d=alldevs; d; d=d->next)
+    {
+        printf("%d. %s", ++i, d->name);
+        if (d->description)
+            printf(" (%s)\n", d->description);
+        else
+            printf(" (No description available)\n");
+    }
+
+    if(i==0)
+    {
+        printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+        return -1;
+    }
+    
+    printf("Enter the interface number (1-%d):",i);
+    scanf_s("%d", &inum);
+    
+    if(inum < 1 || inum > i)
+    {
+        printf("\nInterface number out of range.\n");
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+        
+    /* Jump to the selected adapter */
+    for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+    
+    
+    /* Open the device */
+    if ( (adhandle= pcap_open(d->name,          // name of the device
+                              65536,            // portion of the packet to capture
+                                                // 65536 guarantees that the whole packet will be captured on all the link layers
+                              PCAP_OPENFLAG_PROMISCUOUS,    // promiscuous mode
+                              1000,             // read timeout
+                              NULL,             // authentication on the remote machine
+                              errbuf            // error buffer
+                              ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name);
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+        return -1;
+    }
+
+    /* Open the dump file */
+    dumpfile = pcap_dump_open(adhandle, argv[1]);
+
+    if(dumpfile==NULL)
+    {
+        fprintf(stderr,"\nError opening output file\n");
+        return -1;
+    }
+    
+    printf("\nlistening on %s... Press Ctrl+C to stop...\n", d->description);
+    
+    /* At this point, we no longer need the device list. Free it */
+    pcap_freealldevs(alldevs);
+    
+    /* start the capture */
+    pcap_loop(adhandle, 0, packet_handler, (unsigned char *)dumpfile);
+
+    return 0;
+}
+
+/* Callback function invoked by libpcap for every incoming packet */
+void packet_handler(u_char *dumpfile, const struct pcap_pkthdr *header, const u_char *pkt_data)
+{
+    /* save the packet on the dump file */
+    pcap_dump(dumpfile, header, pkt_data);
+}
+

As you can see, the structure of the program is very similar to the ones we have seen in the previous lessons. The differences are:

+
    +
  • a call to pcap_dump_open() is issued once the interface is opened. This call opens a dump file and associates it with the interface.
  • +
  • the packets are written to this file with a pcap_dump() from the packet_handler() callback. The parameters of pcap_dump() are in 1-1 correspondence with the parameters of pcap_handler().
  • +
+

Reading packets from a dump file

+

Now that we have a dump file available, we can try to read its content. The following code opens a WinPcap/libpcap dump file and displays every packet contained in the file. The file is opened with pcap_open_offline(), then the usual pcap_loop() is used to sequence through the packets. As you can see, reading packets from an offline capture is nearly identical to receiving them from a physical interface.

+

This example introduces another function: pcap_createsrcsrc(). This function is required to create a source string that begins with a marker used to tell WinPcap the type of the source, e.g. "rpcap://" if we are going to open an adapter, or "file://" if we are going to open a file. This step is not required when pcap_findalldevs_ex() is used (the returned values already contain these strings). However, it is required in this example because the name of the file is read from the user input.

+
#include <stdio.h>
+#include <pcap.h>
+
+#define LINE_LEN 16
+
+void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *);
+
+int main(int argc, char **argv)
+{
+pcap_t *fp;
+char errbuf[PCAP_ERRBUF_SIZE];
+char source[PCAP_BUF_SIZE];
+
+    if(argc != 2){
+
+        printf("usage: %s filename", argv[0]);
+        return -1;
+
+    }
+
+    /* Create the source string according to the new WinPcap syntax */
+    if ( pcap_createsrcstr( source,         // variable that will keep the source string
+                            PCAP_SRC_FILE,  // we want to open a file
+                            NULL,           // remote host
+                            NULL,           // port on the remote host
+                            argv[1],        // name of the file we want to open
+                            errbuf          // error buffer
+                            ) != 0)
+    {
+        fprintf(stderr,"\nError creating a source string\n");
+        return -1;
+    }
+    
+    /* Open the capture file */
+    if ( (fp= pcap_open(source,         // name of the device
+                        65536,          // portion of the packet to capture
+                                        // 65536 guarantees that the whole packet will be captured on all the link layers
+                         PCAP_OPENFLAG_PROMISCUOUS,     // promiscuous mode
+                         1000,              // read timeout
+                         NULL,              // authentication on the remote machine
+                         errbuf         // error buffer
+                         ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the file %s.\n", source);
+        return -1;
+    }
+
+    // read and dispatch packets until EOF is reached
+    pcap_loop(fp, 0, dispatcher_handler, NULL);
+
+    return 0;
+}
+
+
+
+void dispatcher_handler(u_char *temp1, 
+                        const struct pcap_pkthdr *header, const u_char *pkt_data)
+{
+    u_int i=0;
+
+    /*
+     * Unused variable
+     */
+    (VOID)temp1;
+
+    /* print pkt timestamp and pkt len */
+    printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len);          
+    
+    /* Print the packet */
+    for (i=1; (i < header->caplen + 1 ) ; i++)
+    {
+        printf("%.2x ", pkt_data[i-1]);
+        if ( (i % LINE_LEN) == 0) printf("\n");
+    }
+    
+    printf("\n\n");     
+    
+}
+

The following example has the same purpose of the last one, but pcap_next_ex() is used instead of the pcap_loop() callback method.

+
#include <stdio.h>
+#include <pcap.h>
+
+#define LINE_LEN 16
+
+int main(int argc, char **argv)
+{
+pcap_t *fp;
+char errbuf[PCAP_ERRBUF_SIZE];
+char source[PCAP_BUF_SIZE];
+struct pcap_pkthdr *header;
+const u_char *pkt_data;
+u_int i=0;
+int res;
+
+    if(argc != 2)
+    {
+        printf("usage: %s filename", argv[0]);
+        return -1;
+    }
+    
+    /* Create the source string according to the new WinPcap syntax */
+    if ( pcap_createsrcstr( source,         // variable that will keep the source string
+                            PCAP_SRC_FILE,  // we want to open a file
+                            NULL,           // remote host
+                            NULL,           // port on the remote host
+                            argv[1],        // name of the file we want to open
+                            errbuf          // error buffer
+                            ) != 0)
+    {
+        fprintf(stderr,"\nError creating a source string\n");
+        return -1;
+    }
+    
+    /* Open the capture file */
+    if ( (fp= pcap_open(source,         // name of the device
+                        65536,          // portion of the packet to capture
+                                        // 65536 guarantees that the whole packet will be captured on all the link layers
+                         PCAP_OPENFLAG_PROMISCUOUS,     // promiscuous mode
+                         1000,              // read timeout
+                         NULL,              // authentication on the remote machine
+                         errbuf         // error buffer
+                         ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the file %s.\n", source);
+        return -1;
+    }
+    
+    /* Retrieve the packets from the file */
+    while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0)
+    {
+        /* print pkt timestamp and pkt len */
+        printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len);          
+        
+        /* Print the packet */
+        for (i=1; (i < header->caplen + 1 ) ; i++)
+        {
+            printf("%.2x ", pkt_data[i-1]);
+            if ( (i % LINE_LEN) == 0) printf("\n");
+        }
+        
+        printf("\n\n");     
+    }
+    
+    
+    if (res == -1)
+    {
+        printf("Error reading the packets: %s\n", pcap_geterr(fp));
+    }
+    
+    return 0;
+}
+
+

Writing packets to a dump file with pcap_live_dump

+

NOTE: At the moment, due to some problems with the new kernel buffer, this feature has been disabled.

+

Recent versions of WinPcap provide a further way to save network traffic to disk, the pcap_live_dump() function. pcap_live_dump() takes three parameters: a file name, the maximum size (in bytes) that this file is allowed to reach and the maximum amount of packets that the file is allowed to contain. Zero means no limit for both these values. Notice that the program can set a filter (with pcap_setfilter(), see the tutorial Filtering the traffic) before calling pcap_live_dump() to define the subset of the traffic that will be saved.

+

pcap_live_dump() is non-blocking, therefore it starts the dump and returns immediately: The dump process goes on asynchronously until the maximum file size or the maximum amount of packets has been reached.

+

The application can wait or check the end of the dump with pcap_live_dump_ended(). Beware that if the sync parameter is nonzero, this function will block your application forever if the limits are both 0.

+
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <pcap.h>
+
+#error At the moment the kernel dump feature is not supported in the driver
+
+main(int argc, char **argv) {
+    
+    pcap_if_t *alldevs, *d;
+    pcap_t *fp;
+    u_int inum, i=0;
+    char errbuf[PCAP_ERRBUF_SIZE];
+
+    printf("kdump: saves the network traffic to file using WinPcap kernel-level dump faeature.\n");
+    printf("\t Usage: %s [adapter] | dump_file_name max_size max_packs\n", argv[0]);
+    printf("\t Where: max_size is the maximum size that the dump file will reach (0 means no limit)\n");
+    printf("\t Where: max_packs is the maximum number of packets that will be saved (0 means no limit)\n\n");
+
+
+    if(argc < 5){
+
+        /* The user didn't provide a packet source: Retrieve the device list */
+        if (pcap_findalldevs(&alldevs, errbuf) == -1)
+        {
+            fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
+            exit(1);
+        }
+        
+        /* Print the list */
+        for(d=alldevs; d; d=d->next)
+        {
+            printf("%d. %s", ++i, d->name);
+            if (d->description)
+                printf(" (%s)\n", d->description);
+            else
+                printf(" (No description available)\n");
+        }
+        
+        if(i==0)
+        {
+            printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
+            return -1;
+        }
+        
+        printf("Enter the interface number (1-%d):",i);
+        scanf("%d", &inum);
+        
+        if(inum < 1 || inum > i)
+        {
+            printf("\nInterface number out of range.\n");
+            /* Free the device list */
+            return -1;
+        }
+        
+        /* Jump to the selected adapter */
+        for(d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+        
+        /* Open the device */
+        if ( (fp = pcap_open_live(d->name, 100, 1, 20, errbuf) ) == NULL)
+        {
+            fprintf(stderr,"\nError opening adapter\n");
+            return -1;
+        }
+
+        /* Free the device list */
+        pcap_freealldevs(alldevs);
+
+        /* Start the dump */
+        if(pcap_live_dump(fp, argv[1], atoi(argv[2]), atoi(argv[3]))==-1){
+            printf("Unable to start the dump, %s\n", pcap_geterr(fp));
+            return -1;
+        }
+    }
+    else{
+        
+        /* Open the device */
+        if ( (fp= pcap_open_live(argv[1], 100, 1, 20, errbuf) ) == NULL)
+        {
+            fprintf(stderr,"\nError opening adapter\n");
+            return -1;
+        }
+
+        /* Start the dump */
+        if(pcap_live_dump(fp, argv[0], atoi(argv[1]), atoi(argv[2]))==-1){
+            printf("Unable to start the dump, %s\n", pcap_geterr(fp));
+            return -1;
+        }
+    }
+
+    /* Wait until the dump finishes, i.e. when  max_size or max_packs is reached*/
+    pcap_live_dump_ended(fp, TRUE);
+    
+    /* Close the adapter, so that the file is correctly flushed */
+    pcap_close(fp);
+
+    return 0;
+}
+

The difference between pcap_live_dump() and pcap_dump(), apart from the possibility to set limits, is performance. pcap_live_dump() exploits the ability of the WinPcap NPF driver (see NPF driver internals manual) to write dumps from kernel level, minimizing the number of context switches and memory copies.

+

Obviously, since this feature is currently not available on other operating systems, pcap_live_dump() is WinPcap specific and is present only under Win32.

+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut8.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut8.html new file mode 100644 index 0000000..7d0320b --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut8.html @@ -0,0 +1,292 @@ + + + + +WinPcap: Sending Packets + + + + + + +
+

Sending Packets

+
+

Although the name WinPcap indicates clearly that the purpose of the library is packet capture, other useful features for raw networking are provided. Among them, the user can find a complete set of functions to send packets.

+

Note that the original libpcap library at the moment doesn't provide any way to send packets, therefore all the functions shown here are WinPcap extensions and will not work under Unix.

+

Sending a single packet with pcap_sendpacket()

+

The simplest way to send a packet is shown in the following code snippet. After opening an adapter, pcap_sendpacket() is called to send a hand-crafted packet. pcap_sendpacket() takes as arguments a buffer containing the data to send, the length of the buffer and the adapter that will send it. Notice that the buffer is sent to the net as is, without any manipulation. This means that the application has to create the correct protocol headers in order to send something meaningful.

+
#include <stdlib.h>
+#include <stdio.h>
+
+#include <pcap.h>
+
+
+void main(int argc, char **argv)
+{
+pcap_t *fp;
+char errbuf[PCAP_ERRBUF_SIZE];
+u_char packet[100];
+int i;
+
+    /* Check the validity of the command line */
+    if (argc != 2)
+    {
+        printf("usage: %s interface (e.g. 'rpcap://eth0')", argv[0]);
+        return;
+    }
+    
+    /* Open the output device */
+    if ( (fp= pcap_open(argv[1],            // name of the device
+                        100,                // portion of the packet to capture (only the first 100 bytes)
+                        PCAP_OPENFLAG_PROMISCUOUS,  // promiscuous mode
+                        1000,               // read timeout
+                        NULL,               // authentication on the remote machine
+                        errbuf              // error buffer
+                        ) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", argv[1]);
+        return;
+    }
+
+    /* Supposing to be on ethernet, set mac destination to 1:1:1:1:1:1 */
+    packet[0]=1;
+    packet[1]=1;
+    packet[2]=1;
+    packet[3]=1;
+    packet[4]=1;
+    packet[5]=1;
+    
+    /* set mac source to 2:2:2:2:2:2 */
+    packet[6]=2;
+    packet[7]=2;
+    packet[8]=2;
+    packet[9]=2;
+    packet[10]=2;
+    packet[11]=2;
+    
+    /* Fill the rest of the packet */
+    for(i=12;i<100;i++)
+    {
+        packet[i]=(u_char)i;
+    }
+
+    /* Send down the packet */
+    if (pcap_sendpacket(fp, packet, 100 /* size */) != 0)
+    {
+        fprintf(stderr,"\nError sending the packet: %s\n", pcap_geterr(fp));
+        return;
+    }
+
+    return;
+}
+

Send queues

+

While pcap_sendpacket() offers a simple and immediate way to send a single packet, send queues provides an advanced, powerful and optimized mechanism to send a collection of packets. A send queue is a container for a variable number of packets that will be sent to the network. It has a size, that represents the maximum amount of bytes it can store.

+

A send queue is created calling the pcap_sendqueue_alloc() function, specifying the size of the new send queue.

+

Once the send queue is created, pcap_sendqueue_queue() can be used to add a packet to the send queue. This function takes a pcap_pkthdr with the timestamp and the length and a buffer with the data of the packet. These parameters are the same as those received by pcap_next_ex() and pcap_handler(), therefore queuing a packet that was just captured or read from a file is a matter of passing these parameters to pcap_sendqueue_queue().

+

To transmit a send queue, WinPcap provides the pcap_sendqueue_transmit() function. Note the third parameter: if nonzero, the send will be synchronized, i.e. the relative timestamps of the packets will be respected. This operation requires a remarkable amount of CPU, because the synchronization takes place in the kernel driver using "busy wait" loops. Although this operation is quite CPU intensive, it often results in very high precision packet transmissions (often around few microseconds or less).

+

Note that transmitting a send queue with pcap_sendqueue_transmit() is much more efficient than performing a series of pcap_sendpacket(), because the send queue is buffered at kernel level drastically decreasing the number of context switches.

+

When a queue is no longer needed, it can be deleted with pcap_sendqueue_destroy() that frees all the buffers associated with the send queue.

+

The next program shows how to use send queues. It opens a capture file with pcap_open_offline(), then it moves the packets from the file to a properly allocated send queue. At his point it transmits the queue, synchronizing it if requested by the user.

+

Note that the link-layer of the dumpfile is compared with the one of the interface that will send the packets using pcap_datalink(), and a warning is printed if they are different -- it is important that the capture-file link-layer be the same as the adapter's link layer for otherwise the tranmission is pointless.

+
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <pcap.h>
+
+void usage();
+
+void main(int argc, char **argv)
+{
+    pcap_t *indesc,*outdesc;
+    char errbuf[PCAP_ERRBUF_SIZE];
+    char source[PCAP_BUF_SIZE];
+    FILE *capfile;
+    int caplen, sync;
+    u_int res;
+    pcap_send_queue *squeue;
+    struct pcap_pkthdr *pktheader;
+    u_char *pktdata;
+    float cpu_time;
+    u_int npacks = 0;
+    errno_t fopen_error;
+
+    /* Check the validity of the command line */
+    if (argc <= 2 || argc >= 5)
+    {
+        usage();
+        return;
+    }
+        
+    /* Retrieve the length of the capture file */
+    fopen_error = fopen_s(&capfile, argv[1],"rb");
+    if(fopen_error != 0){
+        printf("Error opening the file, errno %d.\n", fopen_error);
+        return;
+    }
+    
+    fseek(capfile , 0, SEEK_END);
+    caplen= ftell(capfile)- sizeof(struct pcap_file_header);
+    fclose(capfile);
+            
+    /* Chek if the timestamps must be respected */
+    if(argc == 4 && argv[3][0] == 's')
+        sync = TRUE;
+    else
+        sync = FALSE;
+
+    /* Open the capture */
+    /* Create the source string according to the new WinPcap syntax */
+    if ( pcap_createsrcstr( source,         // variable that will keep the source string
+                            PCAP_SRC_FILE,  // we want to open a file
+                            NULL,           // remote host
+                            NULL,           // port on the remote host
+                            argv[1],        // name of the file we want to open
+                            errbuf          // error buffer
+                            ) != 0)
+    {
+        fprintf(stderr,"\nError creating a source string\n");
+        return;
+    }
+    
+    /* Open the capture file */
+    if ( (indesc= pcap_open(source, 65536, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open the file %s.\n", source);
+        return;
+    }
+
+    /* Open the output adapter */
+    if ( (outdesc= pcap_open(argv[2], 100, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open adapter %s.\n", source);
+        return;
+    }
+
+    /* Check the MAC type */
+    if (pcap_datalink(indesc) != pcap_datalink(outdesc))
+    {
+        printf("Warning: the datalink of the capture differs from the one of the selected interface.\n");
+        printf("Press a key to continue, or CTRL+C to stop.\n");
+        getchar();
+    }
+
+    /* Allocate a send queue */
+    squeue = pcap_sendqueue_alloc(caplen);
+
+    /* Fill the queue with the packets from the file */
+    while ((res = pcap_next_ex( indesc, &pktheader, &pktdata)) == 1)
+    {
+        if (pcap_sendqueue_queue(squeue, pktheader, pktdata) == -1)
+        {
+            printf("Warning: packet buffer too small, not all the packets will be sent.\n");
+            break;
+        }
+
+        npacks++;
+    }
+
+    if (res == -1)
+    {
+        printf("Corrupted input file.\n");
+        pcap_sendqueue_destroy(squeue);
+        return;
+    }
+
+    /* Transmit the queue */
+    
+    cpu_time = (float)clock ();
+
+    if ((res = pcap_sendqueue_transmit(outdesc, squeue, sync)) < squeue->len)
+    {
+        printf("An error occurred sending the packets: %s. Only %d bytes were sent\n", pcap_geterr(outdesc), res);
+    }
+    
+    cpu_time = (clock() - cpu_time)/CLK_TCK;
+    
+    printf ("\n\nElapsed time: %5.3f\n", cpu_time);
+    printf ("\nTotal packets generated = %d", npacks);
+    printf ("\nAverage packets per second = %d", (int)((double)npacks/cpu_time));
+    printf ("\n");
+
+    /* free the send queue */
+    pcap_sendqueue_destroy(squeue);
+
+    /* Close the input file */
+    pcap_close(indesc);
+
+    /* 
+     * lose the output adapter 
+     * IMPORTANT: remember to close the adapter, otherwise there will be no guarantee that all the 
+     * packets will be sent!
+     */
+    pcap_close(outdesc);
+
+
+    return;
+}
+
+
+void usage()
+{
+    
+    printf("\nSendcap, sends a libpcap/tcpdump capture file to the net. Copyright (C) 2002 Loris Degioanni.\n");
+    printf("\nUsage:\n");
+    printf("\t sendcap file_name adapter [s]\n");
+    printf("\nParameters:\n");
+    printf("\nfile_name: the name of the dump file that will be sent to the network\n");
+    printf("\nadapter: the device to use. Use \"WinDump -D\" for a list of valid devices\n");
+    printf("\ns: if present, forces the packets to be sent synchronously, i.e. respecting the timestamps in the dump file. This option will work only under Windows NTx.\n\n");
+
+    exit(0);
+}
+

<<< Previous Next >>>

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut9.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut9.html new file mode 100644 index 0000000..2bbceef --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcap__tut9.html @@ -0,0 +1,206 @@ + + + + +WinPcap: Gathering Statistics on the network traffic + + + + + + +
+

Gathering Statistics on the network traffic

+
+

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. You can take a look at the NPF driver internals manual if you want to know more details.

+

In order to use this feature, the programmer must open an adapter and put it in statistical mode. This can be done with pcap_setmode(). In particular, MODE_STAT must be used as the mode argument of this function.

+

With statistical mode, making an application that monitors the TCP traffic load is a matter of few lines of code. The following sample shows how to do it.

+
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <pcap.h>
+
+void usage();
+
+void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *);
+
+
+void main(int argc, char **argv)
+{
+pcap_t *fp;
+char errbuf[PCAP_ERRBUF_SIZE];
+struct timeval st_ts;
+u_int netmask;
+struct bpf_program fcode;
+  
+    /* Check the validity of the command line */
+    if (argc != 2)
+    {
+        usage();
+        return;
+    }
+        
+    /* Open the output adapter */
+    if ( (fp= pcap_open(argv[1], 100, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf) ) == NULL)
+    {
+        fprintf(stderr,"\nUnable to open adapter %s.\n", errbuf);
+        return;
+    }
+
+    /* Don't care about netmask, it won't be used for this filter */
+    netmask=0xffffff; 
+
+    //compile the filter
+    if (pcap_compile(fp, &fcode, "tcp", 1, netmask) <0 )
+    {
+        fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n");
+        /* Free the device list */
+        return;
+    }
+    
+    //set the filter
+    if (pcap_setfilter(fp, &fcode)<0)
+    {
+        fprintf(stderr,"\nError setting the filter.\n");
+        pcap_close(fp);
+        /* Free the device list */
+        return;
+    }
+
+    /* Put the interface in statstics mode */
+    if (pcap_setmode(fp, MODE_STAT)<0)
+    {
+        fprintf(stderr,"\nError setting the mode.\n");
+        pcap_close(fp);
+        /* Free the device list */
+        return;
+    }
+
+
+    printf("TCP traffic summary:\n");
+
+    /* Start the main loop */
+    pcap_loop(fp, 0, dispatcher_handler, (PUCHAR)&st_ts);
+
+    pcap_close(fp);
+    return;
+}
+
+void dispatcher_handler(u_char *state, const struct pcap_pkthdr *header, const u_char *pkt_data)
+{
+    struct timeval *old_ts = (struct timeval *)state;
+    u_int delay;
+    LARGE_INTEGER Bps,Pps;
+    struct tm ltime;
+    char timestr[16];
+    time_t local_tv_sec;
+
+    /* Calculate the delay in microseconds from the last sample. */
+    /* This value is obtained from the timestamp that the associated with the sample. */
+    delay=(header->ts.tv_sec - old_ts->tv_sec) * 1000000 - old_ts->tv_usec + header->ts.tv_usec;
+    /* Get the number of Bits per second */
+    Bps.QuadPart=(((*(LONGLONG*)(pkt_data + 8)) * 8 * 1000000) / (delay));
+    /*                                            ^      ^
+                                                  |      |
+                                                  |      | 
+                                                  |      |
+                         converts bytes in bits --       |
+                                                         |
+                    delay is expressed in microseconds --
+    */
+
+    /* Get the number of Packets per second */
+    Pps.QuadPart=(((*(LONGLONG*)(pkt_data)) * 1000000) / (delay));
+
+    /* Convert the timestamp to readable format */
+    local_tv_sec = header->ts.tv_sec;
+    localtime_s(&ltime, &local_tv_sec);
+    strftime( timestr, sizeof timestr, "%H:%M:%S", &ltime);
+
+    /* Print timestamp*/
+    printf("%s ", timestr);
+
+    /* Print the samples */
+    printf("BPS=%I64u ", Bps.QuadPart);
+    printf("PPS=%I64u\n", Pps.QuadPart);
+
+    //store current timestamp
+    old_ts->tv_sec=header->ts.tv_sec;
+    old_ts->tv_usec=header->ts.tv_usec;
+}
+
+
+void usage()
+{
+    
+    printf("\nShows the TCP traffic load, in bits per second and packets per second.\nCopyright (C) 2002 Loris Degioanni.\n");
+    printf("\nUsage:\n");
+    printf("\t tcptop adapter\n");
+    printf("\t You can use \"WinDump -D\" if you don't know the name of your adapters.\n");
+
+    exit(0);
+}
+

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 Filtering expression syntax for details. If no filter has been set, all of the traffic will be monitored.

+

Once

+ +

the interface descriptor starts to work in statistical mode. Notice the fourth parameter (to_ms) of pcap_open(): it defines the interval among the statistical samples. The callback function receives the samples calculated by the driver every to_ms milliseconds. These samples are encapsulated in the second and third parameters of the callback function, as shown in the following figure:

+
+stats_wpcap.gif +
+

Two 64-bit counters are provided: the number of packets and the amount of bytes received during the last interval.

+

In the example, the adapter is opened with a timeout of 1000 ms. This means that dispatcher_handler() is called once per second. At this point a filter that keeps only tcp packets is compiled and set. Then pcap_setmode() and pcap_loop() are called. Note that a struct timeval pointer is passed to pcap_loop() as the user parameter. This structure will be used to store a timestamp in order to calculate the interval between two samples. dispatcher_handler()uses this interval to obtain the bits per second and the packets per second and then prints these values on the screen.

+

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. 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.

+

<<< Previous

+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcapfunc.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcapfunc.html new file mode 100644 index 0000000..64f577f --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcapfunc.html @@ -0,0 +1,2452 @@ + + + + +WinPcap: Exported functions + + + + + + +
+

Exported functions
+ +[WinPcap user's manual] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Unix-compatible Functions

These functions are part of the libpcap library, and therefore work both on Windows and on Linux.

+
Note:
errbuf in pcap_open_live(), pcap_open_dead(), pcap_open_offline(), pcap_setnonblock(), pcap_getnonblock(), pcap_findalldevs(), pcap_lookupdev(), and pcap_lookupnet() is assumed to be able to hold at least PCAP_ERRBUF_SIZE chars.
+

typedef void(* pcap_handler )(u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
 Prototype of the callback function that receives the packets.
pcap_tpcap_open_live (const char *device, int snaplen, int promisc, int to_ms, char *ebuf)
 Open a live capture from the network.
pcap_tpcap_open_dead (int linktype, int snaplen)
 Create a pcap_t structure without starting a capture.
pcap_tpcap_open_offline (const char *fname, char *errbuf)
 Open a savefile in the tcpdump/libpcap format to read packets.
pcap_dumper_tpcap_dump_open (pcap_t *p, const char *fname)
 Open a file to write packets.
int pcap_setnonblock (pcap_t *p, int nonblock, char *errbuf)
 Switch between blocking and nonblocking mode.
int pcap_getnonblock (pcap_t *p, char *errbuf)
 Get the "non-blocking" state of an interface.
int pcap_findalldevs (pcap_if_t **alldevsp, char *errbuf)
 Construct a list of network devices that can be opened with pcap_open_live().
void pcap_freealldevs (pcap_if_t *alldevsp)
 Free an interface list returned by pcap_findalldevs().
char * pcap_lookupdev (char *errbuf)
 Return the first valid device in the system.
int pcap_lookupnet (const char *device, bpf_u_int32 *netp, bpf_u_int32 *maskp, char *errbuf)
 Return the subnet and netmask of an interface.
int pcap_dispatch (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 Collect a group of packets.
int pcap_loop (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 Collect a group of packets.
u_char * pcap_next (pcap_t *p, struct pcap_pkthdr *h)
 Return the next available packet.
int pcap_next_ex (pcap_t *p, struct pcap_pkthdr **pkt_header, const u_char **pkt_data)
 Read a packet from an interface or from an offline capture.
void pcap_breakloop (pcap_t *)
 set a flag that will force pcap_dispatch() or pcap_loop() to return rather than looping.
int pcap_sendpacket (pcap_t *p, u_char *buf, int size)
 Send a raw packet.
void pcap_dump (u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
 Save a packet to disk.
long pcap_dump_ftell (pcap_dumper_t *)
 Return the file position for a "savefile".
int pcap_compile (pcap_t *p, struct bpf_program *fp, char *str, int optimize, bpf_u_int32 netmask)
 Compile a packet filter, converting an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.
int pcap_compile_nopcap (int snaplen_arg, int linktype_arg, struct bpf_program *program, char *buf, int optimize, bpf_u_int32 mask)
 Compile a packet filter without the need of opening an adapter. This function converts an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.
int pcap_setfilter (pcap_t *p, struct bpf_program *fp)
 Associate a filter to a capture.
void pcap_freecode (struct bpf_program *fp)
 Free a filter.
int pcap_datalink (pcap_t *p)
 Return the link layer of an adapter.
int pcap_list_datalinks (pcap_t *p, int **dlt_buf)
 list datalinks
int pcap_set_datalink (pcap_t *p, int dlt)
 Set the current data link type of the pcap descriptor to the type specified by dlt. -1 is returned on failure.
int pcap_datalink_name_to_val (const char *name)
 Translates a data link type name, which is a DLT_ name with the DLT_ removed, to the corresponding data link type value. The translation is case-insensitive. -1 is returned on failure.
const char * pcap_datalink_val_to_name (int dlt)
 Translates a data link type value to the corresponding data link type name. NULL is returned on failure.
const char * pcap_datalink_val_to_description (int dlt)
 Translates a data link type value to a short description of that data link type. NULL is returned on failure.
int pcap_snapshot (pcap_t *p)
 Return the dimension of the packet portion (in bytes) that is delivered to the application.
int pcap_is_swapped (pcap_t *p)
 returns true if the current savefile uses a different byte order than the current system.
int pcap_major_version (pcap_t *p)
 return the major version number of the pcap library used to write the savefile.
int pcap_minor_version (pcap_t *p)
 return the minor version number of the pcap library used to write the savefile.
FILE * pcap_file (pcap_t *p)
 Return the standard stream of an offline capture.
int pcap_stats (pcap_t *p, struct pcap_stat *ps)
 Return statistics on current capture.
void pcap_perror (pcap_t *p, char *prefix)
 print the text of the last pcap library error on stderr, prefixed by prefix.
char * pcap_geterr (pcap_t *p)
 return the error text pertaining to the last pcap library error.
char * pcap_strerror (int error)
 Provided in case strerror() isn't available.
const char * pcap_lib_version (void)
 Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number.
void pcap_close (pcap_t *p)
 close the files associated with p and deallocates resources.
FILE * pcap_dump_file (pcap_dumper_t *p)
 return the standard I/O stream of the 'savefile' opened by pcap_dump_open().
int pcap_dump_flush (pcap_dumper_t *p)
 Flushes the output buffer to the ``savefile,'' so that any packets written with pcap_dump() but not yet written to the ``savefile'' will be written. -1 is returned on error, 0 on success.
void pcap_dump_close (pcap_dumper_t *p)
 Closes a savefile.

Windows-specific Extensions

The functions in this section extend libpcap to offer advanced functionalities (like remote packet capture, packet buffer size variation or high-precision packet injection). Howerver, at the moment they can be used only in Windows.

+

PAirpcapHandle pcap_get_airpcap_handle (pcap_t *p)
 Returns the AirPcap handler associated with an adapter. This handler can be used to change the wireless-related settings of the CACE Technologies AirPcap wireless capture adapters.
int pcap_offline_filter (struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data)
 Returns if a given filter applies to an offline packet.
int pcap_live_dump (pcap_t *p, char *filename, int maxsize, int maxpacks)
 Save a capture to file.
int pcap_live_dump_ended (pcap_t *p, int sync)
 Return the status of the kernel dump process, i.e. tells if one of the limits defined with pcap_live_dump() has been reached.
struct pcap_statpcap_stats_ex (pcap_t *p, int *pcap_stat_size)
 Return statistics on current capture.
int pcap_setbuff (pcap_t *p, int dim)
 Set the size of the kernel buffer associated with an adapter.
int pcap_setmode (pcap_t *p, int mode)
 Set the working mode of the interface p to mode.
int pcap_setmintocopy (pcap_t *p, int size)
 Set the minumum amount of data received by the kernel in a single call.
HANDLE pcap_getevent (pcap_t *p)
 Return the handle of the event associated with the interface p.
pcap_send_queuepcap_sendqueue_alloc (u_int memsize)
 Allocate a send queue.
void pcap_sendqueue_destroy (pcap_send_queue *queue)
 Destroy a send queue.
int pcap_sendqueue_queue (pcap_send_queue *queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
 Add a packet to a send queue.
u_int pcap_sendqueue_transmit (pcap_t *p, pcap_send_queue *queue, int sync)
 Send a queue of raw packets to the network.
int pcap_findalldevs_ex (char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
 Create a list of network devices that can be opened with pcap_open().
int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
 Accept a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0').
int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
 Parse the source string and returns the pieces in which the source can be split.
pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
 Open a generic source in order to capture / send (WinPcap only) traffic.
struct pcap_samppcap_setsampling (pcap_t *p)
 Define a sampling method for packet capture.
SOCKET pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
 Block until a network connection is accepted (active mode only).
int pcap_remoteact_close (const char *host, char *errbuf)
 Drop an active connection (active mode only).
void pcap_remoteact_cleanup ()
 Clean the socket that is currently used in waiting active connections.
int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
 Return the hostname of the host that have an active connection with us (active mode only).
+

Detailed Description

+

Functions exported by wpcap.dll

+

Typedef Documentation

+ +
+
+ + + + +
typedef void(* pcap_handler)(u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
+
+
+ +

Prototype of the callback function that receives the packets.

+

When pcap_dispatch() or pcap_loop() are called by the user, the packets are passed to the application by means of this callback. user is a user-defined parameter that contains the state of the capture session, it corresponds to the user parameter of pcap_dispatch() and pcap_loop(). pkt_header is the header associated by the capture driver to the packet. It is NOT a protocol header. pkt_data points to the data of the packet, including the protocol headers.

+ +

Definition at line 27 of file funcs/pcap.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + +
void pcap_breakloop (pcap_t ) 
+
+
+ +

set a flag that will force pcap_dispatch() or pcap_loop() to return rather than looping.

+

They will return the number of packets that have been processed so far, or -2 if no packets have been processed so far. This routine is safe to use inside a signal handler on UNIX or a console control handler on Windows, as it merely sets a flag that is checked within the loop. The flag is checked in loops reading packets from the OS - a signal by itself will not necessarily terminate those loops - as well as in loops processing a set of packets returned by the OS. Note that if you are catching signals on UNIX systems that support restarting system calls after a signal, and calling pcap_breakloop() in the signal handler, you must specify, when catching those signals, that system calls should NOT be restarted by that signal. Otherwise, if the signal interrupted a call reading packets in a live capture, when your signal handler returns after calling pcap_breakloop(), the call will be restarted, and the loop will not terminate until more packets arrive and the call completes.

+
Note:
pcap_next() will, on some platforms, loop reading packets from the OS; that loop will not necessarily be terminated by a signal, so pcap_breakloop() should be used to terminate packet processing even if pcap_next() is being used. pcap_breakloop() does not guarantee that no further packets will be processed by pcap_dispatch() or pcap_loop() after it is called; at most one more packet might be processed. If -2 is returned from pcap_dispatch() or pcap_loop(), the flag is cleared, so a subsequent call will resume reading packets. If a positive number is returned, the flag is not cleared, so a subsequent call will return -2 and clear the flag.
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_close (pcap_t p ) 
+
+
+ +

close the files associated with p and deallocates resources.

+
See also:
pcap_open_live(), pcap_open_offline(), pcap_open_dead()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_compile (pcap_t p,
struct bpf_program *  fp,
char *  str,
int  optimize,
bpf_u_int32  netmask 
)
+
+
+ +

Compile a packet filter, converting an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.

+

pcap_compile() is used to compile the string str into a filter program. program is a pointer to a bpf_program struct and is filled in by pcap_compile(). optimize controls whether optimization on the resulting code is performed. netmask specifies the IPv4 netmask of the network on which packets are being captured; it is used only when checking for IPv4 broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program, or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, a value of 0 can be supplied; tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK. A return of -1 indicates an error in which case pcap_geterr() may be used to display the error text.

+
See also:
pcap_open_live(), pcap_setfilter(), pcap_freecode(), pcap_snapshot()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_compile_nopcap (int  snaplen_arg,
int  linktype_arg,
struct bpf_program *  program,
char *  buf,
int  optimize,
bpf_u_int32  mask 
)
+
+
+ +

Compile a packet filter without the need of opening an adapter. This function converts an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine.

+

pcap_compile_nopcap() is similar to pcap_compile() except that instead of passing a pcap structure, one passes the snaplen and linktype explicitly. It is intended to be used for compiling filters for direct BPF usage, without necessarily having called pcap_open(). A return of -1 indicates an error; the error text is unavailable. (pcap_compile_nopcap() is a wrapper around pcap_open_dead(), pcap_compile(), and pcap_close(); the latter three routines can be used directly in order to get the error text for a compilation error.)

+

Look at the Filtering expression syntax section for details on the str parameter.

+
See also:
pcap_open_live(), pcap_setfilter(), pcap_freecode(), pcap_snapshot()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_createsrcstr (char *  source,
int  type,
const char *  host,
const char *  port,
const char *  name,
char *  errbuf 
)
+
+
+ +

Accept a set of strings (host name, port, ...), and it returns the complete source string according to the new format (e.g. 'rpcap://1.2.3.4/eth0').

+

This function is provided in order to help the user creating the source string according to the new format. An unique source string is used in order to make easy for old applications to use the remote facilities. Think about tcpdump, for example, which has only one way to specify the interface on which the capture has to be started. However, GUI-based programs can find more useful to specify hostname, port and interface name separately. In that case, they can use this function to create the source string before passing it to the pcap_open() function.

+
Parameters:
+ + + + + + + +
source,: a user-allocated buffer that will contain the complete source string wen the function returns.
+ The source will start with an identifier according to the new Source Specification Syntax .
+ This function assumes that the allocated buffer is at least PCAP_BUF_SIZE bytes.
type,: its value tells the type of the source we want to create. It can assume the values defined in the Source identification Codes .
+
host,: an user-allocated buffer that keeps the host (e.g. "foo.bar.com") we want to connect to. It can be NULL in case we want to open an interface on a local host.
port,: an user-allocated buffer that keeps the network port (e.g. "2002") we want to use for the RPCAP protocol. It can be NULL in case we want to open an interface on a local host.
name,: an user-allocated buffer that keeps the interface name we want to use (e.g. "eth0"). It can be NULL in case the return string (i.e. 'source') has to be used with the pcap_findalldevs_ex(), which does not require the interface name.
errbuf,: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).
+
+
+
Returns:
'0' if everything is fine, '-1' if some errors occurred. The string containing the complete source is returned in the 'source' variable.
+
Warning:
If the source is longer than PCAP_BUF_SIZE, the excess characters are truncated.
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_datalink (pcap_t p ) 
+
+
+ +

Return the link layer of an adapter.

+

returns the link layer type; link layer types it can return include:

+
    +
  • DLT_NULL BSD loopback encapsulation; the link layer header is a 4-byte field, in host byte order, containing a PF_ value from socket.h for the network-layer protocol of the packet. Note that ``host byte order'' is the byte order of the machine on which the packets are captured, and the PF_ values are for the OS of the machine on which the packets are captured; if a live capture is being done, ``host byte order'' is the byte order of the machine capturing the packets, and the PF_ values are those of the OS of the machine capturing the packets, but if a ``savefile'' is being read, the byte order and PF_ values are not necessarily those of the machine reading the capture file.
  • +
  • DLT_EN10MB Ethernet (10Mb, 100Mb, 1000Mb, and up)
  • +
  • DLT_IEEE802: IEEE 802.5 Token Ring
  • +
  • DLT_ARCNET: ARCNET
  • +
  • DLT_SLIP: SLIP; the link layer header contains, in order:
      +
    1. a 1-byte flag, which is 0 for packets received by the machine and 1 for packets sent by the machine;
    2. +
    3. a 1-byte field, the upper 4 bits of which indicate the type of packet, as per RFC 1144:
        +
      • 0x40: an unmodified IP datagram (TYPE_IP);
      • +
      • 0x70: an uncompressed-TCP IP datagram (UNCOMPRESSED_TCP), with that byte being the first byte of the raw IP header on the wire, containing the connection number in the protocol field;
      • +
      • 0x80: a compressed-TCP IP datagram (COMPRESSED_TCP), with that byte being the first byte of the compressed TCP/IP datagram header;
      • +
      +
    4. +
    5. for UNCOMPRESSED_TCP, the rest of the modified IP header, and for COMPRESSED_TCP, the compressed TCP/IP datagram header;
    6. +
    7. for a total of 16 bytes; the uncompressed IP datagram follows the header.
    8. +
    +
  • +
+
    +
  • DLT_PPP: PPP; if the first 2 bytes are 0xff and 0x03, it's PPP in HDLC-like framing, with the PPP header following those two bytes, otherwise it's PPP without framing, and the packet begins with the PPP header.
  • +
  • DLT_FDDI: FDDI
  • +
  • DLT_ATM_RFC1483: RFC 1483 LLC/SNAP-encapsulated ATM; the packet begins with an IEEE 802.2 LLC header.
  • +
  • DLT_RAW: raw IP; the packet begins with an IP header.
  • +
  • DLT_PPP_SERIAL: PPP in HDLC-like framing, as per RFC 1662, or Cisco PPP with HDLC framing, as per section 4.3.1 of RFC 1547; the first byte will be 0xFF for PPP in HDLC-like framing, and will be 0x0F or 0x8F for Cisco PPP with HDLC framing.
  • +
  • DLT_PPP_ETHER: PPPoE; the packet begins with a PPPoE header, as per RFC 2516.
  • +
  • DLT_C_HDLC: Cisco PPP with HDLC framing, as per section 4.3.1 of RFC 1547.
  • +
  • DLT_IEEE802_11: IEEE 802.11 wireless LAN
  • +
  • DLT_FRELAY: Frame Relay
  • +
  • DLT_LOOP: OpenBSD loopback encapsulation; the link layer header is a 4-byte field, in network byte order, containing a PF_ value from OpenBSD's socket.h for the network-layer protocol of the packet. Note that, if a ``savefile'' is being read, those PF_ values are not necessarily those of the machine reading the capture file.
  • +
  • DLT_LINUX_SLL: Linux "cooked" capture encapsulation; the link layer header contains, in order:
      +
    • a 2-byte "packet type", in network byte order, which is one of:
        +
      1. packet was sent to us by somebody else
      2. +
      3. packet was broadcast by somebody else
      4. +
      5. packet was multicast, but not broadcast, by somebody else
      6. +
      7. packet was sent by somebody else to somebody else
      8. +
      9. packet was sent by us
      10. +
      +
    • +
    • a 2-byte field, in network byte order, containing a Linux ARPHRD_ value for the link layer device type;
    • +
    • a 2-byte field, in network byte order, containing the length of the link layer address of the sender of the packet (which could be 0);
    • +
    • an 8-byte field containing that number of bytes of the link layer header (if there are more than 8 bytes, only the first 8 are present);
    • +
    • 2-byte field containing an Ethernet protocol type, in network byte order, or containing 1 for Novell 802.3 frames without an 802.2 LLC header or 4 for frames beginning with an 802.2 LLC header.
    • +
    +
  • +
  • DLT_LTALK: Apple LocalTalk; the packet begins with an AppleTalk LLAP header.
  • +
  • DLT_PFLOG: OpenBSD pflog; the link layer header contains, in order:
      +
    • a 4-byte PF_ value, in network byte order;
    • +
    • a 16-character interface name;
    • +
    • a 2-byte rule number, in network byte order;
    • +
    • a 2-byte reason code, in network byte order, which is one of:
        +
      1. match
      2. +
      3. bad offset
      4. +
      5. fragment
      6. +
      7. short
      8. +
      9. normalize
      10. +
      11. memory -a 2-byte action code, in network byte order, which is one of:
      12. +
      13. passed
      14. +
      15. dropped
      16. +
      17. scrubbed
      18. +
      +
    • +
    • a 2-byte direction, in network byte order, which is one of:
        +
      1. incoming or outgoing
      2. +
      3. incoming
      4. +
      5. outgoing
      6. +
      +
    • +
    +
  • +
  • DLT_PRISM_HEADER: Prism monitor mode information followed by an 802.11 header.
  • +
  • DLT_IP_OVER_FC: RFC 2625 IP-over-Fibre Channel, with the link-layer header being the Network_Header as described in that RFC.
  • +
  • DLT_SUNATM: SunATM devices; the link layer header contains, in order:
      +
    • a 1-byte flag field, containing a direction flag in the uppermost bit, which is set for packets transmitted by the machine and clear for packets received by the machine, and a 4-byte traffic type in the low-order 4 bits, which is one of:
        +
      1. raw traffic
      2. +
      3. LANE traffic
      4. +
      5. LLC-encapsulated traffic
      6. +
      7. MARS traffic
      8. +
      9. IFMP traffic
      10. +
      11. ILMI traffic
      12. +
      13. Q.2931 traffic
      14. +
      +
    • +
    • a 1-byte VPI value;
    • +
    • a 2-byte VCI field, in network byte order.
    • +
    +
  • +
  • DLT_IEEE802_11_RADIO: link-layer information followed by an 802.11 header - see http://www.radiotap.org/ for a description of the link-layer information.
  • +
  • DLT_ARCNET_LINUX: ARCNET, with no exception frames, reassembled packets rather than raw frames, and an extra 16-bit offset field between the destination host and type bytes.
  • +
  • DLT_LINUX_IRDA: Linux-IrDA packets, with a DLT_LINUX_SLL header followed by the IrLAP header.
  • +
+
See also:
pcap_list_datalinks(), pcap_set_datalink(), pcap_datalink_name_to_val()
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_datalink_name_to_val (const char *  name ) 
+
+
+ +

Translates a data link type name, which is a DLT_ name with the DLT_ removed, to the corresponding data link type value. The translation is case-insensitive. -1 is returned on failure.

+ +
+
+ +
+
+ + + + + + + + + +
const char* pcap_datalink_val_to_description (int  dlt ) 
+
+
+ +

Translates a data link type value to a short description of that data link type. NULL is returned on failure.

+ +
+
+ +
+
+ + + + + + + + + +
const char* pcap_datalink_val_to_name (int  dlt ) 
+
+
+ +

Translates a data link type value to the corresponding data link type name. NULL is returned on failure.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_dispatch (pcap_t p,
int  cnt,
pcap_handler  callback,
u_char *  user 
)
+
+
+ +

Collect a group of packets.

+

pcap_dispatch() is used to collect and process packets. cnt specifies the maximum number of packets to process before returning. This is not a minimum number; when reading a live capture, only one bufferful of packets is read at a time, so fewer than cnt packets may be processed. A cnt of -1 processes all the packets received in one buffer when reading a live capture, or all the packets in the file when reading a ``savefile''. callback specifies a routine to be called with three arguments: a u_char pointer which is passed in from pcap_dispatch(), a const struct pcap_pkthdr pointer, and a const u_char pointer to the first caplen (as given in the struct pcap_pkthdr a pointer to which is passed to the callback routine) bytes of data from the packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snaplen in your call to pcap_open_live() that is sufficiently large to get all of the packet's data - a value of 65535 should be sufficient on most if not all networks).

+

The number of packets read is returned. 0 is returned if no packets were read from a live capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout that starts before any packets arrive, the timeout expires before any packets arrive, or if the file descriptor for the capture device is in non-blocking mode and no packets were available to be read) or if no more packets are available in a ``savefile.'' A return of -1 indicates an error in which case pcap_perror() or pcap_geterr() may be used to display the error text. A return of -2 indicates that the loop terminated due to a call to pcap_breakloop() before any packets were processed. If your application uses pcap_breakloop(), make sure that you explicitly check for -1 and -2, rather than just checking for a return value < 0.

+
Note:
when reading a live capture, pcap_dispatch() will not necessarily return when the read times out; on some platforms, the read timeout isn't supported, and, on other platforms, the timer doesn't start until at least one packet arrives. This means that the read timeout should NOT be used in, for example, an interactive application, to allow the packet capture loop to ``poll'' for user input periodically, as there's no guarantee that pcap_dispatch() will return after the timeout expires.
+
See also:
pcap_loop(), pcap_next(), pcap_open_live(), pcap_open_offline(), pcap_handler
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void pcap_dump (u_char *  user,
const struct pcap_pkthdr h,
const u_char *  sp 
)
+
+
+ +

Save a packet to disk.

+

pcap_dump() outputs a packet to the "savefile" opened with pcap_dump_open(). Note that its calling arguments are suitable for use with pcap_dispatch() or pcap_loop(). If called directly, the user parameter is of type pcap_dumper_t as returned by pcap_dump_open().

+
See also:
pcap_dump_open(), pcap_dump_close(), pcap_dispatch(), pcap_loop()
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_dump_close (pcap_dumper_t p ) 
+
+
+ +

Closes a savefile.

+
See also:
pcap_dump_open(), pcap_dump()
+ +
+
+ +
+
+ + + + + + + + + +
FILE* pcap_dump_file (pcap_dumper_t p ) 
+
+
+ +

return the standard I/O stream of the 'savefile' opened by pcap_dump_open().

+ +
+
+ +
+
+ + + + + + + + + +
int pcap_dump_flush (pcap_dumper_t p ) 
+
+
+ +

Flushes the output buffer to the ``savefile,'' so that any packets written with pcap_dump() but not yet written to the ``savefile'' will be written. -1 is returned on error, 0 on success.

+ +
+
+ +
+
+ + + + + + + + + +
long pcap_dump_ftell (pcap_dumper_t ) 
+
+
+ +

Return the file position for a "savefile".

+

pcap_dump_ftell() returns the current file position for the "savefile", representing the number of bytes written by pcap_dump_open() and pcap_dump() . -1 is returned on error.

+
See also:
pcap_dump_open(), pcap_dump()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
pcap_dumper_t* pcap_dump_open (pcap_t p,
const char *  fname 
)
+
+
+ +

Open a file to write packets.

+

pcap_dump_open() is called to open a "savefile" for writing. The name "-" in a synonym for stdout. NULL is returned on failure. p is a pcap struct as returned by pcap_open_offline() or pcap_open_live(). fname specifies the name of the file to open. Alternatively, you may call pcap_dump_fopen() to write data to an existing open stream fp. Note that on Windows, that stream should be opened in binary mode. If NULL is returned, pcap_geterr() can be used to get the error text.

+
See also:
pcap_dump_close(), pcap_dump()
+ +
+
+ +
+
+ + + + + + + + + +
FILE* pcap_file (pcap_t p ) 
+
+
+ +

Return the standard stream of an offline capture.

+

pcap_file() returns the standard I/O stream of the "savefile", if a "savefile" was opened with pcap_open_offline(), or NULL, if a network device was opened with pcap_open_live().

+
Deprecated:
Due to incompatibilities between the C Runtime (CRT) used to compile WinPcap and the one used by WinPcap-based applications, this function may return an invalid FILE pointer, i.e. a descriptor that causes all the standard I/O stream functions (ftell, fseek, fclose...) to fail. The function is still available for backwards binary compatibility, only.
+
See also:
pcap_open_offline(), pcap_open_live()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_findalldevs (pcap_if_t **  alldevsp,
char *  errbuf 
)
+
+
+ +

Construct a list of network devices that can be opened with pcap_open_live().

+
Note:
that there may be network devices that cannot be opened with pcap_open_live() by the process calling pcap_findalldevs(), because, for example, that process might not have sufficient privileges to open them for capturing; if so, those devices will not appear on the list.) alldevsp is set to point to the first element of the list; each element of the list is of type pcap_if_t,
+

-1 is returned on failure, in which case errbuf is filled in with an appropriate error message; 0 is returned on success.

+
See also:
struct pcap_if, pcap_freealldevs(), pcap_open_live(), pcap_lookupdev(), pcap_lookupnet()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_findalldevs_ex (char *  source,
struct pcap_rmtauth auth,
pcap_if_t **  alldevs,
char *  errbuf 
)
+
+
+ +

Create a list of network devices that can be opened with pcap_open().

+

This function is a superset of the old 'pcap_findalldevs()', which allows listing only the devices present on the local machine. Vice versa, pcap_findalldevs_ex() allows listing the devices present on a remote machine as well. Additionally, it can list all the pcap files available into a given folder. Moreover, pcap_findalldevs_ex() is platform independent, since it relies on the standard pcap_findalldevs() to get addresses on the local machine.

+

In case the function has to list the interfaces on a remote machine, it opens a new control connection toward that machine, it retrieves the interfaces, and it drops the connection. However, if this function detects that the remote machine is in 'active' mode, the connection is not dropped and the existing socket is used.

+

The 'source' is a parameter that tells the function where the lookup has to be done and it uses the same syntax of the pcap_open().

+

Differently from the pcap_findalldevs(), the interface names (pointed by the alldevs->name and the other ones in the linked list) are already ready to be used in the pcap_open() call. Vice versa, the output that comes from pcap_findalldevs() must be formatted with the new pcap_createsrcstr() before passing the source identifier to the pcap_open().

+
Parameters:
+ + + + + +
source,: a char* buffer that keeps the 'source localtion', according to the new WinPcap syntax. This source will be examined looking for adapters (local or remote) (e.g. source can be 'rpcap://' for local adapters or 'rpcap://host:port' for adapters on a remote host) or pcap files (e.g. source can be 'file://c:/myfolder/').
+ The strings that must be prepended to the 'source' in order to define if we want local/remote adapters or files is defined in the new Source Specification Syntax .
auth,: a pointer to a pcap_rmtauth structure. This pointer keeps the information required to authenticate the RPCAP connection to the remote host. This parameter is not meaningful in case of a query to the local host: in that case it can be NULL.
alldevs,: a 'struct pcap_if_t' pointer, which will be properly allocated inside this function. When the function returns, it is set to point to the first element of the interface list; each element of the list is of type 'struct pcap_if_t'.
errbuf,: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).
+
+
+
Returns:
'0' if everything is fine, '-1' if some errors occurred. The list of the devices is returned in the 'alldevs' variable. When the function returns correctly, 'alldevs' cannot be NULL. In other words, this function returns '-1' also in case the system does not have any interface to list.
+

The error message is returned in the 'errbuf' variable. An error could be due to several reasons:

+
    +
  • libpcap/WinPcap was not installed on the local/remote host
  • +
  • the user does not have enough privileges to list the devices / files
  • +
  • a network problem
  • +
  • the RPCAP version negotiation failed
  • +
  • other errors (not enough memory and others).
  • +
+
Warning:
There may be network devices that cannot be opened with pcap_open() by the process calling pcap_findalldevs(), because, for example, that process might not have sufficient privileges to open them for capturing; if so, those devices will not appear on the list.
+
+The interface list must be deallocated manually by using the pcap_freealldevs().
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_freealldevs (pcap_if_t alldevsp ) 
+
+
+ +

Free an interface list returned by pcap_findalldevs().

+

pcap_freealldevs() is used to free a list allocated by pcap_findalldevs().

+
See also:
pcap_findalldevs()
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_freecode (struct bpf_program *  fp ) 
+
+
+ +

Free a filter.

+

pcap_freecode() is used to free up allocated memory pointed to by a bpf_program struct generated by pcap_compile() when that BPF program is no longer needed, for example after it has been made the filter program for a pcap structure by a call to pcap_setfilter().

+
See also:
pcap_compile(), pcap_compile_nopcap()
+ +
+
+ +
+
+ + + + + + + + + +
PAirpcapHandle pcap_get_airpcap_handle (pcap_t p ) 
+
+
+ +

Returns the AirPcap handler associated with an adapter. This handler can be used to change the wireless-related settings of the CACE Technologies AirPcap wireless capture adapters.

+
Note:
THIS FUNCTION SHOULD BE CONSIDERED PROVISIONAL, AND MAY BE REPLACED IN THE FUTURE BY A MORE COMPLETE SET OF FUNCTIONS FOR WIRELESS SUPPORT.
+

pcap_get_airpcap_handle() allows to obtain the airpcap handle of an open adapter. This handle can be used with the AirPcap API functions to perform wireless-releated operations, e.g. changing the channel or enabling WEP decryption. For more details about the AirPcap wireless capture adapters, see http://www.cacetech.com/products/airpcap.htm

+
Parameters:
+ + +
p,: handle to an open libpcap adapter
+
+
+
Returns:
a pointer to an open AirPcap handle, used internally by the libpcap open adapter. NULL if the libpcap adapter doesn't have wireless support through AirPcap.
+ +
+
+ +
+
+ + + + + + + + + +
char* pcap_geterr (pcap_t p ) 
+
+
+ +

return the error text pertaining to the last pcap library error.

+
Note:
the pointer Return will no longer point to a valid error message string after the pcap_t passed to it is closed; you must use or copy the string before closing the pcap_t.
+
See also:
pcap_perror()
+ +
+
+ +
+
+ + + + + + + + + +
HANDLE pcap_getevent (pcap_t p ) 
+
+
+ +

Return the handle of the event associated with the interface p.

+

This event can be passed to functions like WaitForSingleObject() or WaitForMultipleObjects() to wait until the driver's buffer contains some data without performing a read.

+

We disourage the use of this function because it is not portable.

+
See also:
pcap_open_live()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_getnonblock (pcap_t p,
char *  errbuf 
)
+
+
+ +

Get the "non-blocking" state of an interface.

+

pcap_getnonblock() returns the current "non-blocking" state of the capture descriptor; it always returns 0 on "savefiles". If there is an error, -1 is returned and errbuf is filled in with an appropriate error message.

+
See also:
pcap_setnonblock()
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_is_swapped (pcap_t p ) 
+
+
+ +

returns true if the current savefile uses a different byte order than the current system.

+ +
+
+ +
+
+ + + + + + + + + +
const char* pcap_lib_version (void  ) 
+
+
+ +

Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_list_datalinks (pcap_t p,
int **  dlt_buf 
)
+
+
+ +

list datalinks

+

pcap_list_datalinks() is used to get a list of the supported data link types of the interface associated with the pcap descriptor. pcap_list_datalinks() allocates an array to hold the list and sets *dlt_buf. The caller is responsible for freeing the array. -1 is returned on failure; otherwise, the number of data link types in the array is returned.

+
See also:
pcap_datalink(), pcap_set_datalink(), pcap_datalink_name_to_val()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_live_dump (pcap_t p,
char *  filename,
int  maxsize,
int  maxpacks 
)
+
+
+ +

Save a capture to file.

+
Note:
: this function does not work in current version of WinPcap.
+

pcap_live_dump() dumps the network traffic from an interface to a file. Using this function the dump is performed at kernel level, therefore it is more efficient than using pcap_dump().

+

The parameters of this function are an interface descriptor (obtained with pcap_open_live()), a string with the name of the dump file, the maximum size of the file (in bytes) and the maximum number of packets that the file will contain. Setting maxsize or maxpacks to 0 means no limit. When maxsize or maxpacks are reached, the dump ends.

+

pcap_live_dump() is non-blocking, threfore Return immediately. pcap_live_dump_ended() can be used to check the status of the dump process or to wait until it is finished. pcap_close() can instead be used to end the dump process.

+

Note that when one of the two limits is reached, the dump is stopped, but the file remains opened. In order to correctly flush the data and put the file in a consistent state, the adapter must be closed with pcap_close().

+
See also:
pcap_live_dump_ended(), pcap_open_live(), pcap_close(), pcap_dump_open(), pcap_dump()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_live_dump_ended (pcap_t p,
int  sync 
)
+
+
+ +

Return the status of the kernel dump process, i.e. tells if one of the limits defined with pcap_live_dump() has been reached.

+
Note:
: this function does not work in current version of WinPcap.
+

pcap_live_dump_ended() informs the user about the limits that were set with a previous call to pcap_live_dump() on the interface pointed by p: if the return value is nonzero, one of the limits has been reched and the dump process is currently stopped.

+

If sync is nonzero, the function blocks until the dump is finished, otherwise Return immediately.

+
Warning:
if the dump process has no limits (i.e. if the maxsize and maxpacks arguments of pcap_live_dump() were both 0), the dump process will never stop, therefore setting sync to TRUE will block the application on this call forever.
+
See also:
pcap_live_dump()
+ +
+
+ +
+
+ + + + + + + + + +
char* pcap_lookupdev (char *  errbuf ) 
+
+
+ +

Return the first valid device in the system.

+
Deprecated:
Use pcap_findalldevs() or pcap_findalldevs_ex() instead.
+

pcap_lookupdev() returns a pointer to a network device suitable for use with pcap_open_live() and pcap_lookupnet(). If there is an error, NULL is returned and errbuf is filled in with an appropriate error message.

+
See also:
pcap_findalldevs(), pcap_open_live()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_lookupnet (const char *  device,
bpf_u_int32 netp,
bpf_u_int32 maskp,
char *  errbuf 
)
+
+
+ +

Return the subnet and netmask of an interface.

+
Deprecated:
Use pcap_findalldevs() or pcap_findalldevs_ex() instead.
+

pcap_lookupnet() is used to determine the network number and mask associated with the network device device. Both netp and maskp are bpf_u_int32 pointers. A return of -1 indicates an error in which case errbuf is filled in with an appropriate error message.

+
See also:
pcap_findalldevs()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_loop (pcap_t p,
int  cnt,
pcap_handler  callback,
u_char *  user 
)
+
+
+ +

Collect a group of packets.

+

pcap_loop() is similar to pcap_dispatch() except it keeps reading packets until cnt packets are processed or an error occurs. It does not return when live read timeouts occur. Rather, specifying a non-zero read timeout to pcap_open_live() and then calling pcap_dispatch() allows the reception and processing of any packets that arrive when the timeout occurs. A negative cnt causes pcap_loop() to loop forever (or at least until an error occurs). -1 is returned on an error; 0 is returned if cnt is exhausted; -2 is returned if the loop terminated due to a call to pcap_breakloop() before any packets were processed. If your application uses pcap_breakloop(), make sure that you explicitly check for -1 and -2, rather than just checking for a return value < 0.

+
See also:
pcap_dispatch(), pcap_next(), pcap_open_live(), pcap_open_offline(), pcap_handler
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_major_version (pcap_t p ) 
+
+
+ +

return the major version number of the pcap library used to write the savefile.

+
See also:
pcap_minor_version()
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_minor_version (pcap_t p ) 
+
+
+ +

return the minor version number of the pcap library used to write the savefile.

+
See also:
pcap_major_version()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
u_char* pcap_next (pcap_t p,
struct pcap_pkthdr h 
)
+
+
+ +

Return the next available packet.

+

pcap_next() reads the next packet (by calling pcap_dispatch() with a cnt of 1) and returns a u_char pointer to the data in that packet. (The pcap_pkthdr struct for that packet is not supplied.) NULL is returned if an error occured, or if no packets were read from a live capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout that starts before any packets arrive, the timeout expires before any packets arrive, or if the file descriptor for the capture device is in non-blocking mode and no packets were available to be read), or if no more packets are available in a ``savefile.'' Unfortunately, there is no way to determine whether an error occured or not.

+
See also:
pcap_dispatch(), pcap_loop()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_next_ex (pcap_t p,
struct pcap_pkthdr **  pkt_header,
const u_char **  pkt_data 
)
+
+
+ +

Read a packet from an interface or from an offline capture.

+

This function is used to retrieve the next available packet, bypassing the callback method traditionally provided by libpcap.

+

pcap_next_ex fills the pkt_header and pkt_data parameters (see pcap_handler()) with the pointers to the header and to the data of the next captured packet.

+

The return value can be:

+
    +
  • 1 if the packet has been read without problems
  • +
  • 0 if the timeout set with pcap_open_live() has elapsed. In this case pkt_header and pkt_data don't point to a valid packet
  • +
  • -1 if an error occurred
  • +
  • -2 if EOF was reached reading from an offline capture
  • +
+
See also:
pcap_open_live(), pcap_loop(), pcap_dispatch(), pcap_handler()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_offline_filter (struct bpf_program *  prog,
const struct pcap_pkthdr header,
const u_char *  pkt_data 
)
+
+
+ +

Returns if a given filter applies to an offline packet.

+

This function is used to apply a filter to a packet that is currently in memory. This process does not need to open an adapter; we need just to create the proper filter (by settings parameters like the snapshot length, or the link-layer type) by means of the pcap_compile_nopcap().

+

The current API of libpcap does not allow to receive a packet and to filter the packet after it has been received. However, this can be useful in case you want to filter packets in the application, instead of into the receiving process. This function allows you to do the job.

+
Parameters:
+ + + + +
prog,: bpf program (created with the pcap_compile_nopcap() )
header,: header of the packet that has to be filtered
pkt_data,: buffer containing the packet, in network-byte order.
+
+
+
Returns:
the length of the bytes that are currently available into the packet if the packet satisfies the filter, 0 otherwise.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcap_t* pcap_open (const char *  source,
int  snaplen,
int  flags,
int  read_timeout,
struct pcap_rmtauth auth,
char *  errbuf 
)
+
+
+ +

Open a generic source in order to capture / send (WinPcap only) traffic.

+

The pcap_open() replaces all the pcap_open_xxx() functions with a single call.

+

This function hides the differences between the different pcap_open_xxx() functions so that the programmer does not have to manage different opening function. In this way, the 'true' open function is decided according to the source type, which is included into the source string (in the form of source prefix).

+

This function can rely on the pcap_createsrcstr() to create the string that keeps the capture device according to the new syntax, and the pcap_parsesrcstr() for the other way round.

+
Parameters:
+ + + + + + + +
source,: zero-terminated string containing the source name to open. The source name has to include the format prefix according to the new Source Specification Syntax and it cannot be NULL.
+ On on Linux systems with 2.2 or later kernels, a device argument of "any" (i.e. rpcap://any) can be used to capture packets from all interfaces.
+ In order to makes the source syntax easier, please remember that:

+ +
snaplen,: length of the packet that has to be retained. For each packet received by the filter, only the first 'snaplen' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored.
flags,: keeps several flags that can be needed for capturing packets. The allowed flags are defined in the pcap_open() flags .
read_timeout,: read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored.
auth,: a pointer to a 'struct pcap_rmtauth' that keeps the information required to authenticate the user on a remote machine. In case this is not a remote capture, this pointer can be set to NULL.
errbuf,: a pointer to a user-allocated buffer which will contain the error in case this function fails. The pcap_open() and findalldevs() are the only two functions which have this parameter, since they do not have (yet) a pointer to a pcap_t structure, which reserves space for the error string. Since these functions do not have (yet) a pcap_t pointer (the pcap_t pointer is NULL in case of errors), they need an explicit 'errbuf' variable. 'errbuf' may also be set to warning text when pcap_open_live() succeds; to detect this case the caller should store a zero-length string in 'errbuf' before calling pcap_open_live() and display the warning to the user if 'errbuf' is no longer a zero-length string.
+
+
+
Returns:
A pointer to a 'pcap_t' which can be used as a parameter to the following calls (pcap_compile() and so on) and that specifies an opened WinPcap session. In case of problems, it returns NULL and the 'errbuf' variable keeps the error message.
+
Warning:
The source cannot be larger than PCAP_BUF_SIZE.
+
+The following formats are not allowed as 'source' strings:
    +
  • rpcap:// [to open the first local adapter]
  • +
  • rpcap://hostname/ [to open the first remote adapter]
  • +
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
pcap_t* pcap_open_dead (int  linktype,
int  snaplen 
)
+
+
+ +

Create a pcap_t structure without starting a capture.

+

pcap_open_dead() is used for creating a pcap_t structure to use when calling the other functions in libpcap. It is typically used when just using libpcap for compiling BPF code.

+
See also:
pcap_open_offline(), pcap_open_live(), pcap_findalldevs(), pcap_compile(), pcap_setfilter(), pcap_close()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcap_t* pcap_open_live (const char *  device,
int  snaplen,
int  promisc,
int  to_ms,
char *  ebuf 
)
+
+
+ +

Open a live capture from the network.

+

pcap_open_live() is used to obtain a packet capture descriptor to look at packets on the network. device is a string that specifies the network device to open; on Linux systems with 2.2 or later kernels, a device argument of "any" or NULL can be used to capture packets from all interfaces. snaplen specifies the maximum number of bytes to capture. If this value is less than the size of a packet that is captured, only the first snaplen bytes of that packet will be captured and provided as packet data. A value of 65535 should be sufficient, on most if not all networks, to capture all the data available from the packet. promisc specifies if the interface is to be put into promiscuous mode. (Note that even if this parameter is false, the interface could well be in promiscuous mode for some other reason.) For now, this doesn't work on the "any" device; if an argument of "any" or NULL is supplied, the promisc flag is ignored. to_ms specifies the read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it wait for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored. A zero value for to_ms, on platforms that support a read timeout, will cause a read to wait forever to allow enough packets to arrive, with no timeout. errbuf is used to return error or warning text. It will be set to error text when pcap_open_live() fails and returns NULL. errbuf may also be set to warning text when pcap_open_live() succeds; to detect this case the caller should store a zero-length string in errbuf before calling pcap_open_live() and display the warning to the user if errbuf is no longer a zero-length string.

+
See also:
pcap_open_offline(), pcap_open_dead(), pcap_findalldevs(), pcap_close()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
pcap_t* pcap_open_offline (const char *  fname,
char *  errbuf 
)
+
+
+ +

Open a savefile in the tcpdump/libpcap format to read packets.

+

pcap_open_offline() is called to open a "savefile" for reading. fname specifies the name of the file to open. The file has the same format as those used by tcpdump(1) and tcpslice(1). The name "-" in a synonym for stdin. Alternatively, you may call pcap_fopen_offline() to read dumped data from an existing open stream fp. Note that on Windows, that stream should be opened in binary mode. errbuf is used to return error text and is only set when pcap_open_offline() or pcap_fopen_offline() fails and returns NULL.

+
See also:
pcap_open_live(), pcap_dump_open(), pcap_findalldevs(), pcap_close()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_parsesrcstr (const char *  source,
int *  type,
char *  host,
char *  port,
char *  name,
char *  errbuf 
)
+
+
+ +

Parse the source string and returns the pieces in which the source can be split.

+

This call is the other way round of pcap_createsrcstr(). It accepts a null-terminated string and it returns the parameters related to the source. This includes:

+
    +
  • the type of the source (file, winpcap on a remote adapter, winpcap on local adapter), which is determined by the source prefix (PCAP_SRC_IF_STRING and so on)
  • +
  • the host on which the capture has to be started (only for remote captures)
  • +
  • the 'raw' name of the source (file name, name of the remote adapter, name of the local adapter), without the source prefix. The string returned does not include the type of the source itself (i.e. the string returned does not include "file://" or rpcap:// or such).
  • +
+

The user can omit some parameters in case it is not interested in them.

+
Parameters:
+ + + + + + + +
source,: a null-terminated string containing the WinPcap source. This source starts with an identifier according to the new Source Specification Syntax .
type,: pointer to an integer, which is used to return the code corrisponding to the selected source. The code will be one defined in the Source identification Codes .
+ In case the source string does not exists (i.e. 'source == NULL') or it is empty ('*source == NULL'), it returns PCAP_SRC_IF_LOCAL (i.e. you are ready to call pcap_open_live() ). This behavior is kept only for compatibility with older applications (e.g. tcpdump); therefore we suggest to move to the new syntax for sources.
+ This parameter can be NULL in case the user is not interested in that.
host,: user-allocated buffer (of size PCAP_BUF_SIZE) that is used to return the host name on which the capture has to be started. This value is meaningful only in case of remote capture; otherwise, the returned string will be empty (""). This parameter can be NULL in case the user is not interested in that.
port,: user-allocated buffer (of size PCAP_BUF_SIZE) that is used to return the port that has to be used by the RPCAP protocol to contact the other host. This value is meaningful only in case of remote capture and if the user wants to use a non-standard port; otherwise, the returned string will be empty (""). In case of remote capture, an emply string means "use the standard RPCAP port". This parameter can be NULL in case the user is not interested in that.
name,: user-allocated buffer (of size PCAP_BUF_SIZE) that is used to return the source name, without the source prefix. If the name does not exist (for example because source contains 'rpcap://' that means 'default local adapter'), it returns NULL. This parameter can be NULL in case the user is not interested in that.
errbuf,: pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one). This parameter can be NULL in case the user is not interested in that.
+
+
+
Returns:
'0' if everything is fine, '-1' if some errors occurred. The requested values (host name, network port, type of the source) are returned into the proper variables passed by reference.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
void pcap_perror (pcap_t p,
char *  prefix 
)
+
+
+ +

print the text of the last pcap library error on stderr, prefixed by prefix.

+
See also:
pcap_geterr()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SOCKET pcap_remoteact_accept (const char *  address,
const char *  port,
const char *  hostlist,
char *  connectinghost,
struct pcap_rmtauth auth,
char *  errbuf 
)
+
+
+ +

Block until a network connection is accepted (active mode only).

+

This function has been defined to allow the client dealing with the 'active mode'. In other words, in the 'active mode' the server opens the connection toward the client, so that the client has to open a socket in order to wait for connections. When a new connection is accepted, the RPCAP protocol starts as usual; the only difference is that the connection is initiated by the server.

+

This function accepts only ONE connection, then it closes the waiting socket. This means that if some error occurs, the application has to call it again in order to accept another connection.

+

This function returns when a new connection (coming from a valid host 'connectinghost') is accepted; it returns error otherwise.

+
Parameters:
+ + + + + + + +
address,: a string that keeps the network address we have to bind to; usually it is NULL (it means 'bind on all local addresses').
port,: a string that keeps the network port on which we have to bind to; usually it is NULL (it means 'bind on the predefined port', i.e. RPCAP_DEFAULT_NETPORT_ACTIVE).
hostlist,: a string that keeps the host name of the host from whom we are expecting a connection; it can be NULL (it means 'accept connection from everyone'). Host names are separated by a whatever character in the RPCAP_HOSTLIST_SEP list.
connectinghost,: a user-allocated buffer that will contain the name of the host is trying to connect to us. This variable must be at least RPCAP_HOSTLIST_SIZE bytes..
auth,: a pointer to a pcap_rmtauth structure. This pointer keeps the information required to authenticate the RPCAP connection to the remote host.
errbuf,: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).
+
+
+
Returns:
The SOCKET identifier of the new control connection if everything is fine, a negative number if some errors occurred. The error message is returned into the errbuf variable. In case it returns '-1', this means 'everything is fine', but the host cannot be admitted. In case it returns '-2', in means 'unrecoverable error' (for example it is not able to bind the socket, or something like that). In case it returns '-3', it means 'authentication failed'. The authentication check is performed only if the connecting host is among the ones that are allowed to connect to this host.
+

The host that is connecting to us is returned into the hostlist variable, which ust be allocated by the user. This variable contains the host name both in case the host is allowed, and in case the connection is refused.

+
Warning:
Although this function returns the socket established by the new control connection, this value should not be used. This value will be stored into some libpcap internal variables and it will be managed automatically by the library. In other words, all the following calls to findalldevs() and pcap_open() will check if the host is among one that already has a control connection in place; if so, that one will be used.
+
+This function has several problems if used inside a thread, which is stopped when this call is blocked into the accept(). In this case, the socket on which we accept connections is not freed (thread termination is a very dirty job), so that we are no longer able to accept other connections until the program (i.e. the process) stops. In order to solve the problem, call the pcap_remoteact_cleanup().
+ +
+
+ +
+
+ + + + + + + + +
void pcap_remoteact_cleanup ( ) 
+
+
+ +

Clean the socket that is currently used in waiting active connections.

+

This function does a very dirty job. The fact is that is the waiting socket is not freed if the pcap_remoteaccept() is killed inside a new thread. This function is able to clean the socket in order to allow the next calls to pcap_remoteact_accept() to work.

+

This function is useful *only* if you launch pcap_remoteact_accept() inside a new thread, and you stops (not very gracefully) the thread (for example because the user changed idea, and it does no longer want to wait for an active connection). So, basically, the flow should be the following:

+ +

This function has no effects in other cases.

+
Returns:
None.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_remoteact_close (const char *  host,
char *  errbuf 
)
+
+
+ +

Drop an active connection (active mode only).

+

This function has been defined to allow the client dealing with the 'active mode'. This function closes an active connection that is still in place and it purges the host name from the 'activeHost' list. From this point on, the client will not have any connection with that host in place.

+
Parameters:
+ + + +
host,: a string that keeps the host name of the host for which we want to close the active connection.
errbuf,: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).
+
+
+
Returns:
'0' if everything is fine, '-1' if some errors occurred. The error message is returned into the errbuf variable.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_remoteact_list (char *  hostlist,
char  sep,
int  size,
char *  errbuf 
)
+
+
+ +

Return the hostname of the host that have an active connection with us (active mode only).

+

This function has been defined to allow the client dealing with the 'active mode'. This function returns the list of hosts that are currently having an active connection with us. This function is useful in order to delete an active connection that is still in place.

+
Parameters:
+ + + + + +
hostlist,: a user-allocated string that will keep the list of host that are currently connected with us.
sep,: the character that has to be sued as a separator between the hosts (',' for example).
size,: size of the hostlist buffer.
errbuf,: a pointer to a user-allocated buffer (of size PCAP_ERRBUF_SIZE) that will contain the error message (in case there is one).
+
+
+
Returns:
'0' if everything is fine, '-1' if some errors occurred. The error message is returned into the errbuf variable.
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_sendpacket (pcap_t p,
u_char *  buf,
int  size 
)
+
+
+ +

Send a raw packet.

+

This function allows to send a raw packet to the network. p is the interface that will be used to send the packet, buf contains the data of the packet to send (including the various protocol headers), size is the dimension of the buffer pointed by buf, i.e. the size of the packet to send. The MAC CRC doesn't need to be included, because it is transparently calculated and added by the network interface driver. The return value is 0 if the packet is succesfully sent, -1 otherwise.

+
See also:
pcap_open_live()
+ +
+
+ +
+
+ + + + + + + + + +
pcap_send_queue* pcap_sendqueue_alloc (u_int  memsize ) 
+
+
+ +

Allocate a send queue.

+

This function allocates a send queue, i.e. a buffer containing a set of raw packets that will be transimtted on the network with pcap_sendqueue_transmit().

+

memsize is the size, in bytes, of the queue, therefore it determines the maximum amount of data that the queue will contain.

+

Use pcap_sendqueue_queue() to insert packets in the queue.

+
See also:
pcap_sendqueue_queue(), pcap_sendqueue_transmit(), pcap_sendqueue_destroy()
+ +
+
+ +
+
+ + + + + + + + + +
void pcap_sendqueue_destroy (pcap_send_queue queue ) 
+
+
+ +

Destroy a send queue.

+

Deletes a send queue and frees all the memory associated with it.

+
See also:
pcap_sendqueue_alloc(), pcap_sendqueue_queue(), pcap_sendqueue_transmit()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_sendqueue_queue (pcap_send_queue queue,
const struct pcap_pkthdr pkt_header,
const u_char *  pkt_data 
)
+
+
+ +

Add a packet to a send queue.

+

pcap_sendqueue_queue() adds a packet at the end of the send queue pointed by the queue parameter. pkt_header points to a pcap_pkthdr structure with the timestamp and the length of the packet, pkt_data points to a buffer with the data of the packet.

+

The pcap_pkthdr structure is the same used by WinPcap and libpcap to store the packets in a file, therefore sending a capture file is straightforward. 'Raw packet' means that the sending application will have to include the protocol headers, since every packet is sent to the network 'as is'. The CRC of the packets needs not to be calculated, because it will be transparently added by the network interface.

+
See also:
pcap_sendqueue_alloc(), pcap_sendqueue_transmit(), pcap_sendqueue_destroy()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
u_int pcap_sendqueue_transmit (pcap_t p,
pcap_send_queue queue,
int  sync 
)
+
+
+ +

Send a queue of raw packets to the network.

+

This function transmits the content of a queue to the wire. p is a pointer to the adapter on which the packets will be sent, queue points to a pcap_send_queue structure containing the packets to send (see pcap_sendqueue_alloc() and pcap_sendqueue_queue()), sync determines if the send operation must be synchronized: if it is non-zero, the packets are sent respecting the timestamps, otherwise they are sent as fast as possible.

+

The return value is the amount of bytes actually sent. If it is smaller than the size parameter, an error occurred during the send. The error can be caused by a driver/adapter problem or by an inconsistent/bogus send queue.

+
Note:
Using this function is more efficient than issuing a series of pcap_sendpacket(), because the packets are buffered in the kernel driver, so the number of context switches is reduced. Therefore, expect a better throughput when using pcap_sendqueue_transmit.
+
+When Sync is set to TRUE, the packets are synchronized in the kernel with a high precision timestamp. This requires a non-negligible amount of CPU, but allows normally to send the packets with a precision of some microseconds (depending on the accuracy of the performance counter of the machine). Such a precision cannot be reached sending the packets with pcap_sendpacket().
+
See also:
pcap_sendqueue_alloc(), pcap_sendqueue_queue(), pcap_sendqueue_destroy()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_set_datalink (pcap_t p,
int  dlt 
)
+
+
+ +

Set the current data link type of the pcap descriptor to the type specified by dlt. -1 is returned on failure.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setbuff (pcap_t p,
int  dim 
)
+
+
+ +

Set the size of the kernel buffer associated with an adapter.

+

dim specifies the size of the buffer in bytes. The return value is 0 when the call succeeds, -1 otherwise. If an old buffer was already created with a previous call to pcap_setbuff(), it is deleted and its content is discarded. pcap_open_live() creates a 1 MByte buffer by default.

+
See also:
pcap_open_live(), pcap_loop(), pcap_dispatch()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setfilter (pcap_t p,
struct bpf_program *  fp 
)
+
+
+ +

Associate a filter to a capture.

+

pcap_setfilter() is used to specify a filter program. fp is a pointer to a bpf_program struct, usually the result of a call to pcap_compile(). -1 is returned on failure, in which case pcap_geterr() may be used to display the error text; 0 is returned on success.

+
See also:
pcap_compile(), pcap_compile_nopcap()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setmintocopy (pcap_t p,
int  size 
)
+
+
+ +

Set the minumum amount of data received by the kernel in a single call.

+

pcap_setmintocopy() changes the minimum amount of data in the kernel buffer that causes a read from the application to return (unless the timeout expires). If the value of size is large, the kernel is forced to wait the arrival of several packets before copying the data to the user. This guarantees a low number of system calls, i.e. low processor usage, and is a good setting for applications like packet-sniffers and protocol analyzers. Vice versa, in presence of a small value for this variable, the kernel will copy the packets as soon as the application is ready to receive them. This is useful for real time applications that need the best responsiveness from the kernel. pcap_open_live() sets a default mintocopy value of 16000 bytes.

+
See also:
pcap_open_live(), pcap_loop(), pcap_dispatch()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setmode (pcap_t p,
int  mode 
)
+
+
+ +

Set the working mode of the interface p to mode.

+

Valid values for mode are MODE_CAPT (default capture mode) and MODE_STAT (statistical mode). See the tutorial "\ref wpcap_tut9" for details about statistical mode.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_setnonblock (pcap_t p,
int  nonblock,
char *  errbuf 
)
+
+
+ +

Switch between blocking and nonblocking mode.

+

pcap_setnonblock() puts a capture descriptor, opened with pcap_open_live(), into "non-blocking" mode, or takes it out of "non-blocking" mode, depending on whether the nonblock argument is non-zero or zero. It has no effect on "savefiles". If there is an error, -1 is returned and errbuf is filled in with an appropriate error message; otherwise, 0 is returned. In "non-blocking" mode, an attempt to read from the capture descriptor with pcap_dispatch() will, if no packets are currently available to be read, return 0 immediately rather than blocking waiting for packets to arrive. pcap_loop() and pcap_next() will not work in "non-blocking" mode.

+
See also:
pcap_getnonblock(), pcap_dispatch()
+ +
+
+ +
+
+ + + + + + + + + +
struct pcap_samp* pcap_setsampling (pcap_t p )  [read]
+
+
+ +

Define a sampling method for packet capture.

+

This function allows applying a sampling method to the packet capture process. The currently sampling methods (and the way to set them) are described into the struct pcap_samp. In other words, the user must set the appropriate parameters into it; these will be applied as soon as the capture starts.

+
Warning:
Sampling parameters cannot be changed when a capture is active. These parameters must be applied before starting the capture. If they are applied when the capture is in progress, the new settings are ignored.
+
+Sampling works only when capturing data on Win32 or reading from a file. It has not been implemented on other platforms. Sampling works on remote machines provided that the probe (i.e. the capturing device) is a Win32 workstation.
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_snapshot (pcap_t p ) 
+
+
+ +

Return the dimension of the packet portion (in bytes) that is delivered to the application.

+

pcap_snapshot() returns the snapshot length specified when pcap_open_live was called.

+
See also:
pcap_open_live(), pcap_compile(), pcap_compile_nopcap()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_stats (pcap_t p,
struct pcap_stat ps 
)
+
+
+ +

Return statistics on current capture.

+

pcap_stats() returns 0 and fills in a pcap_stat struct. The values represent packet statistics from the start of the run to the time of the call. If there is an error or the underlying packet capture doesn't support packet statistics, -1 is returned and the error text can be obtained with pcap_perror() or pcap_geterr(). pcap_stats() is supported only on live captures, not on "savefiles"; no statistics are stored in "savefiles", so no statistics are available when reading from a "savefile".

+
See also:
pcap_stats_ex(), pcap_open_live()
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
struct pcap_stat* pcap_stats_ex (pcap_t p,
int *  pcap_stat_size 
) [read]
+
+
+ +

Return statistics on current capture.

+

pcap_stats_ex() extends the pcap_stats() allowing to return more statistical parameters than the old call. One of the advantages of this new call is that the pcap_stat structure is not allocated by the user; instead, it is returned back by the system. This allow to extend the pcap_stat structure without affecting backward compatibility on older applications. These will simply check at the values of the members at the beginning of the structure, while only newest applications are able to read new statistical values, which are appended in tail.

+

To be sure not to read a piece of mamory which has not been allocated by the system, the variable pcap_stat_size will return back the size of the structure pcap_stat allocated by the system.

+
Parameters:
+ + + +
p,: pointer to the pcap_t currently in use.
pcap_stat_size,: pointer to an integer that will contain (when the function returns back) the size of the structure pcap_stat as it has been allocated by the system.
+
+
+
Returns:
: a pointer to a pcap_stat structure, that will contain the statistics related to the current device. The return value is NULL in case of errors, and the error text can be obtained with pcap_perror() or pcap_geterr().
+
Warning:
pcap_stats_ex() is supported only on live captures, not on "savefiles"; no statistics are stored in "savefiles", so no statistics are available when reading from a "savefile".
+
See also:
pcap_stats()
+ +
+
+ +
+
+ + + + + + + + + +
char* pcap_strerror (int  error ) 
+
+
+ +

Provided in case strerror() isn't available.

+
See also:
pcap_perror(), pcap_geterr()
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/group__wpcapsamps.html b/ledset/WpdPack_4_1_2/docs/html/group__wpcapsamps.html new file mode 100644 index 0000000..c52804a --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/group__wpcapsamps.html @@ -0,0 +1,500 @@ + + + + +WinPcap: Using WinPcap in your programs + + + + + + +
+

Using WinPcap in your programs
+ +[WinPcap user's manual] +

+
+ + + + + + + + + + +

Creating an application that uses wpcap.dll

+

To create an application that uses wpcap.dll with Microsoft Visual C++, +follow these +steps:

+
    +
  • Include the file pcap.h at the beginning of every source file that + uses the functions exported by library.
  • +
  • If your program uses Win32 specific functions of WinPcap, remember to include WPCAP + among the preprocessor definitions.
  • +
  • If your program uses the remote capture capabilities of WinPcap, add + HAVE_REMOTE among the preprocessor definitions. Do not include + remote-ext.h directly in your source files.
  • Set the options of the linker to include the wpcap.lib library + file specific for your target (x86 or x64). wpcap.lib for x86 can be + found in the \lib folder of the WinPcap developer's + pack, wpcap.lib for x64 can + be found in the \lib\x64 folder.
  • Set the options of the linker to include the winsock library file + ws2_32.lib. This file is distributed with the C compiler + and contains the socket functions for Windows. It is needed by some + functions used by the samples in the tutorial.
  • +
+

How to properly set Microsoft Visual Studio
+
+
Visual Studio 6

+
    +
  • To add a preprocessor definition, you must select Settings from the Project menu, then select C/C++ + from the tab control, and under the category General, you must add + the definition under the Preprocessor Definitions text box. +
  • To add a new library to the project with Microsoft Visual C++, you must + select Settings from the Project menu, then select Link + from the tab control, and then add the name of the new library in the Object/library + modules editbox. +
  • To add a new path where Microsoft Visual C++ will look for the libraries, + you must select Options from the Tools menu, then + Directories + from the tab control, Library files from the Show directories + for combobox, and the add the path in the Directories box. +
  • To add a new path where Microsoft Visual C++ will look for include files, you must select Options from the Tools menu, then + Directories + from the tab control, Include files from the Show directories + for combobox, and the add the path in the Directories box.
  • +
+

Visual Studio 2005 (needed to compile x64 applications)

+
    +
  • To add a preprocessor definition, you must select Properties from the Project menu, then select C/C++ + from the list control on the left, and under the category Preprocessor, you must add + the definition under the Preprocessor Definitions text box. +
  • To add a new library to the project, you must + select Properties from the Project menu, then select Linker + from the list control on the left, and under the category Input add the name of the new library in the + Additional Dependencies text box.
  • To add a new path where Microsoft Visual + Studio will look for the libraries, + you must select Options from the Tools menu, then + Project and Solutions from the list control on the left, VC++ + Directories, then choose Library Files in the Show directories + for combobox, and the add the path in the box below. +
  • To add a new path where Microsoft Visual + Studio will look for the include files, + you must select Options from the Tools menu, then + Project and Solutions from the list control on the left, VC++ + Directories, then choose Include Files in the Show directories + for combobox, and the add the path in the box below. +
+

 

+

Sample programs

+

A couple of sample programs are provided to show the usage of the WinPcap API. The +source of the examples, along with all the files needed to compile and run them, can be found in the Developer's +Pack.  For didactic purpose we provide here a browsable version of the +code: it is possible to click on the variables and functions to jump the +documentation of each of them. For a more complete set of samples, try WinPcap +Tutorial Section.

+ + + + + + + + + + + + + + + +

Packet Dump

+

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

+ + + + +
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+//
+// NOTE: remember to include WPCAP and HAVE_REMOTE among your
+// preprocessor definitions.
+//
+
+#include <pcap.h>
+
+#define LINE_LEN 16
+
+int main(int argc, char **argv)
+{   
+pcap_if_t *alldevs, *d;
+pcap_t *fp;
+u_int inum, i=0;
+char errbuf[PCAP_ERRBUF_SIZE];
+int res;
+struct pcap_pkthdr *header;
+const u_char *pkt_data;
+
+    printf("pktdump_ex: prints the packets of the network using WinPcap.\n");
+    printf("   Usage: pktdump_ex [-s source]\n\n"
+           "   Examples:\n"
+           "      pktdump_ex -s file://c:/temp/file.acp\n"
+           "      pktdump_ex -s rpcap://\\Device\\NPF_{C8736017-F3C3-4373-94AC-9A34B7DAD998}\n\n");
+
+    if(argc < 3)
+    {
+
+        printf("\nNo adapter selected: printing the device list:\n");
+        /* The user didn't provide a packet source: Retrieve the local device list */
+        if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1)
+        {
+            fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);
+            return -1;
+        }
+        
+        /* Print the list */
+        for(d=alldevs; d; d=d->next)
+        {
+            printf("%d. %s\n    ", ++i, d->name);
+
+            if (d->description)
+                printf(" (%s)\n", d->description);
+            else
+                printf(" (No description available)\n");
+        }
+        
+        if (i==0)
+        {
+            fprintf(stderr,"No interfaces found! Exiting.\n");
+            return -1;
+        }
+        
+        printf("Enter the interface number (1-%d):",i);
+        scanf_s("%d", &inum);
+        
+        if (inum < 1 || inum > i)
+        {
+            printf("\nInterface number out of range.\n");
+
+            /* Free the device list */
+            pcap_freealldevs(alldevs);
+            return -1;
+        }
+        
+        /* Jump to the selected adapter */
+        for (d=alldevs, i=0; i< inum-1 ;d=d->next, i++);
+        
+        /* Open the device */
+        if ( (fp= pcap_open(d->name,
+                            100 /*snaplen*/,
+                            PCAP_OPENFLAG_PROMISCUOUS /*flags*/,
+                            20 /*read timeout*/,
+                            NULL /* remote authentication */,
+                            errbuf)
+                            ) == NULL)
+        {
+            fprintf(stderr,"\nError opening adapter\n");
+            return -1;
+        }
+    }
+    else 
+    {
+        // Do not check for the switch type ('-s')
+        if ( (fp= pcap_open(argv[2],
+                            100 /*snaplen*/,
+                            PCAP_OPENFLAG_PROMISCUOUS /*flags*/,
+                            20 /*read timeout*/,
+                            NULL /* remote authentication */,
+                            errbuf)
+                            ) == NULL)
+        {
+            fprintf(stderr,"\nError opening source: %s\n", errbuf);
+            return -1;
+        }
+    }
+
+    /* Read the packets */
+    while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0)
+    {
+
+        if(res == 0)
+            /* Timeout elapsed */
+            continue;
+
+        /* print pkt timestamp and pkt len */
+        printf("%ld:%ld (%ld)\n", header->ts.tv_sec, header->ts.tv_usec, header->len);          
+        
+        /* Print the packet */
+        for (i=1; (i < header->caplen + 1 ) ; i++)
+        {
+            printf("%.2x ", pkt_data[i-1]);
+            if ( (i % LINE_LEN) == 0) printf("\n");
+        }
+        
+        printf("\n\n");     
+    }
+
+    if(res == -1)
+    {
+        fprintf(stderr, "Error reading the packets: %s\n", pcap_geterr(fp));
+        return -1;
+    }
+
+    return 0;
+}
+
+ + + + + + + + + + +

Packet Filter

+ +

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

+ + + + +
/*
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies 
+ * nor the names of its contributors may be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <pcap.h>
+
+#define MAX_PRINT 80
+#define MAX_LINE 16
+
+
+void usage();
+
+
+void main(int argc, char **argv)
+{
+pcap_t *fp;
+char errbuf[PCAP_ERRBUF_SIZE];
+char *source=NULL;
+char *ofilename=NULL;
+char *filter=NULL;
+int i;
+pcap_dumper_t *dumpfile;
+struct bpf_program fcode;
+bpf_u_int32 NetMask;
+int res;
+struct pcap_pkthdr *header;
+const u_char *pkt_data;
+
+    if (argc == 1)
+    {
+        usage();
+        return;
+    }
+
+    for(i=1;i < argc; i+= 2)
+    {
+
+        switch (argv[i] [1])
+        {
+            case 's':
+            {
+                source=argv[i+1];
+            };
+            break;
+
+            case 'o':
+            {
+                ofilename=argv[i+1];
+            };
+            break;
+
+            case 'f':
+            {
+                filter=argv[i+1];
+            };
+            break;
+        }
+    }
+
+    // open a capture from the network
+    if (source != NULL)
+    {
+        if ( (fp= pcap_open(source,
+                            1514 /*snaplen*/,
+                            PCAP_OPENFLAG_PROMISCUOUS /*flags*/,
+                            20 /*read timeout*/,
+                            NULL /* remote authentication */,
+                            errbuf)
+                            ) == NULL)
+        {
+            fprintf(stderr,"\nUnable to open the adapter.\n");
+            return;
+        }
+    }
+
+    else usage();
+
+    if (filter != NULL)
+    {
+        // We should loop through the adapters returned by the pcap_findalldevs_ex()
+        // in order to locate the correct one.
+        //
+        // Let's do things simpler: we suppose to be in a C class network ;-)
+        NetMask=0xffffff;
+
+        //compile the filter
+        if(pcap_compile(fp, &fcode, filter, 1, NetMask) < 0)
+        {
+            fprintf(stderr,"\nError compiling filter: wrong syntax.\n");
+            return;
+        }
+
+        //set the filter
+        if(pcap_setfilter(fp, &fcode)<0)
+        {
+            fprintf(stderr,"\nError setting the filter\n");
+            return;
+        }
+
+    }
+
+    //open the dump file
+    if (ofilename != NULL)
+    {
+        dumpfile= pcap_dump_open(fp, ofilename);
+
+        if (dumpfile == NULL)
+        {
+            fprintf(stderr,"\nError opening output file\n");
+            return;
+        }
+    }
+    else usage();
+
+    //start the capture
+    while((res = pcap_next_ex( fp, &header, &pkt_data)) >= 0)
+    {
+
+        if(res == 0)
+        /* Timeout elapsed */
+        continue;
+
+        //save the packet on the dump file
+        pcap_dump((unsigned char *) dumpfile, header, pkt_data);
+
+    }
+}
+
+
+void usage()
+{
+
+    printf("\npf - Generic Packet Filter.\n");
+    printf("\nUsage:\npf -s source -o output_file_name [-f filter_string]\n\n");
+    exit(0);
+}
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h.html b/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h.html new file mode 100644 index 0000000..40a901d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h.html @@ -0,0 +1,78 @@ + + + + +WinPcap: pcap.h File Reference + + + + + + +
+

pcap.h File Reference

#include <pcap-stdinc.h>
+#include <net/bpf.h>
+#include <stdio.h>
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  pcap_file_header
 Header of a libpcap dump file. More...
struct  pcap_pkthdr
 Header of a packet in the dump file. More...
struct  pcap_stat
 Structure that keeps statistical values on an interface. More...
struct  pcap_if
 Item in a list of interfaces, used by pcap_findalldevs(). More...
struct  pcap_addr
 Representation of an interface address, used by pcap_findalldevs(). More...

Defines

#define PCAP_VERSION_MAJOR   2
 Major libpcap dump file version.
#define PCAP_VERSION_MINOR   4
 Minor libpcap dump file version.
#define PCAP_ERRBUF_SIZE   256
 Size to use when allocating the buffer that contains the libpcap errors.
#define PCAP_IF_LOOPBACK   0x00000001
 interface is loopback
#define MODE_CAPT   0
 Capture mode, to be used when calling pcap_setmode().
#define MODE_STAT   1
 Statistical mode, to be used when calling pcap_setmode().

Typedefs

typedef int bpf_int32
 32-bit integer
typedef u_int bpf_u_int32
 32-bit unsigned integer
typedef struct pcap pcap_t
 Descriptor of an open capture instance. This structure is opaque to the user, that handles its content through the functions provided by wpcap.dll.
typedef struct pcap_dumper pcap_dumper_t
 libpcap savefile descriptor.
typedef struct pcap_if pcap_if_t
 Item in a list of interfaces, see pcap_if.
typedef struct pcap_addr pcap_addr_t
 Representation of an interface address, see pcap_addr.
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h_source.html new file mode 100644 index 0000000..e265868 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/incs_2pcap_8h_source.html @@ -0,0 +1,155 @@ + + + + +WinPcap: pcap.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/index.hhc b/ledset/WpdPack_4_1_2/docs/html/index.hhc new file mode 100644 index 0000000..ba871e1 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/index.hhc @@ -0,0 +1,171 @@ + + + + + +
    +
  • +
  • +
      +
    +
  • +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      +
    • +
        +
      • +
          +
        • +
            +
          +
        • +
            +
          +
        • +
            +
          +
        • +
            +
          +
        +
      • +
          +
        +
      • +
          +
        +
      +
    • +
        +
      • +
          +
        +
      • +
          +
        +
      • +
          +
        +
      • +
          +
        +
      +
    • +
        +
      • +
          +
        • +
            +
          +
        • +
            +
          +
        • +
            +
          +
        • +
            +
          +
        • +
            +
          +
        +
      • +
          +
        +
      • +
          +
        +
      • +
          +
        +
      +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
+ + diff --git a/ledset/WpdPack_4_1_2/docs/html/index.hhk b/ledset/WpdPack_4_1_2/docs/html/index.hhk new file mode 100644 index 0000000..e3be416 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/index.hhk @@ -0,0 +1,2939 @@ + + + + + +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
+ + diff --git a/ledset/WpdPack_4_1_2/docs/html/index.hhp b/ledset/WpdPack_4_1_2/docs/html/index.hhp new file mode 100644 index 0000000..0ececa2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/index.hhp @@ -0,0 +1,160 @@ +[OPTIONS] +Compatibility=1.1 +Full-text search=Yes +Contents file=index.hhc +Default Window=main +Default topic=main.html +Index file=index.hhk +Language=0x409 English (United States) +Binary TOC=YES +Title=WinPcap + +[WINDOWS] +main="WinPcap","index.hhc","index.hhk","main.html","main.html",,,,,0x23520,,0x10387e,,,,,,,,0 + +[FILES] +main.html +pages.html +daemon_8h_source.html +fileconf_8h_source.html +ioctls_8h_source.html +jitter_8h_source.html +Packet_8h_source.html +pcap-remote_8h_source.html +incs_2pcap_8h_source.html +funcs_2pcap_8h_source.html +remote-ext_8h_source.html +rpcapd_8h_source.html +utils_8h_source.html +Win32-Extensions_8h_source.html +win32-svc_8h_source.html +wpcap__remote_8htm_source.html +daemon_8h.html +doxygen__groups_8txt.html +fileconf_8h.html +ioctls_8h.html +jitter_8h.html +main_8txt.html +Packet_8h.html +pcap-remote_8h.html +incs_2pcap_8h.html +funcs_2pcap_8h.html +remote-ext_8h.html +rpcapd_8h.html +utils_8h.html +Win32-Extensions_8h.html +win32-svc_8h.html +wpcap__remote_8htm.html +wpcap__tut_8txt.html +wpcap__tut1_8txt.html +wpcap__tut2_8txt.html +wpcap__tut3_8txt.html +wpcap__tut4_8txt.html +wpcap__tut5_8txt.html +wpcap__tut6_8txt.html +wpcap__tut7_8txt.html +wpcap__tut8_8txt.html +wpcap__tut9_8txt.html +deprecated.html +group__NPF__ioctl.html +group__NPF__include.html +group__NPF__code.html +group__NPF__jitter.html +group__wpcap__def.html +group__wpcapfunc.html +group__wpcap__tut.html +group__wpcap__tut1.html +group__wpcap__tut2.html +group__wpcap__tut3.html +group__wpcap__tut4.html +group__wpcap__tut5.html +group__wpcap__tut6.html +group__wpcap__tut7.html +group__wpcap__tut8.html +group__wpcap__tut9.html +group__internals.html +group__NPF.html +group__compilation.html +group__packetapi.html +group__wpcap.html +group__language.html +group__wpcapsamps.html +group__remote.html +group__remote__struct.html +group__remotefunc.html +group__remote__pri__func.html +group__remote__pri__struct.html +group__remote__source__string.html +group__remote__source__ID.html +group__remote__open__flags.html +group__remote__samp__methods.html +group__remote__auth__methods.html +modules.html +annotated.html +classes.html +functions.html +functions_vars.html +struct____CPU__Private__Data.html +struct__DEVICE__EXTENSION.html +struct__INTERNAL__REQUEST.html +struct__OPEN__INSTANCE.html +struct__PACKET__OID__DATA.html +struct__PACKET__RESERVED.html +structactive__pars.html +structactivehosts.html +structbinary__stream.html +structdaemon__slpars.html +structJIT__BPF__Filter.html +structpacket__file__header.html +structPacketHeader.html +structpcap__addr.html +structpcap__file__header.html +structpcap__if.html +structpcap__pkthdr.html +structpcap__rmtauth.html +structpcap__samp.html +structpcap__send__queue.html +structpcap__stat.html +structrpcap__auth.html +structrpcap__filter.html +structrpcap__filterbpf__insn.html +structrpcap__findalldevs__if.html +structrpcap__findalldevs__ifaddr.html +structrpcap__header.html +structrpcap__openreply.html +structrpcap__pkthdr.html +structrpcap__sampling.html +structrpcap__startcapreply.html +structrpcap__startcapreq.html +structrpcap__stats.html +structsf__pkthdr.html +files.html +globals.html +globals_0x62.html +globals_0x63.html +globals_0x64.html +globals_0x65.html +globals_0x66.html +globals_0x67.html +globals_0x68.html +globals_0x69.html +globals_0x6a.html +globals_0x6b.html +globals_0x6d.html +globals_0x6e.html +globals_0x6f.html +globals_0x70.html +globals_0x72.html +globals_0x73.html +globals_0x74.html +globals_0x75.html +globals_func.html +globals_vars.html +globals_type.html +globals_enum.html +globals_eval.html +globals_defs.html +tabs.css +tab_b.gif +tab_l.gif +tab_r.gif diff --git a/ledset/WpdPack_4_1_2/docs/html/index.html b/ledset/WpdPack_4_1_2/docs/html/index.html new file mode 100644 index 0000000..c5a530d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/index.html @@ -0,0 +1,16 @@ + + + + +WinPcap + + + + + + <body> + <a href="main.html">Frames are disabled. Click here to go to the main page.</a> + </body> + + + diff --git a/ledset/WpdPack_4_1_2/docs/html/internals-arch.gif b/ledset/WpdPack_4_1_2/docs/html/internals-arch.gif new file mode 100644 index 0000000000000000000000000000000000000000..37b7ea6758d56cb8d94879309d1ecc26b0a624e5 GIT binary patch literal 4650 zcmeH`_ct2~Eg1_s{sA^M20xob&wrob%`#KG6U=h;TS@9034;TOc_-J&>Q5 zH3(#F4YCfwhIG`Vk#X3N5G*zX+s7u)j&{`4bgZ!Zw*P$}du4^az0GF#vDqtZ_P_AI z{m;PvV*`Kwn*iYdS^)5{017-e3@Y>6F7OD+zwWFoXh#VC4#FB#75)>?$LBfSSyl8k zN$OGD)!1jSE|lyG;_EI7j-ILF)QvTymUO3R_^nTO`8gS8Ka98}0jgf5bLybvZHfD( zgQd@kKoZsfxnYteRr0M$4QZ^xp5!TER4Zpu={`)v$<>xk)!oV|&oK(}v7v$YuB6%2 zRoD}P4lae!k1D>mKRhR3S5~94@HN>+-qjdF_|b{JYg*m|Sy}4I7kI}o#w<<@;BO`= z^)~!i8L9kM?qkw8zcEg0?kn#-4P?wc3)(B$5~sZg-j{~3i_}8oe2zWc>kSl zD13A>t!c77lEfl?$<5h2ET4HE$ofhLw|&Hub8AuhVEpg z*?+tsjn5A_x4tqD-_l*43y(i9Vjd}=**OotR68OCKkwR^XD?(Xi;jBcKr4v3;fl8l z6@ZUBB4X0r9qnYr%;yr-y7AwU>(@lS$0-mqrW43ZmT5r`?oZqXi}Q=#iN7Kl>+AvI z|7R}vmL$_TlM8gwHRg$(;cGuHZ^BLFMappz?0BngIdmUl=$h~f;~|NOA;{(WK-Mox zgim8`Z<@b@1?_g6?gPeL)u&YXZlIARDckssvOpTol9obW{@ns$Ve z&ou-hs}(XSZ(8v=F1w5x?7C4-TJ9F9_=JfhRcM;KY*uwjlQtvB5~D#JM`tu{Ht=pYEp;1hH&0K-Z@09p)3;mm zPIz}d1z$4WX_FR1?tG@p_3X4)120!qTs2mKab35^-tD;VSN8s^IO6hd=grK`pIx`J zvG+Ov$w&%a;p^qS9{J(3T`nQNkt#0jqs_hkhun($1Ahy9s{x+KkoSj-1#+lQuBj^? zjJ&k)KKS-RX2)Mw%W3Oi>xS0KD`go;S zK=PzLDYN`!wp3O7WWBO(=HxTst53*xmzB^{#@qhHoelW!ThtvLA^WQME-}te!CL*H|`dspY8G z6u$rBCdWmd&%dP#!bY9uzbhSn`b}>DzTWjm!4NZfU|Lp#mh|+RgvW)rqVAdo_h+1@$yGvDbh!+`Y>@3P5r};pB zH$_MFPVYp9b%u@-O3L^$oktFuQ4ZW1PH27wGwdug#SZ+@I84 zveo2}O-&O{spbmZ_T-98^BGR%uPZ$cVlRIGN4w4j zvLcnxYxRMe4UPqH-InV6kl}}2xwE1%SpPHtL(N%3%4n|~_XSg^xd4`LsrJ@dU&skH z4=}Ux*LkslfIc&zA}+f5Ni_;!E?%msFhqqGj*;OHxA($@75phELuiZ~0p#=AcYT!mF=4ZnU-`z1TBH z#AXgOR@ZUO(T_~B>kS@5ECp0Rdp+$%563={O#|xydJH+R#CyxIx1K>v} z(*KmXZgsyXl{_G$f4RFW8%_2E`%`^FH`{J2d>ef5rdsO?OVP!Y*Q|GRrMix+=<kQB0kFC-)wy5vi;seVRnO(*|ayqu$tjjVJexoEa7|t_q5E;9P64+ ze|cL(OuYiAkF~7Ml!t9?OpnN;We!i4)wwAS2}}zD;C==4vG&~Ja>kd9nJw5|Oq-Okm8OXB8q zzGYKi41BVjSkTiW6J*tKa!EBUy~jn_)Jn>{g~Gz^u zL`!wfV?Ix9H|t^bWwpZgP3MR4m@HIOO(`#*CmAdDEy4Vt(I;V}eH~-l#0Yp3-m7$h z=XBinkKJLxPn)hS z=NnRbNrRCy{S1$hx%s@@=mB~(=4yR zHt`n2H&zC_aIK%#aaU<6<{kD&ZlXpTtIBaFUIP1%E|4RohNE)3qmRZ8s~M zwCtLyhWv%Siv7K7#lms7PjSW%&hcyIZ{^^jyKns?zfFF#ZBa#An5+i^>qpIePTGp? zmLJ|crsI~6@$LM9WOa#!*SP@`W2|*eBZ-ah<*~tc{s(u)nm2@#8e7joSDO&Q_I{@0 zMFEUM8X|Zb71r?Gl(7$@Ht!@0YtFKb58>($hRClPr&Q+_Llv6#yjv~iy%WiUs9ejE z@cMJF`cFn1SqGI#&6{qfr;}7kKy80BBd9-Qw10?$m#1Y1VS2V8&SrL+w(Mr!{0LBC z9}gt8>_>$ItT^WYm{%|2T-Z9P1{)4f4r|Jq4vJzFtl z@9;_iH2lMV9rd$Wr}nI)%y8bFa4t*e1$QV1kNQav^zt~A-#zT2`+Z&}^r|IHKm=x^ z3cF5&-53uSVXBFZ!)|N9*NqN(U=L>e%|AIGTZqa&YMh8uxZOqh``dBUF?sJyU@vId7)XsB4x zqTcX?+488^i$uH9LY1LH1~)Mni3ivt3r!iABxSz!}GyP zg&J{pEaR3x#NlHin5EEj<8dMQxTVi=6dJ5rR;d;o|9}~HMI^on99=J>)F^`F*Fesj zAv+8rThOpiG^9-oa;6YDUVsqDSEV&E5|94hGE{asb&VLItD4SqAZk* zsNF3&r~?m5{y2qO4&}g;^yPNa*;tCiM5t63;?LM9rLG7)Nb0mjn)xcKg){B6G+D3< z^_v`0e=W)o5^)WfW>TMee?GWpOM)Z6K5gs`V_VKBoq_0>!=Ct7X|YAYH8F+_w|g-dm%95|#)6HqU$vf_cL z3xw1Jk7V=uln6p%pdk#^h02sm(a1u*tk1e@m7cqnLcW;I!$ddHAZynUG+=mxDEf;>dOjhmwJW>13&Rb>EP=5RXzVVl4m+EPA&KUc%VCYz za_lEE$75qAMZ>2((7mF$7C`K_VJ@RS0e1||TgxT`bLJp<_pG;V~Za(0UZl z#T<5Q7FTROIyRqm5v#R;<#r|u>S2=O-<#23W+*=Ra5)9`?z)iH_9M^Dkj*?%pCEdCuO!ty@Sjir~q^Yfh zv075YQMx8uTCH2U=w3>OmCoTy%i2mOS4(jmc-A*re6cQmz#X3h!_)D2Y#Y8~6`#&Q zXp<$R=@OdU2}l^B4o`@0BT!Ze5gbIaED^3t#JdxNVZs;@zbTaa8XYs8sMo@^jb zPm*U($n#?53!3GN*5%8=<*V!D;cg|4fpW%4`Hon{u4cu)b;V(D1;DrBq@m($@?Q>) zfBp`@tIoV%>H5R>!l@c>X5}S%Wkp&rKS@?lyz2a;DsHbT8`UZiqag8YRk5im_RlJ* zY>C@ilS18i{E_| z0(tBesP6@lR0z~rHqr~BVDvqV5hi>jun|J(sZEV-P=J~i#A+-kJgCaZ$Sp!WG|^;(bYK&M0J*ZQ@-BqL9{c;0eQ&{R;mMWw)0rQ2x`M4|4zc%AM>U8QR+hC9f` z%P7D`{9OhlPQeQ$Tq~MgZQxZ8Mbv{x_1LNU+|&Ae@rFXJhGJ4B&(v>MhG~W3HFzUq zoDn7GLcJZm=0B$m5qnEzG1Vd2#t0-``Nc>yhP%m2 uAKX6G6#TQvR+7~CnHMs$(e%pAHE!yCYGd<)R?DJI%W_ByT3iqS(E2YekM9=% literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/ioctls_8h.html b/ledset/WpdPack_4_1_2/docs/html/ioctls_8h.html new file mode 100644 index 0000000..50bd03b --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/ioctls_8h.html @@ -0,0 +1,73 @@ + + + + +WinPcap: ioctls.h File Reference + + + + + + +
+

ioctls.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Defines

#define BIOCSETBUFFERSIZE   9592
 IOCTL code: set kernel buffer size.
#define BIOCSETF   9030
 IOCTL code: set packet filtering program.
#define BIOCGSTATS   9031
 IOCTL code: get the capture stats.
#define BIOCSRTIMEOUT   7416
 IOCTL code: set the read timeout.
#define BIOCSMODE   7412
 IOCTL code: set working mode.
#define BIOCSWRITEREP   7413
 IOCTL code: set number of physical repetions of every packet written by the app.
#define BIOCSMINTOCOPY   7414
 IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
#define BIOCSETOID   0x80000000
 IOCTL code: set an OID value.
#define BIOCQUERYOID   0x80000004
 IOCTL code: get an OID value.
#define BIOCSETDUMPFILENAME   9029
 IOCTL code: set the name of a the file used by kernel dump mode.
#define BIOCGEVNAME   7415
 IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
#define BIOCSENDPACKETSNOSYNC   9032
 IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps.
#define BIOCSENDPACKETSSYNC   9033
 IOCTL code: Send a buffer containing multiple packets to the network, considering the timestamps.
#define BIOCSETDUMPLIMITS   9034
 IOCTL code: Set the dump file limits.
#define BIOCISDUMPENDED   7411
 IOCTL code: Get the status of the kernel dump process.
#define BIOCISETLOBBEH   7410
 IOCTL code: set the loopback behavior.
#define BIOCSETEVENTHANDLE   7920
 This IOCTL passes the read event HANDLE allocated by the user (packet.dll) to kernel level.
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/ioctls_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/ioctls_8h_source.html new file mode 100644 index 0000000..68d2da6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/ioctls_8h_source.html @@ -0,0 +1,105 @@ + + + + +WinPcap: ioctls.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/jitter_8h.html b/ledset/WpdPack_4_1_2/docs/html/jitter_8h.html new file mode 100644 index 0000000..96912af --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/jitter_8h.html @@ -0,0 +1,160 @@ + + + + +WinPcap: jitter.h File Reference + + + + + + +
+

jitter.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  binary_stream
 A stream of X86 binary code. More...
struct  JIT_BPF_Filter
 Structure describing a x86 filtering program created by the jitter. More...

Defines

#define EAX   0
#define ECX   1
#define EDX   2
#define EBX   3
#define ESP   4
#define EBP   5
#define ESI   6
#define EDI   7
#define AX   0
#define CX   1
#define DX   2
#define BX   3
#define SP   4
#define BP   5
#define SI   6
#define DI   7
#define AL   0
#define CL   1
#define DL   2
#define BL   3
#define MOVid(r32, i32)   emitm(&stream, 11 << 4 | 1 << 3 | r32 & 0x7, 1); emitm(&stream, i32, 4);
 mov r32,i32
#define MOVrd(dr32, sr32)   emitm(&stream, 8 << 4 | 3 | 1 << 3, 1); emitm(&stream, 3 << 6 | (dr32 & 0x7) << 3 | sr32 & 0x7, 1);
 mov dr32,sr32
#define MOVodd(dr32, sr32, off)
 mov dr32,sr32[off]
#define MOVobd(dr32, sr32, or32)
 mov dr32,sr32[or32]
#define MOVobw(dr32, sr32, or32)
 mov dr16,sr32[or32]
#define MOVobb(dr8, sr32, or32)
 mov dr8,sr32[or32]
#define MOVomd(dr32, or32, sr32)
 mov [dr32][or32],sr32
#define BSWAP(dr32)
 bswap dr32
#define SWAP_AX()
 xchg al,ah
#define PUSH(r32)   emitm(&stream, 5 << 4 | 0 << 3 | r32 & 0x7, 1);
 push r32
#define POP(r32)   emitm(&stream, 5 << 4 | 1 << 3 | r32 & 0x7, 1);
 pop r32
#define RET()   emitm(&stream, 12 << 4 | 0 << 3 | 3, 1);
 ret
#define ADDrd(dr32, sr32)
 add dr32,sr32
#define ADD_EAXi(i32)
 add eax,i32
#define ADDid(r32, i32)
 add r32,i32
#define ADDib(r32, i8)
 add r32,i8
#define SUBrd(dr32, sr32)
 sub dr32,sr32
#define SUB_EAXi(i32)
 sub eax,i32
#define MULrd(r32)
 mul r32
#define DIVrd(r32)
 div r32
#define ANDib(r8, i8)
 and r8,i8
#define ANDid(r32, i32)
 and r32,i32
#define ANDrd(dr32, sr32)
 and dr32,sr32
#define ORrd(dr32, sr32)
 or dr32,sr32
#define ORid(r32, i32)
 or r32,i32
#define SHLib(r32, i8)
 shl r32,i8
#define SHL_CLrb(dr32)
 shl dr32,cl
#define SHRib(r32, i8)
 shr r32,i8
#define SHR_CLrb(dr32)
 shr dr32,cl
#define NEGd(r32)
 neg r32
#define CMPodd(dr32, sr32, off)
 cmp dr32,sr32[off]
#define CMPrd(dr32, sr32)
 cmp dr32,sr32
#define CMPid(dr32, i32)
 cmp dr32,i32
#define JNEb(off8)
 jne off32
#define JE(off32)
 je off32
#define JLE(off32)
 jle off32
#define JLEb(off8)
 jle off8
#define JA(off32)
 ja off32
#define JAE(off32)
 jae off32
#define JG(off32)
 jg off32
#define JGE(off32)
 jge off32
#define JMP(off32)
 jmp off32

Typedefs

typedef UINT(__cdecl * BPF_filter_function )(PVOID *, ULONG, UINT)
 Prototype of a filtering function created by the jitter.
typedef void(* emit_func )(binary_stream *stream, ULONG value, UINT n)
 Prototype of the emit functions.

Functions

JIT_BPF_FilterBPF_jitter (struct bpf_insn *fp, INT nins)
 BPF jitter, builds an x86 function from a BPF program.
BPF_filter_function BPFtoX86 (struct bpf_insn *ins, UINT nins, INT *mem)
 Translates a set of BPF instructions in a set of x86 ones.
void BPF_Destroy_JIT_Filter (JIT_BPF_Filter *Filter)
 Deletes a filtering function that was previously created by BPF_jitter().
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/jitter_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/jitter_8h_source.html new file mode 100644 index 0000000..6a968ae --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/jitter_8h_source.html @@ -0,0 +1,321 @@ + + + + +WinPcap: jitter.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/main.html b/ledset/WpdPack_4_1_2/docs/html/main.html new file mode 100644 index 0000000..78d64f4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/main.html @@ -0,0 +1,237 @@ + + + + +WinPcap: WinPcap Documentation + + + + + + +
+

WinPcap Documentation

4.1.2

+winpcap.gif +
+ + +
+
Authors:
+
The WinPcap Team
+
Home page:
+
http://www.winpcap.org
+
+
+ +

Modules

+ + + + + + + + + + + + +
+ +

Introduction

+ + +

This Manual describes the +programming interface and the source code of WinPcap. It provides detailed +descriptions of the functions and structures exported to programmers, along +with complete documentation of the WinPcap internals. Several tutorials and +examples are provided as well.  + +

+

You can follow the links at the top of this page or use the tree control at +the left to reach sections of interest. + +

+

This documentation was created using the Doxygen documentation system, that can +be found at http://www.doxygen.org. + +

+

What is WinPcap

+

WinPcap is an open source library for packet capture and network analysis for +the Win32 platforms.

+

Most networking applications access the network through widely used operating +system primitives such as sockets.  It is easy to access data on the +network with this approach since the operating system copes with the low level +details (protocol handling, packet reassembly, etc.) and provides a familiar +interface that is similar to the one used to read and write files. + +

+

Sometimes, however, the 'easy way' is not up to the task, since some +applications require direct access to packets on the network.  That is, they +need access to the "raw" data on the network without the interposition of +protocol processing by the operating system.

+

The purpose of WinPcap is to give this kind of access to Win32 applications; +it provides facilities to:

+
    +
  • capture + raw packets, both the ones destined to the machine where it's running and + the ones exchanged by other hosts (on shared media)
  • +
  • filter + the packets according to user-specified rules before dispatching them to the + application
  • +
  • transmit raw packets to the network
  • +
  • gather statistical information on the network traffic
  • +
+

This set of capabilities is obtained by means of a device driver, that is +installed inside the networking portion of Win32 kernels, plus a couple of DLLs.

+

All these features are exported through a powerful programming interface, +easily exploitable by the applications and available on different OSes. The main +goal of this manual is to document this interface, with the help of several +examples.  If you are interested in starting your exploration right away +you can go directly to the WinPcap user's manual.

+ +

What kind of programs use WinPcap

+

The WinPcap programming interface can be used by many types of network tools +for analysis, troubleshooting, security and +monitoring. In particular, classical tools that rely on WinPcap are:

+ +
    +
  • network and protocol analyzers
  • +
  • network monitors
  • +
  • traffic loggers
  • +
  • traffic generators
  • +
  • user-level bridges and routers
  • +
  • network intrusion detection systems (NIDS)
  • +
  • network scanners
  • +
  • security tools
  • +
+

What WinPcap can't do

+

WinPcap receives and sends the packets independently from the host +protocols, like TCP-IP. This means that it isn't able to block, filter or +manipulate the traffic generated by other programs on the same machine: it +simply "sniffs" the packets that transit on the wire. Therefore, it does not +provide the appropriate support for applications like traffic shapers, QoS +schedulers and personal firewalls.

+ +

Purpose of this manual

+

The purpose of this manual is to provide a comprehensive and easy way to +browse the documentation of the WinPcap architecture. You will find two main +sections: WinPcap user's manual and WinPcap Internals.

+

The first one can be used by a programmer who needs to exploit WinPcap from +an application: it contains all the information about functions and data +structures exported by the WinPcap API, a manual that explains how to write +packet filters and a page that explains how to include it in an application. A +tutorial with several code samples is provided as well; it can be used to learn +the basics of the WinPcap API using a step-by-step approach, but it also offers +code snippets that demonstrate advanced features.  

+

The second section is intended for WinPcap developers and maintainers, or for +people who are curious about how this system works: it provides a general +description of the WinPcap architecture and explains how it works. Additionally, +it documents the complete device driver structure, the source code, the packet.dll +interface and the low-level WinPcap API. +If you want to understand what happens inside WinPcap or if you need to extend +it, this is the section you will want to read.

+

Additional Documentation

+

For additional and up-to-date documentation, we suggest that you look at  http://www.winpcap.org/docs/ +

+

In particular, if you are interested in +the structure and the internals of WinPcap, we suggest reading the +following documents:

+ + +

Terminology

+
    +
  • For consistency with the literature, we will use the term packet even + though frame is more accurate since the capture process is done at + the data-link layer and the data-link header is included in the captured + data.
  • +
  • The term Win9x will be used in this documentation to indicate the family of + Microsoft OSes made up of Windows 95 and its derivatives, i.e. Windows 98 and + Windows ME. The term WinNTx will indicate the OSes built upon the NT kernel, + starting from Windows NT 4 and including Windows 2000, Windows XP, + Windows Server 2003 and so on.
  • +
+ +

Note

+

Our development and documentation efforts focus primarily on the +Windows NT/2000/XP/2003/Vista/2008/Win7/2008R2 version of WinPcap. This choice is based on the fact that the +majority of the WinPcap users work on NTx systems, but also because the 9x technology +has been abandoned by Microsoft. Moreover, we assume that a person who needs to +use a PC for an advanced task like network analysis will install an advanced OS +on the machine. For this reason, the documentation will refer to the WinNTx +drivers and APIs. Win9x versions are very similar in the concept but sometimes +differ in the implementation and, occasionally, the Win9x version of the API +lacks some of the more advanced functionality. This manual describes the +complete API and will indicate when a function is present only in Windows NTx.

+ +

 

+ + + + +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/main_8txt.html b/ledset/WpdPack_4_1_2/docs/html/main_8txt.html new file mode 100644 index 0000000..8309c12 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/main_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: main.txt File Reference + + + + + + +
+

main.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/modules.html b/ledset/WpdPack_4_1_2/docs/html/modules.html new file mode 100644 index 0000000..45eabfd --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/modules.html @@ -0,0 +1,73 @@ + + + + +WinPcap: Module Index + + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/npf-dump.gif b/ledset/WpdPack_4_1_2/docs/html/npf-dump.gif new file mode 100644 index 0000000000000000000000000000000000000000..c24189c9a6b26ea52c99ec43c3de5dd91112f341 GIT binary patch literal 4656 zcmeH}2JPF(=JvHpVtWP;Nk4 zX%HnxDWW36sPWv-`)9n@b3UEVzw7#)>*(t1D62frJl7650Q_Izwt!KrEgb8*(T9b@ zu~=K|=vm*!*%<(EHadE?@o&SPo%NmlFaIO(|Bk@j{~GXL7XYjbfFP@YUQ_YAc-9-z z_Q-3o|0G=#1!46FrM;;<4}2#3o66p22y3MX=o8BaawN?$+JVItL-~KX4r2A2D@Tfy zLskTeiB-ldfH zY$s|QhV}v0&4Da&=>{{~pW7V9$X|via>Eqp`-RKTW;d3)rT-i`41;Byd(5tC;hyCM zgL=~+_>vE2iJ$?TmIRaRk?8se-n?D*OOAr?bc2)3-}P;ZtD{7jjZr~3<;f><{Ey!6 z^R7QukQt&7fW0zc**jUz8Xp1s^0l|fHxiYr2Ei_NF>3StPlflhwI2zw$STmn<9~$s zevt0;iTwG|E?ds&uTKBsK6$Y@hmAuC?&!;hf9#e%qyM?TcEoa?4S1EDfHl~UQXmlv92r~i`0J=9)f{NRNUY9 z^oB*e{OSgeIhqr%g0JY|jkH@2H#2>OFp^meRE;XOJTj%%5ohGj<`mtL!smm>%SxQXOeN9Hw9B+wFQ*dETW4X`|{|JZ@B3JS`gawLX6wp|frH=Lz+BO{0s~^I8ov zs2K5srhy;WsvGK3tY|Bp-#PWE-8)?_%C@3o^`*oO%%RGiA06z*K0NP=N|FP+!S4o~ zsMF7}GNg-6;_|)viXDXhK<{TZ?}e-CZVhx3Kj#kQl+@kt=gMbk9=b9i{d<^g1}i`6 z{v~a8^lz<=-=UfpMt&AQRT?QA(w9*umTRjy%#RH{l?@v@vGfb`0gG1snRcC7`!iFN z=wLqwY8ITC^YW}D2l%hrQ*5dpzJ1GBh&cFuuo%NKdf*6S_opw%b}1bALz+L+!QrC! z4r$CJOFFH9#qn?u74Us()#WMfa5E~Pb9${j$Ny-hBb;%+N4^9HTd%AYKi)>S_q4qz zR{Gp-UAk)2zSf=5sXE!9%dGZ{VsMZ1!Us`Dxb282BVsS<)?)bXqf=b|v&5_J>WhF& zAFSxJ?2e3uZyTd30}ERG(H5nY#i*tIqJYJA*+gT;^5H+&{iXMBc4U8uGh7$X7!b~V zhpVvfMMBWYuox!IfLP!QVW#-(cYiLMxc$ztV2w0;bZH?V@?3}Tq4F#RBv=s#Oe+Dp z7IfdxYznxw=Wy;;pZrgiYjB1l_Bk+MQ;Az-E$J?{1n4`fDenIfX_Dq*iqUSA0wV3+ zyemNJ%;s?1`wRK-?%<-B-n}w#V6q|S3a}T_B?0=CZi>xw#)DrS2Fc57Scm{8`g;^s zKDutIt_pQ|b$7MMCxzCQIRsy9(uwnNGEg&3KA|<<-I6iS60j0_N7dxLBA*-~T4pH8 zs-+GK&h&9}-U`i^f6DybeDP~uOXa$3jNgFc6h^#@YK1#W4oLSxFW-384=|lhh(6U? zVN*d4x)Xn9)@fs8*t27pSj#apq{<6Tt%iR0614NPD{|Kphit|r^Ws)2!s4v|9^jpj zp7NDgx;8-d=13@_GbTMW)XtAa2I=Qzb(p0vrO5h?ja!7HtM-sp9}_!`U+kC9^hbr& z$E*xusZ7)LFrIdV>RzbOh@(O?*VqTcJ;$~>uWHt#4{298E8dLTXlkh%BgRRUR~_v1 zogkvm&WGk(4O^=`xG4@|{)Wmg958%H$*))meK?LTn`GAREig;J!`xqEMH!rGfc>ep zU1JBo2U#_tI7`jKuqF^22{JSLlfZb3&kK`-q@9mqdQaItXR27Y>EynKoDQFx8ZYUr zafgHk`QEv3e5;a>h(@GOI$i7mqiKJ{JhiOd#0|{at)|uED>6Kkif;DwJtbJ3zHnuW zmv7`vBms*U+e((HID=~QCYZwz`*S-&+xa}Q=-j5CxeM_e&jGdHupu~yAHAk}(E2gG zA+*ZCVeKf7_|`%8HD7h9gr&ZYI8Y9f6Ee45x?eok+hCal6tA&OE#46Dzd6B=`F(T) zMIUL5Ds-{qQwhdvw9uXsyqxTExv3W`<@|Mf8`EKsw*kEdaW@4>7jpc3id1VFmWCF( zpA~d7GY2KQDmbz%nssC+3@1H3xzFBQU?me3bYOqiRiKyJ_qs$LC0FU%w*Y-F%#hC< zn^?VFHr4-9>VEdORvJ*LbwD$U7=*sNHm=<|xLAHaPd#K!R@Y$25%(%Q~bs%k%|c(JU!gOhD{&DY`WU=ho=OnF0` z5J-nUqS^iMZdcUNj5YTgE7J#Q8;2miMl?b`d7HGQdo1&o=S}u2kyCFGimL4_tUAV9 z%1Ccil~987Y3SNBPji8}K3e;!$@+NPh5vZA-{_@D_QFG@7(mBg zNTm*%q;cz@dDJfnPXXGWb>(4CqmY8sh`VA=;oZg!zj4R*8?phrL%#QZWB5-uPdi(| z!Hf{x*~ykk2J~b8-=P?8!7cEIHUL_PtMd5smg&{@*_(fbiCIUkThAQzB@qJv&ab{X z{(^mYr?KC5+_9~rp*B3xuuqQc)Rg%&{Jc#2@?5r?aLuPLTFEi_sx!k zBTV=;W3}1(^qa$@lNoc3{iel^PT#Yf`PC@N_6&_4c-QJ8{BL@VwZ@VXqw92;yMjI> zL7zw!Io*}P9x0Qf-V=U6zl$!?7osD^dmlxW6r3?wbfeR!8iV#(aK}AK5dcXzqc1{Z zIYQDinhuFRl5joY4rI(gv3!r@_Ms7a_z#ZFd9cQN-ZL$&D zt{Vj`j+0h~3HQ6exQ!Lu<6=Ey)J>rZJZ1=%AUR2xyrj#6O$%4Ic%P(r>5_PDu&T^K zJj+HLGfQL`cY?5Df&mXm2Op+azyX3L!d(G|)Ibw@yb)`dh2C?k%|zzRL>o$?&x9k}f|) zN?9XaS>vJLfNU?lVJ1-AKS?NXNVFG6EK+4=H5qdQamhM~)f)Mz3c2T=*yX0IC8l2D z60Xusx$yo+IVw} zF-z)}cxqzLW1U!SZnSnWJx!Q9T~t1O!YgoE^4Z$N{{jS-$3saH|LR}|eLL|&jjIXS zFDw!uyuq2&eC;vKVVb@#DbL9ZYNj02K+n@HOmd_rrVbSF^{2j?%S%vBE8u+@Uu~O4 zO<1EBo-ya%HcipS=W<#jpyVc?97O_#OR&LM7| zE%3|X_16bD`%O7IWzq zzpaX3hJ~_zx(>7r5&%Ptz^^tBi|ctxwzdMl4S+@H0o>4%fSH1jjUv}1B!^F0FF1|C zTU;1k8k<|{s~dOMHs+pB;cd1um#Q*IZ`p}r?4y*_C(=oKdgV_+C8t&82EcSf5Yhw# zwc!iXY17iH3D7aEu!3O?DHXAEAr7{Wol*jxOINzTSs%~lg--$nc@L`l0xMGo@r_$}cD`x|wNQr} zUjTw*21_yrtIhK9=6p4`@=GoeN?L4cDr<0-9#u7%Dpx`kfv>`n3()bYw)3d=?NRNM z>vcW0b$zh9eoWmUurA0HFnUz?k*|K7ul|XA{WPq87E}MJt^TugeWRlLBA=kq3ey@-YJ>poe{J$Lbv$U= zHEUvK=V!I^X8-1KS;pt;yytZp&6{e3rUZgdCE?E?A$^_Tvqk{26KUc^?jeF`yPK2& zG2|tKSntMp_nX?iV`4c+Ge;`H%B}fIYV*U|<_^VXMJ)-93X;)58gcR*zCrNe)ZYRGPH}2+=j4C3_DH^SFI$htV)P~9IxO+?AB(HrU z$5fi7!8tC3IIW?*U!C{L_IlT)du zEfiX)L@s~(yNB%*9V(ffB67zbGf*>fZBfmUQ(!2 literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/npf-ndis.gif b/ledset/WpdPack_4_1_2/docs/html/npf-ndis.gif new file mode 100644 index 0000000000000000000000000000000000000000..8c151bc4a2ce3f45077d46efb073b4c05ec42062 GIT binary patch literal 3572 zcmeH}i8~XF1IJwn^{U8OLzG;hk~7{y&JYrjE5~M-P>z`+n=$4}Y?zVzm}|y{L=hvS z$X!xy-gp^i#{Ay*@A$o+=ld6Yp6ByCUsH1vZ5_`LPA*Oc$G_l?hmLW$mrtY!l-)<;LMxKY5CgR9A^EYUPFa<-~xc^riw2mW?4c{ z%t=+F6*}Qcw+7BvkJUUXv;IENTyvM;(Je5x*6i)j2pa9Z?9x)}@(MUMVD)M5_eV-7 z{b{W~x!(0Hlv{6c-BHHleG*(qbueQ6XHQ0u>K;p*=#!gu!M_~Z+O$Bk)K9_ZN|5}T zO6)sTj#`LoR6+$YHF~;ueFEi&=}2{HfRr}*GZwzPY;M-|qzvm@Hy1t3*}Uv0@7~e6wAay|Y>A zYjf2q?+hzJ-k%upEl_E?pEpb3+!|& z@=VthE6dm#zIj!+^zpUo(yEw)wfwT)+@g}~VpL6asI$3mJu!Z21?xN_;g|PfP2hK9 zO5no!U-_-a09R zk~27+_fc-5G}uIieBZg#^2ihraoq7&*5D`9;7wNzI{qx@p@;Tk6Txszo6eNvx^ z+8?BPyC&0ILqW0B`A})c4$O!fJ)c1IgqP7>ePZ?ZFs6>tErEW*6wR4n;EAyBGD83v z_N?_Rjf{qF9)&k6pRtaZ3r3di|3Zf&Jm)h^RhctMju7S|7FZXVnjh}gxLlNoZ(hOA zm>sM_XV7g+)%6<(1gB02(~vm9zPi|=m&4lN+%{<6?7Arlo1>f=j@s&N#~g0gUN2PH z9%>hi-ch#?inbed|FdrITmI{4h7w$jy*D4U7tQP}=_DTfmG~ouzKMx7V9@)H-yS85 zr62!hVZOyO4w~FJj!p5LCc|+&JrB5M;=4}N4Zozmoa4Mg&F0lr3q$$=cv)E`r>B#` zqz;RCO%*-}g=N6Kr)2nSv4%qU2MMYHZ}@!_gpgkYkXkU$)1hYFQojNc*)F4(1mU3f z0(K9=P4By%OC|SQZYx8*hZhTX$lm+m5S(n*^XnOj@2&F2P|6dH2jU$!d)0DmBY^~f zcp$k~13H{~D!ycAVP8kLxGt60T>{u7_Nnh?K8NDwrH#a>VO)xF8K2VvWY*o$R~%HihYwIeE7DP<}E4CV3k zc22IbGzU-DC%1!bOxNjh^+fZ*r;>Cm^*qN;Sni;&EH#`d?ig8oPOnCk z@-He_F#PNo1X8J7w4#9vRLFPWb=h^R3aie3OC)TxVxzQ*@x1M9vQ$qcAHV!f5uvZR zVtVD7--_yiZKF{FV=9{jC5JMLFI6GCHOmiI?Xx8uh|n>Dwu8Gv_kcZq<9V%R;JSUm zz@ysu<{D6eB5T}Yh^*vL7qMGoy*lmK(7Q{3(bn9W1e{6@n+f*=E1aed#<~YYDy$HC@4tZ3c_XpT3oZq>wB?n(D!mjYR#&V2t6H(2-^4s;C|JWpS zw2q|j@BAXyr4--NQlDKLM3)$w3lnYb=~#W{sA)sdB{z<_5}v=YbdB8JZR?{!z+`1N zlT0#sUO&i}R^#@uoZJzbDh!)Y?qphoweHm}1uEzK*e8-Z8=}?XT6Ly48TReGLsw&j z(St`2#Cw4pH3WIp18ar-aO&OP>dF`8|8Q^WlG0R&H#)q3Hp{6%&LH@P72#>wh6qL- zxi$avzSrY-+r4u)bHz`92H@onG`WlyuO2Z;g2-j6)>lcoh0cPiQmdDl!4w>^W^Qpq zC;fuG_(U@At+n7ukgc(VKr3Mp=eqex;5m^!zDD#>)Jp1mv$K`2*RrI$DMkxUmW3CM zE=emfXmXeH3*DMq|y4QK{%%;J`G>v6!gxIPE0m(rk z;ro2N^%C*99neJOk!&HE=sRJiVMxup?MQ2<4_ zj8>^^`R!*lZtLSY)dj!{*u3C`7M1-`?Ds1z$U;4L7ssQa?VR?*MfLR7L7+7~Z{~1` zyFoL}A&rh_9WLKF(>Bx%*eSknv|?!5x|1=qQ?A#sXcT*8xX^mHnss|^p`~q{Y!FId zVAoy4b%rbOba-6Hx`o!llouo{C;j{HXYQ;|9a6y7Vg2RcSiP^m1$Rk5GB=|N+h+R( z_usJq842#pIg#Q0o|L1%lWgA3ZCOWt(8F(}y}SKQtdsGxv(W`MbhqzO*`yq~egV%ysvqmEu z-oTixg5jW*6u_nuuw$;7?S4>eU-)YL%;Dr!n}e;Z$NM>_kC!HF*aJq=NBLRr#`p`P z_fn)TrMj~i$F(uNHt*O>vG9YFv4qjs5-sSWSeyqr7IHb(p#sKCjPsd@0rtglIl{Vt zFM$hj;vgsw2n3)+Njg2dR2e0gWPW85CY_{n5gRW;i7!})Zw!yW2n^BOKc|j`>texr zSct>~94#7rM>|kM8xiY?SbBsoqu#OPgIG)=&haEn>>=#pF@$-CuV zlyafF`$?TG=c;zRV5ED+XQh$I&iw4J>42=&&h6)DGY@CXP!0Rs0vlC3cTmdGU)EcsD+6Jy5XT6=xx z%u>5@&Fy>a1$|!rvK{zIuR7Q) X`K&~ykWS|L$C;u`3(kN3t=|6t7iFk2 literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/npf-npf.gif b/ledset/WpdPack_4_1_2/docs/html/npf-npf.gif new file mode 100644 index 0000000000000000000000000000000000000000..7f0e4bc90898b120e3a3d74225dc61d69c851c4d GIT binary patch literal 8463 zcmeH~nG0&vU z*84T{(Ft7q@h0f1g25C)t2&||*@c*NG1uLBbTxb=>vIr0!L#bT(L99&o-@T7E<&hs zo)T=Jx@ZDvPz^{TODdizw{SGtV5uvaE!JTAY#_~hFhx%OY#bx6Xy|#^g0%(0^#|tIA_|Et8#(3l@Y|+R5*Gvl8hYt5p_9_(5MCyJoAGve4ICxRk)QdeSQej98Txw>!e7{SK- z9!2BLcKewUOnJy0LlB!hyiR4*J$B`UtBrg10!ju+m4&;-PLA!x*N)Zbcw*;(K|SNS z8k7{+Ia;=~aUVV%+7yRck}Gs>ScicRd{^s`>;@xf1M||EBFS>s(>ds2cGvk;X4FMI zGQWvP-H@aG0#9Lx1d%feWSk${FZzx$sQfMd@}_t>Cii3aQDOHPQm2>gdxV2bVsbOQ z|Al$+TNtaJ(N3Q_l)0#9*-HtT=`!7T6!ZB6SK9Vrt;iupl7eM#RHluz23>KU@g5}> zhCGS?-FeH6khf!YR*?jL5S~;Jy*w@5se(L`F?3|Bp8WpCw6<0P1qdcV3{w7#)BoxPC|Mb(EHUA~R&vAkO!`>KrlHJjjQbUZ?x+wyxQ%Vj|v z!y>}+ZZk?sO%z#>g1hMOC6v6$ue|_P?>+0xl&nJqT}gsE=ojjpn@(Dx?R(J*z>{Pl zs=I-Ky@A_PsgE&I^?>gqE@#u;BgN;dH*=t?@W7`ZuhW7szH{SkhxOM8vqR9)v3$7~ zerLiDphQ5KO~4VKe2?X?|0C{agpB>4|B3$%pn+r)z1}Wc*Q|K zjT+haWk&%nK2~R|Tz&7RX~AyIdB?{Hd2ne(jPCl2XC#XK@5z3}gz@D+XY6d3lQ@ox zh2+0{t*DsD7cWZOpZ`h}jaCC5CuE<#B>1X0panfnM5q+-=%QnF8;_GJAR9c!+=E7u z$MH-x1#c(>2TZSzQ`#vx`GXXPEL(r2_GWOtVT@PN6FEs6{lNJ)PZ49SRt?Qoc}eOW zfl>ceoxV&77wbb0e2>>onER70ZfB?%lW_w33xU6%@fvoE)=VbA)A)b9K#%xdpJWkG zAwHies(Z1VW|MNlr34H#bT(bHX`&D^ceA6xgw?r^G4@g^v$Q^Hr+Lq)xa5QZgK_bv z`BNs_j8ZJ)$#s+YTvE0wb`okyfY^dJm?D{PN)tNAHE_(WgHjVV@e>O@&8hGKPH9vNoBsbc6^N!lNPMg-4mB2bdct^e|BXm6~1+7$RIybs5Cp?UKkB zv{>qzrP%l#{*lfs4igobM}0RN<5jsfo6OyHUj}Rpns3gb61MIHB#s6(#XC@K=2Sm) z8Tc$7nAfzciwg$2?^@h5_DoyLQKRDYE?x*XJ9d%c9NN zA0h?o4q1jk|2Dq6M;+y8V!*yN-7~nC7;XG#E&j21&F5$iGY#d$iR8NXN6njYFmanL z+xO_SD}Jl=A)DP*ri4Q`g(MpZ+Y`W}!PK$0_Hp%XVvELLDkD~IN&IyW7>IryQnMKk|Rq9aS3tg%F4>CmYJ>s>wD&FQ%9 z19vI;A_oF#>;yG~J4iQb#jH_c%t7{5)>A?Yp%iFBMkZ@<=@5Vbd7Tb@bygCBQP%Hk z#P-Q;A>%+86Mg5I!e9}%0x1IvikrDX7m*AH?mZ`Z)){#8uX5QdM-vj(*&z|Tq6X)E zt0k7MmC)CI&kyp>{a{SgcBk4uC9ok$?8!GvJ zlN=_FaDIc)?z`Oj{IGE}OwH}ySFAMmCkegyveN~@mK_a&^@%(+cPTZgO5G7)M_J~( zQg60jmg_)hTc&j7>%KowjwY(H12@iMP^gpNjrRJYY~!B9!EX}d#fxE&sq?!-J-)_e z67|bY*4AxzqR#}6M=pCM@kg;S&FfFgFVV*M)6l;F$n4!r-}P!EF*8vHP{)5$i zkFfrjFyHCdAag&5NW0?suoA?t5VR&AeA(weX%{R)8vL;y#L5+{u^p(v70go~q|Oz>Y!ITX5NK!{ zsEh@wDuhU5J;mw+XgY%R#X`;NLlnXT9aDi)Od$aK(4Y1p*4SW!%h1>TAr6}%KqlbN z?Z7}ps1#GUr&t)?Pa(i(+uk=dd|f}((mqsOEX0N@%Zmk&DwtVQ4G#HW*{)?91(MgjX7J3At?HN%M?o#;r2~GmNe}#iQ#WD zGI@%I-&95B56L`e(ckFFr0NZWkefuH^}pP zS@G}SC0=>OKVnX3OqP2mp5O&f5OYWn-AVY&tnfuVQKdUU#w*e3eT)KgoSc`ea6_Wr zNqoSABnx<=x?CPAPw4`t1$pD#TTZcG3uVjW(8A!J@Q+M(dr))HF ziYs@D`<1lvX|l_Xv6zgkb3@9{G$XI86i>wzUvvt??sZ;dRkUmG9NcIxGGH}82TL!EmVvxnS~NuK`Ulss;-i&9Xx6s z(%n7MfmhM3SLyA{8A7&PpHmDJFQZmGq8}hKc3yuaupk&^hK-BECJkZJUND}Xj6QsL zhCc#!y9Ha?%9s()TsO=dOM~^HVY^r1tz4O#SDAmwVB0&PdxlwOJDEpmS!?21qa>N< zS6LTfS=Zv(6X>j_OJJ6K5S}cX5*ifxHJgS9_J9XMN*+YN?ME@^yKxyx$dYqkB4^bg zrw|@wsgSE=U;Q@cZlXvej(5U7U%r{O17J4o(oHaDtY0qVxf&vrrou-bbX;uWPzm;+YdFBH!4bm7I7&QS8aoSNdIdi2?49XMbb1#7T%SvUpN;xLvWoCfN zH2DhRo8pR#j0dAMU}z+zawx5F)sM&^I>|~QKqUby9!@Y=)@)Q!2CN`5$PSnAUw{^v z?*>2gE_;cr`rPEjvRC#5oIP~~7k4aDF$m#O&XY*3GFFPxK*INVs%2S0^1L-KaA57G zs$Q|0X<+S-)LNsx(tUK4DMf&8Q{{V#0P8(3oD#%Avf#sRWGYvUqjHTi*qhxrdz}$w z=NP4tUi=A}?ZsN>4fgq-Ug^(T6AiB1y$*`^EO~2C`qsN9!q^+cn`7fx7jsjeWM5U( zm}`MUTH=6Uq_^=+!xvojhrOCugMcu{#x!N`^uY!Qu7170vCgrooV9|9w@Jvmf!L_2 zZm;+`vZ={2ngx)n%3CI246Mc#!@-UH_@+Q)Q!_>k1(0m+_Rj3}ZY~3qDmy-C{=Z?~vHJ`b>) zDz$sIsaw#gO^p&+$=f5r2i7U+_8jc)PVez)>fjmdRCKDh^l7k$_}C7W+pF|EH)xy$ zx1p|k{RcYf@3r}pc5BS_;#-vE`qxo)R2(_SJGs6qW;}^(FFdnwIR6b^ z-y7BdA{;7XzMuWN-&BM#UI-QRA>VX9>lod2-cKE<&etk47Uxzw~gs*?kz7F!kBc{QMN{j zo5nwu*?Tf@AHxa-TRxrkCx=-a&x}6O8^PV89%fYP;?TDygBZTyk&^TlSqw4%==AC#~%J6R+t(C=^OK=7+j_)FkGed{ar3iV?$P4+FCqIq3L`zY_6Bhj9SRVXJNjscCl9#mn>zR zuDg)lGJPQ0icCd=p3KYNEF41FzUtAD!6p-1=5O8S2ZfExh_RHzi&X4OV=dYfFq8BB zWiQy$!5$8WS;#dVWFH)Q>ewYNwOZ}7y7^==k!*bD$>h4}vP#QxuojjT5+C*H_!nUPRxNj2UDy8I=v=6RuWc z*w)UXmOo`q+PW;JVP*wF=y3Y&*=)X_09&l48(L}`3Dk?C`RU_6qo)Ro{s)UvW>^m0 zHM{6d`j5M$3bY{uU1IY~$rKw*{5x*!d$E~YA5=$!rdOwAm;K%>1W;ogGgr1jn_({7 zF-%Q)rd^f0U7s(vHPv>+ohLZi_che^T6U}p&r+nEF+GgCk3Vh(`A&5V>&UTVxsx~h zsdoMLN1e+e``9-`DZ+-Ldu;Z-@~Cw~G8grv{_I3g!iPa3&Ykn~146h1iVug(#)m}i zhe<7SWuRqg{C*Qv02K50(cxMJXyKj7>Z{@ZeDc-@S&^jbyIcxbxncYoiP;K>?Z`*@ zSeo7JjNh1vdcg=1{`X+1Msgk({Wn+bAa3g9&)rVjn`1h2T*CfwAoVGeA0i!a;tn}s zV?CB^JCrkD`S|eQi`wZY^D|w)b!`cVh4SCT1Eg9^wnq71k;UUI{PE+g)Be8Wr6e5S z;l<^`nX%yQN~h`yzu}m+y||?d zc+h`X6R2GiGb08Ix-skiV4G({_B8d7VDe4fC7O!&6^Jk9gNnj3_GHg(;1= zEmf9W|A{=jfyDf&61aO|(47Q{q|5Oy7MT7$(%V&jW$e>hqkv!HZou}PvVS_qDE~7_ z$KNad$3#v;KtxTcF}nOEn2etA^XTY`bT}=i1d&Disw{+A*kv6Xw;~hEAsb1QJ-V)# z$gP|E(({J}I!VZ8IG?%NMm0m+oyBLCep4;`3+REn__%#{BwNxO8^F<;CPI^&u0Tn9 z8J($H>w;;V;vLTU;OEPUtl*u3YblD@;La_LYJYx-<~P>gFl_Q-Y@Ni3el`epy8~_@ z8OluZT^Qa;L9jxE9YLJ`TEx=?Ee7q6Y!8gn?AQA6v5YaBq!KlA{TU?R^{5`Z?m^4H zZM6)Xxmk`kEG<&QfOY26ZTi=bqlG<>8oOPgzcX|^TsE7dc;w4aKio^O+Uzrn3ngxm zBkuAfPvaXsn&v~Y{*|)d-2|?$Nien<_HP4T|6k)Vx5vzN~N zmZoP%PlrIK}-6h{aW|nCGV{omyp8jpH_-t$Tqr<2(Uf>iRNP;k*XD)V_+~hmU&K%!Pog(F?`XQHzmm%OoAz5KMMKJNB20) z4UX*>oV*XK1q9wW7KzF?|L$O51pg{pdUEYHxrCH-sNBlUu&KVU{P7YSPETsJoOa=I z*$@7HdO3X0;{>}MCOdm}P;eN1Jykj)a9Eq5YX&;PdH9J>E!apc?(>JW@XjvDYx{xF zDN8>2>rp>4?yKN0x1jfn2mSDP!e=tE@Q*j&di}|or!Khq3yCEheL3hYRLt>yt*XeRAErlE7Wd&*UmyF9@^K_`oSR{#X~#5zM4CA+qU~hX zZUrqs_g4pl!@oZNjR@kCc}|*CUzsZ$_w_ZOE_q*Q7lU3zuu*gFW66{5H*&OZZG%;r zXH(hVw-%V^9pxS^l4eU<3P!7WDS~#fh(Thl*r1oz98_KkGOx7az}D6;*sc^5b!kRBmDbRvIqDAQ0?ScyIzxBjZR zY!+k6L!Yts5}w&=ID8dO58JcedV_0FbZ*toJXs$VZ(>#lZfa*8%-emRoK^RKp!4P2 zZQ~g+P$L-lF8fl&UYZS{_WSK=4t)Vv4XM$HpPo)0EAgyske7ILs7^lBDZ=ZmgjQl< zjVEIgLdo=6YwxbIK(N3;)hbdmc1{N_iFui5JD{EYASu6Ys7NCUIH|_+s7U#&kP~*T zgOJlL)-C|(GNW~NhG?CPHvsxA*SZxf+4=NS00RtAuclD9^l4Xd{`9q8eXnj=x8t6` z7Er%=Q@5P77>_i)xYlofpjT!EvNt65Ht2r!SUuPs@r~iepkGcz1q6avae5mLnI%_J z)jHWq-ORSTh~&VCogGwJ^~atk*1$oJK=GE@0iSv5<}LXxw7o~Crl%DNy};T`)3~K; zJyb+X>1S8Tc}m^&+D-;!Q6O@DQx4To4SVye#b`dnC9;AM2#*l*2SXZtjn7TA-{)Wi=SUx(b?Iu?G2{tu>GE`so zyz>>p|GsBr!Lr3vBXaOM+WpoF)9b17`PH$nSF`$4MniOvPb9!p|Hp1QKNanzUrRtEZEMtM7wi@Mj>qB(-PCziZ8Tpcj8F``m+datQT0Gf zWK!26l&R7*^CYG~_s^7#K!f^EHzz8ig-r}FJK7^GGi8NmWnQYgT6-*5w{zhVu(RVg zl1L+9xKiUS;*z?D-P(6YOfT{EIwpN{VQeb z1MGc_$H2;vWBQ=Umh{DA>Fp=Z30?EsA1^%XG|9im%fPl + + + +WinPcap: Page Index + + + + + + +
+

Related Pages

Here is a list of all related documentation pages: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h.html b/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h.html new file mode 100644 index 0000000..38a20d1 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h.html @@ -0,0 +1,626 @@ + + + + +WinPcap: pcap-remote.h File Reference + + + + + + +
+

pcap-remote.h File Reference

#include "pcap.h"
+#include "sockutils.h"
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  activehosts
 Keeps a list of all the opened connections in the active mode. More...
struct  rpcap_header
 Common header for all the RPCAP messages. More...
struct  rpcap_findalldevs_if
 Format of the message for the interface description (findalldevs command). More...
struct  rpcap_findalldevs_ifaddr
 Format of the message for the address listing (findalldevs command). More...
struct  rpcap_openreply
 Format of the message of the connection opening reply (open command). More...
struct  rpcap_startcapreq
 Format of the message that starts a remote capture (startcap command). More...
struct  rpcap_startcapreply
 Format of the reply message that devoted to start a remote capture (startcap reply command). More...
struct  rpcap_pkthdr
 Format of the header which encapsulates captured packets when transmitted on the network. More...
struct  rpcap_filter
 General header used for the pcap_setfilter() command; keeps just the number of BPF instructions. More...
struct  rpcap_filterbpf_insn
 Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header. More...
struct  rpcap_auth
 Structure that keeps the data required for the authentication on the remote host. More...
struct  rpcap_stats
 Structure that keeps the statistics about the number of packets captured, dropped, etc. More...
struct  rpcap_sampling
 Structure that is needed to set sampling parameters. More...

Defines

#define RPCAP_DEFAULT_NETPORT   "2002"
#define RPCAP_DEFAULT_NETPORT_ACTIVE   "2003"
#define RPCAP_DEFAULT_NETADDR   ""
#define RPCAP_VERSION   0
#define RPCAP_TIMEOUT_INIT   90
#define RPCAP_TIMEOUT_RUNTIME   180
#define RPCAP_ACTIVE_WAIT   30
#define RPCAP_SUSPEND_WRONGAUTH   1
#define RPCAP_NETBUF_SIZE   64000
 Buffer used by socket functions to send-receive packets. In case you plan to have messages larger than this value, you have to increase it.
#define RPCAP_HOSTLIST_SEP   " ,;\n\r"
 Separators used for the host list.
#define RPCAP_MSG_ERROR   1
#define RPCAP_MSG_FINDALLIF_REQ   2
#define RPCAP_MSG_OPEN_REQ   3
#define RPCAP_MSG_STARTCAP_REQ   4
#define RPCAP_MSG_UPDATEFILTER_REQ   5
#define RPCAP_MSG_CLOSE   6
#define RPCAP_MSG_PACKET   7
#define RPCAP_MSG_AUTH_REQ   8
#define RPCAP_MSG_STATS_REQ   9
#define RPCAP_MSG_ENDCAP_REQ   10
#define RPCAP_MSG_SETSAMPLING_REQ   11
#define RPCAP_MSG_FINDALLIF_REPLY   (128+RPCAP_MSG_FINDALLIF_REQ)
#define RPCAP_MSG_OPEN_REPLY   (128+RPCAP_MSG_OPEN_REQ)
#define RPCAP_MSG_STARTCAP_REPLY   (128+RPCAP_MSG_STARTCAP_REQ)
#define RPCAP_MSG_UPDATEFILTER_REPLY   (128+RPCAP_MSG_UPDATEFILTER_REQ)
#define RPCAP_MSG_AUTH_REPLY   (128+RPCAP_MSG_AUTH_REQ)
#define RPCAP_MSG_STATS_REPLY   (128+RPCAP_MSG_STATS_REQ)
#define RPCAP_MSG_ENDCAP_REPLY   (128+RPCAP_MSG_ENDCAP_REQ)
#define RPCAP_MSG_SETSAMPLING_REPLY   (128+RPCAP_MSG_SETSAMPLING_REQ)
#define RPCAP_STARTCAPREQ_FLAG_PROMISC   1
#define RPCAP_STARTCAPREQ_FLAG_DGRAM   2
#define RPCAP_STARTCAPREQ_FLAG_SERVEROPEN   4
#define RPCAP_STARTCAPREQ_FLAG_INBOUND   8
#define RPCAP_STARTCAPREQ_FLAG_OUTBOUND   16
#define RPCAP_UPDATEFILTER_BPF   1
#define PCAP_ERR_NETW   1
#define PCAP_ERR_INITTIMEOUT   2
#define PCAP_ERR_AUTH   3
#define PCAP_ERR_FINDALLIF   4
#define PCAP_ERR_NOREMOTEIF   5
#define PCAP_ERR_OPEN   6
#define PCAP_ERR_UPDATEFILTER   7
#define PCAP_ERR_GETSTATS   8
#define PCAP_ERR_READEX   9
#define PCAP_ERR_HOSTNOAUTH   10
#define PCAP_ERR_REMOTEACCEPT   11
#define PCAP_ERR_STARTCAPTURE   12
#define PCAP_ERR_ENDCAPTURE   13
#define PCAP_ERR_RUNTIMETIMEOUT   14
#define PCAP_ERR_SETSAMPLING   15
#define PCAP_ERR_WRONGMSG   16
#define PCAP_ERR_WRONGVER   17

Typedefs

typedef unsigned char uint8
 Provides an 8-bits unsigned integer.
typedef unsigned short uint16
 Provides a 16-bits unsigned integer.
typedef unsigned int uint32
 Provides a 32-bits unsigned integer.
typedef int int32
 Provides a 32-bits integer.

Functions

int pcap_opensource_remote (pcap_t *p, struct pcap_rmtauth *auth)
int pcap_startcapture_remote (pcap_t *fp)
int pcap_read_nocb_remote (pcap_t *p, struct pcap_pkthdr **pkt_header, u_char **pkt_data)
int pcap_read_remote (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
int pcap_updatefilter_remote (pcap_t *fp, struct bpf_program *prog)
int pcap_setfilter_remote (pcap_t *fp, struct bpf_program *prog)
int pcap_stats_remote (pcap_t *p, struct pcap_stat *ps)
int pcap_setsampling_remote (pcap_t *p)
struct pcap_statpcap_stats_ex_remote (pcap_t *p)
void pcap_cleanup_remote (pcap_t *p)
void rpcap_createhdr (struct rpcap_header *header, uint8 type, uint16 value, uint32 length)
int rpcap_deseraddr (struct sockaddr_storage *sockaddrin, struct sockaddr_storage **sockaddrout, char *errbuf)
int rpcap_checkmsg (char *errbuf, SOCKET sock, struct rpcap_header *header, uint8 first,...)
int rpcap_senderror (SOCKET sock, char *error, unsigned short errcode, char *errbuf)
int rpcap_sendauth (SOCKET sock, struct pcap_rmtauth *auth, char *errbuf)
int rpcap_remoteact_getsock (const char *host, char *errbuf)
+

Detailed Description

+

This file keeps all the new definitions and typedefs that are exported to the user and that are needed for the RPCAP protocol.

+
Warning:
All the RPCAP functions that are allowed to return a buffer containing the error description can return max PCAP_ERRBUF_SIZE characters. However there is no guarantees that the string will be zero-terminated. Best practice is to define the errbuf variable as a char of size 'PCAP_ERRBUF_SIZE+1' and to insert manually the termination char at the end of the buffer. This will guarantee that no buffer overflows occur even if we use the printf() to show the error on the screen.
+
+This file declares some typedefs that MUST be of a specific size. These definitions (i.e. typedefs) could need to be changed on other platforms than Intel IA32.
+
+This file defines some structures that are used to transfer data on the network. Be careful that you compiler MUST not insert padding into these structures for better alignment. These structures have been created in order to be correctly aligned to a 32 bits boundary, but be careful in any case.
+ +

Definition in file pcap-remote.h.

+

Function Documentation

+ +
+
+ + + + + + + + + +
void pcap_cleanup_remote (pcap_t p ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_opensource_remote (pcap_t p,
struct pcap_rmtauth auth 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_read_nocb_remote (pcap_t p,
struct pcap_pkthdr **  pkt_header,
u_char **  pkt_data 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_read_remote (pcap_t p,
int  cnt,
pcap_handler  callback,
u_char *  user 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_setfilter_remote (pcap_t fp,
struct bpf_program *  prog 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_setsampling_remote (pcap_t p ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
int pcap_startcapture_remote (pcap_t fp ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
struct pcap_stat* pcap_stats_ex_remote (pcap_t p )  [read]
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_stats_remote (pcap_t p,
struct pcap_stat ps 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_updatefilter_remote (pcap_t fp,
struct bpf_program *  prog 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int rpcap_checkmsg (char *  errbuf,
SOCKET  sock,
struct rpcap_header header,
uint8  first,
  ... 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void rpcap_createhdr (struct rpcap_header header,
uint8  type,
uint16  value,
uint32  length 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int rpcap_deseraddr (struct sockaddr_storage *  sockaddrin,
struct sockaddr_storage **  sockaddrout,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int rpcap_remoteact_getsock (const char *  host,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int rpcap_sendauth (SOCKET  sock,
struct pcap_rmtauth auth,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int rpcap_senderror (SOCKET  sock,
char *  error,
unsigned short  errcode,
char *  errbuf 
)
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h_source.html new file mode 100644 index 0000000..c7b2293 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/pcap-remote_8h_source.html @@ -0,0 +1,307 @@ + + + + +WinPcap: pcap-remote.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h.html b/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h.html new file mode 100644 index 0000000..0d01c0f --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h.html @@ -0,0 +1,444 @@ + + + + +WinPcap: remote-ext.h File Reference + + + + + + +
+

remote-ext.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  pcap_rmtauth
 This structure keeps the information needed to autheticate the user on a remote machine. More...
struct  pcap_samp
 This structure defines the information related to sampling. More...

Defines

#define PCAP_BUF_SIZE   1024
 Defines the maximum buffer size in which address, port, interface names are kept.
#define PCAP_SRC_FILE   2
 Internal representation of the type of source in use (file, remote/local interface).
#define PCAP_SRC_IFLOCAL   3
 Internal representation of the type of source in use (file, remote/local interface).
#define PCAP_SRC_IFREMOTE   4
 Internal representation of the type of source in use (file, remote/local interface).
#define PCAP_SRC_FILE_STRING   "file://"
 String that will be used to determine the type of source in use (file, remote/local interface).
#define PCAP_SRC_IF_STRING   "rpcap://"
 String that will be used to determine the type of source in use (file, remote/local interface).
#define PCAP_OPENFLAG_PROMISCUOUS   1
 Defines if the adapter has to go in promiscuous mode.
#define PCAP_OPENFLAG_DATATX_UDP   2
 Defines if the data trasfer (in case of a remote capture) has to be done with UDP protocol.
#define PCAP_OPENFLAG_NOCAPTURE_RPCAP   4
 Defines if the remote probe will capture its own generated traffic.
#define PCAP_OPENFLAG_NOCAPTURE_LOCAL   8
 Defines if the local adapter will capture its own generated traffic.
#define PCAP_OPENFLAG_MAX_RESPONSIVENESS   16
 This flag configures the adapter for maximum responsiveness.
#define PCAP_SAMP_NOSAMP   0
 No sampling has to be done on the current capture.
#define PCAP_SAMP_1_EVERY_N   1
 It defines that only 1 out of N packets must be returned to the user.
#define PCAP_SAMP_FIRST_AFTER_N_MS   2
 It defines that we have to return 1 packet every N milliseconds.
#define RPCAP_RMTAUTH_NULL   0
 It defines the NULL authentication.
#define RPCAP_RMTAUTH_PWD   1
 It defines the username/password authentication.
#define RPCAP_HOSTLIST_SIZE   1024
 Maximum lenght of an host name (needed for the RPCAP active mode).

Functions

New WinPcap functions

This section lists the new functions that are able to help considerably in writing WinPcap programs because of their easiness of use.

+

pcap_tpcap_open (const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf)
int pcap_createsrcstr (char *source, int type, const char *host, const char *port, const char *name, char *errbuf)
int pcap_parsesrcstr (const char *source, int *type, char *host, char *port, char *name, char *errbuf)
int pcap_findalldevs_ex (char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf)
struct pcap_samppcap_setsampling (pcap_t *p)
Remote Capture functions

+

SOCKET pcap_remoteact_accept (const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf)
int pcap_remoteact_list (char *hostlist, char sep, int size, char *errbuf)
int pcap_remoteact_close (const char *host, char *errbuf)
void pcap_remoteact_cleanup ()
+

Detailed Description

+

The goal of this file it to include most of the new definitions that should be placed into the pcap.h file.

+

It includes all new definitions (structures and functions like pcap_open(). Some of the functions are not really a remote feature, but, right now, they are placed here.

+ +

Definition in file remote-ext.h.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_createsrcstr (char *  source,
int  type,
const char *  host,
const char *  port,
const char *  name,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_findalldevs_ex (char *  source,
struct pcap_rmtauth auth,
pcap_if_t **  alldevs,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcap_t* pcap_open (const char *  source,
int  snaplen,
int  flags,
int  read_timeout,
struct pcap_rmtauth auth,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_parsesrcstr (const char *  source,
int *  type,
char *  host,
char *  port,
char *  name,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SOCKET pcap_remoteact_accept (const char *  address,
const char *  port,
const char *  hostlist,
char *  connectinghost,
struct pcap_rmtauth auth,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + +
void pcap_remoteact_cleanup ( ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int pcap_remoteact_close (const char *  host,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int pcap_remoteact_list (char *  hostlist,
char  sep,
int  size,
char *  errbuf 
)
+
+
+ +
+
+ +
+
+ + + + + + + + + +
struct pcap_samp* pcap_setsampling (pcap_t p )  [read]
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h_source.html new file mode 100644 index 0000000..e0052f8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/remote-ext_8h_source.html @@ -0,0 +1,171 @@ + + + + +WinPcap: remote-ext.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h.html b/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h.html new file mode 100644 index 0000000..ba50c11 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h.html @@ -0,0 +1,162 @@ + + + + +WinPcap: rpcapd.h File Reference + + + + + + +
+

rpcapd.h File Reference

+

Go to the source code of this file.

+ + + + + + + + + + + + +

Data Structures

struct  active_pars

Defines

#define PROGRAM_NAME   "rpcapd"
#define MAX_LINE   2048
#define SOCKET_MAXCONN   10
#define MAX_HOST_LIST   64000
#define MAX_ACTIVE_LIST   10

Functions

void main_startup (void)
void main_cleanup (int sign)
+

Define Documentation

+ +
+
+ + + + +
#define MAX_ACTIVE_LIST   10
+
+
+ +

Definition at line 41 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
#define MAX_HOST_LIST   64000
+
+
+ +

Definition at line 40 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
#define MAX_LINE   2048
+
+
+ +

Definition at line 38 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
#define PROGRAM_NAME   "rpcapd"
+
+
+ +

Definition at line 37 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
#define SOCKET_MAXCONN   10
+
+
+ +

Definition at line 39 of file rpcapd.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + +
void main_cleanup (int  sign ) 
+
+
+ +
+
+ +
+
+ + + + + + + + + +
void main_startup (void  ) 
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h_source.html new file mode 100644 index 0000000..eaa95e6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/rpcapd_8h_source.html @@ -0,0 +1,88 @@ + + + + +WinPcap: rpcapd.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/stats.gif b/ledset/WpdPack_4_1_2/docs/html/stats.gif new file mode 100644 index 0000000000000000000000000000000000000000..5c44ba356944837b2622bb2ebbd231ecb326c9d5 GIT binary patch literal 5431 zcmeHL^Zr=Y@MiV8}{2J0~xy%Ex|V8qCc zloA*q%_xQ@;6Pya(a4}0hi1r+1SLEA}tXMIUhLzqO`SLyQ966PR_Hg44cB)}jk#U9X_`)cs z%FBWN{*Z7{%pJdRR@B+#J?-j}sg|JF3)V(dwWrNVH@$pyhKgsp(ubap8PUpzIbcIJL zPKJL`YiOG_gJt~KLGIhF&9!t^;?pjG2Xy@>mEvYPzOtLJIkgz{v^H#ZPy9gj_MpjL9Dp8*tETem<_(ev7R^_c1pZ~rAK*JT($kT93{uP&K zGuflrNhY#=FH)>bw&jp_Dz;>kq_j4(5YI1oWLf!_YCcc)F%jxZ4VY}3B|aR(%%I;8 zU0f`}1dm@OJv)e#`+P5hr(o^YRPIWEL5Ac%xALGoBFY3p&Uq!c;F@>llqZs$nL|-R zI1~HlGx@~~mMTt8OWD#5DkGRex8VblmEWyiA;(OiJ6Toa)l|-Tv7ASSoW8T{c)fdnjORJ2)-; z$@V-P?W+YlSFy6QSlptryL8l;Nee2UE81OQY<4CsS6RqwEqo(O>8vz9@ZI~>AYZ$+ z+J5~GW35?N`mKMjg|y_)!6{VDZ<^iszR!5LG=6KU%9^>ILrUX&E|!_%c7No`hmEWc z`q}Mm{%NV<|6WWR;~%Zt7xI6PRZd?&Rb8>CC~{-Z`TH}8tvaTj*~cfBpB<5j(#`Sk z55KTvtjpEAc^zI1*3!nZ8P@8#>qcP9-Al*nZ;E@IKWP>+iT%X1RX?PJ^@1jrOPSvP(=3v$=6hMHULf&nLvWH(4%F^l<` zPipAyzX24Ym^mDtVl;0&j0JeQyjg%0>uZS1WW2m)>5y3pnQ49pHL^2eOi3vZG{?eU zy1mtzlD>bo6}_JyXZIqb?(m!K>$o zz~@$fB^5^`Nt-H4t3v{i0qxoHPdy&#pIWnJoy(RCEi-)L`Ovr4bEYx}V5F>4hP$(8 zA!&ZT!|Wac)qX4crlx|dsLC|@enfA(neEl(ZV&{bBwwn>UW!Ndc5&Ot_J@(|p z&9rvJv-_m858p3Xr0-@K>YfzqX7Ea458dtj2cU#Kb!PdYN9O!Iw z3OeF*IZ*V92gsB{f>U0_01LaYsyJl1`{DcQE?^Tyx38ETf5lrB09vmELyJ4!zQwsz&Wcnxs7zAE2Gw0DM*6ni`)l2JTu|m{(RVLwFl%@yB1G4zOo|c z7*rWDpfs4JqMi?jxhApMGR)uSRs5|C?dFE966!Vz0g6jze}=6aRR&5Dk@>L__WhS8 ztaNPdDmlq4T8+O#mB0(VU&v?=cjJ%+_$xl-*EU%_CR^MdVzg? z%*A1SWM!tK&qE@QJ}I_Y-TFGpT~FDHJ%*wZ-mdt(WDj#EE6WE@`uaI(4@`$_(!ckQ z2C&$vL*R?W=|@yvNpnU7ur^h^^Gk1P18fHQhbw)X*dDuLDZf#7s=`P8=!6m52{5X( z^KKz*ltUUA-qggtg}mE`*rW<-lq_}lJ%^4wJ(-3qUbXV~ZnJkfdcQhk^_OrE)@J-{ zu6zCyyB~`7OV3$6^=9RJQt@66U^Lr+)u-NiD5%}pW_v69hRUk1Ys~afMZ4RIK5CcJ zPRv|39BQ;wF;4liga&%GupO)^=#kAX)he%ch)NkBdop%*n+)v$c&xczJ??g!GZZ#i zQ08*rPD9}8FB#<%x6()e^UTw3aT=sDqRXpsCD~OlG6SP3e60f-T}n`YP#(X=nCISt zB(g*wd@WuN-gxU3=saSnSUM>EehH2F*Xaq(viy?$dE+M*rXaQuqSFG-H$_$qGV zc0m50_}dpxIV9Bsw{Gx^Id&-e#L8q)BmYXduZHq9+y?VvVOg8sg>>8|ADf&9O@_^Cprn4(Jq8>Px{jtb5Y)(QYsQG4R+Nqy;+WI}IR|D`R zO!vaH=7`j(kjg@n48)hAMdu6J^tN}e%kY5ZC)V_~p)sjk3rW3K7vs2H#Go4b-FE-3 z)v@uh%@f1>D_e>>ANid#br#T{?`;@wMZ;!(Linqg#A7qrgze5y{#ueBV|ww-4mD*is|U`{5!$QTQxq^Wj)kxWzGF zxkn#8w*tk3J?(=dUIx29Rq*F;T=;O@{r#m#!=lDW?dix1qEV`?pFTZOqof$=VWK{2 z1gHjmZk!Iks}Nxm@#*Wd9Kt#JW$TsI($Djo4+ee*@@yg&rcM5-dR6tvKzA-?>5g() zu-8nB;Z%!dy@qpHkk}1(SWDF7wmewhnweBqjH5=}J*&86z4#k0@nI41!0dSU#(4QA zt54PD9E}T;8VMlVg!@;#=M|I}suSFM6L?z*zGo9x=M&a#6ORNWu3-{&EiY;62lL(a zcbXEP-AIB~hze3g(+87IMLV1TBn@2^IA;gH0ELTU;bK&{#1LF+8-59Zkkv%U*&)t@ z#Q&~L;yNLKLkN{^geriatOkXj(M%9fP1e9BYf+PR+TiNY=(~WFe>79{w&C}wF%PjR zU}}mMG^MvS#SDOa3_zGfN8Hgw+G3HmcF3q8BxD=;43y#k4SJ%95bS}wfZ#$T_z@E7 zV7kaXA+#SzBrsa!HB>}&2;~PwyHQbUnkY*&%2g2q1z`d`;0MhyQCN(p9V!lhj^$zG zp@=7T*aR#p(GHzL#o&jqszMl3H_Rn0)*FP22PLD)nA~WL6c&4D8-wIwQJ`c(G>*ta znRw&Bl35|VhyIKBtI zN+`7=I+aQ$bYkHhP-Is$VX7^4f`=H`_WN#!bEgtvP+}nnovDb;Z6oYxiu6+9Apq>2 zX7aM8_YV+}sfp)$;If9$vmoTw5N5|Cy&6kcQ%n_tr0bIr_7(V}A*e=b`e_>O2M-5V zBvC+Vy;!1j49T5L>S`pFYhr0acm-O<4P5G3rL-mxiA*L6E8&3)$tuS!Rh97jJe)cX z{|J&+0L?rnM!d9;d6$+s20|QK@YK~x`%TS$#UuR&VV^3Yvw3Ju2uUOcod?MA;$g4Qf)sQ(_Z^NDDkc{OLGWK_ zdpn$WR*0OUl#5{dB5~wrQ1aDWGLeS-ppty#|2sxZdq2pJYyhvoq63p1n3J${j$G)p0% zGQ!bHJi7u6s-(D8K2@x=BUe_oRQh?9qZTS`WvYU;%iiF{pd(etLw)UvA6 zpz0`m^%{cg^JUope zPR&q;Frgi!fFwqZQA<+cUoAGCFq| zT^z>1QJUaOssR5IRY;e5WTJX7U!-EO=0I`Hm@qSmUNa%i9KzR7lxv14Zl|9y31`Dv)pe|8wQqU+3WZm*^1jW&Gz27|mvdrUZ z59v0Ik2K-5S!cajFHSTACF)&abspYLC)*|MfVEbHMirfgN$n=5z1qV@&87s_J%<*q zVH5w+9@PdI=f`Eu+Bd!0Yt(_Yh{Eb(9O_{Ot;XK<$}n2Ej`OFumY3WHxKZ0>Mq?PP z8Odl8T53w$tN*~IqG9oVjQS^xhCpu1O9K0OJ1tR%QwnUzmS`d~7(VUi`tq5F>zhWs zm@Gnzs}a*ZP9(mdS-gPRy4T+BP{S8z{k_Lw9jF;*bkxz=Bds0ZB{~~pJC28SazLeEnD%?>f+|x>LW-NA#>-C(j;pj=Uj~1}SPSQmkb!D!7r54m&@!{7h8q;ck zY?}7h2i85MI_>T4O`Zky1B~Xj6U~mmj(f)S*RFltl(?i;$T4DYerUIadH37`)`3R* zwm5A`1$7r{=&FT(E7vglPOz$V>h7HAcO$fF7&Y8HG0+8L*f{=emr8S~sgpBmZ*t%u zB{)hQy)RPhT3`b|b@~A2efs+YnXvYLLh~!hfgqo6cvugtL+0IRe}WI&fZG;bIOwz7 z=H=5CJ8B(&ckt0@gH%CZg7E;+u`%WD@UHT=e`l=9!7gvKwyNps h>*(gza7RW*zt;?63#+Fc$7(Z&=Orlz{=JB_{}0J|o^t>I literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/stats_wpcap.gif b/ledset/WpdPack_4_1_2/docs/html/stats_wpcap.gif new file mode 100644 index 0000000000000000000000000000000000000000..f65263185cae5433b2e49e312c3515f6ab39ae4f GIT binary patch literal 5267 zcmeH``9BkmXPP7&-G0AJt`K+&xJbyo^N@}e87zT{oHgy<WR$z_<*^-Ce6VrLVU=RvTnWM zF{bc@Tx5+`4gA3P&^N?j(nCg?BScrHd0t!dEE#dnp~gQF3I{Y zKlk{M_;EXp6EUkC>IP_Ogj7WmVK;JrQfXeX=&}mJ68f2 za>y&Ew98Ps6X4t=K?@D<3_W|lvuLer#HFmnMTZg_Lpat6{kJ{9C&_As^Yrmu7iX_r zTj?0p?8ilZN~njXd!KwPqe*J{H;QyBkp9$`h5RRza+5JORM@|`kQM(GJb)y(nCVJ~ zjYFc<;C2w}^|eaNFn)_#L8fkXMXtOmlvql*=JKq_y|ksGJT{s2Z&4T@P>@B4?o%c5 zQF&Yvfo5}2mBgr&xlVjo1t`F+u>2y5bs}0IGsr$5Ljm=s~XrF zB?Kx=qk-_Pe-5J+5p;QMcCztSe?D!)x`Y;--v>WZ6Gp9N1>q&_Ye%!D42-H28Any;0#AARYc<0&s3iy^j#i4! z3$byT&Anow8<#oOJ2hLdt>*ekKdM57=1fDkf{?DM+;0h@m)nf#2f@76x8fOkbA6pQ z`de715ZQ%p%~$*18`grA*xvTlpWHiaJ2gPkH-_UkX0M!S3;WjmD&|vDPLTnx%JR$~ z?zFe(pS7ll{7Q=>L>C`q&~1MYp0t_X&LQzv>>TCK%QCkCJwo8EG0P)Adpif@hT<$# zAD3{AsY6?XN#8C1;-8bbBjyqsBT?fiHvhsvs&*tzR2yyAmapZWb-{&Sy_AE8E|;og zKX{RN2rl&PmeC2*%Cw6+3%_vygJXu@AT~%<_)!k=jB=J!^Hf&3eK+|O?!h%jhrgsf zu|_w-GtzD@pK%BUn%oG^gkSpy|BBG4?jrX$G9Es$cXfhrPAwGX;O4#aL)b*KGz1l{ z?Jh6pXCx93c0(oA{!GeP@2RM4S2GT>Ood~&b8mse)qZp!?Z8et=!-H@yiqw{~@zU=|J5ijet+|-OJ z`cEFFI(zD49*;^gyK`x%B)zGd-sf2skJj=Rq;iXoMrTK;s^Qo8%XnRwBt=!^r1MC& zd7gkEMVWgYOK$L89)j8a+3)d5*A!otl9v&j+=h=^0>V|en3ON0WxFsXlNnRxAEe;? zd*) z1#+a$?p#r|u2e9hP2StTn*T$4{PvOa57aJ1kswwB?lJ*m?U$wX6aI(*g}LWEuB8tfT@bj}3+8 zZ3Ef*4xK8_QITJ_-6~B#-&1JyiYoSubrwfh+$;kIam;)0tD=ZhfY(oSl`jYN()v9X)QIJW22TvpLjq`8UEm zsEKy6HZaW=$llsnezUkgOiacvnNz{~{6jV$Uxmaw6c_?oC9UHz++U3OoeGNX%a5?S zwsOl&-`g0J8~6tmB!mj2J$f1O5brQdyWDy+W5_Y3e)si?dFv>%FY<qLVR5bjn_Z-F_(LrzH)8?!M!a3<#ZYO@oj->o?A@WzQcpTL!M_ugq* z{JEVUOT5XL4{-+jA4C5>oKyeul78J_E!Y4}n=!cE_EeO0rNzl`xGqVr#DafuduVDK zBNN|zrRYLcg#M=sp1jqEeS5vav)^kn3=({8u4ToAA4Tf%g@a^82utKU~OJNLU$eCoHCf8s)3 zaZSVyy891iB5FFV&kP>$jVSHh=9d|#6OV!tg}{jbY@!GwQH+y#VlPobHt7^FNeYxC z4Nj89Cdo6B6gf%Cdr2y?$*REQbD(53aIywA`644(i<5kLFZrr$$~9n$HYnvLI0cAJ z(PgCQb5acVQtrs6-UFr@n}zXTq?$qfKs^cL>H;=JW&6QSKw-E&7=#5o{u%bb z41QQeqQXq#AxOdoEa3!{pfKQ7dlDo7g2sY3L*d>Ua4|o4gIQYZ9^x$!VW$D<03bb} zuq-oZxh%4QgREd6oCINYP-NBTwD(XHm6I0lhwR=%O@m;Q8t6qvS{oy=7l8TzM9zWI zdKst<7IFcI{1=$9yNAXAQTZU$3h z8u&+R$ZO7-Z!cv1L&COBT|B~4Fz&{=>?8Q#!qYK1M*M;tjVW{wEcXDMHB73y}LYa`Vmt>2NtYN}f1&`^k1dc+~-{Lp@GlF#T7C0yXyRdXWk4QxJ z%jT1anaj>aT$mN%8JeMyzZ8?bFopR!h55$L)z!f?z>4pC6*;VE^IJ+l$Fdb#^Nv)P zDshYT{EPnPD zJ9<_%de`L`9*mWFZI?;G2yWGR!t$>V!OI<5vX61|$OVWdXl2AcLEZbASdW=-kD;=5 zVGb0JT`PayY8QO5Vp8yaWx3JlU08H%6`#CUPM}wvopkSR^in@dOvT|KefCg!FO^;I zbL+ktIMQ)BlGk;TuCzC%?}0`O2}Hu4>~#Y$^*^11Kq$D6?BAtr?N0T&*Cl2n!qvrEqYR=~l|@ zH02|gvLIi(q+7e}Qp<6%$-fvq8BqIWy7nu#_B*#WW&*M0Qnwphx2IbxIRV?BuH$p- ze&Fup1L}{u)(ep-_ioe+Gwa0=b#-z9oyoo%)AdrW4J+LG=%!0H(gD&l4az)-85!CGTk;V;fhe8?85J zleor3-G--u^k8!1Jp|o&hH|IB_F>@jUgL^lpU1mpO?o^~waAbe#K4w- z8Af(sYaY3dzy;!FtS&8kJd2jNCFSX9#`t2_8r)A05oOwnQfm}i8eAKD0wqYIOmA0a zeU8^vwd#02{&A>O#h%0Cr-JPbdTofA)(3ccv_c0>v!hm_31!(9t=SH?Y{!#5nk=49 z^_$MP8XZw>8%8wRk=rab+S8ex^N0?TD}7_8b5oDZ3u6|~RJDq_HI6Y~!^_@SwzB#e zHXE(!qHn78-YDxc1%G#9cWY;&q znyy37=^GoJfg2s)Tq_*$c9ss-oTt9$x%w48I;9FU{gO^|=DRA*W<@RLxmo(n-?U2J zyE|gkdxRFxo2B}q)Vq4!&hhj=acz;7^g2ZMC&ZhuflfKG-n-A=iYitt+DkiG(O$;a z@v;5NvGJD`dA+NBJ&-T8Nm{H@yy_`DD^si<@jE6#k)5Yin?s1rZ)5+&u}6B@uWMLO z^y4s!eSZ;HMKv!f6q|`wz2O8ZN&f{I*(K!Kw;|GUHom@LAetuDaWt@BH@-`h+3)+I zpH1#z#k2lFys;s7NBr*cn;E#n>pS-Q^^Qngvs+sgbI>xdJtJvECP3H5Bw(m8qKWYY!c6I*L@5@CFMt$iF z`7$J$Ffgq(G_o-;@jJd7IedaLY#`RW9pABGHLOthUeZ0j$9KR_t7V1W+&Vm;<>JsAsx25nBN iC)0S26Jc`=y>~wVWGL~dn#d#FCbAswlM(^~djAJB`x`L; literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/structJIT__BPF__Filter.html b/ledset/WpdPack_4_1_2/docs/html/structJIT__BPF__Filter.html new file mode 100644 index 0000000..d0736f6 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structJIT__BPF__Filter.html @@ -0,0 +1,88 @@ + + + + +WinPcap: JIT_BPF_Filter Struct Reference + + + + + + +
+

JIT_BPF_Filter Struct Reference
+ +[NPF Just-in-time compiler definitions] +

+

Structure describing a x86 filtering program created by the jitter. +More...

+ +

#include <jitter.h>

+ + + + + +

Data Fields

BPF_filter_function Function
 The x86 filtering binary, in the form of a BPF_filter_function.
PINT mem
+

Detailed Description

+

Structure describing a x86 filtering program created by the jitter.

+ +

Definition at line 95 of file jitter.h.

+

Field Documentation

+ +
+ +
+ +

The x86 filtering binary, in the form of a BPF_filter_function.

+ +

Definition at line 96 of file jitter.h.

+ +
+
+ +
+
+ + + + +
PINT mem
+
+
+ +

Definition at line 97 of file jitter.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structPacketHeader.html b/ledset/WpdPack_4_1_2/docs/html/structPacketHeader.html new file mode 100644 index 0000000..b89aef3 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structPacketHeader.html @@ -0,0 +1,92 @@ + + + + +WinPcap: PacketHeader Struct Reference + + + + + + +
+

PacketHeader Struct Reference
+ +[NPF structures and definitions] +

+

Structure prepended to each packet in the kernel buffer pool. +More...

+ +

#include <Packet.h>

+ + + + + + +

Data Fields

ULONG SN
 Sequence number of the packet.
struct bpf_hdr header
 bpf header, created by the tap, and copied unmodified to user level programs.
+

Detailed Description

+

Structure prepended to each packet in the kernel buffer pool.

+

Each packet in one of the kernel buffers is prepended by this header. It encapsulates the bpf_header, which will be passed to user level programs, as well as the sequence number of the packet, set by the producer (the tap function), and used by the consumer (the read function) to "reorder" the packets contained in the various kernel buffers.

+ +

Definition at line 341 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
struct bpf_hdr header [read]
+
+
+ +

bpf header, created by the tap, and copied unmodified to user level programs.

+ +

Definition at line 344 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG SN
+
+
+ +

Sequence number of the packet.

+ +

Definition at line 343 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct__DEVICE__EXTENSION.html b/ledset/WpdPack_4_1_2/docs/html/struct__DEVICE__EXTENSION.html new file mode 100644 index 0000000..6896fb8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct__DEVICE__EXTENSION.html @@ -0,0 +1,90 @@ + + + + +WinPcap: _DEVICE_EXTENSION Struct Reference + + + + + + +
+

_DEVICE_EXTENSION Struct Reference
+ +[NPF structures and definitions] +

+

Port device extension. +More...

+ +

#include <Packet.h>

+ + + + + +

Data Fields

NDIS_STRING AdapterName
 Name of the adapter.
PWSTR ExportString
+

Detailed Description

+

Port device extension.

+

Structure containing some data relative to every adapter on which NPF is bound.

+ +

Definition at line 196 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
NDIS_STRING AdapterName
+
+
+ +

Name of the adapter.

+ +

Definition at line 197 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PWSTR ExportString
+
+
+

Name of the exported device, i.e. name that the applications will use to open this adapter through WinPcap.

+ +

Definition at line 198 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct__INTERNAL__REQUEST.html b/ledset/WpdPack_4_1_2/docs/html/struct__INTERNAL__REQUEST.html new file mode 100644 index 0000000..dc12df9 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct__INTERNAL__REQUEST.html @@ -0,0 +1,124 @@ + + + + +WinPcap: _INTERNAL_REQUEST Struct Reference + + + + + + +
+

_INTERNAL_REQUEST Struct Reference
+ +[NPF structures and definitions] +

+

Stores an OID request. +More...

+ +

#include <Packet.h>

+ + + + + + + + +

Data Fields

LIST_ENTRY ListElement
 Used to handle lists of requests.
NDIS_EVENT InternalRequestCompletedEvent
NDIS_REQUEST Request
 The structure with the actual request, that will be passed to NdisRequest().
NDIS_STATUS RequestStatus
+

Detailed Description

+

Stores an OID request.

+

This structure is used by the driver to perform OID query or set operations on the underlying NIC driver. The OID operations be performed usually only by network drivers, but NPF exports this mechanism to user-level applications through an IOCTL interface. The driver uses this structure to wrap a NDIS_REQUEST structure. This allows to handle correctly the callback structure of NdisRequest(), handling multiple requests and maintaining information about the IRPs to complete.

+ +

Definition at line 163 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
NDIS_EVENT InternalRequestCompletedEvent
+
+
+ +

Definition at line 167 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LIST_ENTRY ListElement
+
+
+ +

Used to handle lists of requests.

+ +

Definition at line 164 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_REQUEST Request
+
+
+ +

The structure with the actual request, that will be passed to NdisRequest().

+ +

Definition at line 168 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_STATUS RequestStatus
+
+
+ +

Definition at line 169 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct__OPEN__INSTANCE.html b/ledset/WpdPack_4_1_2/docs/html/struct__OPEN__INSTANCE.html new file mode 100644 index 0000000..bdb2669 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct__OPEN__INSTANCE.html @@ -0,0 +1,978 @@ + + + + +WinPcap: _OPEN_INSTANCE Struct Reference + + + + + + +
+

_OPEN_INSTANCE Struct Reference
+ +[NPF structures and definitions] +

+

Contains the state of a running instance of the NPF driver. +More...

+ +

#include <Packet.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Fields

PDEVICE_EXTENSION DeviceExtension
NDIS_HANDLE AdapterHandle
 NDIS idetifier of the adapter used by this instance.
UINT Medium
NDIS_HANDLE PacketPool
 Pool of NDIS_PACKET structures used to transfer the packets from and to the NIC driver.
KSPIN_LOCK RequestSpinLock
 SpinLock used to synchronize the OID requests.
LIST_ENTRY RequestList
 List of pending OID requests.
LIST_ENTRY ResetIrpList
 List of pending adapter reset requests.
INTERNAL_REQUEST Requests [MAX_REQUESTS]
 Array of structures that wrap every single OID request.
PMDL BufferMdl
 Pointer to a Memory descriptor list (MDL) that maps the circular buffer's memory.
PKEVENT ReadEvent
 Pointer to the event on which the read calls on this instance must wait.
PUCHAR bpfprogram
UINT MinToCopy
LARGE_INTEGER TimeOut
int mode
 Working mode of the driver. See PacketSetMode() for details.
LARGE_INTEGER Nbytes
 Amount of bytes accepted by the filter when this instance is in statistical mode.
LARGE_INTEGER Npackets
 Number of packets accepted by the filter when this instance is in statistical mode.
NDIS_SPIN_LOCK CountersLock
 SpinLock that protects the statistical mode counters.
UINT Nwrites
ULONG Multiple_Write_Counter
 Counts the number of times a single write has already physically repeated.
NDIS_EVENT WriteEvent
 Event used to synchronize the multiple write process.
BOOLEAN WriteInProgress
NDIS_SPIN_LOCK WriteLock
 SpinLock that protects the WriteInProgress variable.
NDIS_EVENT NdisRequestEvent
 Event used to synchronize I/O requests with the callback structure of NDIS.
BOOLEAN SkipSentPackets
 True if this instance should not capture back the packets that it transmits.
NDIS_STATUS IOStatus
 Maintains the status of and OID request call, that will be passed to the application.
HANDLE DumpFileHandle
 Handle of the file used in dump mode.
PFILE_OBJECT DumpFileObject
 Pointer to the object of the file used in dump mode.
PKTHREAD DumpThreadObject
 Pointer to the object of the thread used in dump mode.
HANDLE DumpThreadHandle
 Handle of the thread created by dump mode to asynchronously move the buffer to disk.
NDIS_EVENT DumpEvent
 Event used to synchronize the dump thread with the tap when the instance is in dump mode.
LARGE_INTEGER DumpOffset
 Current offset in the dump file.
UNICODE_STRING DumpFileName
 String containing the name of the dump file.
UINT MaxDumpBytes
UINT MaxDumpPacks
BOOLEAN DumpLimitReached
NDIS_SPIN_LOCK MachineLock
 SpinLock that protects the BPF filter and the TME engine, if in use.
UINT MaxFrameSize
CpuPrivateData CpuData [sizeof(KAFFINITY)*8]
 Pool of kernel buffer structures, one for each CPU.
ULONG ReaderSN
 Sequence number of the next packet to be read from the pool of kernel buffers.
ULONG WriterSN
ULONG Size
 Size of each kernel buffer contained in the CpuData field.
ULONG AdapterHandleUsageCounter
NDIS_SPIN_LOCK AdapterHandleLock
ULONG AdapterBindingStatus
 Specifies if NPF is still bound to the adapter used by this instance, it's unbinding or it's not bound.
NDIS_EVENT NdisOpenCloseCompleteEvent
NDIS_EVENT NdisWriteCompleteEvent
 Event that is signalled when all the packets have been successfully sent by NdisSend (and corresponfing sendComplete has been called).
NTSTATUS OpenCloseStatus
ULONG TransmitPendingPackets
 Specifies the number of packets that are pending to be transmitted, i.e. have been submitted to NdisSendXXX but the SendComplete has not been called yet.
ULONG NumPendingIrps
BOOLEAN ClosePending
NDIS_SPIN_LOCK OpenInUseLock
+

Detailed Description

+

Contains the state of a running instance of the NPF driver.

+

This is the most important structure of NPF: it is used by almost all the functions of the driver. An _OPEN_INSTANCE structure is associated with every user-level session, allowing concurrent access to the driver.

+ +

Definition at line 240 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
ULONG AdapterBindingStatus
+
+
+ +

Specifies if NPF is still bound to the adapter used by this instance, it's unbinding or it's not bound.

+ +

Definition at line 315 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_HANDLE AdapterHandle
+
+
+ +

NDIS idetifier of the adapter used by this instance.

+ +

Definition at line 244 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK AdapterHandleLock
+
+
+ +

Definition at line 314 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG AdapterHandleUsageCounter
+
+
+ +

Definition at line 313 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PUCHAR bpfprogram
+
+
+

Pointer to the filtering pseudo-code associated with current instance of the driver. This code is used only in particular situations (for example when the packet received from the NIC driver is stored in two non-consecutive buffers. In normal situations the filtering routine created by the JIT compiler and pointed by the next field is used. See NPF driver internals manual for details on the filtering process.

+ +

Definition at line 254 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PMDL BufferMdl
+
+
+ +

Pointer to a Memory descriptor list (MDL) that maps the circular buffer's memory.

+ +

Definition at line 252 of file Packet.h.

+ +
+
+ +
+
+ + + + +
BOOLEAN ClosePending
+
+
+ +

Definition at line 322 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK CountersLock
+
+
+ +

SpinLock that protects the statistical mode counters.

+ +

Definition at line 271 of file Packet.h.

+ +
+
+ +
+
+ + + + +
CpuPrivateData CpuData[sizeof(KAFFINITY)*8]
+
+
+ +

Pool of kernel buffer structures, one for each CPU.

+ +

Definition at line 308 of file Packet.h.

+ +
+
+ +
+ +
+

Pointer to the _DEVICE_EXTENSION structure of the device on which the instance is bound.

+ +

Definition at line 242 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_EVENT DumpEvent
+
+
+ +

Event used to synchronize the dump thread with the tap when the instance is in dump mode.

+ +

Definition at line 286 of file Packet.h.

+ +
+
+ +
+
+ + + + +
HANDLE DumpFileHandle
+
+
+ +

Handle of the file used in dump mode.

+ +

Definition at line 282 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UNICODE_STRING DumpFileName
+
+
+ +

String containing the name of the dump file.

+ +

Definition at line 288 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PFILE_OBJECT DumpFileObject
+
+
+ +

Pointer to the object of the file used in dump mode.

+ +

Definition at line 283 of file Packet.h.

+ +
+
+ +
+
+ + + + +
BOOLEAN DumpLimitReached
+
+
+

TRUE if the maximum dimension of the dump file (MaxDumpBytes or MaxDumpPacks) is reached.

+ +

Definition at line 294 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LARGE_INTEGER DumpOffset
+
+
+ +

Current offset in the dump file.

+ +

Definition at line 287 of file Packet.h.

+ +
+
+ +
+
+ + + + +
HANDLE DumpThreadHandle
+
+
+ +

Handle of the thread created by dump mode to asynchronously move the buffer to disk.

+ +

Definition at line 285 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PKTHREAD DumpThreadObject
+
+
+ +

Pointer to the object of the thread used in dump mode.

+ +

Definition at line 284 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_STATUS IOStatus
+
+
+ +

Maintains the status of and OID request call, that will be passed to the application.

+ +

Definition at line 281 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK MachineLock
+
+
+ +

SpinLock that protects the BPF filter and the TME engine, if in use.

+ +

Definition at line 301 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT MaxDumpBytes
+
+
+

Maximum dimension in bytes of the dump file. If the dump file reaches this size it will be closed. A value of 0 means unlimited size.

+ +

Definition at line 289 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT MaxDumpPacks
+
+
+

Maximum number of packets that will be saved in the dump file. If this number of packets is reached the dump will be closed. A value of 0 means unlimited number of packets.

+ +

Definition at line 291 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT MaxFrameSize
+
+
+

Maximum frame size that the underlying MAC acceptes. Used to perform a check on the size of the frames sent with NPF_Write() or NPF_BufferedWrite().

+ +

Definition at line 302 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT Medium
+
+
+

Type of physical medium the underlying NDIS driver uses. See the documentation of NdisOpenAdapter in the MS DDK for details.

+ +

Definition at line 245 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT MinToCopy
+
+
+

Minimum amount of data in the circular buffer that unlocks a read. Set with the BIOCSMINTOCOPY IOCTL.

+ +

Definition at line 263 of file Packet.h.

+ +
+
+ +
+
+ + + + +
int mode
+
+
+ +

Working mode of the driver. See PacketSetMode() for details.

+ +

Definition at line 268 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Multiple_Write_Counter
+
+
+ +

Counts the number of times a single write has already physically repeated.

+ +

Definition at line 274 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LARGE_INTEGER Nbytes
+
+
+ +

Amount of bytes accepted by the filter when this instance is in statistical mode.

+ +

Definition at line 269 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_EVENT NdisOpenCloseCompleteEvent
+
+
+ +

Definition at line 317 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_EVENT NdisRequestEvent
+
+
+ +

Event used to synchronize I/O requests with the callback structure of NDIS.

+ +

Definition at line 279 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_EVENT NdisWriteCompleteEvent
+
+
+ +

Event that is signalled when all the packets have been successfully sent by NdisSend (and corresponfing sendComplete has been called).

+ +

Definition at line 318 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LARGE_INTEGER Npackets
+
+
+ +

Number of packets accepted by the filter when this instance is in statistical mode.

+ +

Definition at line 270 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG NumPendingIrps
+
+
+ +

Definition at line 321 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT Nwrites
+
+
+

Number of times a single write must be physically repeated. See NPF driver internals manual for an explanation

+ +

Definition at line 272 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NTSTATUS OpenCloseStatus
+
+
+ +

Definition at line 319 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK OpenInUseLock
+
+
+ +

Definition at line 323 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_HANDLE PacketPool
+
+
+ +

Pool of NDIS_PACKET structures used to transfer the packets from and to the NIC driver.

+ +

Definition at line 247 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG ReaderSN
+
+
+ +

Sequence number of the next packet to be read from the pool of kernel buffers.

+ +

Definition at line 309 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PKEVENT ReadEvent
+
+
+ +

Pointer to the event on which the read calls on this instance must wait.

+ +

Definition at line 253 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LIST_ENTRY RequestList
+
+
+ +

List of pending OID requests.

+ +

Definition at line 249 of file Packet.h.

+ +
+
+ +
+
+ + + + +
INTERNAL_REQUEST Requests[MAX_REQUESTS]
+
+
+ +

Array of structures that wrap every single OID request.

+ +

Definition at line 251 of file Packet.h.

+ +
+
+ +
+
+ + + + +
KSPIN_LOCK RequestSpinLock
+
+
+ +

SpinLock used to synchronize the OID requests.

+ +

Definition at line 248 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LIST_ENTRY ResetIrpList
+
+
+ +

List of pending adapter reset requests.

+ +

Definition at line 250 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Size
+
+
+ +

Size of each kernel buffer contained in the CpuData field.

+ +

Definition at line 312 of file Packet.h.

+ +
+
+ +
+
+ + + + +
BOOLEAN SkipSentPackets
+
+
+ +

True if this instance should not capture back the packets that it transmits.

+ +

Definition at line 280 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LARGE_INTEGER TimeOut
+
+
+

Timeout after which a read is released, also if the amount of data in the buffer is less than MinToCopy. Set with the BIOCSRTIMEOUT IOCTL.

+ +

Definition at line 265 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG TransmitPendingPackets
+
+
+ +

Specifies the number of packets that are pending to be transmitted, i.e. have been submitted to NdisSendXXX but the SendComplete has not been called yet.

+ +

Definition at line 320 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_EVENT WriteEvent
+
+
+ +

Event used to synchronize the multiple write process.

+ +

Definition at line 275 of file Packet.h.

+ +
+
+ +
+
+ + + + +
BOOLEAN WriteInProgress
+
+
+

True if a write is currently in progress. NPF currently allows a single wite on the same open instance.

+ +

Definition at line 276 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK WriteLock
+
+
+ +

SpinLock that protects the WriteInProgress variable.

+ +

Definition at line 278 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG WriterSN
+
+
+

Sequence number of the next packet to be written in the pool of kernel buffers. These two sequence numbers are unique for each capture instance.

+ +

Definition at line 310 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__OID__DATA.html b/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__OID__DATA.html new file mode 100644 index 0000000..75c2a30 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__OID__DATA.html @@ -0,0 +1,107 @@ + + + + +WinPcap: _PACKET_OID_DATA Struct Reference + + + + + + +
+

_PACKET_OID_DATA Struct Reference
+ +[NPF structures and definitions] +

+

Structure containing an OID request. +More...

+ +

#include <Packet.h>

+ + + + + + +

Data Fields

ULONG Oid
ULONG Length
 Length of the data field.
UCHAR Data [1]
+

Detailed Description

+

Structure containing an OID request.

+

It is used by the PacketRequest() function to send an OID to the interface card driver. It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, the list of the multicast groups defined on it, and so on.

+ +

Definition at line 143 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
UCHAR Data[1]
+
+
+

variable-lenght field that contains the information passed to or received from the adapter.

+ +

Definition at line 147 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Length
+
+
+ +

Length of the data field.

+ +

Definition at line 146 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Oid
+
+
+

OID code. See the Microsoft DDK documentation or the file ntddndis.h for a complete list of valid codes.

+ +

Definition at line 144 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__RESERVED.html b/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__RESERVED.html new file mode 100644 index 0000000..6fe0825 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct__PACKET__RESERVED.html @@ -0,0 +1,147 @@ + + + + +WinPcap: _PACKET_RESERVED Struct Reference + + + + + + +
+

_PACKET_RESERVED Struct Reference
+ +[NPF structures and definitions] +

+

Contains a NDIS packet. +More...

+ +

#include <Packet.h>

+ + + + + + + + + + + +

Data Fields

LIST_ENTRY ListElement
 Used to handle lists of packets.
PIRP Irp
 Irp that performed the request.
PMDL pMdl
 MDL mapping the buffer of the packet.
BOOLEAN FreeBufAfterWrite
ULONG Cpu
 The CPU on which the packet was pulled out of the linked list of free packets.
+

Detailed Description

+

Contains a NDIS packet.

+

The driver uses this structure to wrap a NDIS_PACKET structure. This allows to handle correctly the callback structure of NdisTransferData(), handling multiple requests and maintaining information about the IRPs to complete.

+ +

Definition at line 180 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
ULONG Cpu
+
+
+ +

The CPU on which the packet was pulled out of the linked list of free packets.

+ +

Definition at line 186 of file Packet.h.

+ +
+
+ +
+
+ + + + +
BOOLEAN FreeBufAfterWrite
+
+
+

True if the memory buffer associated with the packet must be freed after a call to NdisSend().

+ +

Definition at line 184 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PIRP Irp
+
+
+ +

Irp that performed the request.

+ +

Definition at line 182 of file Packet.h.

+ +
+
+ +
+
+ + + + +
LIST_ENTRY ListElement
+
+
+ +

Used to handle lists of packets.

+ +

Definition at line 181 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PMDL pMdl
+
+
+ +

MDL mapping the buffer of the packet.

+ +

Definition at line 183 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/struct____CPU__Private__Data.html b/ledset/WpdPack_4_1_2/docs/html/struct____CPU__Private__Data.html new file mode 100644 index 0000000..75b690b --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/struct____CPU__Private__Data.html @@ -0,0 +1,257 @@ + + + + +WinPcap: __CPU_Private_Data Struct Reference + + + + + + +
+

__CPU_Private_Data Struct Reference
+ +[NPF structures and definitions] +

+

Kernel buffer of each CPU. +More...

+ +

#include <Packet.h>

+ + + + + + + + + + + + + + + + + + + + + +

Data Fields

ULONG P
 Zero-based index of the producer in the buffer. It indicates the first free byte to be written.
ULONG C
 Zero-based index of the consumer in the buffer. It indicates the first free byte to be read.
ULONG Free
 Number of the free bytes in the buffer.
PUCHAR Buffer
 Pointer to the kernel buffer used to capture packets.
ULONG Accepted
ULONG Received
ULONG Dropped
NDIS_SPIN_LOCK BufferLock
 It protects the buffer associated with this CPU.
PMDL TransferMdl1
 MDL used to map the portion of the buffer that will contain an incoming packet.
PMDL TransferMdl2
 Second MDL used to map the portion of the buffer that will contain an incoming packet.
ULONG NewP
 Used by NdisTransferData() (when we call NdisTransferData, p index must be updated only in the TransferDataComplete.
+

Detailed Description

+

Kernel buffer of each CPU.

+

Structure containing the kernel buffer (and other CPU related fields) used to capture packets.

+ +

Definition at line 207 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
ULONG Accepted
+
+
+

Number of packet that current capture instance acepted, from its opening. A packet is accepted if it passes the filter and fits in the buffer. Accepted packets are the ones that reach the application. This number is related to the particular CPU this structure is referring to.

+ +

Definition at line 213 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PUCHAR Buffer
+
+
+ +

Pointer to the kernel buffer used to capture packets.

+ +

Definition at line 212 of file Packet.h.

+ +
+
+ +
+
+ + + + +
NDIS_SPIN_LOCK BufferLock
+
+
+ +

It protects the buffer associated with this CPU.

+ +

Definition at line 225 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG C
+
+
+ +

Zero-based index of the consumer in the buffer. It indicates the first free byte to be read.

+ +

Definition at line 210 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Dropped
+
+
+

Number of packet that current instance had to drop, from its opening. A packet is dropped if there is no more space to store it in the circular buffer that the driver associates to current instance. This number is related to the particular CPU this structure is referring to.

+ +

Definition at line 221 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Free
+
+
+ +

Number of the free bytes in the buffer.

+ +

Definition at line 211 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG NewP
+
+
+ +

Used by NdisTransferData() (when we call NdisTransferData, p index must be updated only in the TransferDataComplete.

+ +

Definition at line 228 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG P
+
+
+ +

Zero-based index of the producer in the buffer. It indicates the first free byte to be written.

+ +

Definition at line 209 of file Packet.h.

+ +
+
+ +
+
+ + + + +
ULONG Received
+
+
+

Number of packets received by current instance from its opening, i.e. number of packet received by the network adapter since the beginning of the capture/monitoring/dump session. This number is related to the particular CPU this structure is referring to.

+ +

Definition at line 217 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PMDL TransferMdl1
+
+
+ +

MDL used to map the portion of the buffer that will contain an incoming packet.

+ +

Definition at line 226 of file Packet.h.

+ +
+
+ +
+
+ + + + +
PMDL TransferMdl2
+
+
+ +

Second MDL used to map the portion of the buffer that will contain an incoming packet.

+ +

Definition at line 227 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structactive__pars.html b/ledset/WpdPack_4_1_2/docs/html/structactive__pars.html new file mode 100644 index 0000000..800860c --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structactive__pars.html @@ -0,0 +1,94 @@ + + + + +WinPcap: active_pars Struct Reference + + + + + + +
+

active_pars Struct Reference

+

#include <rpcapd.h>

+ + + + + +

Data Fields

char address [MAX_LINE+1]
char port [MAX_LINE+1]
int ai_family
+

Detailed Description

+ +

Definition at line 44 of file rpcapd.h.

+

Field Documentation

+ +
+
+ + + + +
char address[MAX_LINE+1]
+
+
+ +

Definition at line 46 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
int ai_family
+
+
+ +

Definition at line 48 of file rpcapd.h.

+ +
+
+ +
+
+ + + + +
char port[MAX_LINE+1]
+
+
+ +

Definition at line 47 of file rpcapd.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structactivehosts.html b/ledset/WpdPack_4_1_2/docs/html/structactivehosts.html new file mode 100644 index 0000000..382c20f --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structactivehosts.html @@ -0,0 +1,102 @@ + + + + +WinPcap: activehosts Struct Reference + + + + + + +
+

activehosts Struct Reference
+ +[Internal Structures and Definitions] +

+

Keeps a list of all the opened connections in the active mode. +More...

+ +

#include <pcap-remote.h>

+ + + + + +

Data Fields

struct sockaddr_storage host
SOCKET sockctrl
struct activehostsnext
+

Detailed Description

+

Keeps a list of all the opened connections in the active mode.

+

This structure defines a linked list of items that are needed to keep the info required to manage the active mode. In other words, when a new connection in active mode starts, this structure is updated so that it reflects the list of active mode connections currently opened. This structure is required by findalldevs() and open_remote() to see if they have to open a new control connection toward the host, or they already have a control connection in place.

+ +

Definition at line 133 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
struct sockaddr_storage host [read]
+
+
+ +

Definition at line 135 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
struct activehosts* next [read]
+
+
+ +

Definition at line 137 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
SOCKET sockctrl
+
+
+ +

Definition at line 136 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structbinary__stream.html b/ledset/WpdPack_4_1_2/docs/html/structbinary__stream.html new file mode 100644 index 0000000..918b059 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structbinary__stream.html @@ -0,0 +1,129 @@ + + + + +WinPcap: binary_stream Struct Reference + + + + + + +
+

binary_stream Struct Reference
+ +[NPF Just-in-time compiler definitions] +

+

A stream of X86 binary code. +More...

+ +

#include <jitter.h>

+ + + + + + + + + + +

Data Fields

INT cur_ip
 Current X86 instruction pointer.
INT bpf_pc
 Current BPF instruction pointer, i.e. position in the BPF program reached by the jitter.
PCHAR ibuf
 Instruction buffer, contains the X86 generated code.
PUINT refs
 Jumps reference table.
+

Detailed Description

+

A stream of X86 binary code.

+ +

Definition at line 69 of file jitter.h.

+

Field Documentation

+ +
+
+ + + + +
INT bpf_pc
+
+
+ +

Current BPF instruction pointer, i.e. position in the BPF program reached by the jitter.

+ +

Definition at line 71 of file jitter.h.

+ +
+
+ +
+
+ + + + +
INT cur_ip
+
+
+ +

Current X86 instruction pointer.

+ +

Definition at line 70 of file jitter.h.

+ +
+
+ +
+
+ + + + +
PCHAR ibuf
+
+
+ +

Instruction buffer, contains the X86 generated code.

+ +

Definition at line 72 of file jitter.h.

+ +
+
+ +
+
+ + + + +
PUINT refs
+
+
+ +

Jumps reference table.

+ +

Definition at line 73 of file jitter.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structdaemon__slpars.html b/ledset/WpdPack_4_1_2/docs/html/structdaemon__slpars.html new file mode 100644 index 0000000..82caf02 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structdaemon__slpars.html @@ -0,0 +1,126 @@ + + + + +WinPcap: daemon_slpars Struct Reference + + + + + + +
+

daemon_slpars Struct Reference

+

Structure that keeps the parameters needed by the daemon_serviceloop() function. +More...

+ +

#include <daemon.h>

+ + + + + + + + + + +

Data Fields

SOCKET sockctrl
 SOCKET ID of the control connection.
int isactive
 Not null if the daemon has to run in active mode.
int nullAuthAllowed
 '1' if we permit NULL authentication, '0' otherwise
int activeclose
 '1' if the client closed the control connection explicitely; used in active mode only
+

Detailed Description

+

Structure that keeps the parameters needed by the daemon_serviceloop() function.

+ +

Definition at line 37 of file daemon.h.

+

Field Documentation

+ +
+
+ + + + +
int activeclose
+
+
+ +

'1' if the client closed the control connection explicitely; used in active mode only

+ +

Definition at line 42 of file daemon.h.

+ +
+
+ +
+
+ + + + +
int isactive
+
+
+ +

Not null if the daemon has to run in active mode.

+ +

Definition at line 40 of file daemon.h.

+ +
+
+ +
+
+ + + + +
int nullAuthAllowed
+
+
+ +

'1' if we permit NULL authentication, '0' otherwise

+ +

Definition at line 41 of file daemon.h.

+ +
+
+ +
+
+ + + + +
SOCKET sockctrl
+
+
+ +

SOCKET ID of the control connection.

+ +

Definition at line 39 of file daemon.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpacket__file__header.html b/ledset/WpdPack_4_1_2/docs/html/structpacket__file__header.html new file mode 100644 index 0000000..f2b0b69 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpacket__file__header.html @@ -0,0 +1,187 @@ + + + + +WinPcap: packet_file_header Struct Reference + + + + + + +
+

packet_file_header Struct Reference
+ +[NPF structures and definitions] +

+

Header of a libpcap dump file. +More...

+ +

#include <Packet.h>

+ + + + + + + + + + + + + + + + +

Data Fields

UINT magic
 Libpcap magic number.
USHORT version_major
 Libpcap major version.
USHORT version_minor
 Libpcap minor version.
UINT thiszone
 Gmt to local correction.
UINT sigfigs
 Accuracy of timestamps.
UINT snaplen
 Length of the max saved portion of each packet.
UINT linktype
 Data link type (DLT_*). See win_bpf.h for details.
+

Detailed Description

+

Header of a libpcap dump file.

+

Used when a driver instance is set in dump mode to create a libpcap-compatible file.

+ +

Definition at line 106 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
UINT linktype
+
+
+ +

Data link type (DLT_*). See win_bpf.h for details.

+ +

Definition at line 114 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT magic
+
+
+ +

Libpcap magic number.

+ +

Definition at line 108 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT sigfigs
+
+
+ +

Accuracy of timestamps.

+ +

Definition at line 112 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT snaplen
+
+
+ +

Length of the max saved portion of each packet.

+ +

Definition at line 113 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT thiszone
+
+
+ +

Gmt to local correction.

+ +

Definition at line 111 of file Packet.h.

+ +
+
+ +
+
+ + + + +
USHORT version_major
+
+
+ +

Libpcap major version.

+ +

Definition at line 109 of file Packet.h.

+ +
+
+ +
+
+ + + + +
USHORT version_minor
+
+
+ +

Libpcap minor version.

+ +

Definition at line 110 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__addr.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__addr.html new file mode 100644 index 0000000..d374db5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__addr.html @@ -0,0 +1,148 @@ + + + + +WinPcap: pcap_addr Struct Reference + + + + + + +
+

pcap_addr Struct Reference
+ +[Definitions] +

+

Representation of an interface address, used by pcap_findalldevs(). +More...

+ +

#include <pcap.h>

+ + + + + + + + + + + + +

Data Fields

struct pcap_addrnext
 if not NULL, a pointer to the next element in the list; NULL for the last element of the list
struct sockaddr * addr
 a pointer to a struct sockaddr containing an address
struct sockaddr * netmask
 if not NULL, a pointer to a struct sockaddr that contains the netmask corresponding to the address pointed to by addr.
struct sockaddr * broadaddr
 if not NULL, a pointer to a struct sockaddr that contains the broadcast address corre sponding to the address pointed to by addr; may be null if the interface doesn't support broadcasts
struct sockaddr * dstaddr
 if not NULL, a pointer to a struct sockaddr that contains the destination address corre sponding to the address pointed to by addr; may be null if the interface isn't a point- to-point interface
+

Detailed Description

+

Representation of an interface address, used by pcap_findalldevs().

+ +

Definition at line 161 of file incs/pcap.h.

+

Field Documentation

+ +
+
+ + + + +
struct sockaddr* addr [read]
+
+
+ +

a pointer to a struct sockaddr containing an address

+ +

Definition at line 163 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr* broadaddr [read]
+
+
+ +

if not NULL, a pointer to a struct sockaddr that contains the broadcast address corre sponding to the address pointed to by addr; may be null if the interface doesn't support broadcasts

+ +

Definition at line 165 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr* dstaddr [read]
+
+
+ +

if not NULL, a pointer to a struct sockaddr that contains the destination address corre sponding to the address pointed to by addr; may be null if the interface isn't a point- to-point interface

+ +

Definition at line 166 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr* netmask [read]
+
+
+ +

if not NULL, a pointer to a struct sockaddr that contains the netmask corresponding to the address pointed to by addr.

+ +

Definition at line 164 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct pcap_addr* next [read]
+
+
+ +

if not NULL, a pointer to the next element in the list; NULL for the last element of the list

+ +

Definition at line 162 of file incs/pcap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__file__header.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__file__header.html new file mode 100644 index 0000000..cbdb480 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__file__header.html @@ -0,0 +1,192 @@ + + + + +WinPcap: pcap_file_header Struct Reference + + + + + + +
+

pcap_file_header Struct Reference
+ +[Definitions] +

+

Header of a libpcap dump file. +More...

+ +

#include <pcap.h>

+ + + + + + + + + + + + + + + +

Data Fields

bpf_u_int32 magic
u_short version_major
 Libpcap major version.
u_short version_minor
 Libpcap minor version.
bpf_int32 thiszone
 gmt to local correction
bpf_u_int32 sigfigs
 accuracy of timestamps
bpf_u_int32 snaplen
 max length saved portion of each pkt
bpf_u_int32 linktype
 data link type (LINKTYPE_*)
+

Detailed Description

+

Header of a libpcap dump file.

+

The first record in the file contains saved values for some of the flags used in the printout phases of tcpdump. Many fields here are 32 bit ints so compilers won't insert unwanted padding; these files need to be interchangeable across architectures.

+

Do not change the layout of this structure, in any way (this includes changes that only affect the length of fields in this structure).

+

Also, do not change the interpretation of any of the members of this structure, in any way (this includes using values other than LINKTYPE_ values, as defined in "savefile.c", in the "linktype" field).

+

Instead:

+

introduce a new structure for the new format, if the layout of the structure changed;

+

send mail to "tcpdump-workers@tcpdump.org", requesting a new magic number for your new capture file format, and, when you get the new magic number, put it in "savefile.c";

+

use that magic number for save files with the changed file header;

+

make the code in "savefile.c" capable of reading files with the old file header as well as files with the new file header (using the magic number to determine the header format).

+

Then supply the changes to "patches@tcpdump.org", so that future versions of libpcap and programs that use it (such as tcpdump) will be able to read your new capture file format.

+ +

Definition at line 110 of file incs/pcap.h.

+

Field Documentation

+ +
+
+ + + + +
bpf_u_int32 linktype
+
+
+ +

data link type (LINKTYPE_*)

+ +

Definition at line 117 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
bpf_u_int32 magic
+
+
+ +

Definition at line 111 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
bpf_u_int32 sigfigs
+
+
+ +

accuracy of timestamps

+ +

Definition at line 115 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
bpf_u_int32 snaplen
+
+
+ +

max length saved portion of each pkt

+ +

Definition at line 116 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
bpf_int32 thiszone
+
+
+ +

gmt to local correction

+ +

Definition at line 114 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_short version_major
+
+
+ +

Libpcap major version.

+ +

Definition at line 112 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_short version_minor
+
+
+ +

Libpcap minor version.

+ +

Definition at line 113 of file incs/pcap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__if.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__if.html new file mode 100644 index 0000000..3f455a8 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__if.html @@ -0,0 +1,148 @@ + + + + +WinPcap: pcap_if Struct Reference + + + + + + +
+

pcap_if Struct Reference
+ +[Definitions] +

+

Item in a list of interfaces, used by pcap_findalldevs(). +More...

+ +

#include <pcap.h>

+ + + + + + + + + + + + +

Data Fields

struct pcap_ifnext
 if not NULL, a pointer to the next element in the list; NULL for the last element of the list
char * name
 a pointer to a string giving a name for the device to pass to pcap_open_live()
char * description
 if not NULL, a pointer to a string giving a human-readable description of the device
struct pcap_addraddresses
 a pointer to the first element of a list of addresses for the interface
u_int flags
 PCAP_IF_ interface flags. Currently the only possible flag is PCAP_IF_LOOPBACK, that is set if the interface is a loopback interface.
+

Detailed Description

+

Item in a list of interfaces, used by pcap_findalldevs().

+ +

Definition at line 148 of file incs/pcap.h.

+

Field Documentation

+ +
+
+ + + + +
struct pcap_addr* addresses [read]
+
+
+ +

a pointer to the first element of a list of addresses for the interface

+ +

Definition at line 152 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
char* description
+
+
+ +

if not NULL, a pointer to a string giving a human-readable description of the device

+ +

Definition at line 151 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_int flags
+
+
+ +

PCAP_IF_ interface flags. Currently the only possible flag is PCAP_IF_LOOPBACK, that is set if the interface is a loopback interface.

+ +

Definition at line 153 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
char* name
+
+
+ +

a pointer to a string giving a name for the device to pass to pcap_open_live()

+ +

Definition at line 150 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct pcap_if* next [read]
+
+
+ +

if not NULL, a pointer to the next element in the list; NULL for the last element of the list

+ +

Definition at line 149 of file incs/pcap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__pkthdr.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__pkthdr.html new file mode 100644 index 0000000..9a721e0 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__pkthdr.html @@ -0,0 +1,111 @@ + + + + +WinPcap: pcap_pkthdr Struct Reference + + + + + + +
+

pcap_pkthdr Struct Reference
+ +[Definitions] +

+

Header of a packet in the dump file. +More...

+ +

#include <pcap.h>

+ + + + + + + + +

Data Fields

struct timeval ts
 time stamp
bpf_u_int32 caplen
 length of portion present
bpf_u_int32 len
 length this packet (off wire)
+

Detailed Description

+

Header of a packet in the dump file.

+

Each packet in the dump file is prepended with this generic header. This gets around the problem of different headers for different packet interfaces.

+ +

Definition at line 126 of file incs/pcap.h.

+

Field Documentation

+ +
+
+ + + + +
bpf_u_int32 caplen
+
+
+ +

length of portion present

+ +

Definition at line 128 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
bpf_u_int32 len
+
+
+ +

length this packet (off wire)

+ +

Definition at line 129 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
struct timeval ts [read]
+
+
+ +

time stamp

+ +

Definition at line 127 of file incs/pcap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__rmtauth.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__rmtauth.html new file mode 100644 index 0000000..f846c46 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__rmtauth.html @@ -0,0 +1,115 @@ + + + + +WinPcap: pcap_rmtauth Struct Reference + + + + + + +
+

pcap_rmtauth Struct Reference
+ +[Exported Structures and Definitions] +

+

This structure keeps the information needed to autheticate the user on a remote machine. +More...

+ +

#include <remote-ext.h>

+ + + + + + + + +

Data Fields

int type
 Type of the authentication required.
char * username
 Zero-terminated string containing the username that has to be used on the remote machine for authentication.
char * password
 Zero-terminated string containing the password that has to be used on the remote machine for authentication.
+

Detailed Description

+

This structure keeps the information needed to autheticate the user on a remote machine.

+

The remote machine can either grant or refuse the access according to the information provided. In case the NULL authentication is required, both 'username' and 'password' can be NULL pointers.

+

This structure is meaningless if the source is not a remote interface; in that case, the functions which requires such a structure can accept a NULL pointer as well.

+ +

Definition at line 338 of file remote-ext.h.

+

Field Documentation

+ +
+
+ + + + +
char* password
+
+
+ +

Zero-terminated string containing the password that has to be used on the remote machine for authentication.

+

This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication and it can be NULL.

+ +

Definition at line 365 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
int type
+
+
+ +

Type of the authentication required.

+

In order to provide maximum flexibility, we can support different types of authentication based on the value of this 'type' variable. The currently supported authentication methods are defined into the Remote Authentication Methods Section.

+ +

Definition at line 349 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
char* username
+
+
+ +

Zero-terminated string containing the username that has to be used on the remote machine for authentication.

+

This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication and it can be NULL.

+ +

Definition at line 357 of file remote-ext.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__samp.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__samp.html new file mode 100644 index 0000000..6aaeb84 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__samp.html @@ -0,0 +1,89 @@ + + + + +WinPcap: pcap_samp Struct Reference + + + + + + +
+

pcap_samp Struct Reference
+ +[Exported Structures and Definitions] +

+

This structure defines the information related to sampling. +More...

+ +

#include <remote-ext.h>

+ + + + +

Data Fields

int method
int value
+

Detailed Description

+

This structure defines the information related to sampling.

+

In case the sampling is requested, the capturing device should read only a subset of the packets coming from the source. The returned packets depend on the sampling parameters.

+
Warning:
The sampling process is applied after the filtering process. In other words, packets are filtered first, then the sampling process selects a subset of the 'filtered' packets and it returns them to the caller.
+ +

Definition at line 380 of file remote-ext.h.

+

Field Documentation

+ +
+
+ + + + +
int method
+
+
+

Method used for sampling. Currently, the supported methods are listed in the Sampling Methods Section.

+ +

Definition at line 386 of file remote-ext.h.

+ +
+
+ +
+
+ + + + +
int value
+
+
+

This value depends on the sampling method defined. For its meaning, please check at the Sampling Methods Section.

+ +

Definition at line 392 of file remote-ext.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__send__queue.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__send__queue.html new file mode 100644 index 0000000..f8a8510 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__send__queue.html @@ -0,0 +1,107 @@ + + + + +WinPcap: pcap_send_queue Struct Reference + + + + + + +
+

pcap_send_queue Struct Reference

+

A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit(). +More...

+ +

#include <Win32-Extensions.h>

+ + + + + + + + +

Data Fields

u_int maxlen
 Maximum size of the the queue, in bytes. This variable contains the size of the buffer field.
u_int len
 Current size of the queue, in bytes.
char * buffer
 Buffer containing the packets to be sent.
+

Detailed Description

+

A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit().

+ +

Definition at line 46 of file Win32-Extensions.h.

+

Field Documentation

+ +
+
+ + + + +
char* buffer
+
+
+ +

Buffer containing the packets to be sent.

+ +

Definition at line 50 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
u_int len
+
+
+ +

Current size of the queue, in bytes.

+ +

Definition at line 49 of file Win32-Extensions.h.

+ +
+
+ +
+
+ + + + +
u_int maxlen
+
+
+ +

Maximum size of the the queue, in bytes. This variable contains the size of the buffer field.

+ +

Definition at line 48 of file Win32-Extensions.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structpcap__stat.html b/ledset/WpdPack_4_1_2/docs/html/structpcap__stat.html new file mode 100644 index 0000000..efa5825 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structpcap__stat.html @@ -0,0 +1,130 @@ + + + + +WinPcap: pcap_stat Struct Reference + + + + + + +
+

pcap_stat Struct Reference
+ +[Definitions] +

+

Structure that keeps statistical values on an interface. +More...

+ +

#include <pcap.h>

+ + + + + + + + + + +

Data Fields

u_int ps_recv
 number of packets transited on the network
u_int ps_drop
 number of packets dropped by the driver
u_int ps_ifdrop
 drops by interface, not yet supported
u_int bs_capt
 Win32 specific. number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application. For backward compatibility, pcap_stats() does not fill this member, so use pcap_stats_ex() to get it.
+

Detailed Description

+

Structure that keeps statistical values on an interface.

+

As returned by the pcap_stats()

+ +

Definition at line 136 of file incs/pcap.h.

+

Field Documentation

+ +
+
+ + + + +
u_int bs_capt
+
+
+ +

Win32 specific. number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application. For backward compatibility, pcap_stats() does not fill this member, so use pcap_stats_ex() to get it.

+ +

Definition at line 141 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_int ps_drop
+
+
+ +

number of packets dropped by the driver

+ +

Definition at line 138 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_int ps_ifdrop
+
+
+ +

drops by interface, not yet supported

+ +

Definition at line 139 of file incs/pcap.h.

+ +
+
+ +
+
+ + + + +
u_int ps_recv
+
+
+ +

number of packets transited on the network

+ +

Definition at line 137 of file incs/pcap.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__auth.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__auth.html new file mode 100644 index 0000000..5d68086 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__auth.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_auth Struct Reference + + + + + + +
+

rpcap_auth Struct Reference
+ +[Internal Structures and Definitions] +

+

Structure that keeps the data required for the authentication on the remote host. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint16 type
 Authentication type.
uint16 dummy
 Must be zero.
uint16 slen1
 Length of the first authentication item (e.g. username).
uint16 slen2
 Length of the second authentication item (e.g. password).
+

Detailed Description

+

Structure that keeps the data required for the authentication on the remote host.

+ +

Definition at line 249 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint16 dummy
+
+
+ +

Must be zero.

+ +

Definition at line 252 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 slen1
+
+
+ +

Length of the first authentication item (e.g. username).

+ +

Definition at line 253 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 slen2
+
+
+ +

Length of the second authentication item (e.g. password).

+ +

Definition at line 254 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 type
+
+
+ +

Authentication type.

+ +

Definition at line 251 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__filter.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__filter.html new file mode 100644 index 0000000..2c6e543 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__filter.html @@ -0,0 +1,110 @@ + + + + +WinPcap: rpcap_filter Struct Reference + + + + + + +
+

rpcap_filter Struct Reference
+ +[Internal Structures and Definitions] +

+

General header used for the pcap_setfilter() command; keeps just the number of BPF instructions. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + +

Data Fields

uint16 filtertype
 type of the filter transferred (BPF instructions, ...)
uint16 dummy
 Must be zero.
uint32 nitems
 Number of items contained into the filter (e.g. BPF instructions for BPF filters).
+

Detailed Description

+

General header used for the pcap_setfilter() command; keeps just the number of BPF instructions.

+ +

Definition at line 230 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint16 dummy
+
+
+ +

Must be zero.

+ +

Definition at line 233 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 filtertype
+
+
+ +

type of the filter transferred (BPF instructions, ...)

+ +

Definition at line 232 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 nitems
+
+
+ +

Number of items contained into the filter (e.g. BPF instructions for BPF filters).

+ +

Definition at line 234 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__filterbpf__insn.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__filterbpf__insn.html new file mode 100644 index 0000000..12f7bdd --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__filterbpf__insn.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_filterbpf_insn Struct Reference + + + + + + +
+

rpcap_filterbpf_insn Struct Reference
+ +[Internal Structures and Definitions] +

+

Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint16 code
 opcode of the instuction
uint8 jt
 relative offset to jump to in case of 'true'
uint8 jf
 relative offset to jump to in case of 'false'
int32 k
 instruction-dependent value
+

Detailed Description

+

Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header.

+ +

Definition at line 239 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint16 code
+
+
+ +

opcode of the instuction

+ +

Definition at line 241 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint8 jf
+
+
+ +

relative offset to jump to in case of 'false'

+ +

Definition at line 243 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint8 jt
+
+
+ +

relative offset to jump to in case of 'true'

+ +

Definition at line 242 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
int32 k
+
+
+ +

instruction-dependent value

+ +

Definition at line 244 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__if.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__if.html new file mode 100644 index 0000000..6b5fa8d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__if.html @@ -0,0 +1,148 @@ + + + + +WinPcap: rpcap_findalldevs_if Struct Reference + + + + + + +
+

rpcap_findalldevs_if Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the message for the interface description (findalldevs command). +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + + + +

Data Fields

uint16 namelen
 Length of the interface name.
uint16 desclen
 Length of the interface description.
uint32 flags
 Interface flags.
uint16 naddr
 Number of addresses.
uint16 dummy
 Must be zero.
+

Detailed Description

+

Format of the message for the interface description (findalldevs command).

+ +

Definition at line 160 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint16 desclen
+
+
+ +

Length of the interface description.

+ +

Definition at line 163 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 dummy
+
+
+ +

Must be zero.

+ +

Definition at line 166 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 flags
+
+
+ +

Interface flags.

+ +

Definition at line 164 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 naddr
+
+
+ +

Number of addresses.

+ +

Definition at line 165 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 namelen
+
+
+ +

Length of the interface name.

+ +

Definition at line 162 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__ifaddr.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__ifaddr.html new file mode 100644 index 0000000..e3cc4f2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__findalldevs__ifaddr.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_findalldevs_ifaddr Struct Reference + + + + + + +
+

rpcap_findalldevs_ifaddr Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the message for the address listing (findalldevs command). +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

struct sockaddr_storage addr
 Network address.
struct sockaddr_storage netmask
 Netmask for that address.
struct sockaddr_storage broadaddr
 Broadcast address for that address.
struct sockaddr_storage dstaddr
 P2P destination address for that address.
+

Detailed Description

+

Format of the message for the address listing (findalldevs command).

+ +

Definition at line 171 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
struct sockaddr_storage addr [read]
+
+
+ +

Network address.

+ +

Definition at line 173 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr_storage broadaddr [read]
+
+
+ +

Broadcast address for that address.

+ +

Definition at line 175 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr_storage dstaddr [read]
+
+
+ +

P2P destination address for that address.

+ +

Definition at line 176 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
struct sockaddr_storage netmask [read]
+
+
+ +

Netmask for that address.

+ +

Definition at line 174 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__header.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__header.html new file mode 100644 index 0000000..296717d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__header.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_header Struct Reference + + + + + + +
+

rpcap_header Struct Reference
+ +[Internal Structures and Definitions] +

+

Common header for all the RPCAP messages. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint8 ver
 RPCAP version number.
uint8 type
 RPCAP message type (error, findalldevs, ...).
uint16 value
 Message-dependent value (not always used).
uint32 plen
 Length of the payload of this RPCAP message.
+

Detailed Description

+

Common header for all the RPCAP messages.

+ +

Definition at line 150 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint32 plen
+
+
+ +

Length of the payload of this RPCAP message.

+ +

Definition at line 155 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint8 type
+
+
+ +

RPCAP message type (error, findalldevs, ...).

+ +

Definition at line 153 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 value
+
+
+ +

Message-dependent value (not always used).

+ +

Definition at line 154 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint8 ver
+
+
+ +

RPCAP version number.

+ +

Definition at line 152 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__openreply.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__openreply.html new file mode 100644 index 0000000..bc686e2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__openreply.html @@ -0,0 +1,92 @@ + + + + +WinPcap: rpcap_openreply Struct Reference + + + + + + +
+

rpcap_openreply Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the message of the connection opening reply (open command). +More...

+ +

#include <pcap-remote.h>

+ + + + + + +

Data Fields

int32 linktype
 Link type.
int32 tzoff
 Timezone offset.
+

Detailed Description

+

Format of the message of the connection opening reply (open command).

+

This structure transfers over the network some of the values useful on the client side.

+ +

Definition at line 186 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
int32 linktype
+
+
+ +

Link type.

+ +

Definition at line 188 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
int32 tzoff
+
+
+ +

Timezone offset.

+ +

Definition at line 189 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__pkthdr.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__pkthdr.html new file mode 100644 index 0000000..34837d4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__pkthdr.html @@ -0,0 +1,149 @@ + + + + +WinPcap: rpcap_pkthdr Struct Reference + + + + + + +
+

rpcap_pkthdr Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the header which encapsulates captured packets when transmitted on the network. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + + + +

Data Fields

uint32 timestamp_sec
 'struct timeval' compatible, it represents the 'tv_sec' field
uint32 timestamp_usec
 'struct timeval' compatible, it represents the 'tv_usec' field
uint32 caplen
 Length of portion present in the capture.
uint32 len
 Real length this packet (off wire).
uint32 npkt
 Ordinal number of the packet (i.e. the first one captured has '1', the second one '2', etc).
+

Detailed Description

+

Format of the header which encapsulates captured packets when transmitted on the network.

+

This message requries the general header as well, since we want to be albe to exchange more information across the network in the future (for example statistics, and kind like that).

+ +

Definition at line 219 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint32 caplen
+
+
+ +

Length of portion present in the capture.

+ +

Definition at line 223 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 len
+
+
+ +

Real length this packet (off wire).

+ +

Definition at line 224 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 npkt
+
+
+ +

Ordinal number of the packet (i.e. the first one captured has '1', the second one '2', etc).

+ +

Definition at line 225 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 timestamp_sec
+
+
+ +

'struct timeval' compatible, it represents the 'tv_sec' field

+ +

Definition at line 221 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 timestamp_usec
+
+
+ +

'struct timeval' compatible, it represents the 'tv_usec' field

+ +

Definition at line 222 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__sampling.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__sampling.html new file mode 100644 index 0000000..47fcf32 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__sampling.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_sampling Struct Reference + + + + + + +
+

rpcap_sampling Struct Reference
+ +[Internal Structures and Definitions] +

+

Structure that is needed to set sampling parameters. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint8 method
 Sampling method.
uint8 dummy1
 Must be zero.
uint16 dummy2
 Must be zero.
uint32 value
 Parameter related to the sampling method.
+

Detailed Description

+

Structure that is needed to set sampling parameters.

+ +

Definition at line 269 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint8 dummy1
+
+
+ +

Must be zero.

+ +

Definition at line 272 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 dummy2
+
+
+ +

Must be zero.

+ +

Definition at line 273 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint8 method
+
+
+ +

Sampling method.

+ +

Definition at line 271 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 value
+
+
+ +

Parameter related to the sampling method.

+ +

Definition at line 274 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreply.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreply.html new file mode 100644 index 0000000..600c78a --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreply.html @@ -0,0 +1,110 @@ + + + + +WinPcap: rpcap_startcapreply Struct Reference + + + + + + +
+

rpcap_startcapreply Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the reply message that devoted to start a remote capture (startcap reply command). +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + +

Data Fields

int32 bufsize
 Size of the user buffer allocated by WinPcap; it can be different from the one we chose.
uint16 portdata
 Network port on which the server is waiting at (passive mode only).
uint16 dummy
 Must be zero.
+

Detailed Description

+

Format of the reply message that devoted to start a remote capture (startcap reply command).

+ +

Definition at line 205 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
int32 bufsize
+
+
+ +

Size of the user buffer allocated by WinPcap; it can be different from the one we chose.

+ +

Definition at line 207 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 dummy
+
+
+ +

Must be zero.

+ +

Definition at line 209 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 portdata
+
+
+ +

Network port on which the server is waiting at (passive mode only).

+ +

Definition at line 208 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreq.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreq.html new file mode 100644 index 0000000..569d619 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__startcapreq.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_startcapreq Struct Reference + + + + + + +
+

rpcap_startcapreq Struct Reference
+ +[Internal Structures and Definitions] +

+

Format of the message that starts a remote capture (startcap command). +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint32 snaplen
 Length of the snapshot (number of bytes to capture for each packet).
uint32 read_timeout
 Read timeout in milliseconds.
uint16 flags
 Flags (see RPCAP_STARTCAPREQ_FLAG_xxx).
uint16 portdata
 Network port on which the client is waiting at (if 'serveropen').
+

Detailed Description

+

Format of the message that starts a remote capture (startcap command).

+ +

Definition at line 195 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint16 flags
+
+
+ +

Flags (see RPCAP_STARTCAPREQ_FLAG_xxx).

+ +

Definition at line 199 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint16 portdata
+
+
+ +

Network port on which the client is waiting at (if 'serveropen').

+ +

Definition at line 200 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 read_timeout
+
+
+ +

Read timeout in milliseconds.

+ +

Definition at line 198 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 snaplen
+
+
+ +

Length of the snapshot (number of bytes to capture for each packet).

+ +

Definition at line 197 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structrpcap__stats.html b/ledset/WpdPack_4_1_2/docs/html/structrpcap__stats.html new file mode 100644 index 0000000..d270a9c --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structrpcap__stats.html @@ -0,0 +1,129 @@ + + + + +WinPcap: rpcap_stats Struct Reference + + + + + + +
+

rpcap_stats Struct Reference
+ +[Internal Structures and Definitions] +

+

Structure that keeps the statistics about the number of packets captured, dropped, etc. +More...

+ +

#include <pcap-remote.h>

+ + + + + + + + + + +

Data Fields

uint32 ifrecv
 Packets received by the kernel filter (i.e. pcap_stats.ps_recv).
uint32 ifdrop
 Packets dropped by the network interface (e.g. not enough buffers) (i.e. pcap_stats.ps_ifdrop).
uint32 krnldrop
 Packets dropped by the kernel filter (i.e. pcap_stats.ps_drop).
uint32 svrcapt
 Packets captured by the RPCAP daemon and sent on the network.
+

Detailed Description

+

Structure that keeps the statistics about the number of packets captured, dropped, etc.

+ +

Definition at line 259 of file pcap-remote.h.

+

Field Documentation

+ +
+
+ + + + +
uint32 ifdrop
+
+
+ +

Packets dropped by the network interface (e.g. not enough buffers) (i.e. pcap_stats.ps_ifdrop).

+ +

Definition at line 262 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 ifrecv
+
+
+ +

Packets received by the kernel filter (i.e. pcap_stats.ps_recv).

+ +

Definition at line 261 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 krnldrop
+
+
+ +

Packets dropped by the kernel filter (i.e. pcap_stats.ps_drop).

+ +

Definition at line 263 of file pcap-remote.h.

+ +
+
+ +
+
+ + + + +
uint32 svrcapt
+
+
+ +

Packets captured by the RPCAP daemon and sent on the network.

+ +

Definition at line 264 of file pcap-remote.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/structsf__pkthdr.html b/ledset/WpdPack_4_1_2/docs/html/structsf__pkthdr.html new file mode 100644 index 0000000..5ab32a5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/structsf__pkthdr.html @@ -0,0 +1,108 @@ + + + + +WinPcap: sf_pkthdr Struct Reference + + + + + + +
+

sf_pkthdr Struct Reference
+ +[NPF structures and definitions] +

+

Header associated to a packet in the driver's buffer when the driver is in dump mode. Similar to the bpf_hdr structure, but simpler. +More...

+ +

#include <Packet.h>

+ + + + + + + +

Data Fields

struct timeval ts
 time stamp
UINT caplen
UINT len
 Length of the original packet (off wire).
+

Detailed Description

+

Header associated to a packet in the driver's buffer when the driver is in dump mode. Similar to the bpf_hdr structure, but simpler.

+ +

Definition at line 121 of file Packet.h.

+

Field Documentation

+ +
+
+ + + + +
UINT caplen
+
+
+

Length of captured portion. The captured portion can be different from the original packet, because it is possible (with a proper filter) to instruct the driver to capture only a portion of the packets.

+ +

Definition at line 123 of file Packet.h.

+ +
+
+ +
+
+ + + + +
UINT len
+
+
+ +

Length of the original packet (off wire).

+ +

Definition at line 126 of file Packet.h.

+ +
+
+ +
+
+ + + + +
struct timeval ts [read]
+
+
+ +

time stamp

+ +

Definition at line 122 of file Packet.h.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/style.css b/ledset/WpdPack_4_1_2/docs/html/style.css new file mode 100644 index 0000000..b9205ee --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/style.css @@ -0,0 +1,360 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Verdana,Arial,Helvetica; +} +BODY,TD { + font-size: 80%; +} +CODE,PRE { + font-size: 120%; +} +H1 { + text-align: center; + font-size: 190%; +} +H2 { + font-size: 150%; +} +H3 { + font-size: 120%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/ledset/WpdPack_4_1_2/docs/html/tab_b.gif b/ledset/WpdPack_4_1_2/docs/html/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/tab_l.gif b/ledset/WpdPack_4_1_2/docs/html/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/tab_r.gif b/ledset/WpdPack_4_1_2/docs/html/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+0i1zeusiYVp-phBl7b5+Px-X&LhByq z0F&<;K0l2+v>qiHlXb#$jXMv$uK-dEGE9L~qtdU(XeRXmvu*K2Q&6!fD**JxYP4b4BR7FdJ$Qx9G9`J%-_X!a#LGpp3g9)VWytGCa;7`S1_e8F~!R+aSJ zOF17p2`H?2kPs8Q`_;U}+D%3p zs2-0BTqFwpUoBk`?P;iPQ(IbEA|JmMx!P&YYG|R@S=5Mnw;-?A6rEEVyV%d7{iU4a zNk`i!%F(Ykpm`}#oH;BjY->@b8vQedv;pza2FL&*6ufjd+*3Ute&>kes~TU?^KkojsTh(o~(3tk1Y6>4(yn( z#U*ID9@eg-beKo1B;HXe+}{Z%n@7m0+yxivuqk9~;!1LGQlah)xYK4>wgL}l6dsaN zIxlRlq`*`j9PG4*0hD6YV_b_2w5b#)o7J?`q#{GjvvKlD`T*dWcZx<-s(ZvLB44E# z=!|sw!?)@%y$oRNL#25WS3lzdii}TuQ3?CLnvQ1_n};2sT_;Y;#d3=+-(O% zMN$>O!3;ke(UuLR%h_&)N zs^!-@A>QR}4yB1bPp`9S19ikTbZ~O{&FF-yHK{En;mmShDUIEw03`j(DBIsM}Rjki2J#SQa3gFZTKBPDeIiLt9Z z%bL3(B@Qw%(B`wSMS~dPh$=R`(}lBoFXKy(s|*{#ru$wjsBc_O#zxNk9w+UUHmx(U zmJ8+M+ndtnZ<7|VU9Mbt61zpo9T&3%Wx&XII=#QJxjR`CZf22ac3d51Z?GD%LEe_&*t46Qf;4`bZ7p2K(Ab5>GfT^}4! zBT&HZD`^PEgWoI&{~o-ID0F?O`75sm(87x%A{(}Ch1)QlzdJ)1B-eqe5a(weg0`4lQIf1evjvbBY50DVbzO7CLf|vP z2#0(U-|jZ`H{y5N^o7%iK6H>_HEGN->U6^!)1{XpJV!!4(Ig7wzZQ*9WYF4X1rG0x z=1uA@i`rIAciubDC{;~b(|&|A@xkjRP5aRcvRU9tvIm}jDB6J eQ0-6-y)mpwdT=ayS0tBxKDA*~;EWmo literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/tabs.css b/ledset/WpdPack_4_1_2/docs/html/tabs.css new file mode 100644 index 0000000..a444163 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/tabs.css @@ -0,0 +1,105 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs #MSearchBox +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; +} diff --git a/ledset/WpdPack_4_1_2/docs/html/tree.html b/ledset/WpdPack_4_1_2/docs/html/tree.html new file mode 100644 index 0000000..2f3ebe4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/tree.html @@ -0,0 +1,175 @@ + + + + + + + + TreeView + + + + +
+

WinPcap

+
+

o*WinPcap Documentation

+

o*Deprecated List

+

o+Modules

+ +

o+Data Structures

+ +

o*Data Fields

+

o+File List

+ +

\*Globals

+
+
+ + + diff --git a/ledset/WpdPack_4_1_2/docs/html/utils_8h.html b/ledset/WpdPack_4_1_2/docs/html/utils_8h.html new file mode 100644 index 0000000..2e2cb08 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/utils_8h.html @@ -0,0 +1,74 @@ + + + + +WinPcap: utils.h File Reference + + + + + + +
+

utils.h File Reference

+

Go to the source code of this file.

+ + + +

Functions

int getopt (int nargc, char *const *nargv, const char *ostr)
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int getopt (int  nargc,
char *const *  nargv,
const char *  ostr 
)
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/utils_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/utils_8h_source.html new file mode 100644 index 0000000..0642e89 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/utils_8h_source.html @@ -0,0 +1,77 @@ + + + + +WinPcap: utils.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h.html b/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h.html new file mode 100644 index 0000000..b9d8d60 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h.html @@ -0,0 +1,59 @@ + + + + +WinPcap: win32-svc.h File Reference + + + + + + +
+

win32-svc.h File Reference

+

Go to the source code of this file.

+ + + +

Functions

int svc_start (void)
+

Function Documentation

+ +
+
+ + + + + + + + + +
int svc_start (void  ) 
+
+
+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h_source.html b/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h_source.html new file mode 100644 index 0000000..36005b5 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/win32-svc_8h_source.html @@ -0,0 +1,65 @@ + + + + +WinPcap: win32-svc.h Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/winpcap.gif b/ledset/WpdPack_4_1_2/docs/html/winpcap.gif new file mode 100644 index 0000000000000000000000000000000000000000..c6b3484f0e6e13c8a691f682dbb21058114c0a64 GIT binary patch literal 10723 zcmeI!^;eUR-^cMa8|4_CZZwEELZxApw4l=SaUHEptgMcE;upy z%8678<#-gNQc_bXIjP6vL{4hz@hHzp&B;kE$T=P-3UYFeM_oZqK|xM=!O3VYI8k0u zP*+gUTwYLDe$vkJ6Lsa~&E@5tb>($+<;`^`W1#Ltb6s6$UEM%)U2}6?XY40H|*bdC=kj}zkq1IJ@!d|-ThU}pSyoR}FO zUzr)7nK|x><8H0YtgIaO#BukxR<^c|dt!h8_)h%%d3-1S`|tSv-~Ztkz%XR>tPF5A zm#x&$HojiyOUCASsR*>qB^=t&FEG+89DT(rJi;#|7_A_$2#^CDJ9%>ea0WmVA!O80 zL?^>JWu1o_ihC1~VkQMfjV1jld`kXHLye__8ECy^A>*fI!`af-)y~6D%SUKfk5>i8 z&nm|9RU$qv4L_@V{YZz*ENs$LHCbwuE$ebK(z?QorWlkwG`v%8`XKl7(#E&Pvrith z`U}@&a=xkYJs0Mp&b=mS=J&+JD`sNP)+`9~@?Jiz7FQDnW*VUQ1z+t-+9N1FQR z;vGKQYRb=sO7k!=8Rl;v*oucK{p=gcxpkYdDU$*`b=;u~#tH06dFC&!3+hrPP!|eX zTXaT!#lk+D{T(YZph|Bo$Gk;}s`sn^#MNu;&l_dDo3n(pKXqz~`@pDmct6Oo-E2xK zEqqfsnl7xmKJwbF^ktgBdGBrBDT&u*FYXn75VQ()iF1kUZw3yYPLbXkb|1&s3kgN@ zfe@}>{=_2Tczi-J&SytqCEBL|n3zz@UA`i*7eoi2+NWQ{TaiqRrsje4@2IZBdkZgbxEV*uz+|{W?`t471uriZK?HnC&My^t_hBJ?(av)` z&Uk+kOoZ*G3{{c_5tU5xOwNSf%R)7~pVn^Lkxbq1H-1;ZxHxk|iuGK_0r}x@oMh1> zbsYD0QK1W+gwXUn9E`K$M(hcmqagLTLY3!uD)Gq}i3&4;H#>;|R0mOxi7SsEU;b$R z)S$Y$9pO`Oe#&8s_1VmCU6vNzESZ}f4E+aB$xpkxA($nqK^ev6=^h`SMkt-x1fTcG ziv~|7oJtT;50;Dz-TlOG#Fg@?UM2JTTg-MvyKIf(I6Rnki74^SH~-fW5HC zG%t5Vj@?nm_cye}xlaQ=We0K<(Yuk{Vz^su7gCjUh$;)GG_Z7NZOa`xgj3^yz8LjN zeSZnNPrXFD{lR70DeltGUO>{H(O-_4tPcRIM(TSK-gMq5`iB(X-&e$oZUz`KJDggH zv9Jr`_&r_MN}*7;RvX zsNK<1tb`^(on2Sw#}tf^STUUIazN^zG>I%9agN9*Cbw^-Na#~kmEa^WDBt;Vy(s1I z-l)0Qk<+9kww7;+0N2Coa$O(NlUQwFVkqQZh3ikm(hi^8m4o-jW_|4hzAPi&ZG|wU za8g)gAKP#^L(uXZo$T0EU&|wVxPn{K_O%ZX%r^aXZ6v>$jV=dm+7(&BJMa-fmBjlM zZ@cP~y8Z>&Urg2InE)^`udPuNC}4pJK)l@10Zai)LU@Pji&yI~o3zt7{j&N^_~g`V zo#()LZ|;L6ORV7_I(X{n87pHTEdy)CQgIP$_j!yUq1+33%G0bqzHt^8ifNCYxYXp* z?V!gePE(@@8L3RWrr1+33?h?3EQVRHmCkIB2QwOpP+2^k<4(n}`KvNw=8QH?%Q#$#@1_ z&+?+hfa`Q0SU~6onD+<}^^UbtWjN__M2~pvZ~X~gYhTlguQ+j{bDPMCqNXltqhFs) zk9@Xd^T^&9N>GW6@2VQm&dHH-CP6q&?t@ve%Av!~_zIAxz;k>PitnxTr3`EfHU2Bq z3iRNdxf-h8S;D8#;c=t$`~Yprx}sA9Zg)W%gPDt{K+6re?iFpjo;-X=TR9tn<)K2uTH^fC_; zP=L&zPlG`j(#{YQ$>Ik%NR#-Sy~ooQgKiA-MJ)ZFfAm@S@5tJKOgS%l5k>hHXMw0K z30&CX^g0$ITkHimYy3yBg-41>vE1*nSIVnx9a0ftsK&M2-f40DdPLzEf@`t}f_}MQ zoL9?UIpr=e6yBefas(FYrY4NWTf;=0>aJ-!t*kGddRh1)dAg^@warzR110)V;7=3n z2Qzoe8Mw!-?=y?qfy&Hk1yhYV&#pGDen4vX(41CcZS}f=NGD=&q#f4!v;2{GEiH0}LDilB+-;-Ur7ZIZcm1z8;(%DXK5|8(4XM!*VY7J z=rP1g&RFs2nA5dkPot9bHjw{u>VF)S!FdF%$?*6z6~?8U9>;Gg^l^<`XJt-n6foyf z*g}O-t#A7ukhLQd(-6f9;Zxn-Tvh0RI*o_|oZ{9vk$19?{7P%mX^m`TU%vQB&IabP z{YEmaTKiXs0obO<*dC|#shU(CJ%|)gcORQH05TWYUb4(s5VI<1Kt$gZu!wt35?py( zQ(C&r2bfWOCfO9k);aA9^*-;kvrn#9M2L_2cxkQHK3m*2J}WK=73tfJex!*K=e;!i zTZ_$G*Ob)tTSf1Nq(zHCYKsH!gQbpCDMvnBm?_?7;EZSHi+7rSe{%`#q2tQV3_w_j z^3%wbzvFNl@usaS))qtksyOvi^3HfSnst~ho}@mIb7j4Cw8d?4}L*p-SPaj z_Jbb#zou%3*ejo2#&76X7KlGHMBYqWcp-Ty;Ukg<8LF82HGcQj67qD9OpV3Ew_qnV+|BU@NFHo?6S6H;-5(qgM-yK1x!B7m`TDDf zL&>M$tymQ8jedUM`mE5C%Ph#22E8_+r=hr5qkErzN-({w6Ps zTjIw=E*9RWqZX!DN_7Y;EY3y@?kxR?*Qa%NzN-SiK5$vCnR9~HUZT%rFn-_6i0)KT zkN%6hl8$EHfAOMHB7NT@t)*rTSC#!p19sg%@s+Ului=YtR`HBJ6FJeTtSjKDmTO|( zZnUDCbAvb8z6C8ap=OobQheNI2TUqkWD>Vx;%D#Bu(v#@D)tw2f6{K@kyx?l^3n~V&9lgET)0(bpu~Z}%FM0vz8nQ8&A~E5?xWj%hoDb6 zaaVQ4v2j7pb`-lX%3-C8y*I{tf^zgztvjNbooSN84Yb0^qlXpaKK~?r6>!Ok#Eg=nT{=>YH!D zOx!CTb!wttYA%QW9KZTR{NXinVP?!$R8s#M>@g<@nBY^GNO_bPH`EA^o`4PwLJcN> z1`*2gi8gq8@=+!@-75C2rENeaLN6RKdnrY3$bXBL!h=cbSAbgDCxJ7seWRq_GE_xu z!Gej&f39E2N}xyqeC@w85wMUm-N43YYFXCAhf##UGsGut(ZWGL5Rhs%;oq*}yahEF`l}i=A7(wTd(MklLUK zZRN<(Rn5Wi!%0*orv|VZ4_ShEfe`5<_?UytD=br#!TQTd4o#-A%9?{9v-3py5D=Q62vy4WYABw$}oOQ6-`D9T>to5eno@JIE@kqD+0cn(BQ~STrh>pGE;Z z*mtKHQfTG;7HkAFjUQxOBcIK^f-VL)H3TcC$&?k!C#;3U&dj@f%*i+KxCg~3$`7a3 z8zu2&IcF<8YX2fdYbX%DM7!pvelLeM*&jQgFSj~(qdJktPY2?NMetS@c5NhvV8K^z ze!>-KtFX}{C~rfe3x=EJRnaTNncq7FrSrCVn^9E}z|)o4 z%DJeI*Cp(5kW;Gw_6cBAsn^Bd>WMT+$78!CewF!X?l@|3+s?V<8+>>U#JOM49S57Y znLP8uo|H^($0Ke?GDj}y(Ggwo`g*}VPh(l6b(Nl;sw+v5rBU775RI)2k5!nOczyi5KfnKG+r)o9N94|aij`A;6JI`esf>5jv ztE4QXm;0k{;A?M$!eNS!H9i8^CIGUMXE&rX2OMj6$^=_0P%#{ua`=2eT(rl5ogs`j zBRfA}6>7_zvMiv0VFpF#D$}sysYSQ!(6DqvJmr)++c0zOFsC8l{js z83x_pPl}g~Ni;M`HLee!f`vYYuM3o1Jpd5ku>VLrB+(~!q0rDvO6d;-!U51g7N{Ko z)0QPbLc@&lErtY$0ky>d&y-2B|Oxxu&s%tUh%t8X(6sL zFiDT`r%SaA0+Q>Fg}`X2DD|WaI}Rqr&^B64TfQJ&7zz94)b*ZM$WaF<;M`u7-(Jn~ ztacIbB)Kef)i_h<1q=Sg^FPm8^8xKC048KF(<&HyUF0rH#h{?@`3BDfKZL`tI*=X~ z=HC3Fomh5_CqSq3>T2=}F6h`A%wh=o&guDO;??z7o@Bzyt&!*ESZJv`!gme!dH3ak zVAqW^5IoW{^Gxnf!86iS6<{fZtZx)&GkE>hV1lRL_he*BF8K@D`lTkTbU=n8^8uNNc#o8iV2RTt6ioATkpyv#0Q$A~N;osp$9pHq9LH40SDWtoVw9{e= z+9Duv?6R_D&Vb`!0t>#W?!RF14hG!LZFF$yx%u(utvmSBpV0~D zfkV@=H=_{8)r$G0ItsDt_geC08OyH@Z#bI+bV`sZ3ecU}arV*i&ws}coI$~P5q5N@ zpQA&+YF{gl)VexdyN{g6s~v8A@q#IB;*k(jm=9f$0}tBdlVaeT_$}Zrm!L3EQ6@3uRyaFIjBr80ACykqsv293`{^C6&}KIYZThz$jNksRMC+4>-bJK=nm|ua z&>ad80WpSUyY6V{>3tH@7wQJGPwYIh0C0r9Gs(Z)g%Z}sHluzU_E%*P0#!Y%Ha@-b z>Bf|2(?(1mG9Jnq@T0ytS$*53f8GF`hM685|GA&DmxtLE?Rkvu#X0HyGga`%&%Y;w z`TFk8J`|e|E)QgHrFFyKv419NfDXn0%$%ToC5Rt>h~*(rm`e7UWNH%LPE7@JhpyG= zeZN?y=Kz4o)|HMd)YdI%T5sM>P(J8p1I}*aRh#ZFcxo$H0Pg$;_-X!;F9XeP`_TH? z#cUm+HV62e$9cJl+3ti;8k$M$YNsoHH+p;fKMSfIX4B^LhRlB778`V61!6}0`nl%o zLY!H~3!}6gCKsKt9*Xjx1m~Z|6_*|b36Xe|Ccc%ieXjx=UCjR>OWiss0P+KXAEJb% zko#_o)8DQ4@!=hLcZ<9Q>leqE)vFCmf;}%ro^JBt1m$qu|UZt<$YS0)j((ab`dEBDRI4 zWNun7{}$vYTvWR>*El7v9^CiB!FuH{|2I)t*U?tr>dL13LRzW0p7pPLp@TQCif3(b z%bMvLm#1lfWF#N>yNgN{P<&UlIByPpIyENS7|NlCdMpO7D0sD2Pr5=*m#uAD_doLl z#u`w|;Z!TzXtWT%TZh^xIYZ%#?de61@%#d_owirOQJDA|eA^5(UTh!-1juHJul9OO zFY2lEZoE39%@Wi!Wnmh0eugL3{K7-&25H&1a+JPH8h3Va@$2cP=|E)zM&zNzzFgz` z_KzJyho(F=3uO`p14{cE-yXD{>ie+jWOOzG{aaU*bw=;2=8WuNMj4>X%2*rBYcf#* z<+sVGe^f#kH<`gYL}alS{w7hXo<}tHaaw+hH2C~kBPBa-#((!Lhis?9rRAx>Pvxt+ zt*amzgxOw}(1XZ51wpB9%R$-iiy@qGiO94On3)nQ9>pzSO`0F=FmjZ0`ofVeS2D4t zvXS+N0QZae{=F?7U7Y^-)v{)pPS1r_VjYw5IS*n>6*>nV=}UhEAvKC)yTR zdDZr7?2{fPw|_`yX(H~sZ5cwF8#od$h9NL8Uu*Yg!%8plsl<+=5~HAi{>4dCT@eT0 z^Z_*ox>ZCt`fw5Ojy-6fukBZYkWJIIzDJi?e^2Xtl{dv0Qjecd%AV`61>@+IE<&ON zDf=O=y@3$GtcGv@_QdPCNnrSh*3UrPRk3Gg&jVh+kx&uM%l`~iE1LVU?R=ZEdU3Ss z+4ZA}w_wY}Y{IXaREtM5S?96$hgiOA5Wdt>~ zBy+5~z?GYJZW}6lJ`?e8xFq_iF(62s{BF?M3vMWfxf&Tmbo=}R_w7&$xwos!ay5Y} z=-P8?Q$gq^n%W9f^f~`$_fZ+6MZrdRkIcXkK&FY*?961Gu`dxg&K1WFvcxATkZTo< zKxa^p6eH!#z4n%&yJtO_+g}jN0XLpAKle6IsiNYzvd#w>#4B>3m?aY|x zROX1h+-fr!Q#Db%j&4n1)wdzEpnfRP4#J0F8wT^Y)?RI3!A!WfnO5_eM+u2lzE%q_ zkBzjz+#XtMR&EdxM<^z)S3i`UjMKN1&&<~xc_R@@7y%N9VYQSkTMdxGkG3_$4CHO; zK%!Z1-kLH&XSDQ)*E|Ui1Zlc0@#1pZ)GXZcnNznUbXo?rEaYfZ8zcULES$*3DoE%X zT3xV>o3CiKklQ8kvkBqxk8LZwaGU;C_qC*c?2`*(*Ca2;+2fyCHmMumD$mP3!o7Bh zWk=QlhRghWi2vMDX82zVl}(69xb&b-Lm4tRM+va=;)+jFeMsOUyf_N`u5)T_E!{x{+Ogi9JTs89=BUIr)`Kp?hU%GJ(~oy3<<8`7e(bx^tG7D zIbpuc6kQTJ6MFR*ke?ODLTajJBq=G>H7|sNQeJG3o*ngR=*;3H68lQING@IeKc9GP zlZ`h4Z9{244bNGZ%0I5Q8%_#jw#J9>njy&>>xU>A52~|8uhJj+jmn3g05MBWJQilV zC|!61(Qnn8_8E2N@$D3@WL75~rr(yt10akwXq(-!jjRnMK4fDdJ*@>}-iV0um`a1Aplj#lqV_&Kko$l4Nq%TKo6z@yFQOi(OnJ@TI3W z-`2qJi+)dI%z92u7}=bb+CWwR!QHtr5nBvWe4T6RS`Yafdm2C@Pcsh1eZKJ^De7=5 zbd(SvEI4v-4Y7Mi7sg=!7tDG@R5c4nc}f!@S{v%8{(Ok)`qvr4Z}SA`*NPME_upB4 zTJ-K3A-Y%Cl}Sxsh^a7M+9j54SWc0bo#>m}n?7$Rt`>%e3NTVe~*8$mNW*hAPq28G0!qCo)(I*ZGUA7>Ar1J4bCg{@Gn?_e}3 zxK20l@8>8m#Py&rX_{+z7LdZJ`KCm~Q-T$kkUst7iS8-_%!iI;6#w05(hAJcsm%)T z|A9*Om81DEKJQBAri-y)uA^knN4|Ub1*LWE2fMw_4%s8P$taG_a_hfXo}(g7(Ac8A ztOD3Qsp#XCuHQ4w?77{^J)!qe=c+j!es;h9rvM$qezy8lLkHIc+c+Wf3rqc1Q|<3g+UwoCiCKIa`CX|2Ni;ZETf&5-Yk*I-G`>p`Y^;>V|Hr5oE{Z?``ox3FW=f`&oZDxlyk*5+Qi5QW(K z9@qCwLlmHky}|ZXud7S1r#nE~$x()R=By-*j$|_=2Dq!I9SHm= zsLffcjqL{No9S7d_E|4}L9D^r@=f zO=1NI-J+`itBw1uR||n?aWt`jUdfdxyfi4H zi6FC31T6z+ecm_i%(*OLllO%BC$A>k)u^g4n;t+fk}*6x|`cP2vvadC)=Bi{aV4bzihmV}OVu&1J$#mvXNd%pq1M+tR0ClWI+on4tHR=#(ofSCYJnpjwz?Kzd zs7wgj137ifQUb?tW+syGSRn$irM3W@FFQyEOGvk}^y7UGAH0K%4+=g!bsorKYjO0~ za&rT~#y0u!jKp|!e(K)|kxt_2ASTsj>=BJ?N&lQlEX|W{9m#eZ)7-f>CWUYK;5Ld9W7}{(J*0>PU#tlA!Q(s|PU*K+ zb#JsffqI<=*lt#EUuBojL%gu9b)BtKr>%7}ej>->i+H1)IRG*@C7p?LZniZ^13HQ0 z!EbCV$(Wm#v3T3JPLZ}Dd3jR)oU5%sTVc@qc@DU`$%l_@*rC{)7`yPa*v9NW+eTUC z?`&A=VEvR$Ssz&ro^D+Cz{=66eeX>e!@%zDKfB1Fx4CXJ=0R+F+ic2wvo|p!@j>?M zIJ@xMv;6BE@Q8d1^SQWdbC@~%^iTE~%X1FUN#s4Mtdc2#?TT_wPsXNw!dVgHHz~pN z%kj!DS2tMVf^18UuAsuMVEJaF%8UJ*g;V~K`FhC3Xvb2`1!jykS<^mQ;w3IpBk;C; zr~Q>CINt@;3nf+5qH87hRqRVOo!SZ)+YHE* ze`%M6W7mN_Z%4>>>o4GFR$80Ei}J-b^TphMj!G`_WQm2*2?qy%Hr6m_kwz+<+ws-{ z>)7(rSdddo5Mso3DO}f@AGE*#|9NOWl{&UrW`S~PU|YO@U^-K{Jpa~tq%&*OpZmPA z%fcs@cm2rLIPiSb5lebCtW}j+OUN z((+Kgvv$U?OU|`Q`HqK5x`*nIdtdZME>t{L9rw^&d9PIOAsOth_`w4w;;Ad*uFZI% z{<2ip)zdI|Bkwj_lLi3B=6(%8WB0O*f8R9kY2k{x`S=`O z#Oq41m;4o8Yb{;yDv_ijZ1>X3Io(4cX_KB!vL!7zvwOS6uM2(wl5#e?$$*s6X18E( zANlpBM2M@ac2?)4&r9#Xha*j`5T0Cbx|7iPrr|&lpK$N$I4UTFy#v~MKHYIM{LWT@ z1xwfW53taY@+8gZ?s1>nuwo;Xd5;UkVM3lvifq)15Ba*6S?-ocJW;Inb!*N%IenY3 zLeWUv0IQV#0UGwPGV{v%CNZ{6L{eCeJbu^+1kG=IJ$IzK?gV~LG{6G8JjS;@jf?C* z^m+Leq;I9@k}=Zb0?pF}-%UaogX{%4<19WGWcR%?*bKO<0AUwYl(3&35_AsEmewUXW4gjeC E4;?nL{r~^~ literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/winpcap_small.gif b/ledset/WpdPack_4_1_2/docs/html/winpcap_small.gif new file mode 100644 index 0000000000000000000000000000000000000000..42b3adb6584302f3ba39bd8b002b04b72408a076 GIT binary patch literal 2160 zcmeIx|5sD@9mnyTFOY-T|sNHI}TM;`p0K{&`h7++Ph#f`1 za3cVUAWj5vqlgm)^`L+gMcpXsaiUHq>UM(RcLHvw)8lmd-A=dL>2ZS*a04E<+wXP< zJZ_K2?e~B&=K=g4Pr&1u^LzY$Pr#22AmI07V_ecTJ>l2fy|!Ll^hk!p;MvM*gU@)|k>WrXqeX4WDJOU#<*!GI_a;MBiJW zSRcrJ|H2`5>DYOu?0ya-TNtrHPAq?`+xBKzR8!=U5NgNPVPf5mOGzo^u8fI{)$I4x z48t?l({q*qL1FtmZ1;V9G5p2!c|I}Xhdy10tEivltnHw`u@P-v9~EAS?Ho%@#D_JQ z&aZ9xw8vPYjF*3wTBIYrnkI zfB%=2qca!EzNbuGB3pG2gXn+BefnW2Jt=*Lv$^vh--vHSM^EqOZp9aIzU{5`GbrAE zCVfv78dG2j)k@#}_ffO*_r05NhgAKA@}c>2(bWlJ<{Bxsz!6o)YDp?fN)&gFUuicD zDhFX1{d!Xwr^=d&JM>n(=eP=8k;b2N@!9!@J8ZLTW_mh_Xb{8Zz&|4lfynk%Ozr3UPNYv${&5C zpoJ1u^i-Q0kr$;j+qNB3S|4qc*Pj#f-lsYWnW>%e{h1(;iHNkQ$KIgEoT~-K|i)(%>*d zM$(rj7b_%ZiueszXc=B8PQ-uk!$>g0MIJPtbKmBi9`AAviDsp_uz}xvHZ-%ucp|cZ z)kP%4!pt1npROmp6K<U>XCC5}{}t zzh|lQCLt^9jCAC{A)|>(q#8(r-4en2uF~CoIi3ai4)I*<(e?B~7WbiHocGR?$#BKs zDa!-W&6Ekkal@!225l)8;bZr&SO{&J2gAMd+g%%>KSqyI5*dOPioCX=b(UV~s+?t) zoN>TIfSi&}-daLBD<^IkMMq{SB>>M`4jUIZPvS3P)?w;e+`Q=|Ayp;jLt4 zTw@CXZAidTrn6rvm5@THkb(Ad`#oDi(#~p2D|Kc;I4%q-5%~n$)%82`k%_Tumdioc z5~n#&@9jZq6z!a8qc=Dh=S}a!IS=-agn37C)J2@wdN*Onb(VM@3b&aj=(`%*Qldgq zi*-VL4sB32-KUl<`NC|ckVHNc$72{f$trVP0Yqq0LWE;AWWIJ0|2C3v%iBkZN`vt2 zokBt!A6|?nMkxAvWPBW{qPH&6W($jpyGF@=eVEy87C-)Agq*R63vY;w<51g385_-M zk^e$pF2Sq3l12KAM%-^uH!@fv ZI*%rqzr~}TTY;}8-|h@!F(K&Se*w~9UAX`N literal 0 HcmV?d00001 diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm.html new file mode 100644 index 0000000..5a6a851 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm.html @@ -0,0 +1,180 @@ + + + + +WinPcap: wpcap_remote.htm File Reference + + + + + + +
+

wpcap_remote.htm File Reference

+

Go to the source code of this file.

+ + + + + + + + +

Functions

< html >< head >< metahttp-equiv="Content-Type"content="text/html;charset=windows-1252">
+< metaname="GENERATOR"content="MicrosoftFrontPage4.0">
+< metaname="ProgId"content="FrontPage.Editor.Document">
+< title > Using WinPcap Remote
+Capture</title ></head >< body >
+< hr >< ul >< li >< ahref="#RunningModes">
+ Remote Capture Running Modes
+</a ></li >< li >< ahref="#Config">
+ Configuring the Remote 
Daemon (rpcapd)</a ></li >< li >< a href

Variables

 then
the client sends the
+appropriate commands to the
+daemon and it starts the
+capture This name is due to
+the fact thet the daemon
+becomes< i > active</i >
+ instead of< i > waiting</i >
+ for new connections</li ></ul >
+< p > The Active Mode is
+useful in case the remote
+daemon is behind a firewall
+and it cannot receive
+connections from the external
+world In this 
case
the client sends the
+appropriate commands to the
+daemon and it starts the
+capture This name is due to
+the fact thet the daemon
+becomes< i > active</i >
+ instead of< i > waiting</i >
+ for new connections</li ></ul >
+< p > The Active Mode is
+useful in case the remote
+daemon is behind a firewall
+and it cannot receive
+connections from the external
+world In this the daemon can
+be configured to establish the
+connection to a given 
host
the client sends the
+appropriate commands to the
+daemon and it starts the
+capture This name is due to
+the fact thet the daemon
+becomes< i > active</i >
+ instead of< i > waiting</i >
+ for new connections</li ></ul >
+< p > The Active Mode is
+useful in case the remote
+daemon is behind a firewall
+and it cannot receive
+connections from the external
+world In this the daemon can
+be configured to establish the
+connection to a given which
+will have been configured in
+order to< i > wait</i > for
+that connection After
+establishing the 
connection
+

Function Documentation

+ +
+
+ + + + + + + + + +
<html><head><metahttp-equiv="Content-Type"content="text/html;charset=windows-1252"><metaname="GENERATOR"content="MicrosoftFrontPage4.0"><metaname="ProgId"content="FrontPage.Editor.Document"><title> Using WinPcap Remote Capture</title></head><body><hr><ul><li><ahref="#RunningModes"> Remote Capture Running Modes</a></li><li><ahref="#Config"> Configuring the Remote Daemon (rpcapd  ) 
+
+
+ +
+
+

Variable Documentation

+ +
+
+ + + + +
the client sends the appropriate commands to the daemon and it starts the capture This name is due to the fact thet the daemon becomes<i> active</i> instead of<i> waiting</i> for new connections</li></ul><p> The Active Mode is useful in case the remote daemon is behind a firewall and it cannot receive connections from the external world In this case
+
+
+ +

Definition at line 38 of file wpcap_remote.htm.

+ +
+
+ +
+
+ + + + +
the client sends the appropriate commands to the daemon and it starts the capture This name is due to the fact thet the daemon becomes<i> active</i> instead of<i> waiting</i> for new connections</li></ul><p> The Active Mode is useful in case the remote daemon is behind a firewall and it cannot receive connections from the external world In this the daemon can be configured to establish the connection to a given which will have been configured in order to<i> wait</i> for that connection After establishing the connection
+
+
+ +

Definition at line 38 of file wpcap_remote.htm.

+ +
+
+ +
+
+ + + + +
the client sends the appropriate commands to the daemon and it starts the capture This name is due to the fact thet the daemon becomes<i> active</i> instead of<i> waiting</i> for new connections</li></ul><p> The Active Mode is useful in case the remote daemon is behind a firewall and it cannot receive connections from the external world In this the daemon can be configured to establish the connection to a given host
+
+
+ +

Definition at line 38 of file wpcap_remote.htm.

+ +
+
+ +
+
+ + + + +
then
+
+
+ +

Definition at line 38 of file wpcap_remote.htm.

+ +
+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm_source.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm_source.html new file mode 100644 index 0000000..967f3ec --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__remote_8htm_source.html @@ -0,0 +1,382 @@ + + + + +WinPcap: wpcap_remote.htm Source File + + + + + + + +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut1_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut1_8txt.html new file mode 100644 index 0000000..eec681d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut1_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut1.txt File Reference + + + + + + +
+

wpcap_tut1.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut2_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut2_8txt.html new file mode 100644 index 0000000..24c0847 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut2_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut2.txt File Reference + + + + + + +
+

wpcap_tut2.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut3_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut3_8txt.html new file mode 100644 index 0000000..bb5b360 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut3_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut3.txt File Reference + + + + + + +
+

wpcap_tut3.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut4_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut4_8txt.html new file mode 100644 index 0000000..7b903a2 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut4_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut4.txt File Reference + + + + + + +
+

wpcap_tut4.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut5_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut5_8txt.html new file mode 100644 index 0000000..64737d4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut5_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut5.txt File Reference + + + + + + +
+

wpcap_tut5.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut6_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut6_8txt.html new file mode 100644 index 0000000..0e97065 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut6_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut6.txt File Reference + + + + + + +
+

wpcap_tut6.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut7_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut7_8txt.html new file mode 100644 index 0000000..24c5a8c --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut7_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut7.txt File Reference + + + + + + +
+

wpcap_tut7.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut8_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut8_8txt.html new file mode 100644 index 0000000..3bfa5e4 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut8_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut8.txt File Reference + + + + + + +
+

wpcap_tut8.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut9_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut9_8txt.html new file mode 100644 index 0000000..5ec7a67 --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut9_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut9.txt File Reference + + + + + + +
+

wpcap_tut9.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/WpdPack_4_1_2/docs/html/wpcap__tut_8txt.html b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut_8txt.html new file mode 100644 index 0000000..e76e54d --- /dev/null +++ b/ledset/WpdPack_4_1_2/docs/html/wpcap__tut_8txt.html @@ -0,0 +1,36 @@ + + + + +WinPcap: wpcap_tut.txt File Reference + + + + + + +
+

wpcap_tut.txt File Reference

+
+
+ +
+

+documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2009 +CACE Technologies. All rights reserved.

diff --git a/ledset/basewin.cpp b/ledset/basewin.cpp new file mode 100644 index 0000000..b2d3466 --- /dev/null +++ b/ledset/basewin.cpp @@ -0,0 +1,172 @@ +#include "basewin.h" +#include +#include +#include +#include +#include +#include +#include + +BaseWinBase::BaseWinBase(QWidget *that) : that(that) { + that->setWindowFlag(Qt::FramelessWindowHint); + that->setAttribute(Qt::WA_TranslucentBackground); + that->setMouseTracking(true); + auto layout = new QBoxLayout(QBoxLayout::TopToBottom, that); + layout->setContentsMargins(8,8,8,8); + layout->setSpacing(0); + layout->addWidget(center = new QWidget()); + center->installEventFilter(that); +} + +QHBoxLayout *BaseWinBase::addBtns(QHBoxLayout *hBox) { + if(hBox->count()==0) hBox->addStretch(); + auto btn = new QPushButton("--"); + btn->setProperty("ss", "min"); + that->connect(btn, &QPushButton::clicked, that, &BaseWin::showMinimized); + hBox->addWidget(btn); + btn = new QPushButton("X"); + btn->setProperty("ss", "close"); + that->connect(btn, &QPushButton::clicked, that, &BaseWin::close); + hBox->addWidget(btn); + return hBox; +} + +void BaseWinBase::paintEvent() { + QPainter painter(that); + painter.setRenderHints(QPainter::Antialiasing); + auto pal = that->palette(); + auto back = pal.window(); + bool isMax = that->isMaximized(); + if(isMax) painter.fillRect(that->rect(), back); + else { + QPainterPath borderPath = QPainterPath(); + borderPath.addRoundedRect(0.5, 0.5, that->width()-1, that->height()-1, borderRadius, borderRadius); + painter.fillPath(borderPath, back); + painter.strokePath(borderPath, isActive ? borderPenAct : borderPenUnact); + } + QString title = that->windowTitle(); + if(! title.isEmpty()) { + static const QPen penTitleUnact(Qt::gray); + painter.setPen(isActive ? pal.windowText().color() : penTitleUnact); + isMax ? painter.drawText(titlePos.x()-8, titlePos.y()-8, title) : painter.drawText(titlePos, title); + } + auto icon = that->windowIcon(); + if(! icon.isNull()) isMax ? icon.paint(&painter, iconRect.translated(-8, -8)) : icon.paint(&painter, iconRect); +} + +void transPos(QPoint &pos, QScreen *src, QScreen *dst) { + auto ratio = src->devicePixelRatio(); + if(ratio != 1) { + auto geo = src->geometry(); + pos.setX((pos.x() - geo.x()) * ratio + geo.x()); + pos.setY((pos.y() - geo.y()) * ratio + geo.y()); + } + ratio = dst->devicePixelRatio(); + if(ratio != 1) { + auto geo = dst->geometry(); + pos.setX((pos.x() - geo.x()) / ratio + geo.x()); + pos.setY((pos.y() - geo.y()) / ratio + geo.y()); + } +} +void BaseWinBase::mousePressEvent(QMouseEvent *e) { + if(e->button() != Qt::LeftButton) return; + setFrmSec(e->pos()); + if(mFrmSec==Qt::TitleBarArea) {mPressRel = that->pos() - e->globalPos(); mSize = that->size();} + else if(mFrmSec==Qt::TopSection || mFrmSec==Qt::LeftSection || mFrmSec==Qt::TopLeftSection) mPressRel = that->pos() - e->globalPos(); + else if(mFrmSec==Qt::BottomRightSection) mPressRel = QPoint(that->width() - e->globalX(), that->height() - e->globalY()); + else if(mFrmSec==Qt::RightSection ) mPressRel = QPoint(that->width() - e->globalX(), that->height() ); + else if(mFrmSec==Qt::BottomSection ) mPressRel = QPoint(that->width() , that->height() - e->globalY()); + else if(mFrmSec==Qt::TopRightSection ) mPressRel = that->geometry().topRight() - e->globalPos(); + else if(mFrmSec==Qt::BottomLeftSection ) mPressRel = that->geometry().bottomLeft() - e->globalPos(); + else if(mFrmSec==Qt::NoSection) mPressRel.setX(INT_MIN); +} +void BaseWinBase::mouseReleaseEvent(QMouseEvent *e) { + if(e->button() != Qt::LeftButton) return; + mPressRel.setX(INT_MIN); +} +void BaseWinBase::mouseMoveEvent(QMouseEvent *e) { + if(e->buttons() & Qt::LeftButton) { + if(mFrmSec==Qt::NoSection || mPressRel.x()==INT_MIN) return; + if(that->isMaximized()) return; + if(mFrmSec==Qt::TitleBarArea) { + auto pos = e->globalPos(); + auto screenMouse = QGuiApplication::screenAt(pos); + if(screenMouse==0) return; + auto screen = that->screen(); + if(screenMouse!=screen) transPos(pos, screenMouse, screen); + that->setGeometry(QRect(pos + mPressRel, mSize)); + } else if(mFrmSec==Qt::BottomRightSection) that->resize(mPressRel.rx() + e->globalX(), mPressRel.ry() + e->globalY()); + else if(mFrmSec==Qt::RightSection ) that->resize(mPressRel.rx() + e->globalX(), mPressRel.ry() ); + else if(mFrmSec==Qt::BottomSection ) that->resize(mPressRel.rx() , mPressRel.ry() + e->globalY()); + else { + auto geo = that->geometry(); + if(mFrmSec==Qt::LeftSection) geo.setLeft(e->globalX() + mPressRel.rx()); + else if(mFrmSec==Qt::TopSection) geo.setTop(e->globalY() + mPressRel.ry()); + else if(mFrmSec==Qt::TopLeftSection) geo.setTopLeft(e->globalPos() + mPressRel); + else if(mFrmSec==Qt::TopRightSection) geo.setTopRight(e->globalPos() + mPressRel); + else if(mFrmSec==Qt::BottomLeftSection) geo.setBottomLeft(e->globalPos() + mPressRel); + that->setGeometry(geo); + } + } else setFrmSec(e->pos()); +} +void BaseWinBase::setFrmSec(const QPoint &pos) { + if(that->isMaximized()) return; + if(pos.y()<8) { + if(pos.x()<16) setFrmSecIfNeed(Qt::TopLeftSection, Qt::SizeFDiagCursor); + else if(pos.x()width()-16) setFrmSecIfNeed(Qt::TopSection, Qt::SizeVerCursor); + else setFrmSecIfNeed(Qt::TopRightSection, Qt::SizeBDiagCursor); + } else if(pos.y()>=that->height()-8) { + if(pos.x()<16) setFrmSecIfNeed(Qt::BottomLeftSection, Qt::SizeBDiagCursor); + else if(pos.x()width()-16) setFrmSecIfNeed(Qt::BottomSection, Qt::SizeVerCursor); + else setFrmSecIfNeed(Qt::BottomRightSection, Qt::SizeFDiagCursor); + } else if(pos.x()<8) { + if(pos.y()<16) setFrmSecIfNeed(Qt::TopLeftSection, Qt::SizeFDiagCursor); + else if(pos.y()height()-16) setFrmSecIfNeed(Qt::LeftSection, Qt::SizeHorCursor); + else setFrmSecIfNeed(Qt::BottomLeftSection, Qt::SizeBDiagCursor); + } else if(pos.x()>=that->width()-8) { + if(pos.y()<16) setFrmSecIfNeed(Qt::TopRightSection, Qt::SizeBDiagCursor); + else if(pos.y()height()-16) setFrmSecIfNeed(Qt::RightSection, Qt::SizeHorCursor); + else setFrmSecIfNeed(Qt::BottomRightSection, Qt::SizeFDiagCursor); + } else setFrmSecIfNeed(Qt::TitleBarArea, Qt::ArrowCursor); +} +void BaseWinBase::setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor) { + if(mFrmSec==frmSec) return; + mFrmSec = frmSec; + if(cursor==Qt::ArrowCursor) that->unsetCursor(); + else that->setCursor(cursor); +} +void BaseWinBase::leaveEvent() { + setFrmSecIfNeed(Qt::NoSection, Qt::ArrowCursor); + mPressRel.setX(INT_MIN); +} +void BaseWinBase::mouseDoubleClickEvent(QMouseEvent *e) { + if(e->y() > 32) return; + mPressRel.setX(INT_MIN); + mFrmSec = Qt::NoSection; + if(that->isMaximized()) that->setWindowState(that->windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen)); + else that->setWindowState((that->windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen)) | Qt::WindowMaximized); +} +bool BaseWinBase::eventFilter(QObject *watched, QEvent *e) { + if(e->type()==QEvent::Enter && watched==center) { + setFrmSecIfNeed(Qt::NoSection, Qt::ArrowCursor); + mPressRel.setX(INT_MIN); + } + return false; +} +void BaseWinBase::changeEvent(QEvent *e) { + if(e->type()==QEvent::WindowStateChange) that->isMaximized() ? that->layout()->setContentsMargins(0,0,0,0) : that->layout()->setContentsMargins(8,8,8,8); +} + +#ifdef _MSC_VER //MSVC编译器 +#include +bool BaseWinBase::nativeEvent(const QByteArray &eventType, void *message) { + if(eventType=="windows_generic_MSG") { + MSG *msg = (MSG*)message; + if(msg->message==WM_NCACTIVATE) { + isActive = msg->wParam; + that->repaint(); + } + } + return false; +} +#endif diff --git a/ledset/basewin.h b/ledset/basewin.h new file mode 100644 index 0000000..0db9e8e --- /dev/null +++ b/ledset/basewin.h @@ -0,0 +1,113 @@ +#ifndef BASEWIN_H +#define BASEWIN_H + +#include +#include +#include + +class BaseWinBase { +public: + explicit BaseWinBase(QWidget *that); + QHBoxLayout *addBtns(QHBoxLayout *); + QWidget *center{0}; + QPen borderPenAct{QColor{0x0077cc}}; + QPen borderPenUnact{Qt::gray}; + qreal borderRadius{4.0}; + QPointF titlePos{36, 26}; + QRect iconRect{13, 13, 16, 16}; +protected: + void paintEvent(); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void leaveEvent(); + void mouseDoubleClickEvent(QMouseEvent *); + bool eventFilter(QObject *, QEvent *); + void changeEvent(QEvent *); +#ifdef _MSC_VER + bool nativeEvent(const QByteArray &, void *); +#endif + void setFrmSec(const QPoint &pos); + void setFrmSecIfNeed(Qt::WindowFrameSection frmSec, Qt::CursorShape cursor); + + QPoint mPressRel{INT_MIN, INT_MIN}; + QSize mSize; + Qt::WindowFrameSection mFrmSec{Qt::NoSection}; + bool isActive{false}; + QWidget *that{0}; +}; + +class BaseWin : public QWidget, public BaseWinBase { + Q_OBJECT +public: + explicit BaseWin(QWidget *parent = nullptr) : QWidget{parent, Qt::Window}, BaseWinBase{this} {} +protected: + void paintEvent(QPaintEvent *e) override { + QWidget::paintEvent(e); + BaseWinBase::paintEvent(); + } + void mousePressEvent(QMouseEvent *e) override { + BaseWinBase::mousePressEvent(e); + } + void mouseReleaseEvent(QMouseEvent *e) override { + BaseWinBase::mouseReleaseEvent(e); + } + void mouseMoveEvent(QMouseEvent *e) override { + BaseWinBase::mouseMoveEvent(e); + } + void leaveEvent(QEvent *) override { + BaseWinBase::leaveEvent(); + } + void mouseDoubleClickEvent(QMouseEvent *e) override { + BaseWinBase::mouseDoubleClickEvent(e); + } + bool eventFilter(QObject *watched, QEvent *e) override { + return BaseWinBase::eventFilter(watched, e); + } + void changeEvent(QEvent *e) override { + BaseWinBase::changeEvent(e); + } +#ifdef _MSC_VER + bool nativeEvent(const QByteArray &eventType, void *message, long *) override { + return BaseWinBase::nativeEvent(eventType, message); + } +#endif +}; + +class BaseDlg : public QDialog, public BaseWinBase { + Q_OBJECT +public: + explicit BaseDlg(QWidget *parent = nullptr) : QDialog{parent}, BaseWinBase{this} {} +protected: + void paintEvent(QPaintEvent *e) override { + QDialog::paintEvent(e); + BaseWinBase::paintEvent(); + } + void mousePressEvent(QMouseEvent *e) override { + BaseWinBase::mousePressEvent(e); + } + void mouseReleaseEvent(QMouseEvent *e) override { + BaseWinBase::mouseReleaseEvent(e); + } + void mouseMoveEvent(QMouseEvent *e) override { + BaseWinBase::mouseMoveEvent(e); + } + void leaveEvent(QEvent *) override { + BaseWinBase::leaveEvent(); + } + void mouseDoubleClickEvent(QMouseEvent *e) override { + BaseWinBase::mouseDoubleClickEvent(e); + } + bool eventFilter(QObject *watched, QEvent *e) override { + return BaseWinBase::eventFilter(watched, e); + } + void changeEvent(QEvent *e) override { + BaseWinBase::changeEvent(e); + } +#ifdef _MSC_VER + bool nativeEvent(const QByteArray &eventType, void *message, long *) override { + return BaseWinBase::nativeEvent(eventType, message); + } +#endif +}; +#endif // BASEWIN_H diff --git a/ledset/brightwin.cpp b/ledset/brightwin.cpp new file mode 100644 index 0000000..3b0b890 --- /dev/null +++ b/ledset/brightwin.cpp @@ -0,0 +1,196 @@ +#include "brightwin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +BrightWin::BrightWin(QWidget *parent) : BaseWin{parent} { + setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose); + setWindowTitle("亮度控制"); + resize(620, 700); + + auto vBox = new QVBoxLayout(center); + vBox->setContentsMargins(0,0,0,0); + vBox->addLayout(addBtns(new QHBoxLayout())); + + auto hBox = new QHBoxLayout(); + hBox->addWidget(new QLabel(tr("亮度设置"))); + + auto line = new QFrame(); + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line, 1); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + auto lb = new QLabel(tr("亮度")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignRight); + hBox->addWidget(lb); + + auto fdBright = new QSpinBox(); + fdBright->setRange(0,255); + fdBright->setValue(255); + hBox->addWidget(fdBright); + + auto sliBright = new QSlider(Qt::Horizontal); + sliBright->setRange(0,255); + sliBright->setValue(255); + hBox->addWidget(sliBright); + + connect(fdBright, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, sliBright, &QSlider::setValue); + connect(sliBright, &QSlider::valueChanged, fdBright, &QSpinBox::setValue); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + lb = new QLabel(tr("对比度")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignRight); + hBox->addWidget(lb); + + auto fdContrast = new QSpinBox(); + fdContrast->setRange(1,255); + fdContrast->setValue(64); + hBox->addWidget(fdContrast); + + auto sliContrast = new QSlider(Qt::Horizontal); + sliContrast->setRange(1,255); + sliContrast->setValue(64); + hBox->addWidget(sliContrast); + + connect(fdContrast, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, sliContrast, &QSlider::setValue); + connect(sliContrast, &QSlider::valueChanged, fdContrast, &QSpinBox::setValue); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + hBox->addStretch(); + + auto btnSave = new QPushButton("固化"); + btnSave->setMinimumWidth(80); + hBox->addWidget(btnSave); + + vBox->addLayout(hBox); + + + hBox = new QHBoxLayout(); + hBox->addWidget(new QLabel(tr("色彩调整"))); + + line = new QFrame(); + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line, 1); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + lb = new QLabel(tr("红")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignRight); + hBox->addWidget(lb); + + auto fdRed = new QSpinBox(); + fdRed->setRange(0, 32768); + fdRed->setValue(32768); + hBox->addWidget(fdRed); + + auto sliRed = new QSlider(Qt::Horizontal); + sliRed->setRange(0, 32768); + sliRed->setValue(32768); + hBox->addWidget(sliRed); + + connect(fdRed, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, sliRed, &QSlider::setValue); + connect(sliRed, &QSlider::valueChanged, fdRed, &QSpinBox::setValue); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + lb = new QLabel(tr("绿")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignRight); + hBox->addWidget(lb); + + auto fdGreen = new QSpinBox(); + fdGreen->setRange(0, 32768); + fdGreen->setValue(32768); + hBox->addWidget(fdGreen); + + auto sliGreen = new QSlider(Qt::Horizontal); + sliGreen->setRange(0, 32768); + sliGreen->setValue(32768); + hBox->addWidget(sliGreen); + + connect(fdGreen, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, sliGreen, &QSlider::setValue); + connect(sliGreen, &QSlider::valueChanged, fdGreen, &QSpinBox::setValue); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + lb = new QLabel(tr("蓝")+":"); + lb->setMinimumWidth(70); + lb->setAlignment(Qt::AlignRight); + hBox->addWidget(lb); + + auto fdBlue = new QSpinBox(); + fdBlue->setRange(0, 32768); + fdBlue->setValue(32768); + hBox->addWidget(fdBlue); + + auto sliBlue = new QSlider(Qt::Horizontal); + sliBlue->setRange(0, 32768); + sliBlue->setValue(32768); + hBox->addWidget(sliBlue); + + connect(fdBlue, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, sliBlue, &QSlider::setValue); + connect(sliBlue, &QSlider::valueChanged, fdBlue, &QSpinBox::setValue); + + vBox->addLayout(hBox); + + hBox = new QHBoxLayout(); + hBox->addStretch(); + + btnSave = new QPushButton("固化"); + btnSave->setMinimumWidth(80); + hBox->addWidget(btnSave); + + vBox->addLayout(hBox); + + + + hBox = new QHBoxLayout(); + hBox->addWidget(new QLabel(tr("Gamma 调节"))); + + line = new QFrame(); + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line, 1); + + vBox->addLayout(hBox); + + auto table = new QTableWidget(256, 2); + table->setSelectionBehavior(QTableWidget::SelectRows); + table->setEditTriggers(QAbstractItemView::NoEditTriggers); + table->setAlternatingRowColors(true); + table->setHorizontalHeaderLabels({"X","Y"}); + table->horizontalHeader()->setBackgroundRole(QPalette::Window); + for(int i=0; i<256; i++) { + table->setItem(i, 0, new QTableWidgetItem(QString::number(i))); + } + + vBox->addWidget(table); + + connect(btnSave, &QPushButton::clicked, this, [] { + qDebug()<<"aaa"; + + }); + + vBox->addStretch(); +} diff --git a/ledset/brightwin.h b/ledset/brightwin.h new file mode 100644 index 0000000..b842f92 --- /dev/null +++ b/ledset/brightwin.h @@ -0,0 +1,13 @@ +#ifndef BRIGHTWIN_H +#define BRIGHTWIN_H + +#include "basewin.h" + +class BrightWin : public BaseWin { + Q_OBJECT +public: + explicit BrightWin(QWidget *parent = nullptr); + +}; + +#endif // BRIGHTWIN_H diff --git a/ledset/capthread - 副本.cpp b/ledset/capthread - 副本.cpp new file mode 100644 index 0000000..99fe66a --- /dev/null +++ b/ledset/capthread - 副本.cpp @@ -0,0 +1,324 @@ +#include "capthread.h" +#include +#include + +CapThread::CapThread(struct pcap *pcap, QObject *parent) : QThread(parent), pcap(pcap) { + connect(this, &QThread::finished, this, &QThread::deleteLater); +} + +void CapThread::run() { + pcap_pkthdr *header; + const u_char *pkt_data; + +// qDebug("The program is working......\n"); +// qDebug("The capture file is saving as 'data.txt'\n"); +// qDebug("You can input 'ctrl + C' to stop the program\n"); + int res; + while((res = pcap_next_ex(pcap, &header, &pkt_data)) >= 0) { + if (res == 0) continue; //超时 + packet.time = QDateTime::fromSecsSinceEpoch(header->ts.tv_sec).toString("yy-MM-dd HH:mm:ss.")+QString::number(header->ts.tv_usec); + packet.len = header->len; + //输出编号、时间戳和包长度 + qDebug("=======================\n"); + qDebug()<caplen<<"/"<len; + QString data_str; + char line[LINE_LEN + 1]; + int l = 0; + for(uint i=0; i < header->caplen; i++) { + data_str.append(QString::asprintf("%.2x ", pkt_data[i])); + if(i > 13) { + if(isgraph(pkt_data[i]) || pkt_data[i] == ' ') line[l] = pkt_data[i]; + else line[l] = '.'; + if(l==15) { + line[16] = '\0'; + data_str.append(" "); + data_str.append(line); + data_str.append("\n"); + memset(line, 0, LINE_LEN); + l = 0; + } else l++; + } else if(i == 13) { + data_str.append("\n"); + } + } + packet.data = data_str; + qDebug()<append(packet); + //emit newPacket(); + } + qDebug("Error reading the packets: %s\n", pcap_geterr(pcap)); + +} + +// TCP协议处理 +//u_short sport; +//u_short dport; +//u_int sequence; // 序列码 +//u_int ack; // 回复码 +//u_char hdrLen; // 首部长度保留字 +//u_char flags; // 标志 +//u_short windows; // 窗口大小 +//u_short checksum; // 校验和 +//u_short urgent_pointer; // 紧急指针 +void CapThread::tcp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + packet.tcp_header = *(TcpHeader*) (pkt_content + 14 + 20); +// qDebug("===================TCP Protocol=================\n"); + +// qDebug("Source Port: %i\n", ntohs(tcp_protocol->sport)); +// qDebug("Destination Port: %i\n", ntohs(tcp_protocol->dport)); +// qDebug("Sequence number: %d\n", ntohl(tcp_protocol->sequence)); +// qDebug("Acknowledgment number: %d\n", ntohl(tcp_protocol->ack)); +// qDebug("Header Length: %d\n", (tcp_protocol->hdrLen >> 4) * 4); +// qDebug("Flags: 0x%.3x ", tcp_protocol->flags); +// if (tcp_protocol->flags & 0x08) qDebug("(PSH)"); +// if (tcp_protocol->flags & 0x10) qDebug("(ACK)"); +// if (tcp_protocol->flags & 0x02) qDebug("(SYN)"); +// if (tcp_protocol->flags & 0x20) qDebug("(URG)"); +// if (tcp_protocol->flags & 0x01) qDebug("(FIN)"); +// if (tcp_protocol->flags & 0x04) qDebug("(RST)"); +// qDebug("\n"); +// qDebug("Windows Size: %i\n", ntohs(tcp_protocol->windows)); +// qDebug("Checksum: 0x%.4x\n", ntohs(tcp_protocol->checksum)); +// qDebug("Urgent Pointer: %i\n", ntohs(tcp_protocol->urgent_pointer)); +} + +// UDP协议处理 +//u_short sport; // 源端口 +//u_short dport; // 目标端口 +//u_short datalen; // UDP数据长度 +//u_short checksum; // 校验和 +void CapThread::udp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + packet.udp_header = *(UdpHeader*)(pkt_content + 14 + 20); +// qDebug("===================UDP Protocol=================\n"); +// qDebug("Source Port: %i\n", ntohs(udp_protocol->sport)); +// qDebug("Destination Port: %i\n", ntohs(udp_protocol->dport)); +// qDebug("Datalen: %i\n", ntohs(udp_protocol->datalen)); +// qDebug("Checksum: 0x%.4x\n", ntohs(udp_protocol->checksum)); +} + +// ICMP协议处理 +//u_char type; // ICMP类型 +//u_char code; // 代码 +//u_short checksum; // 校验和 +//u_short identification; // 标识 +//u_short sequence; // 序列号 +//u_long timestamp; // 时间戳 +void CapThread::icmp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + packet.icmp_header = *(IcmpHeader*)(pkt_content + 14 + 20); +// qDebug("==================ICMP Protocol=================\n"); +// qDebug("Type: %d ", icmp_protocol->type); +// switch (icmp_protocol->type) +// { +// case 8: +// qDebug("(request)\n"); +// break; +// case 0: +// qDebug("(reply)\n"); +// break; +// default: +// qDebug("\n"); +// break; +// } +// qDebug("Code: %d\n", icmp_protocol->code); +// qDebug("CheckSum: 0x%.4x\n", ntohs(icmp_protocol->checksum)); +// qDebug("Identification: 0x%.4x\n", ntohs(icmp_protocol->identification)); +// qDebug("Sequence: 0x%.4x\n", ntohs(icmp_protocol->sequence)); +} + +// ARP协议处理 +//u_short hardware_type; // 格式化的硬件地址 +//u_short protocol_type; // 协议地址格式 +//u_char hardware_length; // 硬件地址长度 +//u_char protocol_length; // 协议地址长度 +//u_short operation_code; // 操作码 +//u_char source_ethernet_address[6]; // 发送者硬件地址 +//u_char source_ip_address[4]; // 发送者协议地址 +//u_char destination_ethernet_address[6]; // 目的方硬件地址 +//u_char destination_ip_address[4]; // 目的方协议地址 +void CapThread::arp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + packet.arp_header = *(ArpHeader*)(pkt_content + 14); +// qDebug("==================ARP Protocol==================\n"); +// qDebug("Hardware Type: "); +// switch (ntohs(arp_protocol->hardware_type)) +// { +// case 1: +// qDebug("Ethernet"); +// break; +// default: +// break; +// } +// qDebug(" (%d)\n", ntohs(arp_protocol->hardware_type)); +// qDebug("Protocol Type: \n"); +// switch (ntohs(arp_protocol->protocol_type)) +// { +// case 0x0800: +// qDebug("%s", "IP"); +// break; +// case 0x0806: +// qDebug("%s", "ARP"); +// break; +// case 0x0835: +// qDebug("%s", "RARP"); +// break; +// default: +// qDebug("%s", "Unknown Protocol"); +// break; +// } +// qDebug(" (0x%04x)\n", ntohs(arp_protocol->protocol_type)); +// qDebug("Hardware Length: %d\n", arp_protocol->hardware_length); +// qDebug("Protocol Length: %d\n", arp_protocol->protocol_length); +// qDebug("Operation Code: "); +// switch (ntohs(arp_protocol->operation_code)) +// { +// case 1: +// qDebug("request"); +// break; +// case 2: +// qDebug("reply"); +// break; +// default: +// break; +// } +// qDebug(" (%i)\n", ntohs(arp_protocol->operation_code)); +} + +// IP协议处理 +//u_char version_hlen; // 首部长度 版本 +//u_char tos; // 服务质量 +//u_short tlen; // 总长度 +//u_short identification; // 身份识别 +//u_short flags_offset; // 标识 分组偏移 +//u_char ttl; // 生命周期 +//u_char proto; // 协议类型 +//u_short checksum; // 包头测验码 +//u_int saddr; // 源IP地址 +//u_int daddr; // 目的IP地址 +void CapThread::ip_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + sockaddr_in source, dest; + char sourceIP[MAX_ADDR_LEN], destIP[MAX_ADDR_LEN]; + + auto ip_protocol = (IpHeader*)(pkt_content + 14); + source.sin_addr.s_addr = ip_protocol->saddr; + dest.sin_addr.s_addr = ip_protocol->daddr; + strncpy(sourceIP, inet_ntoa(source.sin_addr), MAX_ADDR_LEN); + strncpy(destIP, inet_ntoa(dest.sin_addr), MAX_ADDR_LEN); + + packet.ip_header = *ip_protocol; + +// qDebug("===================IP Protocol==================\n"); +// qDebug("Version: %d\n", ip_protocol->version_hlen >> 4); +// qDebug("Header Length: %d bytes\n", (ip_protocol->version_hlen & 0x0f) * 4); +// qDebug("Tos: %d\n", ip_protocol->tos); +// qDebug("Total Length: %d\n", ntohs(ip_protocol->tlen)); +// qDebug("Identification: 0x%.4x (%i)\n", ntohs(ip_protocol->identification), ntohs(ip_protocol->identification)); +// qDebug("Flags: %d\n", ntohs(ip_protocol->flags_offset) >> 13); +// qDebug("---Reserved bit: %d\n", (ntohs(ip_protocol->flags_offset) & 0x8000) >> 15); +// qDebug("---Don't fragment: %d\n", (ntohs(ip_protocol->flags_offset) & 0x4000) >> 14); +// qDebug("---More fragment: %d\n", (ntohs(ip_protocol->flags_offset) & 0x2000) >> 13); +// qDebug("Fragment offset: %d\n", ntohs(ip_protocol->flags_offset) & 0x1fff); +// qDebug("Time to live: %d\n", ip_protocol->ttl); +// qDebug("Protocol Type: "); + switch (ip_protocol->proto) + { + case 1: +// qDebug("ICMP"); + packet.protocol = "ICMP"; + break; + case 6: +// qDebug("TCP"); + packet.protocol = "TCP"; + break; + case 17: +// qDebug("UDP"); + packet.protocol = "UDP"; + break; + default: + break; + } +// qDebug(" (%d)\n", ip_protocol->proto); +// qDebug("Header checkSum: 0x%.4x\n", ntohs(ip_protocol->checksum)); +// qDebug("Source: %s\n", sourceIP); +// qDebug("Destination: %s\n", destIP); + + if (ip_protocol->proto == htons(0x0600)) + tcp_protocol_packet_handle(arg, pkt_header, pkt_content); + else if (ip_protocol->proto == htons(0x1100)) + udp_protocol_packet_handle(arg, pkt_header, pkt_content); + else if (ip_protocol->proto == htons(0x0100)) + icmp_protocol_packet_handle(arg, pkt_header, pkt_content); +} +// Ethernet协议处理 +void CapThread::ethernet_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content) { + packet.ether_header = *(EtherHeader*)pkt_content; + u_short ethernet_type; //以太网类型 + u_char *mac_string; //以太网地址 + //获取以太网数据内容 + ethernet_type = ntohs(packet.ether_header.ether_type); + +// qDebug("==============Ethernet Protocol=================\n"); + +// //以太网目标地址 +// mac_string = ethernet_protocol->ether_dhost; + +// qDebug("Destination Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", +// *mac_string, +// *(mac_string + 1), +// *(mac_string + 2), +// *(mac_string + 3), +// *(mac_string + 4), +// *(mac_string + 5)); + +// //以太网源地址 +// mac_string = ethernet_protocol->ether_shost; + +// qDebug("Source Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", +// *mac_string, +// *(mac_string + 1), +// *(mac_string + 2), +// *(mac_string + 3), +// *(mac_string + 4), +// *(mac_string + 5)); + +// qDebug("Ethernet type: "); + switch (ethernet_type) + { + case 0x0800: +// qDebug("%s", "IP"); + break; + case 0x0806: +// qDebug("%s", "ARP"); + packet.protocol = "ARP"; + break; + case 0x0835: +// qDebug("%s", "RARP"); +// packet_data.setRarp_flag(true); + break; + default: +// qDebug("%s", "Unknown Protocol"); + packet.protocol = "Unknown Protocol"; + break; + } +// qDebug(" (0x%04x)\n", ethernet_type); + + switch (ethernet_type) + { + case 0x0800: + ip_protocol_packet_handle(arg, pkt_header, pkt_content); + break; + case 0x0806: + arp_protocol_packet_handle(arg, pkt_header, pkt_content); + break; +// case 0x0835: +// qDebug("==============RARP Protocol=================\n"); +// qDebug("RARP\n"); +// break; +// default: +// qDebug("==============Unknown Protocol==============\n"); +// qDebug("Unknown Protocol\n"); +// break; + } +} diff --git a/ledset/capthread - 副本.h b/ledset/capthread - 副本.h new file mode 100644 index 0000000..2d7f19b --- /dev/null +++ b/ledset/capthread - 副本.h @@ -0,0 +1,114 @@ +#ifndef CAPTHREAD_H +#define CAPTHREAD_H + +#include +#include +#include "pcap.h" +#include + +#pragma comment(lib, "wpcap.lib") +#pragma comment(lib, "Ws2_32.lib") + +#define LINE_LEN 16 +#define MAX_ADDR_LEN 16 + +struct EtherHeader { + u_char ether_dhost[6]; // 目标MAC地址 + u_char ether_shost[6]; // 源MAC地址 + u_short ether_type; // 以太网类型 +}; +struct IpAddress { + u_char byte1; + u_char byte2; + u_char byte3; + u_char byte4; +}; +struct IpHeader { + u_char version_hlen; // 首部长度 版本 + u_char tos; // 服务质量 + u_short tlen; // 总长度 + u_short identification; // 身份识别 + u_short flags_offset; // 标识 分组偏移 + u_char ttl; // 生命周期 + u_char proto; // 协议类型 + u_short checksum; // 包头测验码 + u_int saddr; // 源IP地址 + u_int daddr; // 目的IP地址 +}; +struct TcpHeader { + u_short sport; + u_short dport; + u_int sequence; // 序列码 + u_int ack; // 回复码 + u_char hdrLen; // 首部长度保留字 + u_char flags; // 标志 + u_short windows; // 窗口大小 + u_short checksum; // 校验和 + u_short urgent_pointer; // 紧急指针 +}; +struct UdpHeader { + u_short sport; // 源端口 + u_short dport; // 目标端口 + u_short datalen; // UDP数据长度 + u_short checksum; // 校验和 +}; +struct IcmpHeader { + u_char type; // ICMP类型 + u_char code; // 代码 + u_short checksum; // 校验和 + u_short identification; // 标识 + u_short sequence; // 序列号 + u_long timestamp; // 时间戳 +}; +struct ArpHeader { + u_short hardware_type; // 格式化的硬件地址 + u_short protocol_type; // 协议地址格式 + u_char hardware_length; // 硬件地址长度 + u_char protocol_length; // 协议地址长度 + u_short operation_code; // 操作码 + u_char source_ethernet_address[6]; // 发送者硬件地址 + u_char source_ip_address[4]; // 发送者协议地址 + u_char destination_ethernet_address[6]; // 目的方硬件地址 + u_char destination_ip_address[4]; // 目的方协议地址 +}; + +struct Packet { + QString time; + QString data; + u_int len; + EtherHeader ether_header; + IpHeader ip_header; + TcpHeader tcp_header; + UdpHeader udp_header; + IcmpHeader icmp_header; + ArpHeader arp_header; + QString protocol; +}; + +class CapThread : public QThread { + Q_OBJECT +public: + explicit CapThread(pcap *pcap, QObject *parent = nullptr); + void setPacketList(QList *p){p->clear();packet_list=p;} + pcap *pcap{0}; + QList *packet_list; + Packet packet; + +private: + void tcp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + void udp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + void icmp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + void arp_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + void ip_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + void ethernet_protocol_packet_handle(u_char *arg, const struct pcap_pkthdr *pkt_header, const u_char *pkt_content); + +protected: + void run(); + +signals: + void newPacket(); + +public slots: +}; + +#endif // CAPTHREAD_H diff --git a/ledset/expertsmartpointsetwin.cpp b/ledset/expertsmartpointsetwin.cpp new file mode 100644 index 0000000..b38724f --- /dev/null +++ b/ledset/expertsmartpointsetwin.cpp @@ -0,0 +1,229 @@ +#include "expertsmartpointsetwin.h" +#include +#include +#include +#include +#include +#include + +ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent} { + setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose); + setWindowTitle("智能走点参数配置"); + resize(900, 600); + + auto vBox = new QVBoxLayout(center); + vBox->setContentsMargins(0,0,0,0); + vBox->setSpacing(3); + vBox->addLayout(addBtns(new QHBoxLayout())); + + auto stack = new QStackedLayout; + vBox->addLayout(stack); + + auto page = new QWidget; + stack->addWidget(page); + { + auto vBox = new QVBoxLayout(page); + + auto lb = new QLabel("扫描行数"); + vBox->addWidget(lb); + vBox->addSpacing(50); + + auto hBox = new QHBoxLayout; + vBox->addLayout(hBox); + hBox->addStretch(); + + auto vvv = new QVBoxLayout; + hBox->addLayout(vvv); + + lb = new QLabel("根据亮线的行/列数确定扫描行/列数: "); + vvv->addWidget(lb); + vvv->addSpacing(30); + + auto hhhh = new QHBoxLayout; + hhhh->addStretch(); + auto fdRow = new QRadioButton("行"); + hhhh->addWidget(fdRow); + hhhh->addStretch(); + auto fdCol = new QRadioButton("列"); + hhhh->addWidget(fdCol); + hhhh->addStretch(); + vvv->addLayout(hhhh); + vvv->addSpacing(20); + + hhhh = new QHBoxLayout; + hhhh->addStretch(); + + lb = new QLabel("亮线的行/列数: "); + hhhh->addWidget(lb); + + auto fdNum = new QSpinBox; + fdNum->setRange(0, 9999); + fdNum->setValue(1); + hhhh->addWidget(fdNum); + + hhhh->addStretch(); + vvv->addLayout(hhhh); + + vvv->addStretch(); + + hBox->addStretch(); + + vvv = new QVBoxLayout; + hBox->addLayout(vvv); + + lb = new QLabel("芯片245版本: "); + vvv->addWidget(lb); + vvv->addSpacing(30); + + hhhh = new QHBoxLayout; + hhhh->addStretch(); + auto fdA = new QRadioButton("A"); + hhhh->addWidget(fdA); + hhhh->addStretch(); + auto fdD = new QRadioButton("D"); + hhhh->addWidget(fdD); + hhhh->addStretch(); + vvv->addLayout(hhhh); + + vvv->addStretch(); + hBox->addStretch(); + } + + page = new QWidget; + stack->addWidget(page); + { + auto vBox = new QVBoxLayout(page); + + auto lb = new QLabel("数据线颜色"); + vBox->addWidget(lb); + vBox->addSpacing(50); + + lb = new QLabel("依次点击以下状态, 根据模组颜色选择对应颜色"); + vBox->addWidget(lb, 0, Qt::AlignCenter); + vBox->addSpacing(30); + + auto hhhh = new QHBoxLayout; + hhhh->addStretch(); + auto fdSta1 = new QRadioButton("状态1"); + hhhh->addWidget(fdSta1); + hhhh->addStretch(); + + auto fdR1 = new QRadioButton("红"); + hhhh->addWidget(fdR1); + hhhh->addSpacing(20); + + auto fdG1 = new QRadioButton("绿"); + hhhh->addWidget(fdG1); + hhhh->addSpacing(20); + + auto fdB1 = new QRadioButton("蓝"); + hhhh->addWidget(fdB1); + hhhh->addSpacing(20); + + auto fdNo1 = new QRadioButton("黑"); + hhhh->addWidget(fdNo1); + hhhh->addStretch(); + + vBox->addLayout(hhhh); + vBox->addSpacing(20); + + hhhh = new QHBoxLayout; + hhhh->addStretch(); + auto fdSta2 = new QRadioButton("状态2"); + hhhh->addWidget(fdSta2); + hhhh->addStretch(); + + auto fdR2 = new QRadioButton("红"); + hhhh->addWidget(fdR2); + hhhh->addSpacing(20); + + auto fdG2 = new QRadioButton("绿"); + hhhh->addWidget(fdG2); + hhhh->addSpacing(20); + + auto fdB2 = new QRadioButton("蓝"); + hhhh->addWidget(fdB2); + hhhh->addSpacing(20); + + auto fdNo2 = new QRadioButton("黑"); + hhhh->addWidget(fdNo2); + hhhh->addStretch(); + + vBox->addLayout(hhhh); + vBox->addSpacing(20); + + hhhh = new QHBoxLayout; + hhhh->addStretch(); + auto fdSta3 = new QRadioButton("状态3"); + hhhh->addWidget(fdSta3); + hhhh->addStretch(); + + auto fdR3 = new QRadioButton("红"); + hhhh->addWidget(fdR3); + hhhh->addSpacing(20); + + auto fdG3 = new QRadioButton("绿"); + hhhh->addWidget(fdG3); + hhhh->addSpacing(20); + + auto fdB3 = new QRadioButton("蓝"); + hhhh->addWidget(fdB3); + hhhh->addSpacing(20); + + auto fdNo3 = new QRadioButton("黑"); + hhhh->addWidget(fdNo3); + hhhh->addStretch(); + + vBox->addLayout(hhhh); + vBox->addStretch(); + + auto btnGrp = new QButtonGroup(page); + btnGrp->addButton(fdR1); + btnGrp->addButton(fdG1); + btnGrp->addButton(fdB1); + btnGrp->addButton(fdNo1); + btnGrp = new QButtonGroup(page); + btnGrp->addButton(fdR2); + btnGrp->addButton(fdG2); + btnGrp->addButton(fdB2); + btnGrp->addButton(fdNo2); + btnGrp = new QButtonGroup(page); + btnGrp->addButton(fdR3); + btnGrp->addButton(fdG3); + btnGrp->addButton(fdB3); + btnGrp->addButton(fdNo3); + } + + auto hBox = new QHBoxLayout; + vBox->addLayout(hBox); + + hBox->addStretch(); + + auto btnPrev = new QPushButton("上一步"); + btnPrev->setMinimumSize(90, 30); + hBox->addWidget(btnPrev); + + auto btnNext = new QPushButton("下一步"); + btnNext->setMinimumSize(90, 30); + hBox->addWidget(btnNext); + + connect(btnPrev, &QPushButton::clicked, this, [stack, btnPrev, btnNext] { + auto idx = stack->currentIndex()-1; + stack->setCurrentIndex(idx); + btnPrev->setVisible(idx > 0); + btnNext->setVisible(idx < stack->count()-1); + }); + connect(btnNext, &QPushButton::clicked, this, [stack, btnPrev, btnNext] { + auto idx = stack->currentIndex()+1; + stack->setCurrentIndex(idx); + btnPrev->setVisible(idx > 0); + btnNext->setVisible(idx < stack->count()-1); + }); + + auto btnCcl = new QPushButton("取消"); + btnCcl->setMinimumSize(90, 30); + hBox->addWidget(btnCcl); + + hBox->addSpacing(30); +} diff --git a/ledset/expertsmartpointsetwin.h b/ledset/expertsmartpointsetwin.h new file mode 100644 index 0000000..9fdc9f6 --- /dev/null +++ b/ledset/expertsmartpointsetwin.h @@ -0,0 +1,12 @@ +#ifndef EXPERTSMARTPOINTSETWIN_H +#define EXPERTSMARTPOINTSETWIN_H + +#include "basewin.h" + +class ExpertSmartPointSetWin : public BaseWin { + Q_OBJECT +public: + explicit ExpertSmartPointSetWin(QWidget *parent = nullptr); +}; + +#endif // EXPERTSMARTPOINTSETWIN_H diff --git a/ledset/expertwin.cpp b/ledset/expertwin.cpp new file mode 100644 index 0000000..c85ef17 --- /dev/null +++ b/ledset/expertwin.cpp @@ -0,0 +1,227 @@ +#include "expertwin.h" +#include "table.h" +#include "screenunit.h" +#include "expertsmartpointsetwin.h" +#include +#include +#include +#include +#include + +QColor colors[] {QColor(0xdd0000), QColor(0xdd6600), QColor(0x008800), QColor(0x008888), QColor(0x0000ff), QColor(0x777777), QColor(0xaaaaaa)}; + +ExpertWin::ExpertWin(QWidget *parent) : BaseWin{parent} { + //setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose); + setWindowTitle("专家调屏"); + resize(1024, 720); + + auto vBox = new QVBoxLayout(center); + vBox->setContentsMargins(0,0,0,0); + vBox->setSpacing(3); + vBox->addLayout(addBtns(new QHBoxLayout())); + + auto tab = new QTabWidget; + tab->setStyleSheet(R"rrr( +QTabWidget::pane {border: 1px solid #888; margin-top:-1px;} +QTabBar::tab {margin-top: 4px; padding: 6px 20px; border: 1px solid #888; border-radius: 0 0 3px 3px;} +QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; background-color: #000;} +)rrr"); + vBox->addWidget(tab); + + auto sendPanel = new QWidget; + tab->addTab(sendPanel, "发送设备"); + { + auto hhh = new QHBoxLayout(sendPanel); + hhh->setContentsMargins(6,6,6,6); + + auto wgtLeft = new QWidget; + wgtLeft->setMaximumWidth(400); + hhh->addWidget(wgtLeft); + + auto vLeft = new QVBoxLayout(wgtLeft); + vLeft->setContentsMargins(0,0,0,0); + + auto hBox = new QHBoxLayout; + hBox->addWidget(new QLabel("分辨率: ")); + + auto fdW = new QLineEdit(QString::number(screenWidth)); + hBox->addWidget(fdW); + + hBox->addWidget(new QLabel("X")); + + auto fdH = new QLineEdit(QString::number(screenHeight)); + hBox->addWidget(fdH); + + vLeft->addLayout(hBox); + + hBox = new QHBoxLayout; + hBox->addStretch(); + + auto btnGet = new QPushButton("刷新"); + btnGet->setMinimumWidth(80); + hBox->addWidget(btnGet); + + hBox->addSpacing(40); + + auto btnSet = new QPushButton("设置"); + btnSet->setMinimumWidth(80); + hBox->addWidget(btnSet); + + hBox->addStretch(); + vLeft->addLayout(hBox); + + auto table = new Table{ + {"face", "网口", 40}, + {"x", "X", Table::Stretch}, + {"y", "Y", Table::Stretch}, + {"w", "宽度", Table::Stretch}, + {"h", "高度", Table::Stretch}, + {"audio", "音频开关", Table::Stretch}, + {"backup", "备份开关", Table::Stretch} + }; + table->setDefs(); + vLeft->addWidget(table); + table->setRowCount(4); + + auto canvas = new Canvas; + auto screen = new QWidget(canvas); + screen->setGeometry(0, 0, screenWidth, screenHeight); + screen->setAutoFillBackground(true); + auto pal = palette(); + pal.setColor(QPalette::Window, QColor(0, 0, 0)); + screen->setPalette(pal); + connect(canvas, &Canvas::resized, this, [this, canvas, screen] { + rate = qMin(canvas->width()/(double)screenWidth, canvas->height()/(double)screenHeight); + if(rate==0) return; + screen->resize(qRound(screenWidth*rate), qRound(screenHeight*rate)); + auto children = screen->children(); + foreach(auto childObj, children) { + auto unit = static_cast(childObj); + unit->setGeometry(qRound(unit->mX*rate), qRound(unit->mY*rate), qRound(unit->mW*rate), qRound(unit->mH*rate)); + } + }); + hhh->addWidget(canvas); + + int idx = 0; + for(int rr=0; rr<4; rr++) { + QString name = "P"+QString::number(rr+1); + table->setValue(rr, "name", name); + table->setValue(rr, "x", QString::number(idx)); + table->setValue(rr, "y", "0"); + table->setValue(rr, "w", "128"); + table->setValue(rr, "h", "128"); + table->setValue(rr, "audio", "0"); + table->setValue(rr, "backup", "0"); + + auto unit = new ScreenUnit(this, name, idx, 0, 128, 128, screen); + unit->setAutoFillBackground(true); + pal.setColor(QPalette::Window, colors[rr]); + unit->setPalette(pal); + idx += 128; + } + + + + + } + + + auto receivePanel = new QWidget; + tab->addTab(receivePanel, "接收卡"); + { + auto vBox = new QVBoxLayout(receivePanel); + auto gBox = new QGroupBox("模组信息", receivePanel); + gBox->setForegroundRole(QPalette::Text); + vBox->addWidget(gBox); + + auto hhh = new QHBoxLayout(gBox); + + auto vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + auto lb = new QLabel("驱动芯片: "); + vvv->addWidget(lb); + + lb = new QLabel("译码方式: "); + vvv->addWidget(lb); + + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("驱动芯片"); + vvv->addWidget(lb); + + lb = new QLabel("译码方式"); + vvv->addWidget(lb); + + hhh->addSpacing(20); + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("模组宽度: "); + vvv->addWidget(lb); + + lb = new QLabel("模组高度: "); + vvv->addWidget(lb); + + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("模组宽度"); + vvv->addWidget(lb); + + lb = new QLabel("模组高度"); + vvv->addWidget(lb); + + hhh->addSpacing(20); + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("扫描数: "); + vvv->addWidget(lb); + + lb = new QLabel("数据数组: "); + vvv->addWidget(lb); + + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("扫描数"); + vvv->addWidget(lb); + + lb = new QLabel("数据数组"); + vvv->addWidget(lb); + + hhh->addSpacing(20); + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("数据线颜色: "); + vvv->addWidget(lb); + + lb = new QLabel("模组抽行设置"); + vvv->addWidget(lb); + + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + lb = new QLabel("数据线颜色"); + vvv->addWidget(lb); + + hhh->addStretch(); + vvv = new QVBoxLayout(); + hhh->addLayout(vvv); + + auto btn = new QPushButton("模组选择"); + vvv->addWidget(btn); + + btn = new QPushButton("智能设置"); + connect(btn, &QPushButton::clicked, this, [this] { + (new ExpertSmartPointSetWin(this))->show(); + }); + vvv->addWidget(btn); + + vBox->addStretch(); + } +} diff --git a/ledset/expertwin.h b/ledset/expertwin.h new file mode 100644 index 0000000..c2b229f --- /dev/null +++ b/ledset/expertwin.h @@ -0,0 +1,29 @@ +#ifndef EXPERTWIN_H +#define EXPERTWIN_H + +#include "basewin.h" + +class ExpertWin : public BaseWin { + Q_OBJECT +public: + explicit ExpertWin(QWidget *parent = nullptr); + + int screenWidth{1280}, screenHeight{720}; + double rate{1}; +signals: + +}; + +class Canvas : public QWidget { + Q_OBJECT +public: + explicit Canvas(QWidget *parent = nullptr) : QWidget{parent} {} +protected: + void resizeEvent(QResizeEvent *) override { + emit resized(); + }; + +signals: + void resized(); +}; +#endif // EXPERTWIN_H diff --git a/ledset/fast.cpp b/ledset/fast.cpp new file mode 100644 index 0000000..dd71901 --- /dev/null +++ b/ledset/fast.cpp @@ -0,0 +1,17 @@ +#include "fast.h" +#include + +Fast::Fast(QWidget *parent) : BaseWin{parent} { + setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose); + setWindowTitle("快速调屏"); + resize(620, 700); + + auto vBox = new QVBoxLayout(center); + vBox->setContentsMargins(0,0,0,0); + vBox->addLayout(addBtns(new QHBoxLayout())); + + + vBox->addStretch(); +} + diff --git a/ledset/fast.h b/ledset/fast.h new file mode 100644 index 0000000..a626945 --- /dev/null +++ b/ledset/fast.h @@ -0,0 +1,13 @@ +#ifndef FAST_H +#define FAST_H + +#include "basewin.h" + +class Fast : public BaseWin { + Q_OBJECT +public: + explicit Fast(QWidget *parent = nullptr); + +}; + +#endif // FAST_H diff --git a/ledset/gqt.cpp b/ledset/gqt.cpp new file mode 100644 index 0000000..ed8369c --- /dev/null +++ b/ledset/gqt.cpp @@ -0,0 +1,4 @@ +#include "gqt.h" + +Label::Label(QWidget *parent, Qt::WindowFlags f) : QLabel(parent, f), Wgt(this){} +Label::Label(const QString &text, QWidget *parent, Qt::WindowFlags f) : QLabel(text, parent, f), Wgt(this){} diff --git a/ledset/gqt.h b/ledset/gqt.h new file mode 100644 index 0000000..a488d29 --- /dev/null +++ b/ledset/gqt.h @@ -0,0 +1,33 @@ +#ifndef GLABEL_H +#define GLABEL_H +#include +#include + +template +class Wgt{ +public: + T *wgt; + Wgt(T *wgt = nullptr){ + this->wgt = wgt; + }; + inline Wgt* margin(int a){ + wgt->setMargin(a); + return this; + } +}; + +class VBox : public QVBoxLayout{ +public: + inline VBox(QWidget *parent=nullptr) : QVBoxLayout(parent){} + inline VBox(QBoxLayout *boxLayout){ + boxLayout->addLayout(this); + }; +}; + +class Label : public QLabel, public Wgt