Changeset 8fc8ce
- Timestamp:
- 06/14/09 22:12:35 (3 years ago)
- Branches:
- master
- Children:
- 16e152
- Parents:
- e59aaa
- git-author:
- Erik Ekman <yarrick@…> (06/14/09 22:12:35)
- git-committer:
- Erik Ekman <erik@…> (02/04/12 20:34:02)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
re59aaa r8fc8ce 9 9 - Fixed tunnel not working on Windows. 10 10 - Any device name is now supported on Windows, fixes #47. 11 - Multiple installed TAP32 interfaces are now supported, fixes #46. 11 12 12 13 2009-06-01: 0.5.2 "WifiFree" -
README-win32.txt
re59aaa r8fc8ce 14 14 select to install only the TAP driver. 15 15 16 2. Have one TAP32 interface installed 16 2. Make sure the interface you want to use does not have a default gateway set. 17 Use -d to specify the interface, use double quotes to include spaces, example 18 iodine.exe -d "Local Area Connection 4" abc.ab 17 19 18 3. Make sure the interface does not have a default gateway set 19 20 4. Run iodine/iodined as normal (see the main README file). 20 3. Run iodine/iodined as normal (see the main README file). 21 21 You may have to run it as administrator depending on user privileges. 22 22 23 5. Enjoy!23 4. Enjoy! 24 24 25 25 … … 48 48 == Results of crappy Win32 API: 49 49 The following fixable limitations apply: 50 - Exactly one TAP32 interface must be installed51 50 - Server cannot read packet destination address 52 51 -
src/tun.c
re59aaa r8fc8ce 33 33 struct tun_data data; 34 34 35 static void get_name(char *ifname, int namelen, char *dev_name); 36 35 37 #define TAP_CONTROL_CODE(request,method) CTL_CODE(FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) 36 38 #define TAP_IOCTL_CONFIG_TUN TAP_CONTROL_CODE(10, METHOD_BUFFERED) … … 161 163 #else /* WINDOWS32 */ 162 164 static void 163 get_device(char *device, int device_len )165 get_device(char *device, int device_len, const char *wanted_dev) 164 166 { 165 167 LONG status; … … 217 219 warnx("Error reading registry key %s\\%s on TAP device", unit, iid_string); 218 220 } else { 219 /* Done getting name of TAP device */ 221 /* Done getting GUID of TAP device, 222 * now check if the name is the requested one */ 223 if (wanted_dev) { 224 char name[250]; 225 get_name(name, sizeof(name), device); 226 if (strncmp(name, wanted_dev, strlen(wanted_dev))) { 227 /* Skip if name mismatch */ 228 goto next; 229 } 230 } 231 /* Get the if name */ 232 get_name(if_name, sizeof(if_name), device); 220 233 RegCloseKey(device_key); 221 234 return; … … 230 243 231 244 static void 232 get_name(char * dev_name)245 get_name(char *ifname, int namelen, char *dev_name) 233 246 { 234 247 char path[256]; … … 239 252 DWORD datatype; 240 253 241 memset(if _name, 0, sizeof(if_name));254 memset(ifname, 0, namelen); 242 255 243 256 snprintf(path, sizeof(path), NETWORK_KEY "\\%s\\Connection", dev_name); 244 257 status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0, KEY_READ, &conn_key); 245 printf("%s ?? %s\n", path, dev_name);246 258 if (status != ERROR_SUCCESS) { 247 259 fprintf(stderr, "Could not look up name of interface %s: error opening key\n", dev_name); … … 249 261 return; 250 262 } 251 len = sizeof(if_name);252 status = RegQueryValueEx(conn_key, name_str, NULL, &datatype, (LPBYTE)if _name, &len);263 len = namelen; 264 status = RegQueryValueEx(conn_key, name_str, NULL, &datatype, (LPBYTE)ifname, &len); 253 265 if (status != ERROR_SUCCESS || datatype != REG_SZ) { 254 266 fprintf(stderr, "Could not look up name of interface %s: error reading value\n", dev_name); … … 296 308 297 309 memset(adapter, 0, sizeof(adapter)); 298 get_device(adapter, sizeof(adapter) );299 get_name( adapter); /* Copies interface 'human name' to if_name */310 get_device(adapter, sizeof(adapter), tun_device); 311 get_name(if_name, sizeof(if_name), adapter); 300 312 301 313 if (strlen(adapter) == 0 || strlen(if_name) == 0) { … … 305 317 306 318 snprintf(tapfile, sizeof(tapfile), "%s%s.tap", TAP_DEVICE_SPACE, adapter); 307 fprintf(stderr, "Opening device %s\n", tapfile);319 fprintf(stderr, "Opening device %s\n", if_name); 308 320 dev_handle = CreateFile(tapfile, GENERIC_WRITE | GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, NULL); 309 321 if (dev_handle == INVALID_HANDLE_VALUE) {
Note: See TracChangeset
for help on using the changeset viewer.
