summaryrefslogtreecommitdiffstats
path: root/tun.h
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-31 03:01:17 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-10-31 03:01:17 +0000
commitc67d59cd5c30534a4108945294284f29df7a6c84 (patch)
tree00f4471a4eba2fdb39f1c0b4a0021d6824eb2abb /tun.h
parent1df5be59818066b89936b245e6974efee78529aa (diff)
downloadopenvpn-c67d59cd5c30534a4108945294284f29df7a6c84.tar.gz
openvpn-c67d59cd5c30534a4108945294284f29df7a6c84.tar.xz
openvpn-c67d59cd5c30534a4108945294284f29df7a6c84.zip
Windows reliability changes:
* Added code to make sure that the local PATH environmental variable points to the Windows system32 directory. * Added new --ip-win32 adaptive mode which tries 'dynamic' and then fails over to 'netsh' if the DHCP negotiation fails. * Made --ip-win32 adaptive the default. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@739 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'tun.h')
-rw-r--r--tun.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/tun.h b/tun.h
index 41264e6..6f66961 100644
--- a/tun.h
+++ b/tun.h
@@ -40,6 +40,10 @@
#ifdef WIN32
+/* time constants for --ip-win32 adaptive */
+#define IPW32_SET_ADAPTIVE_DELAY_WINDOW 300
+#define IPW32_SET_ADAPTIVE_TRY_NETSH 20
+
struct tuntap_options {
/* --ip-win32 options */
bool ip_win32_defined;
@@ -48,7 +52,8 @@ struct tuntap_options {
# define IPW32_SET_NETSH 1 /* "--ip-win32 netsh" */
# define IPW32_SET_IPAPI 2 /* "--ip-win32 ipapi" */
# define IPW32_SET_DHCP_MASQ 3 /* "--ip-win32 dynamic" */
-# define IPW32_SET_N 4
+# define IPW32_SET_ADAPTIVE 4 /* "--ip-win32 adaptive" */
+# define IPW32_SET_N 5
int ip_win32_type;
/* --ip-win32 dynamic options */
@@ -155,6 +160,8 @@ struct tuntap
/* Windows adapter index for TAP-Win32 adapter,
~0 if undefined */
DWORD adapter_index;
+
+ int standby_iter;
#else
int fd; /* file descriptor for TUN/TAP dev */
#endif
@@ -318,12 +325,13 @@ void tun_show_debug (struct tuntap *tt);
bool dhcp_release (const struct tuntap *tt);
bool dhcp_renew (const struct tuntap *tt);
+void tun_standby_init (struct tuntap *tt);
+void tun_standby (struct tuntap *tt);
+
int tun_read_queue (struct tuntap *tt, int maxsize);
int tun_write_queue (struct tuntap *tt, struct buffer *buf);
int tun_finalize (HANDLE h, struct overlapped_io *io, struct buffer *buf);
-const char *get_netsh_id (const char *dev_node, struct gc_arena *gc);
-
static inline bool
tuntap_stop (int status)
{
@@ -379,6 +387,16 @@ tuntap_stop (int status)
return false;
}
+static inline void
+tun_standby_init (struct tuntap *tt)
+{
+}
+
+static inline void
+tun_standby (struct tuntap *tt)
+{
+}
+
#endif
/*