From: "cron2 (Code Review)" Date: Thu, 20 Feb 2025 13:24:24 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <838b53c307b64484a91587f811614456e0555ca4-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="nWXScud4Qs8="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: dco-win: support for iroutes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , plaisthos , flichtenheld Cc: openvpn-devel --nWXScud4Qs8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#16) to the change originally created b= y stipa. ( http://gerrit.openvpn.net/c/openvpn/+/857?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: dco-win: support for iroutes ...................................................................... dco-win: support for iroutes Unlike Linux/FreeBSD, dco-win doesn't have access to a system routing table, so we have to maintain internal routing table in the driver. For that, we have 4 ioctls to add/delete IPv4/IPv6 iroutes. When adding iroute, we pass peer-id, so that the driver is able to associate a subnet with a peer context. Change-Id: I36a5442c0a5667628f419bc64efe5fb562ad3b57 Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20250220124205.27502-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 958.html Signed-off-by: Gert Doering --- M src/openvpn/dco.c M src/openvpn/dco_win.c M src/openvpn/dco_win.h M src/openvpn/ovpn_dco_win.h 4 files changed, 127 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/57/857/16 diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index c65aece..02fae81 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -649,7 +649,7 @@ dco_install_iroute(struct multi_context *m, struct multi_instance *mi, struct mroute_addr *addr) { -#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) +#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(_WIN32) if (!dco_enabled(&m->top.options)) { return; @@ -665,28 +665,34 @@ } struct context *c =3D &mi->context; - const char *dev =3D c->c1.tuntap->actual_name; - if (addrtype =3D=3D MR_ADDR_IPV6) { +#if defined(_WIN32) + dco_win_add_iroute_ipv6(&c->c1.tuntap->dco, addr->v6.addr, addr->n= etbits, c->c2.tls_multi->peer_id); +#else net_route_v6_add(&m->top.net_ctx, &addr->v6.addr, addr->netbits, - &mi->context.c2.push_ifconfig_ipv6_local, dev, 0, + &mi->context.c2.push_ifconfig_ipv6_local, c->c1.t= untap->actual_name, 0, DCO_IROUTE_METRIC); +#endif } else if (addrtype =3D=3D MR_ADDR_IPV4) { +#if defined(_WIN32) + dco_win_add_iroute_ipv4(&c->c1.tuntap->dco, addr->v4.addr, addr->n= etbits, c->c2.tls_multi->peer_id); +#else in_addr_t dest =3D htonl(addr->v4.addr); net_route_v4_add(&m->top.net_ctx, &dest, addr->netbits, - &mi->context.c2.push_ifconfig_local, dev, 0, + &mi->context.c2.push_ifconfig_local, c->c1.tuntap= ->actual_name, 0, DCO_IROUTE_METRIC); +#endif } -#endif /* if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) */ +#endif /* if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(_= WIN32) */ } void dco_delete_iroutes(struct multi_context *m, struct multi_instance *mi) { -#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) +#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(_WIN32) if (!dco_enabled(&m->top.options)) { return; @@ -694,7 +700,6 @@ ASSERT(TUNNEL_TYPE(mi->context.c1.tuntap) =3D=3D DEV_TYPE_TUN); struct context *c =3D &mi->context; - const char *dev =3D c->c1.tuntap->actual_name; if (mi->context.c2.push_ifconfig_defined) { @@ -702,9 +707,13 @@ ir; ir =3D ir->next) { +#if defined(_WIN32) + dco_win_del_iroute_ipv4(&c->c1.tuntap->dco, htonl(ir->network)= , ir->netbits); +#else net_route_v4_del(&m->top.net_ctx, &ir->network, ir->netbits, - &mi->context.c2.push_ifconfig_local, dev, + &mi->context.c2.push_ifconfig_local, c->c1.tu= ntap->actual_name, 0, DCO_IROUTE_METRIC); +#endif } } @@ -714,12 +723,16 @@ ir6; ir6 =3D ir6->next) { +#if defined(_WIN32) + dco_win_del_iroute_ipv6(&c->c1.tuntap->dco, ir6->network, ir6-= >netbits); +#else net_route_v6_del(&m->top.net_ctx, &ir6->network, ir6->netbits, - &mi->context.c2.push_ifconfig_ipv6_local, dev, + &mi->context.c2.push_ifconfig_ipv6_local, c->= c1.tuntap->actual_name, 0, DCO_IROUTE_METRIC); +#endif } } -#endif /* if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) */ +#endif /* if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(_= WIN32) */ } #endif /* defined(ENABLE_DCO) */ diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index f46c93d..45cb919 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -823,4 +823,80 @@ return dco_get_version(&ver) && ver.Major >=3D 2; } +void +dco_win_add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int ne= tbits, unsigned int peer_id) +{ + struct gc_arena gc =3D gc_new(); + + OVPN_MP_IROUTE route =3D {.Addr.Addr4.S_un.S_addr =3D dst, .Netbits = =3D netbits, .PeerId =3D peer_id, .IPv6 =3D 0}; + + msg(D_DCO_DEBUG, "%s: %s/%d -> peer %d", __func__, print_in_addr_t(dst= , IA_NET_ORDER, &gc), netbits, peer_id); + + DWORD bytes_returned =3D 0; + if (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_ADD_IROUTE, &route, + sizeof(route), NULL, 0, &bytes_returned, NULL)) + { + msg(M_WARN | M_ERRNO, "DeviceIoControl(OVPN_IOCTL_MP_ADD_IROUTE) f= ailed"); + } + + gc_free(&gc); +} + +void +dco_win_add_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned = int netbits, unsigned int peer_id) +{ + struct gc_arena gc =3D gc_new(); + + OVPN_MP_IROUTE route =3D { .Addr.Addr6 =3D dst, .Netbits =3D netbits, = .PeerId =3D peer_id, .IPv6 =3D 1 }; + + msg(D_DCO_DEBUG, "%s: %s/%d -> peer %d", __func__, print_in6_addr(dst,= IA_NET_ORDER, &gc), netbits, peer_id); + + DWORD bytes_returned =3D 0; + if (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_ADD_IROUTE, &route, + sizeof(route), NULL, 0, &bytes_returned, NULL)) + { + msg(M_WARN | M_ERRNO, "DeviceIoControl(OVPN_IOCTL_MP_ADD_IROUTE) f= ailed"); + } + + gc_free(&gc); +} + +void +dco_win_del_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int ne= tbits) +{ + struct gc_arena gc =3D gc_new(); + + OVPN_MP_IROUTE route =3D { .Addr.Addr4.S_un.S_addr =3D dst, .Netbits = =3D netbits, .PeerId =3D -1, .IPv6 =3D 0 }; + + msg(D_DCO_DEBUG, "%s: %s/%d", __func__, print_in_addr_t(dst, IA_NET_OR= DER, &gc), netbits); + + DWORD bytes_returned =3D 0; + if (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_DEL_IROUTE, &route, + sizeof(route), NULL, 0, &bytes_returned, NULL)) + { + msg(M_WARN | M_ERRNO, "DeviceIoControl(OVPN_IOCTL_MP_DEL_IROUTE) f= ailed"); + } + + gc_free(&gc); +} + +void +dco_win_del_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned = int netbits) +{ + struct gc_arena gc =3D gc_new(); + + OVPN_MP_IROUTE route =3D { .Addr.Addr6 =3D dst, .Netbits =3D netbits, = .PeerId =3D -1, .IPv6 =3D 1 }; + + msg(D_DCO_DEBUG, "%s: %s/%d", __func__, print_in6_addr(dst, IA_NET_ORD= ER, &gc), netbits); + + DWORD bytes_returned =3D 0; + if (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_DEL_IROUTE, &route, + sizeof(route), NULL, 0, &bytes_returned, NULL)) + { + msg(M_WARN | M_ERRNO, "DeviceIoControl(OVPN_IOCTL_MP_DEL_IROUTE) f= ailed"); + } + + gc_free(&gc); +} + #endif /* defined(_WIN32) */ diff --git a/src/openvpn/dco_win.h b/src/openvpn/dco_win.h index 309badf..95c95c8 100644 --- a/src/openvpn/dco_win.h +++ b/src/openvpn/dco_win.h @@ -24,6 +24,8 @@ #if defined(ENABLE_DCO) && defined(_WIN32) +#include + #include "buffer.h" #include "ovpn_dco_win.h" #include "sig.h" @@ -69,6 +71,18 @@ bool dco_win_supports_multipeer(void); +void +dco_win_add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int ne= tbits, unsigned int peer_id); + +void +dco_win_add_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned = int netbits, unsigned int peer_id); + +void +dco_win_del_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int ne= tbits); + +void +dco_win_del_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned = int netbits); + #else /* if defined(ENABLE_DCO) && defined(_WIN32) */ static inline void diff --git a/src/openvpn/ovpn_dco_win.h b/src/openvpn/ovpn_dco_win.h index bfe939d..f6d745c 100644 --- a/src/openvpn/ovpn_dco_win.h +++ b/src/openvpn/ovpn_dco_win.h @@ -174,6 +174,16 @@ int PeerId; } OVPN_MP_SWAP_KEYS, * POVPN_MP_SWAP_KEYS; +typedef struct _OVPN_MP_IROUTE { + union { + IN_ADDR Addr4; + IN6_ADDR Addr6; + } Addr; + int Netbits; + int PeerId; + int IPv6; +} OVPN_MP_IROUTE, * POVPN_MP_IROUTE; + #define OVPN_IOCTL_NEW_PEER CTL_CODE(FILE_DEVICE_UNKNOWN, 1, METHOD_BU= FFERED, FILE_ANY_ACCESS) #define OVPN_IOCTL_GET_STATS CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_BU= FFERED, FILE_ANY_ACCESS) #define OVPN_IOCTL_NEW_KEY CTL_CODE(FILE_DEVICE_UNKNOWN, 3, METHOD_BU= FFERED, FILE_ANY_ACCESS) @@ -193,3 +203,6 @@ #define OVPN_IOCTL_MP_DEL_PEER CTL_CODE(FILE_DEVICE_UNKNOWN, 15, METHOD= _BUFFERED, FILE_ANY_ACCESS) #define OVPN_IOCTL_MP_SWAP_KEYS CTL_CODE(FILE_DEVICE_UNKNOWN, 16, METHOD= _BUFFERED, FILE_ANY_ACCESS) + +#define OVPN_IOCTL_MP_ADD_IROUTE CTL_CODE(FILE_DEVICE_UNKNOWN, 17, METHOD_= BUFFERED, FILE_ANY_ACCESS) +#define OVPN_IOCTL_MP_DEL_IROUTE CTL_CODE(FILE_DEVICE_UNKNOWN, 18, METHOD_= BUFFERED, FILE_ANY_ACCESS) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/857?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I36a5442c0a5667628f419bc64efe5fb562ad3b57 Gerrit-Change-Number: 857 Gerrit-PatchSet: 16 Gerrit-Owner: stipa Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --nWXScud4Qs8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #16 to the change originally c= reated by stipa.

View Change

The following approvals got outdated an= d were removed: Code-Review+2 by cron2

dco-win: support for iroutes

Unlike Linux/Fre= eBSD, dco-win doesn't have access to a
system routing table, so we h= ave to maintain internal routing
table in the driver. For that, we have = 4 ioctls to add/delete
IPv4/IPv6 iroutes. When adding iroute, we pass pe= er-id, so that
the driver is able to associate a subnet with a peer cont= ext.

Change-Id: I36a5442c0a5667628f419bc64efe5fb562ad3b57
Signed-= off-by: Lev Stipakov <lev@...515...>
Acked-by: Gert Doering <ge= rt@...1296...>
Message-Id: <20250220124205.27502-1-gert@...1296...= >
URL: https://www.mail-archive.com/openvpn-devel@...1223...= et/msg30958.html
Signed-off-by: Gert Doering <gert@...1296...>
= ---
M src/openvpn/dco.c
M src/openvpn/dco_win.c
M src/openvpn/dco_= win.h
M src/openvpn/ovpn_dco_win.h
4 files changed, 127 insertions(+)= , 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn=
 refs/changes/57/857/16
diff --git a/src/openvpn/dco.c b/src/openvp=
n/dco.c
index c65aece..02fae81 100644
--- a= /src/openvpn/dco.c
+++ b/src/openvpn/dco.c
= @@ -649,7 +649,7 @@
dco_install_iroute(struct multi_contex= t *m, struct multi_instance *mi,
struct= mroute_addr *addr)
{
-#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
+#if defined(TARGET_LINUX)= || defined(TARGET_FREEBSD) || defined(_WIN32)
if (!dc= o_enabled(&m->top.options))
{
= return;
@@ -665,28 +665,34 @@
= }

struct context *c =3D &mi->= context;
- const cha= r *dev =3D c->c1.tuntap->actual_name;
-
if (addrtype =3D=3D MR_ADDR_IPV= 6)
{
+#if defined(_WIN32)
+ dco_win_add_iroute_ipv6(&c->c1.tuntap->dco, addr-&g= t;v6.addr, addr->netbits, c->c2.tls_multi->peer_id);
+#else

ne= t_route_v6_add(&m->top.net_ctx, &addr->v6.addr, addr->netb= its,
- = &mi->context.c2.push_ifconfig_ipv6_local, dev, 0,
= + &= mi->context.c2.push_ifconfig_ipv6_local, c->c1.tuntap->actual_name= , 0,
DCO_IROUTE_METRIC);+#endif
= }
else if (addrtype =3D=3D MR_ADDR_IPV4)
{
+#if define= d(_WIN32)
+ dc= o_win_add_iroute_ipv4(&c->c1.tuntap->dco, addr->v4.addr, addr-= >netbits, c->c2.tls_multi->peer_id);
+#else
in_addr_t dest =3D= htonl(addr->v4.addr);
net_route_v4_add(&m-= >top.net_ctx, &dest, addr->netbits,
- &mi->context.c2.pus= h_ifconfig_local, dev, 0,
+ &mi->context.c2.push_ifconfig_local, = c->c1.tuntap->actual_name, 0,
= DCO_IROUTE_METRIC);
-#endif /* if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) */=
+#endif /* if define= d(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(_WIN32) */
= }

void
dco_delet= e_iroutes(struct multi_context *m, struct multi_instance *mi)
{
-#if defined(TARG= ET_LINUX) || defined(TARGET_FREEBSD)
+#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || de= fined(_WIN32)
if (!dco_enabled(&m->top.options)= )
{
return;
@= @ -694,7 +700,6 @@
ASSERT(TUNNEL_TYPE(mi->context.c= 1.tuntap) =3D=3D DEV_TYPE_TUN);

stru= ct context *c =3D &mi->context;
- const char *dev =3D c->c1.tuntap->actual_name;

if (mi->context.c2.push_ifconfig_d= efined)
{
@@ -702,9 +707,13 @@<= br> ir;
ir =3D ir->next= )
{
+#if defined(_WIN32)
+ dco_win_del_iroute_ipv4(&c->c1.tuntap->dco, = htonl(ir->network), ir->netbits);
+#else
net_route_v4_del(&am= p;m->top.net_ctx, &ir->network, ir->netbits,
- &mi-&g= t;context.c2.push_ifconfig_local, dev,
+ &mi->context.c2.push= _ifconfig_local, c->c1.tuntap->actual_name,
= 0, DCO_IROUTE_METRIC);
+#endif
}
= }

@@ -714,12 +723,16 @@
ir6;

ir6 =3D ir6->next)
{
+#if defined(_WIN32)
+ dco_win_del_iroute_ipv6(&c->c1.tuntap->dco, ir6= ->network, ir6->netbits);
+#else
net_route_v6_del(&m->= top.net_ctx, &ir6->network, ir6->netbits,
- &mi->co= ntext.c2.push_ifconfig_ipv6_local, dev,
+ &mi->context.c2.pus= h_ifconfig_ipv6_local, c->c1.tuntap->actual_name,
= 0, DCO_IROUTE_METRIC);
+#endif
}
<= span> }

-#endif /* = if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) */
+#endif /* if defined(TARGET_LINUX) || de= fined(TARGET_FREEBSD) || defined(_WIN32) */
}

#endif /* defined(ENABLE_DCO) */
dif= f --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c
ind= ex f46c93d..45cb919 100644
--- a/src/openvpn/dco_win.c
+++ b/src/openvpn/dco_win.c
@@ -823,4 +823,80 @= @
return dco_get_version(&ver) && ver.Majo= r >=3D 2;
}

+void
+dco_win_add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, u= nsigned int netbits, unsigned int peer_id)
+{
+ struct gc_arena gc =3D gc_new();
+
+
+ msg(D_DCO_DEBUG, "%s: %s/%d -> peer %d", __func__= , print_in_addr_t(dst, IA_NET_ORDER, &gc), netbits, peer_id);+
+ DWORD bytes_returned =3D 0;
+ if (!DeviceIoControl(dco->tt-= >hand, OVPN_IOCTL_MP_ADD_IROUTE, &route,
+ sizeof(route), NULL, 0= , &bytes_returned, NULL))
+ {
+ = msg(M_WARN | M_ERRNO, "DeviceIoControl(OVPN_IOCTL_MP_ADD_IROUTE) f= ailed");
+ }<= /span>
+
+ gc_free(&gc);
+}
+
= +void
+dco_win_add_ir= oute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned int netbits, un= signed int peer_id)
+= {
+ struct gc_aren= a gc =3D gc_new();
+<= /span>
+ OVPN_MP_IROUTE r= oute =3D { .Addr.Addr6 =3D dst, .Netbits =3D netbits, .PeerId =3D peer_id, = .IPv6 =3D 1 };
+
+ msg(D_DCO_DEBUG, &qu= ot;%s: %s/%d -> peer %d", __func__, print_in6_addr(dst, IA_NET_ORDE= R, &gc), netbits, peer_id);
+
+ DWO= RD bytes_returned =3D 0;
+ if (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_ADD_IROUTE= , &route,
+ = sizeof(route), NULL, 0, &bytes_returned, NULL))
+ {
+ msg(M_WARN | M_ERRNO, "De= viceIoControl(OVPN_IOCTL_MP_ADD_IROUTE) failed");
+ }
+
+ gc_free(&gc);
+}
+
+void

+dco_win_del_iroute_ipv4(dco_context_t *dco, in_a= ddr_t dst, unsigned int netbits)
+{
+ s= truct gc_arena gc =3D gc_new();
+
+ OVP= N_MP_IROUTE route =3D { .Addr.Addr4.S_un.S_addr =3D dst, .Netbits =3D netbi= ts, .PeerId =3D -1, .IPv6 =3D 0 };
+
+ = msg(D_DCO_DEBUG, "%s: %s/%d", __func__, print_in_addr_t(dst, IA_N= ET_ORDER, &gc), netbits);
+
+ DWORD= bytes_returned =3D 0;
+ = sizeof(route), NULL, 0, &bytes_returned, NULL))=
+ {
+ msg(M_WARN | M_ERRNO, "Devi= ceIoControl(OVPN_IOCTL_MP_DEL_IROUTE) failed");
+ }
+
= + gc_free(&gc);
+
+void

+dco_win_del_iroute_ipv6(dco_context_t *dco, struc= t in6_addr dst, unsigned int netbits)
+{
+= struct gc_arena gc =3D gc_new();
+
+ = OVPN_MP_IROUTE route =3D { .Addr.Addr6 =3D dst, .Netbits =3D netbits, .Pe= erId =3D -1, .IPv6 =3D 1 };
+
+ msg(D_D= CO_DEBUG, "%s: %s/%d", __func__, print_in6_addr(dst, IA_NET_ORDER= , &gc), netbits);
+
+ DWORD bytes_r= eturned =3D 0;
+ i= f (!DeviceIoControl(dco->tt->hand, OVPN_IOCTL_MP_DEL_IROUTE, &rou= te,
+ = sizeof(route), NULL, 0, &bytes_returned, NULL))
+ {

+ msg(M_WARN | M_ERRNO, "DeviceIoCont= rol(OVPN_IOCTL_MP_DEL_IROUTE) failed");
+ }
+
+ gc_f= ree(&gc);
+}
+
#endif= /* defined(_WIN32) */
diff --git a/src/openvpn/dco_win.h b= /src/openvpn/dco_win.h
index 309badf..95c95c8 100644=
--- a/src/openvpn/dco_win.h
+++ b/src/openvpn/dco= _win.h
@@ -24,6 +24,8 @@

= #if defined(ENABLE_DCO) && defined(_WIN32)

+#include <in6addr.h>= ;
+
= #include "buffer.h"
#include "ovpn_dco_win.= h"
#include "sig.h"
@@ -69,= 6 +71,18 @@
bool
dco_win_supports_multipe= er(void);

+void
+dco_win= _add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int netbits, u= nsigned int peer_id);
+
+void
+dco_win_add_iroute_ipv6(dco_cont= ext_t *dco, struct in6_addr dst, unsigned int netbits, unsigned int peer_id= );

+
+void
+dco_win_del_iroute_ipv4(dco_context_t *dco, in_addr= _t dst, unsigned int netbits);
+
+void

+dco_win_del_iroute_ipv6= (dco_context_t *dco, struct in6_addr dst, unsigned int netbits);
= +
#else /* if = defined(ENABLE_DCO) && defined(_WIN32) */
<= br> static inline void
diff --git a/src/openvpn/ovpn_= dco_win.h b/src/openvpn/ovpn_dco_win.h
index bfe939d..f6d74= 5c 100644
--- a/src/openvpn/ovpn_dco_win.h
= +++ b/src/openvpn/ovpn_dco_win.h
@@ -174,6 +174,16 @@
int PeerId;
} OVPN_MP_SWAP_KEYS, * POVPN_M= P_SWAP_KEYS;

+typedef struct _OVPN_MP_IROUTE {
+ union {
+ IN_ADDR Addr4;
+ IN6_ADDR Addr6;
+ } Addr;
+ int Netbits;
+ int PeerId;
+ int IPv6;
+} OVPN_MP_IROUTE, * POVPN_MP_IROUTE;
+
#define OVPN_IOCTL_NEW_PEER CTL_CO= DE(FILE_DEVICE_UNKNOWN, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define OVPN_IOCTL_GET_STATS CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_= BUFFERED, FILE_ANY_ACCESS)

#define OVPN_IOCTL_NEW_KEY = CTL_CODE(FILE_DEVICE_UNKNOWN, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)<= br>@@ -193,3 +203,6 @@

#define OVP= N_IOCTL_MP_DEL_PEER CTL_CODE(FILE_DEVICE_UNKNOWN, 15, METHOD_BUFFERED, F= ILE_ANY_ACCESS)
#define OVPN_IOCTL_MP_SWAP_KEYS CTL_CODE= (FILE_DEVICE_UNKNOWN, 16, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#define OVPN_IOCTL_MP_ADD_IROUTE CTL_CODE(FILE_DEVICE_= UNKNOWN, 17, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define OVPN_IOCTL_MP_DEL_IROUTE CTL_CODE(FILE_D= EVICE_UNKNOWN, 18, METHOD_BUFFERED, FILE_ANY_ACCESS)

To view, visit change 857. To unsubscribe, or for help writing mai= l filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I36a5442c0a5667628f419bc64ef= e5fb562ad3b57
Gerrit-Change-Number: 857
Gerrit-PatchSet: 16
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--nWXScud4Qs8=--