diff --git a/src/ipc-windows.h b/src/ipc-windows.h index 137151a..207b800 100644 --- a/src/ipc-windows.h +++ b/src/ipc-windows.h @@ -417,12 +417,7 @@ static int kernel_set_device(struct wgdevice *dev) aip_count = 0; wg_aip = (void *)wg_peer + sizeof(WG_IOCTL_PEER); for_each_wgallowedip(peer, aip) { - if (aip->flags) { - //TODO: implement me - errno = EOPNOTSUPP; - goto out; - } - + wg_aip->Flags = aip->flags; wg_aip->AddressFamily = aip->family; wg_aip->Cidr = aip->cidr; diff --git a/src/uapi/windows/wireguard.h b/src/uapi/windows/wireguard.h index 5c5938e..8859efb 100644 --- a/src/uapi/windows/wireguard.h +++ b/src/uapi/windows/wireguard.h @@ -14,6 +14,11 @@ #define WG_KEY_LEN 32 +typedef enum +{ + WG_IOCTL_ALLOWED_IP_REMOVE = 1 << 0 +} WG_IOCTL_ALLOWED_IP_FLAG; + typedef struct _WG_IOCTL_ALLOWED_IP { union @@ -21,8 +26,9 @@ typedef struct _WG_IOCTL_ALLOWED_IP IN_ADDR V4; IN6_ADDR V6; } Address; - ADDRESS_FAMILY AddressFamily; - UCHAR Cidr; + ADDRESS_FAMILY AddressFamily; + UCHAR Cidr; + WG_IOCTL_ALLOWED_IP_FLAG Flags; } __attribute__((aligned(8))) WG_IOCTL_ALLOWED_IP; typedef enum