script execution.
.\"*********************************************************
.TP
+.B dev_idx
+On Windows, the device index of the TUN/TAP adapter (to
+be used in netsh.exe calls which sometimes just do not work
+right with interface names).
+Set prior to
+.B \-\-up
+or
+.B \-\-down
+script execution.
+.\"*********************************************************
+.TP
.B foreign_option_{n}
An option pushed via
.B \-\-push
c->plugins,
OPENVPN_PLUGIN_UP,
c->c1.tuntap->actual_name,
+#ifdef WIN32
+ c->c1.tuntap->adapter_index,
+#endif
dev_type_string (c->options.dev, c->options.dev_type),
TUN_MTU_SIZE (&c->c2.frame),
EXPANDED_SIZE (&c->c2.frame),
c->plugins,
OPENVPN_PLUGIN_UP,
c->c1.tuntap->actual_name,
+#ifdef WIN32
+ c->c1.tuntap->adapter_index,
+#endif
dev_type_string (c->options.dev, c->options.dev_type),
TUN_MTU_SIZE (&c->c2.frame),
EXPANDED_SIZE (&c->c2.frame),
if (c->c1.tuntap && c->c1.tuntap_owned)
{
const char *tuntap_actual = string_alloc (c->c1.tuntap->actual_name, &gc);
+#ifdef WIN32
+ DWORD adapter_index = c->c1.tuntap->adapter_index;
+#endif
const in_addr_t local = c->c1.tuntap->local;
const in_addr_t remote_netmask = c->c1.tuntap->remote_netmask;
c->plugins,
OPENVPN_PLUGIN_ROUTE_PREDOWN,
tuntap_actual,
+#ifdef WIN32
+ adapter_index,
+#endif
NULL,
TUN_MTU_SIZE (&c->c2.frame),
EXPANDED_SIZE (&c->c2.frame),
c->plugins,
OPENVPN_PLUGIN_DOWN,
tuntap_actual,
+#ifdef WIN32
+ adapter_index,
+#endif
NULL,
TUN_MTU_SIZE (&c->c2.frame),
EXPANDED_SIZE (&c->c2.frame),
c->plugins,
OPENVPN_PLUGIN_DOWN,
tuntap_actual,
+#ifdef WIN32
+ adapter_index,
+#endif
NULL,
TUN_MTU_SIZE (&c->c2.frame),
EXPANDED_SIZE (&c->c2.frame),
const struct plugin_list *plugins,
int plugin_type,
const char *arg,
+#ifdef WIN32
+ DWORD adapter_index,
+#endif
const char *dev_type,
int tun_mtu,
int link_mtu,
setenv_str (es, "dev", arg);
if (dev_type)
setenv_str (es, "dev_type", dev_type);
+#ifdef WIN32
+ setenv_int (es, "dev_idx", adapter_index);
+#endif
if (!ifconfig_local)
ifconfig_local = "";