From 0d94876f5925e71d80a40545e707de2368b4f53e Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Wed, 22 Aug 2018 16:27:29 -0500 Subject: [PATCH] Update libpcap-compatible Examples-pcap directory for VS 2015 --- Examples-pcap/MakeAll.sln | 128 ++++++ Examples-pcap/MakeaAll.dsw | 137 ------- Examples-pcap/MakeaAll.sln | 116 ------ Examples-pcap/UDPdump/UDPdump.dsp | 110 ------ Examples-pcap/UDPdump/UDPdump.dsw | 29 -- Examples-pcap/UDPdump/UDPdump.vcproj | 364 ------------------ Examples-pcap/UDPdump/UDPdump.vcxproj | 143 +++++++ Examples-pcap/UDPdump/udpdump.c | 33 +- Examples-pcap/basic_dump/basic_dump.c | 33 +- Examples-pcap/basic_dump/basic_dump.dsp | 110 ------ Examples-pcap/basic_dump/basic_dump.dsw | 29 -- Examples-pcap/basic_dump/basic_dump.vcproj | 364 ------------------ Examples-pcap/basic_dump/basic_dump.vcxproj | 143 +++++++ Examples-pcap/basic_dump_ex/basic_dump_ex.c | 34 +- Examples-pcap/basic_dump_ex/basic_dump_ex.dsp | 110 ------ Examples-pcap/basic_dump_ex/basic_dump_ex.dsw | 29 -- .../basic_dump_ex/basic_dump_ex.vcproj | 364 ------------------ .../basic_dump_ex/basic_dump_ex.vcxproj | 143 +++++++ Examples-pcap/iflist/iflist.c | 32 +- Examples-pcap/iflist/iflist.dsp | 110 ------ Examples-pcap/iflist/iflist.dsw | 29 -- Examples-pcap/iflist/iflist.vcproj | 364 ------------------ Examples-pcap/iflist/iflist.vcxproj | 143 +++++++ Examples-pcap/pcap_filter/pcap_filter.c | 29 ++ Examples-pcap/pcap_filter/pcap_filter.dsp | 110 ------ Examples-pcap/pcap_filter/pcap_filter.dsw | 29 -- Examples-pcap/pcap_filter/pcap_filter.vcproj | 364 ------------------ Examples-pcap/pcap_filter/pcap_filter.vcxproj | 143 +++++++ Examples-pcap/pktdump_ex/pktdump_ex.c | 29 ++ Examples-pcap/pktdump_ex/pktdump_ex.dsp | 110 ------ Examples-pcap/pktdump_ex/pktdump_ex.dsw | 29 -- Examples-pcap/pktdump_ex/pktdump_ex.vcproj | 364 ------------------ Examples-pcap/pktdump_ex/pktdump_ex.vcxproj | 143 +++++++ Examples-pcap/readfile/readfile.c | 29 ++ Examples-pcap/readfile/readfile.dsp | 110 ------ Examples-pcap/readfile/readfile.dsw | 29 -- Examples-pcap/readfile/readfile.vcproj | 364 ------------------ Examples-pcap/readfile/readfile.vcxproj | 143 +++++++ Examples-pcap/readfile_ex/readfile_ex.c | 29 ++ Examples-pcap/readfile_ex/readfile_ex.dsp | 110 ------ Examples-pcap/readfile_ex/readfile_ex.dsw | 29 -- Examples-pcap/readfile_ex/readfile_ex.vcproj | 364 ------------------ Examples-pcap/readfile_ex/readfile_ex.vcxproj | 143 +++++++ Examples-pcap/savedump/savedump.c | 31 +- Examples-pcap/savedump/savedump.dsp | 110 ------ Examples-pcap/savedump/savedump.dsw | 29 -- Examples-pcap/savedump/savedump.vcproj | 364 ------------------ Examples-pcap/savedump/savedump.vcxproj | 143 +++++++ Examples-pcap/sendpack/sendpack.c | 29 ++ Examples-pcap/sendpack/sendpack.dsp | 110 ------ Examples-pcap/sendpack/sendpack.dsw | 29 -- Examples-pcap/sendpack/sendpack.vcproj | 364 ------------------ Examples-pcap/sendpack/sendpack.vcxproj | 143 +++++++ Examples-pcap/stats/stats.dsp | 110 ------ Examples-pcap/stats/stats.dsw | 29 -- Examples-pcap/winpcap_stress/winpcap_stress.c | 31 +- .../winpcap_stress/winpcap_stress.dsp | 106 ----- .../winpcap_stress/winpcap_stress.dsw | 29 -- .../winpcap_stress/winpcap_stress.vcxproj | 143 +++++++ 59 files changed, 2030 insertions(+), 5567 deletions(-) create mode 100644 Examples-pcap/MakeAll.sln delete mode 100644 Examples-pcap/MakeaAll.dsw delete mode 100644 Examples-pcap/MakeaAll.sln delete mode 100644 Examples-pcap/UDPdump/UDPdump.dsp delete mode 100644 Examples-pcap/UDPdump/UDPdump.dsw delete mode 100644 Examples-pcap/UDPdump/UDPdump.vcproj create mode 100644 Examples-pcap/UDPdump/UDPdump.vcxproj delete mode 100644 Examples-pcap/basic_dump/basic_dump.dsp delete mode 100644 Examples-pcap/basic_dump/basic_dump.dsw delete mode 100644 Examples-pcap/basic_dump/basic_dump.vcproj create mode 100644 Examples-pcap/basic_dump/basic_dump.vcxproj delete mode 100644 Examples-pcap/basic_dump_ex/basic_dump_ex.dsp delete mode 100644 Examples-pcap/basic_dump_ex/basic_dump_ex.dsw delete mode 100644 Examples-pcap/basic_dump_ex/basic_dump_ex.vcproj create mode 100644 Examples-pcap/basic_dump_ex/basic_dump_ex.vcxproj delete mode 100644 Examples-pcap/iflist/iflist.dsp delete mode 100644 Examples-pcap/iflist/iflist.dsw delete mode 100644 Examples-pcap/iflist/iflist.vcproj create mode 100644 Examples-pcap/iflist/iflist.vcxproj delete mode 100644 Examples-pcap/pcap_filter/pcap_filter.dsp delete mode 100644 Examples-pcap/pcap_filter/pcap_filter.dsw delete mode 100644 Examples-pcap/pcap_filter/pcap_filter.vcproj create mode 100644 Examples-pcap/pcap_filter/pcap_filter.vcxproj delete mode 100644 Examples-pcap/pktdump_ex/pktdump_ex.dsp delete mode 100644 Examples-pcap/pktdump_ex/pktdump_ex.dsw delete mode 100644 Examples-pcap/pktdump_ex/pktdump_ex.vcproj create mode 100644 Examples-pcap/pktdump_ex/pktdump_ex.vcxproj delete mode 100644 Examples-pcap/readfile/readfile.dsp delete mode 100644 Examples-pcap/readfile/readfile.dsw delete mode 100644 Examples-pcap/readfile/readfile.vcproj create mode 100644 Examples-pcap/readfile/readfile.vcxproj delete mode 100644 Examples-pcap/readfile_ex/readfile_ex.dsp delete mode 100644 Examples-pcap/readfile_ex/readfile_ex.dsw delete mode 100644 Examples-pcap/readfile_ex/readfile_ex.vcproj create mode 100644 Examples-pcap/readfile_ex/readfile_ex.vcxproj delete mode 100644 Examples-pcap/savedump/savedump.dsp delete mode 100644 Examples-pcap/savedump/savedump.dsw delete mode 100644 Examples-pcap/savedump/savedump.vcproj create mode 100644 Examples-pcap/savedump/savedump.vcxproj delete mode 100644 Examples-pcap/sendpack/sendpack.dsp delete mode 100644 Examples-pcap/sendpack/sendpack.dsw delete mode 100644 Examples-pcap/sendpack/sendpack.vcproj create mode 100644 Examples-pcap/sendpack/sendpack.vcxproj delete mode 100644 Examples-pcap/stats/stats.dsp delete mode 100644 Examples-pcap/stats/stats.dsw delete mode 100644 Examples-pcap/winpcap_stress/winpcap_stress.dsp delete mode 100644 Examples-pcap/winpcap_stress/winpcap_stress.dsw create mode 100644 Examples-pcap/winpcap_stress/winpcap_stress.vcxproj diff --git a/Examples-pcap/MakeAll.sln b/Examples-pcap/MakeAll.sln new file mode 100644 index 00000000..8a457bee --- /dev/null +++ b/Examples-pcap/MakeAll.sln @@ -0,0 +1,128 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic_dump", "basic_dump\basic_dump.vcxproj", "{66297062-96A0-4F0E-B147-3C8384031232}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic_dump_ex", "basic_dump_ex\basic_dump_ex.vcxproj", "{92849630-6B09-409C-A7AD-E91E682558B1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iflist", "iflist\iflist.vcxproj", "{0B27B213-4BF3-4611-B412-A2D09CDE8632}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcap_filter", "pcap_filter\pcap_filter.vcxproj", "{B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pktdump_ex", "pktdump_ex\pktdump_ex.vcxproj", "{3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readfile", "readfile\readfile.vcxproj", "{161E7606-F4CD-4A04-AB6B-5837F7818EE1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readfile_ex", "readfile_ex\readfile_ex.vcxproj", "{3071DFB6-68F8-41EF-A56C-0C7A71B6967C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "savedump", "savedump\savedump.vcxproj", "{1B8791CB-DD15-46BF-B0A2-879892085538}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sendpack", "sendpack\sendpack.vcxproj", "{1C376689-5F61-48E7-AE83-0DED9EE9E458}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UDPdump", "UDPdump\UDPdump.vcxproj", "{42E5F1D6-6E83-4C13-83CC-C6CD83478C58}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpcap_stress", "winpcap_stress\winpcap_stress.vcxproj", "{4F73FCBE-F4ED-45EA-A207-38633D9526D0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {66297062-96A0-4F0E-B147-3C8384031232}.Debug|x64.ActiveCfg = Debug|x64 + {66297062-96A0-4F0E-B147-3C8384031232}.Debug|x64.Build.0 = Debug|x64 + {66297062-96A0-4F0E-B147-3C8384031232}.Debug|x86.ActiveCfg = Debug|Win32 + {66297062-96A0-4F0E-B147-3C8384031232}.Debug|x86.Build.0 = Debug|Win32 + {66297062-96A0-4F0E-B147-3C8384031232}.Release|x64.ActiveCfg = Release|x64 + {66297062-96A0-4F0E-B147-3C8384031232}.Release|x64.Build.0 = Release|x64 + {66297062-96A0-4F0E-B147-3C8384031232}.Release|x86.ActiveCfg = Release|Win32 + {66297062-96A0-4F0E-B147-3C8384031232}.Release|x86.Build.0 = Release|Win32 + {92849630-6B09-409C-A7AD-E91E682558B1}.Debug|x64.ActiveCfg = Debug|x64 + {92849630-6B09-409C-A7AD-E91E682558B1}.Debug|x64.Build.0 = Debug|x64 + {92849630-6B09-409C-A7AD-E91E682558B1}.Debug|x86.ActiveCfg = Debug|Win32 + {92849630-6B09-409C-A7AD-E91E682558B1}.Debug|x86.Build.0 = Debug|Win32 + {92849630-6B09-409C-A7AD-E91E682558B1}.Release|x64.ActiveCfg = Release|x64 + {92849630-6B09-409C-A7AD-E91E682558B1}.Release|x64.Build.0 = Release|x64 + {92849630-6B09-409C-A7AD-E91E682558B1}.Release|x86.ActiveCfg = Release|Win32 + {92849630-6B09-409C-A7AD-E91E682558B1}.Release|x86.Build.0 = Release|Win32 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Debug|x64.ActiveCfg = Debug|x64 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Debug|x64.Build.0 = Debug|x64 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Debug|x86.ActiveCfg = Debug|Win32 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Debug|x86.Build.0 = Debug|Win32 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Release|x64.ActiveCfg = Release|x64 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Release|x64.Build.0 = Release|x64 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Release|x86.ActiveCfg = Release|Win32 + {0B27B213-4BF3-4611-B412-A2D09CDE8632}.Release|x86.Build.0 = Release|Win32 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Debug|x64.ActiveCfg = Debug|x64 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Debug|x64.Build.0 = Debug|x64 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Debug|x86.ActiveCfg = Debug|Win32 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Debug|x86.Build.0 = Debug|Win32 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Release|x64.ActiveCfg = Release|x64 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Release|x64.Build.0 = Release|x64 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Release|x86.ActiveCfg = Release|Win32 + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF}.Release|x86.Build.0 = Release|Win32 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Debug|x64.ActiveCfg = Debug|x64 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Debug|x64.Build.0 = Debug|x64 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Debug|x86.ActiveCfg = Debug|Win32 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Debug|x86.Build.0 = Debug|Win32 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Release|x64.ActiveCfg = Release|x64 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Release|x64.Build.0 = Release|x64 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Release|x86.ActiveCfg = Release|Win32 + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E}.Release|x86.Build.0 = Release|Win32 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Debug|x64.ActiveCfg = Debug|x64 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Debug|x64.Build.0 = Debug|x64 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Debug|x86.ActiveCfg = Debug|Win32 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Debug|x86.Build.0 = Debug|Win32 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Release|x64.ActiveCfg = Release|x64 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Release|x64.Build.0 = Release|x64 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Release|x86.ActiveCfg = Release|Win32 + {161E7606-F4CD-4A04-AB6B-5837F7818EE1}.Release|x86.Build.0 = Release|Win32 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Debug|x64.ActiveCfg = Debug|x64 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Debug|x64.Build.0 = Debug|x64 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Debug|x86.ActiveCfg = Debug|Win32 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Debug|x86.Build.0 = Debug|Win32 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Release|x64.ActiveCfg = Release|x64 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Release|x64.Build.0 = Release|x64 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Release|x86.ActiveCfg = Release|Win32 + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C}.Release|x86.Build.0 = Release|Win32 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Debug|x64.ActiveCfg = Debug|x64 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Debug|x64.Build.0 = Debug|x64 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Debug|x86.ActiveCfg = Debug|Win32 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Debug|x86.Build.0 = Debug|Win32 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Release|x64.ActiveCfg = Release|x64 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Release|x64.Build.0 = Release|x64 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Release|x86.ActiveCfg = Release|Win32 + {1B8791CB-DD15-46BF-B0A2-879892085538}.Release|x86.Build.0 = Release|Win32 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Debug|x64.ActiveCfg = Debug|x64 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Debug|x64.Build.0 = Debug|x64 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Debug|x86.ActiveCfg = Debug|Win32 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Debug|x86.Build.0 = Debug|Win32 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Release|x64.ActiveCfg = Release|x64 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Release|x64.Build.0 = Release|x64 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Release|x86.ActiveCfg = Release|Win32 + {1C376689-5F61-48E7-AE83-0DED9EE9E458}.Release|x86.Build.0 = Release|Win32 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Debug|x64.ActiveCfg = Debug|x64 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Debug|x64.Build.0 = Debug|x64 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Debug|x86.ActiveCfg = Debug|Win32 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Debug|x86.Build.0 = Debug|Win32 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Release|x64.ActiveCfg = Release|x64 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Release|x64.Build.0 = Release|x64 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Release|x86.ActiveCfg = Release|Win32 + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58}.Release|x86.Build.0 = Release|Win32 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Debug|x64.ActiveCfg = Debug|x64 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Debug|x64.Build.0 = Debug|x64 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Debug|x86.ActiveCfg = Debug|Win32 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Debug|x86.Build.0 = Debug|Win32 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Release|x64.ActiveCfg = Release|x64 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Release|x64.Build.0 = Release|x64 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Release|x86.ActiveCfg = Release|Win32 + {4F73FCBE-F4ED-45EA-A207-38633D9526D0}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Examples-pcap/MakeaAll.dsw b/Examples-pcap/MakeaAll.dsw deleted file mode 100644 index 68075d3e..00000000 --- a/Examples-pcap/MakeaAll.dsw +++ /dev/null @@ -1,137 +0,0 @@ -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/Examples-pcap/MakeaAll.sln b/Examples-pcap/MakeaAll.sln deleted file mode 100644 index b0d9f29d..00000000 --- a/Examples-pcap/MakeaAll.sln +++ /dev/null @@ -1,116 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UDPdump", "UDPdump\UDPdump.vcproj", "{B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic_dump", "basic_dump\basic_dump.vcproj", "{80E57A40-2069-4261-8470-A56A94EA4D48}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basic_dump_ex", "basic_dump_ex\basic_dump_ex.vcproj", "{6C124B8E-5310-4294-9148-0D62AF96A649}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iflist", "iflist\iflist.vcproj", "{AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcap_filter", "pcap_filter\pcap_filter.vcproj", "{1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pktdump_ex", "pktdump_ex\pktdump_ex.vcproj", "{E501F12B-2CAD-4B65-BFB9-E012553BE0A2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readfile", "readfile\readfile.vcproj", "{D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readfile_ex", "readfile_ex\readfile_ex.vcproj", "{C34F10C8-A733-4D64-B1AF-2AAA53FA6506}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "savedump", "savedump\savedump.vcproj", "{FC4AF1CF-72A5-4862-9F38-5063A588B2A6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sendpack", "sendpack\sendpack.vcproj", "{58E5469B-4C43-43C5-9E63-86D92D870D19}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Debug|Win32.ActiveCfg = Debug|Win32 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Debug|Win32.Build.0 = Debug|Win32 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Debug|x64.ActiveCfg = Debug|x64 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Debug|x64.Build.0 = Debug|x64 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Release|Win32.ActiveCfg = Release|Win32 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Release|Win32.Build.0 = Release|Win32 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Release|x64.ActiveCfg = Release|x64 - {B484FA1C-6508-4DDA-8DA7-EA14DB6585AE}.Release|x64.Build.0 = Release|x64 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Debug|Win32.ActiveCfg = Debug|Win32 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Debug|Win32.Build.0 = Debug|Win32 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Debug|x64.ActiveCfg = Debug|x64 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Debug|x64.Build.0 = Debug|x64 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Release|Win32.ActiveCfg = Release|Win32 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Release|Win32.Build.0 = Release|Win32 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Release|x64.ActiveCfg = Release|x64 - {80E57A40-2069-4261-8470-A56A94EA4D48}.Release|x64.Build.0 = Release|x64 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Debug|Win32.ActiveCfg = Debug|Win32 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Debug|Win32.Build.0 = Debug|Win32 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Debug|x64.ActiveCfg = Debug|x64 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Debug|x64.Build.0 = Debug|x64 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Release|Win32.ActiveCfg = Release|Win32 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Release|Win32.Build.0 = Release|Win32 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Release|x64.ActiveCfg = Release|x64 - {6C124B8E-5310-4294-9148-0D62AF96A649}.Release|x64.Build.0 = Release|x64 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Debug|Win32.ActiveCfg = Debug|Win32 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Debug|Win32.Build.0 = Debug|Win32 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Debug|x64.ActiveCfg = Debug|x64 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Debug|x64.Build.0 = Debug|x64 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Release|Win32.ActiveCfg = Release|Win32 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Release|Win32.Build.0 = Release|Win32 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Release|x64.ActiveCfg = Release|x64 - {AD22E53E-6B36-4514-8F90-A92D2CFAAEBF}.Release|x64.Build.0 = Release|x64 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Debug|Win32.ActiveCfg = Debug|Win32 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Debug|Win32.Build.0 = Debug|Win32 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Debug|x64.ActiveCfg = Debug|x64 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Debug|x64.Build.0 = Debug|x64 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Release|Win32.ActiveCfg = Release|Win32 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Release|Win32.Build.0 = Release|Win32 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Release|x64.ActiveCfg = Release|x64 - {1F9B464B-56FE-4649-BE0E-E0B9B3DDEB00}.Release|x64.Build.0 = Release|x64 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Debug|Win32.ActiveCfg = Debug|Win32 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Debug|Win32.Build.0 = Debug|Win32 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Debug|x64.ActiveCfg = Debug|x64 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Debug|x64.Build.0 = Debug|x64 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Release|Win32.ActiveCfg = Release|Win32 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Release|Win32.Build.0 = Release|Win32 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Release|x64.ActiveCfg = Release|x64 - {E501F12B-2CAD-4B65-BFB9-E012553BE0A2}.Release|x64.Build.0 = Release|x64 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Debug|Win32.Build.0 = Debug|Win32 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Debug|x64.ActiveCfg = Debug|x64 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Debug|x64.Build.0 = Debug|x64 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Release|Win32.ActiveCfg = Release|Win32 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Release|Win32.Build.0 = Release|Win32 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Release|x64.ActiveCfg = Release|x64 - {D47AE2DA-FDC6-430E-AA6A-15290E3AA5B5}.Release|x64.Build.0 = Release|x64 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Debug|Win32.ActiveCfg = Debug|Win32 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Debug|Win32.Build.0 = Debug|Win32 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Debug|x64.ActiveCfg = Debug|x64 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Debug|x64.Build.0 = Debug|x64 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Release|Win32.ActiveCfg = Release|Win32 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Release|Win32.Build.0 = Release|Win32 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Release|x64.ActiveCfg = Release|x64 - {C34F10C8-A733-4D64-B1AF-2AAA53FA6506}.Release|x64.Build.0 = Release|x64 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Debug|Win32.Build.0 = Debug|Win32 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Debug|x64.ActiveCfg = Debug|x64 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Debug|x64.Build.0 = Debug|x64 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Release|Win32.ActiveCfg = Release|Win32 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Release|Win32.Build.0 = Release|Win32 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Release|x64.ActiveCfg = Release|x64 - {FC4AF1CF-72A5-4862-9F38-5063A588B2A6}.Release|x64.Build.0 = Release|x64 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Debug|Win32.ActiveCfg = Debug|Win32 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Debug|Win32.Build.0 = Debug|Win32 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Debug|x64.ActiveCfg = Debug|x64 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Debug|x64.Build.0 = Debug|x64 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Release|Win32.ActiveCfg = Release|Win32 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Release|Win32.Build.0 = Release|Win32 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Release|x64.ActiveCfg = Release|x64 - {58E5469B-4C43-43C5-9E63-86D92D870D19}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Examples-pcap/UDPdump/UDPdump.dsp b/Examples-pcap/UDPdump/UDPdump.dsp deleted file mode 100644 index 40e38063..00000000 --- a/Examples-pcap/UDPdump/UDPdump.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/UDPdump/UDPdump.dsw b/Examples-pcap/UDPdump/UDPdump.dsw deleted file mode 100644 index 0def7090..00000000 --- a/Examples-pcap/UDPdump/UDPdump.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/UDPdump/UDPdump.vcproj b/Examples-pcap/UDPdump/UDPdump.vcproj deleted file mode 100644 index 40d42c0b..00000000 --- a/Examples-pcap/UDPdump/UDPdump.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/UDPdump/UDPdump.vcxproj b/Examples-pcap/UDPdump/UDPdump.vcxproj new file mode 100644 index 00000000..bdebdac6 --- /dev/null +++ b/Examples-pcap/UDPdump/UDPdump.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {42E5F1D6-6E83-4C13-83CC-C6CD83478C58} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/UDPdump/udpdump.c b/Examples-pcap/UDPdump/udpdump.c index 3bfcde15..a2348a0a 100644 --- a/Examples-pcap/UDPdump/udpdump.c +++ b/Examples-pcap/UDPdump/udpdump.c @@ -39,7 +39,27 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "pcap.h" +#include + +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif /* 4 bytes IP address */ typedef struct ip_address @@ -91,6 +111,15 @@ int main() char packet_filter[] = "ip and udp"; struct bpf_program fcode; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Retrieve the device list */ if(pcap_findalldevs(&alldevs, errbuf) == -1) { @@ -139,7 +168,7 @@ int main() errbuf // error buffer )) == NULL) { - fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n"); + fprintf(stderr,"\nUnable to open the adapter: %s\n", errbuf); /* Free the device list */ pcap_freealldevs(alldevs); return -1; diff --git a/Examples-pcap/basic_dump/basic_dump.c b/Examples-pcap/basic_dump/basic_dump.c index 89fa6641..f03f4cf5 100644 --- a/Examples-pcap/basic_dump/basic_dump.c +++ b/Examples-pcap/basic_dump/basic_dump.c @@ -6,7 +6,27 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "pcap.h" +#include +#include +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif /* prototype of the packet handler */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); @@ -19,7 +39,16 @@ int main() int i=0; pcap_t *adhandle; char errbuf[PCAP_ERRBUF_SIZE]; - + +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Retrieve the device list */ if(pcap_findalldevs(&alldevs, errbuf) == -1) { diff --git a/Examples-pcap/basic_dump/basic_dump.dsp b/Examples-pcap/basic_dump/basic_dump.dsp deleted file mode 100644 index 3e8bc029..00000000 --- a/Examples-pcap/basic_dump/basic_dump.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/basic_dump/basic_dump.dsw b/Examples-pcap/basic_dump/basic_dump.dsw deleted file mode 100644 index 1f6a6ff4..00000000 --- a/Examples-pcap/basic_dump/basic_dump.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/basic_dump/basic_dump.vcproj b/Examples-pcap/basic_dump/basic_dump.vcproj deleted file mode 100644 index cf4907f4..00000000 --- a/Examples-pcap/basic_dump/basic_dump.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/basic_dump/basic_dump.vcxproj b/Examples-pcap/basic_dump/basic_dump.vcxproj new file mode 100644 index 00000000..778c8330 --- /dev/null +++ b/Examples-pcap/basic_dump/basic_dump.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {66297062-96A0-4F0E-B147-3C8384031232} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/basic_dump_ex/basic_dump_ex.c b/Examples-pcap/basic_dump_ex/basic_dump_ex.c index 4c109dcc..e97026a7 100644 --- a/Examples-pcap/basic_dump_ex/basic_dump_ex.c +++ b/Examples-pcap/basic_dump_ex/basic_dump_ex.c @@ -6,7 +6,27 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "pcap.h" +#include +#include +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif int main() { @@ -22,8 +42,16 @@ int main() struct pcap_pkthdr *header; const u_char *pkt_data; time_t local_tv_sec; - - + +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Retrieve the device list */ if(pcap_findalldevs(&alldevs, errbuf) == -1) { diff --git a/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp b/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp deleted file mode 100644 index e798f636..00000000 --- a/Examples-pcap/basic_dump_ex/basic_dump_ex.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw b/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw deleted file mode 100644 index e3364367..00000000 --- a/Examples-pcap/basic_dump_ex/basic_dump_ex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/basic_dump_ex/basic_dump_ex.vcproj b/Examples-pcap/basic_dump_ex/basic_dump_ex.vcproj deleted file mode 100644 index 6c63b8e9..00000000 --- a/Examples-pcap/basic_dump_ex/basic_dump_ex.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/basic_dump_ex/basic_dump_ex.vcxproj b/Examples-pcap/basic_dump_ex/basic_dump_ex.vcxproj new file mode 100644 index 00000000..d63d6b6c --- /dev/null +++ b/Examples-pcap/basic_dump_ex/basic_dump_ex.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {92849630-6B09-409C-A7AD-E91E682558B1} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/iflist/iflist.c b/Examples-pcap/iflist/iflist.c index d4128f3c..3793a434 100644 --- a/Examples-pcap/iflist/iflist.c +++ b/Examples-pcap/iflist/iflist.c @@ -39,7 +39,8 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "pcap.h" +#include +#include #ifndef WIN32 #include @@ -48,6 +49,26 @@ #include #endif +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + // Function prototypes void ifprint(pcap_if_t *d); @@ -61,6 +82,15 @@ int main() pcap_if_t *d; char errbuf[PCAP_ERRBUF_SIZE+1]; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Retrieve the device list */ if(pcap_findalldevs(&alldevs, errbuf) == -1) { diff --git a/Examples-pcap/iflist/iflist.dsp b/Examples-pcap/iflist/iflist.dsp deleted file mode 100644 index b1a8c8c3..00000000 --- a/Examples-pcap/iflist/iflist.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/iflist/iflist.dsw b/Examples-pcap/iflist/iflist.dsw deleted file mode 100644 index 6bd686d0..00000000 --- a/Examples-pcap/iflist/iflist.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/iflist/iflist.vcproj b/Examples-pcap/iflist/iflist.vcproj deleted file mode 100644 index 779c0012..00000000 --- a/Examples-pcap/iflist/iflist.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/iflist/iflist.vcxproj b/Examples-pcap/iflist/iflist.vcxproj new file mode 100644 index 00000000..2c481f8d --- /dev/null +++ b/Examples-pcap/iflist/iflist.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {0B27B213-4BF3-4611-B412-A2D09CDE8632} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.lib;ws2_32.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + \ No newline at end of file diff --git a/Examples-pcap/pcap_filter/pcap_filter.c b/Examples-pcap/pcap_filter/pcap_filter.c index e910488e..2413fcd3 100644 --- a/Examples-pcap/pcap_filter/pcap_filter.c +++ b/Examples-pcap/pcap_filter/pcap_filter.c @@ -40,6 +40,26 @@ #define MAX_PRINT 80 #define MAX_LINE 16 +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + void usage(); @@ -59,6 +79,15 @@ int main(int argc, char **argv) struct pcap_pkthdr *header; const u_char *pkt_data; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + if (argc == 1) { usage(); diff --git a/Examples-pcap/pcap_filter/pcap_filter.dsp b/Examples-pcap/pcap_filter/pcap_filter.dsp deleted file mode 100644 index 5bd65b5b..00000000 --- a/Examples-pcap/pcap_filter/pcap_filter.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/pcap_filter/pcap_filter.dsw b/Examples-pcap/pcap_filter/pcap_filter.dsw deleted file mode 100644 index a9031834..00000000 --- a/Examples-pcap/pcap_filter/pcap_filter.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/pcap_filter/pcap_filter.vcproj b/Examples-pcap/pcap_filter/pcap_filter.vcproj deleted file mode 100644 index ec5450df..00000000 --- a/Examples-pcap/pcap_filter/pcap_filter.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/pcap_filter/pcap_filter.vcxproj b/Examples-pcap/pcap_filter/pcap_filter.vcxproj new file mode 100644 index 00000000..57acf619 --- /dev/null +++ b/Examples-pcap/pcap_filter/pcap_filter.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {B9F68F6F-22AE-47A2-A3A3-1212831AF9FF} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/pktdump_ex/pktdump_ex.c b/Examples-pcap/pktdump_ex/pktdump_ex.c index 6ff42cac..8ad1b76d 100644 --- a/Examples-pcap/pktdump_ex/pktdump_ex.c +++ b/Examples-pcap/pktdump_ex/pktdump_ex.c @@ -46,6 +46,26 @@ #define LINE_LEN 16 +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + int main(int argc, char **argv) { @@ -57,6 +77,15 @@ int main(int argc, char **argv) struct pcap_pkthdr *header; const u_char *pkt_data; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + printf("pktdump_ex: prints the packets of the network using WinPcap.\n"); printf(" Usage: pktdump_ex [-s source]\n\n" " Examples:\n" diff --git a/Examples-pcap/pktdump_ex/pktdump_ex.dsp b/Examples-pcap/pktdump_ex/pktdump_ex.dsp deleted file mode 100644 index 85c062da..00000000 --- a/Examples-pcap/pktdump_ex/pktdump_ex.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/pktdump_ex/pktdump_ex.dsw b/Examples-pcap/pktdump_ex/pktdump_ex.dsw deleted file mode 100644 index b0f6812f..00000000 --- a/Examples-pcap/pktdump_ex/pktdump_ex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/pktdump_ex/pktdump_ex.vcproj b/Examples-pcap/pktdump_ex/pktdump_ex.vcproj deleted file mode 100644 index 74b98e56..00000000 --- a/Examples-pcap/pktdump_ex/pktdump_ex.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/pktdump_ex/pktdump_ex.vcxproj b/Examples-pcap/pktdump_ex/pktdump_ex.vcxproj new file mode 100644 index 00000000..947e9c83 --- /dev/null +++ b/Examples-pcap/pktdump_ex/pktdump_ex.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {3D62DEB4-3536-44AE-8E4B-AD6DFF1B795E} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/readfile/readfile.c b/Examples-pcap/readfile/readfile.c index 187634f0..c08c86db 100644 --- a/Examples-pcap/readfile/readfile.c +++ b/Examples-pcap/readfile/readfile.c @@ -3,6 +3,26 @@ #define LINE_LEN 16 +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + void dispatcher_handler(u_char *, const struct pcap_pkthdr *, const u_char *); int main(int argc, char **argv) @@ -10,6 +30,15 @@ int main(int argc, char **argv) pcap_t *fp; char errbuf[PCAP_ERRBUF_SIZE]; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + if(argc != 2) { printf("usage: %s filename", argv[0]); diff --git a/Examples-pcap/readfile/readfile.dsp b/Examples-pcap/readfile/readfile.dsp deleted file mode 100644 index 88972bb5..00000000 --- a/Examples-pcap/readfile/readfile.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/readfile/readfile.dsw b/Examples-pcap/readfile/readfile.dsw deleted file mode 100644 index f971e0b6..00000000 --- a/Examples-pcap/readfile/readfile.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/readfile/readfile.vcproj b/Examples-pcap/readfile/readfile.vcproj deleted file mode 100644 index 46e9df92..00000000 --- a/Examples-pcap/readfile/readfile.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/readfile/readfile.vcxproj b/Examples-pcap/readfile/readfile.vcxproj new file mode 100644 index 00000000..46218fc6 --- /dev/null +++ b/Examples-pcap/readfile/readfile.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {161E7606-F4CD-4A04-AB6B-5837F7818EE1} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/readfile_ex/readfile_ex.c b/Examples-pcap/readfile_ex/readfile_ex.c index 2324c065..109d2258 100644 --- a/Examples-pcap/readfile_ex/readfile_ex.c +++ b/Examples-pcap/readfile_ex/readfile_ex.c @@ -3,6 +3,26 @@ #define LINE_LEN 16 +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + int main(int argc, char **argv) { pcap_t *fp; @@ -12,6 +32,15 @@ int main(int argc, char **argv) u_int i=0; int res; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + if(argc != 2) { printf("usage: %s filename", argv[0]); diff --git a/Examples-pcap/readfile_ex/readfile_ex.dsp b/Examples-pcap/readfile_ex/readfile_ex.dsp deleted file mode 100644 index 2c1b4889..00000000 --- a/Examples-pcap/readfile_ex/readfile_ex.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/readfile_ex/readfile_ex.dsw b/Examples-pcap/readfile_ex/readfile_ex.dsw deleted file mode 100644 index 2713b365..00000000 --- a/Examples-pcap/readfile_ex/readfile_ex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/readfile_ex/readfile_ex.vcproj b/Examples-pcap/readfile_ex/readfile_ex.vcproj deleted file mode 100644 index a75e0dd9..00000000 --- a/Examples-pcap/readfile_ex/readfile_ex.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/readfile_ex/readfile_ex.vcxproj b/Examples-pcap/readfile_ex/readfile_ex.vcxproj new file mode 100644 index 00000000..df9ae4d7 --- /dev/null +++ b/Examples-pcap/readfile_ex/readfile_ex.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {3071DFB6-68F8-41EF-A56C-0C7A71B6967C} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/savedump/savedump.c b/Examples-pcap/savedump/savedump.c index 84273a7e..6c508e1d 100644 --- a/Examples-pcap/savedump/savedump.c +++ b/Examples-pcap/savedump/savedump.c @@ -6,7 +6,27 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "pcap.h" +#include + +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif /* prototype of the packet handler */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data); @@ -21,6 +41,15 @@ int main(int argc, char **argv) char errbuf[PCAP_ERRBUF_SIZE]; pcap_dumper_t *dumpfile; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Check command line */ if(argc != 2) diff --git a/Examples-pcap/savedump/savedump.dsp b/Examples-pcap/savedump/savedump.dsp deleted file mode 100644 index 7d2e366b..00000000 --- a/Examples-pcap/savedump/savedump.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/savedump/savedump.dsw b/Examples-pcap/savedump/savedump.dsw deleted file mode 100644 index 32473951..00000000 --- a/Examples-pcap/savedump/savedump.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/savedump/savedump.vcproj b/Examples-pcap/savedump/savedump.vcproj deleted file mode 100644 index 79f6b461..00000000 --- a/Examples-pcap/savedump/savedump.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/savedump/savedump.vcxproj b/Examples-pcap/savedump/savedump.vcxproj new file mode 100644 index 00000000..1adc137a --- /dev/null +++ b/Examples-pcap/savedump/savedump.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {1B8791CB-DD15-46BF-B0A2-879892085538} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/sendpack/sendpack.c b/Examples-pcap/sendpack/sendpack.c index 28af84cf..5b27fafc 100644 --- a/Examples-pcap/sendpack/sendpack.c +++ b/Examples-pcap/sendpack/sendpack.c @@ -3,6 +3,26 @@ #include +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + int main(int argc, char **argv) { @@ -11,6 +31,15 @@ int main(int argc, char **argv) u_char packet[100]; int i; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + /* Check the validity of the command line */ if (argc != 2) { diff --git a/Examples-pcap/sendpack/sendpack.dsp b/Examples-pcap/sendpack/sendpack.dsp deleted file mode 100644 index 982ce670..00000000 --- a/Examples-pcap/sendpack/sendpack.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# 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/Examples-pcap/sendpack/sendpack.dsw b/Examples-pcap/sendpack/sendpack.dsw deleted file mode 100644 index 3e0424d3..00000000 --- a/Examples-pcap/sendpack/sendpack.dsw +++ /dev/null @@ -1,29 +0,0 @@ -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/Examples-pcap/sendpack/sendpack.vcproj b/Examples-pcap/sendpack/sendpack.vcproj deleted file mode 100644 index 1a48c44c..00000000 --- a/Examples-pcap/sendpack/sendpack.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Examples-pcap/sendpack/sendpack.vcxproj b/Examples-pcap/sendpack/sendpack.vcxproj new file mode 100644 index 00000000..d0e7685a --- /dev/null +++ b/Examples-pcap/sendpack/sendpack.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {1C376689-5F61-48E7-AE83-0DED9EE9E458} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + + diff --git a/Examples-pcap/stats/stats.dsp b/Examples-pcap/stats/stats.dsp deleted file mode 100644 index b26fe3c3..00000000 --- a/Examples-pcap/stats/stats.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="stats" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=stats - 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 "stats.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 "stats.mak" CFG="stats - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "stats - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "stats - 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)" == "stats - 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)" == "stats - 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 "stats - Win32 Release" -# Name "stats - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\stats.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/Examples-pcap/stats/stats.dsw b/Examples-pcap/stats/stats.dsw deleted file mode 100644 index 1d8ca313..00000000 --- a/Examples-pcap/stats/stats.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "stats"=.\stats.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/Examples-pcap/winpcap_stress/winpcap_stress.c b/Examples-pcap/winpcap_stress/winpcap_stress.c index d59659a1..ba246a75 100644 --- a/Examples-pcap/winpcap_stress/winpcap_stress.c +++ b/Examples-pcap/winpcap_stress/winpcap_stress.c @@ -62,6 +62,26 @@ #define LINE_LEN 16 +#ifdef WIN32 +#include +BOOL LoadNpcapDlls() +{ + _TCHAR npcap_dir[512]; + UINT len; + len = GetSystemDirectory(npcap_dir, 480); + if (!len) { + fprintf(stderr, "Error in GetSystemDirectory: %x", GetLastError()); + return FALSE; + } + _tcscat_s(npcap_dir, 512, _T("\\Npcap")); + if (SetDllDirectory(npcap_dir) == 0) { + fprintf(stderr, "Error in SetDllDirectory: %x", GetLastError()); + return FALSE; + } + return TRUE; +} +#endif + #define FILTER "ether[80:1] < 128 || ether[81:1] > 127 || ether[82:1] < 180 || ether[83:1] > 181" \ "|| ether[84:1] < 128 || ether[85:1] > 127 || ether[86:1] < 180 || ether[87:1] > 181" \ @@ -185,8 +205,8 @@ DWORD WINAPI pcap_thread(LPVOID arg) #ifdef STRESS_AIRPCAP_TRANSMISSION PAirpcapHandle airpcap_handle; tx_ieee80211_radiotap_header *radio_header; -#endif u_int rate_index; +#endif srand( (unsigned)time( NULL ) ); @@ -368,6 +388,15 @@ int main(int argc, char **argv) char* string_to_match; DWORD WaitRes; +#ifdef WIN32 + /* Load Npcap and its functions. */ + if (!LoadNpcapDlls()) + { + fprintf(stderr, "Couldn't load Npcap\n"); + exit(1); + } +#endif + // // Parse input // diff --git a/Examples-pcap/winpcap_stress/winpcap_stress.dsp b/Examples-pcap/winpcap_stress/winpcap_stress.dsp deleted file mode 100644 index 4a774f0c..00000000 --- a/Examples-pcap/winpcap_stress/winpcap_stress.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="winpcap_stress" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=winpcap_stress - 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 "winpcap_stress.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 "winpcap_stress.mak" CFG="winpcap_stress - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "winpcap_stress - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "winpcap_stress - 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)" == "winpcap_stress - 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/" /I "../../" /I "../../../../wpdpack/Include/" /I "../../include" /I "../../../WinPcap_Devpack/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 wpcap.lib airpcap.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 wsock32.lib /nologo /subsystem:console /machine:I386 /libpath:"../../debug" /libpath:"../../lib" /libpath:"../../../../npcap-sdk/lib/" /libpath:"../../../WinPcap_Devpack/lib/" - -!ELSEIF "$(CFG)" == "winpcap_stress - 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 "../../" /I "../../../../wpdpack/Include/" /I "../../include" /I "../../../WinPcap_Devpack/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 wpcap.lib airpcap.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 wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../debug" /libpath:"../../lib" /libpath:"../../../../npcap-sdk/lib/" /libpath:"../../../WinPcap_Devpack/lib/" - -!ENDIF - -# Begin Target - -# Name "winpcap_stress - Win32 Release" -# Name "winpcap_stress - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\winpcap_stress.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 -# End Target -# End Project diff --git a/Examples-pcap/winpcap_stress/winpcap_stress.dsw b/Examples-pcap/winpcap_stress/winpcap_stress.dsw deleted file mode 100644 index 87a2e5d9..00000000 --- a/Examples-pcap/winpcap_stress/winpcap_stress.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "winpcap_stress"=.\winpcap_stress.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/Examples-pcap/winpcap_stress/winpcap_stress.vcxproj b/Examples-pcap/winpcap_stress/winpcap_stress.vcxproj new file mode 100644 index 00000000..9a10656d --- /dev/null +++ b/Examples-pcap/winpcap_stress/winpcap_stress.vcxproj @@ -0,0 +1,143 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {4F73FCBE-F4ED-45EA-A207-38633D9526D0} + Win32Proj + + + + Application + true + v140 + + + Application + false + v140 + + + Application + true + v140 + + + Application + false + v140 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Console + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Console + true + true + wpcap.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;%(AdditionalDependencies) + wpcap.dll + C:\npcap-sdk-0.1\Lib;%(AdditionalLibraryDirectories) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + wpcap.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;%(AdditionalDependencies) + + + + + wpcap.dll + C:\npcap-sdk-0.1\Lib\x64;%(AdditionalLibraryDirectories) + + + C:\npcap-sdk-0.1\Include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;HAVE_REMOTE;WPCAP;%(PreprocessorDefinitions) + + + + + + + + +