Changeset 548
- Timestamp:
- 10/28/10 21:05:23 (19 months ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
ocat.h (modified) (4 diffs)
-
ocat_wintuntap.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ocat.h
r547 r548 37 37 #include <syslog.h> 38 38 39 #include <arpa/inet.h>40 39 41 40 #include <sys/time.h> … … 44 43 #include <sys/stat.h> 45 44 45 #ifdef HAVE_SYS_TYPES_H 46 #include <sys/types.h> 47 #endif 46 48 #ifdef HAVE_SYS_SOCKET_H 47 49 #include <sys/socket.h> … … 52 54 #include <sys/endian.h> 53 55 #endif 54 #ifdef HAVE_SYS_TYPES_H55 #include <sys/types.h>56 #endif57 56 #ifdef HAVE_SYS_WAIT_H 58 57 #include <sys/wait.h> … … 67 66 #include <netinet/in_systm.h> 68 67 #endif 68 #include <arpa/inet.h> 69 69 #ifdef HAVE_NET_IF_H 70 70 #include <net/if.h> -
trunk/src/ocat_wintuntap.c
r486 r548 37 37 // this registry directory contains also information about network drivers 38 38 #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" 39 const char *tap_component_id_[] = {"tap0901", "tapoas", "tap0801", NULL}; 41 40 42 41 #define USERMODEDEVICEDIR "\\\\.\\Global\\" … … 70 69 71 70 72 int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen )71 int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen, const char *tap_component_id) 73 72 { 74 73 HKEY adapterKey, key; … … 97 96 len = sizeof(componentId); 98 97 if ((RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len) == ERROR_SUCCESS) 99 && !strcmp(componentId, TAP_COMPONENT_ID))98 && !strcmp(componentId, tap_component_id)) 100 99 { 101 100 len = deviceIDLen; … … 138 137 TapData_t *tapData = &tapData_; 139 138 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"); 146 148 return -1; 147 149 }
Note: See TracChangeset
for help on using the changeset viewer.
