[Pkg-privacy-commits] [onioncat] 219/241: Header files reordered according to inet(3). Wincode updated, compiles and runs now on Windows 7 with OpenVPN 2.3 and Cygwin 1.7.
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 26 16:17:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch upstream-master
in repository onioncat.
commit b2c8dc04b620b3237ba3a98c402807206fc90381
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Thu Oct 28 19:05:23 2010 +0000
Header files reordered according to inet(3).
Wincode updated, compiles and runs now on Windows 7 with OpenVPN 2.3 and Cygwin 1.7.
git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk@548 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
src/ocat.h | 8 ++++----
src/ocat_wintuntap.c | 20 +++++++++++---------
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/ocat.h b/src/ocat.h
index 29bfe25..3a097a8 100644
--- a/src/ocat.h
+++ b/src/ocat.h
@@ -36,13 +36,15 @@
#include <ctype.h>
#include <syslog.h>
-#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -51,9 +53,6 @@
#elif HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
@@ -66,6 +65,7 @@
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
+#include <arpa/inet.h>
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
diff --git a/src/ocat_wintuntap.c b/src/ocat_wintuntap.c
index 6e7b69a..01d404e 100644
--- a/src/ocat_wintuntap.c
+++ b/src/ocat_wintuntap.c
@@ -36,8 +36,7 @@
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
// this registry directory contains also information about network drivers
#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
-// I changed this from tap0801
-#define TAP_COMPONENT_ID "tap0901"
+const char *tap_component_id_[] = {"tap0901", "tapoas", "tap0801", NULL};
#define USERMODEDEVICEDIR "\\\\.\\Global\\"
#define TAPSUFFIX ".tap"
@@ -69,7 +68,7 @@ typedef struct TapData
static TapData_t tapData_;
-int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen)
+int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen, const char *tap_component_id)
{
HKEY adapterKey, key;
int i;
@@ -96,7 +95,7 @@ int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceN
len = sizeof(componentId);
if ((RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len) == ERROR_SUCCESS)
- && !strcmp(componentId, TAP_COMPONENT_ID))
+ && !strcmp(componentId, tap_component_id))
{
len = deviceIDLen;
RegQueryValueEx(key, "NetCfgInstanceId", NULL, NULL, deviceID, &len);
@@ -137,12 +136,15 @@ int win_open_tun(char *dev, int s)
char deviceId[SIZE_256], deviceName[SIZE_256], tapPath[SIZE_256];
TapData_t *tapData = &tapData_;
unsigned long len = 0;
- int status;
-
- if (findTapDevice(deviceId, sizeof(deviceId), deviceName, sizeof(deviceName)) == -1)
+ int status, i;
+
+ for (i = 0; tap_component_id_[i] != NULL; i++)
+ if ((status = findTapDevice(deviceId, sizeof(deviceId), deviceName, sizeof(deviceName), tap_component_id_[i])) != -1)
+ break;
+
+ if (status == -1)
{
- log_msg(LOG_ALERT, "could not find TAP driver with componentId \"%s\". Probly not installed",
- TAP_COMPONENT_ID);
+ log_msg(LOG_ALERT, "could not find TAP driver with valid componentId. Probly not installed");
return -1;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list