Lines Matching refs:allowedip
32 struct wgallowedip *allowedip; in userspace_set_device() local
83 for_each_wgallowedip(peer, allowedip) { in userspace_set_device()
84 if (allowedip->family == AF_INET) { in userspace_set_device()
85 if (!inet_ntop(AF_INET, &allowedip->ip4, ip, INET6_ADDRSTRLEN)) in userspace_set_device()
87 } else if (allowedip->family == AF_INET6) { in userspace_set_device()
88 if (!inet_ntop(AF_INET6, &allowedip->ip6, ip, INET6_ADDRSTRLEN)) in userspace_set_device()
92 …fprintf(f, "allowed_ip=%s%s/%d\n", (allowedip->flags & WGALLOWEDIP_REMOVE_ME) ? "-" : "", ip, allo… in userspace_set_device()
142 struct wgallowedip *allowedip = NULL; in userspace_get_device() local
193 allowedip = NULL; in userspace_get_device()
258 if (allowedip) in userspace_get_device()
259 allowedip->next_allowedip = new_allowedip; in userspace_get_device()
262 allowedip = new_allowedip; in userspace_get_device()
263 allowedip->family = AF_UNSPEC; in userspace_get_device()
265 if (inet_pton(AF_INET6, ip, &allowedip->ip6) == 1) in userspace_get_device()
266 allowedip->family = AF_INET6; in userspace_get_device()
268 if (inet_pton(AF_INET, ip, &allowedip->ip4) == 1) in userspace_get_device()
269 allowedip->family = AF_INET; in userspace_get_device()
271 allowedip->cidr = strtoul(mask, &end, 10); in userspace_get_device()
272 …*end || allowedip->family == AF_UNSPEC || (allowedip->family == AF_INET6 && allowedip->cidr > 128)… in userspace_get_device()