line |
true |
false |
branch |
41
|
0 |
0 |
hv_stores(hv, "public_key", (peer->flags & WGPEER_HAS_PUBLIC_KEY) ? newSVpvn((char*) peer->public_key, sizeof(peer->public_key)) : &PL_sv_undef); |
42
|
0 |
0 |
hv_stores(hv, "preshared_key", (peer->flags & WGPEER_HAS_PRESHARED_KEY) ? newSVpvn( (char*) peer->preshared_key, sizeof(peer->preshared_key)) : &PL_sv_undef); |
58
|
0 |
0 |
hv_stores(hv, "endpoint", endpoint_len ? newSVpvn((char*) &peer->endpoint, endpoint_len) : &PL_sv_undef); |
62
|
0 |
0 |
hv_stores(hv, "persistent_keepalive_interval", (peer->flags & WGPEER_HAS_PERSISTENT_KEEPALIVE_INTERVAL) ? newSVuv(peer->persistent_keepalive_interval) : &PL_sv_undef); |
70
|
0 |
0 |
wg_for_each_allowedip(peer, allowedip) { |
88
|
0 |
0 |
hv_stores(dev_hv, "public_key", dev->flags & WGDEVICE_HAS_PUBLIC_KEY ? newSVpvn((char*) dev->public_key, sizeof(dev->public_key)) : &PL_sv_undef); |
89
|
0 |
0 |
hv_stores(dev_hv, "private_key", dev->flags & WGDEVICE_HAS_PRIVATE_KEY ? newSVpvn((char*) dev->private_key, sizeof(dev->private_key)) : &PL_sv_undef); |
91
|
0 |
0 |
hv_stores(dev_hv, "fwmark", dev->flags & WGDEVICE_HAS_FWMARK ? newSVuv(dev->fwmark) : &PL_sv_undef); |
92
|
0 |
0 |
hv_stores(dev_hv, "listen_port", dev->flags & WGDEVICE_HAS_LISTEN_PORT ? newSVuv(dev->listen_port) : &PL_sv_undef); |
97
|
0 |
0 |
wg_for_each_peer(dev, peer) { |
122
|
0 |
1 |
if (!device_names) { |
128
|
0 |
1 |
wg_for_each_device_name(device_names, device_name, len) { |
130
|
0 |
0 |
mXPUSHp(device_name, len); |
144
|
0 |
0 |
if (wg_get_device(&dev, devname) < 0) { |
164
|
0 |
2 |
int result = ix ? wg_del_device(devname) : wg_add_device(devname); |
165
|
2 |
0 |
if (result) { |
166
|
0 |
2 |
croak("Failed to %s device `%s`: %s", ix ? "delete" : "add", devname, strerror(errno)); |
176
|
2 |
2 |
if (ix) { |
192
|
0 |
2 |
if (SvROK(private_key_sv)) { |
197
|
2 |
0 |
const char* private_key_char = SvPVbyte(private_key_sv, keylen); |
199
|
0 |
2 |
if (keylen != sizeof(wg_key)) { |