Skip to content

Commit

Permalink
Update UserBridge example project for VS 2015
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Aug 17, 2018
1 parent fe9bcc3 commit 8088214
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 501 deletions.
10 changes: 10 additions & 0 deletions Examples/MakeAll.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcptop", "tcptop\tcptop.vcx
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UDPdump", "UDPdump\UDPdump.vcxproj", "{42E5F1D6-6E83-4C13-83CC-C6CD83478C58}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UserBridge", "UserLevelBridge\UserBridge.vcxproj", "{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -121,6 +123,14 @@ Global
{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
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Debug|x64.ActiveCfg = Debug|x64
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Debug|x64.Build.0 = Debug|x64
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Debug|x86.ActiveCfg = Debug|Win32
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Debug|x86.Build.0 = Debug|Win32
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Release|x64.ActiveCfg = Release|x64
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Release|x64.Build.0 = Release|x64
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Release|x86.ActiveCfg = Release|Win32
{BB73BFD4-454F-42C8-AFE6-FA890A8BD8FC}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
29 changes: 27 additions & 2 deletions Examples/UserLevelBridge/UserBridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@
*/

#include <signal.h>
#include "pcap.h"
#include <pcap.h>
#include <tchar.h>
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;
}


/* Storage data structure used to pass parameters to the threads */
typedef struct _in_out_adapters
Expand Down Expand Up @@ -78,6 +96,13 @@ int main()
struct bpf_program fcode;
in_out_adapters couple0, couple1;

/* Load Npcap and its functions. */
if (!LoadNpcapDlls())
{
fprintf(stderr, "Couldn't load Npcap\n");
exit(1);
}

/*
* Retrieve the device list
*/
Expand Down Expand Up @@ -464,4 +489,4 @@ void ctrlc_handler(int sig)
5000); /* Timeout */

exit(0);
}
}
106 changes: 0 additions & 106 deletions Examples/UserLevelBridge/UserBridge.dsp

This file was deleted.

29 changes: 0 additions & 29 deletions Examples/UserLevelBridge/UserBridge.dsw

This file was deleted.

Loading

0 comments on commit 8088214

Please sign in to comment.