Following the Linux case, now support the same API on Windows.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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;
#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
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