Changeset 548


Ignore:
Timestamp:
10/28/10 21:05:23 (19 months ago)
Author:
eagle
Message:

Header files reordered according to inet(3).
Wincode updated, compiles and runs now on Windows 7 with OpenVPN 2.3 and Cygwin 1.7.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ocat.h

    r547 r548  
    3737#include <syslog.h> 
    3838 
    39 #include <arpa/inet.h> 
    4039 
    4140#include <sys/time.h> 
     
    4443#include <sys/stat.h> 
    4544 
     45#ifdef HAVE_SYS_TYPES_H 
     46#include <sys/types.h> 
     47#endif 
    4648#ifdef HAVE_SYS_SOCKET_H 
    4749#include <sys/socket.h> 
     
    5254#include <sys/endian.h> 
    5355#endif 
    54 #ifdef HAVE_SYS_TYPES_H 
    55 #include <sys/types.h> 
    56 #endif 
    5756#ifdef HAVE_SYS_WAIT_H 
    5857#include <sys/wait.h> 
     
    6766#include <netinet/in_systm.h> 
    6867#endif 
     68#include <arpa/inet.h> 
    6969#ifdef HAVE_NET_IF_H 
    7070#include <net/if.h> 
  • trunk/src/ocat_wintuntap.c

    r486 r548  
    3737// this registry directory contains also information about network drivers 
    3838#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" 
    39 // I changed this from tap0801 
    40 #define TAP_COMPONENT_ID "tap0901" 
     39const char *tap_component_id_[] = {"tap0901", "tapoas", "tap0801", NULL}; 
    4140 
    4241#define USERMODEDEVICEDIR "\\\\.\\Global\\" 
     
    7069 
    7170 
    72 int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen) 
     71int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen, const char *tap_component_id) 
    7372{ 
    7473   HKEY adapterKey, key; 
     
    9796      len = sizeof(componentId); 
    9897      if ((RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len) == ERROR_SUCCESS) 
    99             && !strcmp(componentId, TAP_COMPONENT_ID)) 
     98            && !strcmp(componentId, tap_component_id)) 
    10099      { 
    101100         len = deviceIDLen; 
     
    138137   TapData_t *tapData = &tapData_; 
    139138   unsigned long len = 0; 
    140    int status; 
    141      
    142    if (findTapDevice(deviceId, sizeof(deviceId), deviceName, sizeof(deviceName)) == -1) 
    143    { 
    144       log_msg(LOG_ALERT, "could not find TAP driver with componentId \"%s\". Probly not installed", 
    145             TAP_COMPONENT_ID); 
     139   int status, i; 
     140 
     141   for (i = 0; tap_component_id_[i] != NULL; i++) 
     142      if ((status = findTapDevice(deviceId, sizeof(deviceId), deviceName, sizeof(deviceName), tap_component_id_[i])) != -1) 
     143         break; 
     144 
     145   if (status == -1) 
     146   { 
     147      log_msg(LOG_ALERT, "could not find TAP driver with valid componentId. Probly not installed"); 
    146148      return -1; 
    147149   } 
Note: See TracChangeset for help on using the changeset viewer.