assert_return(ret, -EINVAL);
r = parse_env_file(NULL, "/run/systemd/netif/state", field, &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
if (isempty(s))
return -ENODATA;
*ret = TAKE_PTR(s);
-
return 0;
}
assert_return(ret, -EINVAL);
r = parse_env_file(NULL, "/run/systemd/netif/state", key, &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
if (isempty(s)) {
r = (int) strv_length(a);
*ret = TAKE_PTR(a);
-
return r;
}
xsprintf(path, "/run/systemd/netif/links/%i", ifindex);
r = parse_env_file(NULL, path, field, &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
if (isempty(s))
return -ENODATA;
*ret = TAKE_PTR(s);
-
return 0;
}
xsprintf(path, "/run/systemd/netif/links/%i", ifindex);
r = parse_env_file(NULL, path, key, &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
if (isempty(s)) {
r = (int) strv_length(a);
*ret = TAKE_PTR(a);
-
return r;
}
xsprintf(path, "/run/systemd/netif/links/%i", ifindex);
r = parse_env_file(NULL, path, "DNS_DEFAULT_ROUTE", &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
if (isempty(s))
xsprintf(path, "/run/systemd/netif/links/%i", ifindex);
r = parse_env_file(NULL, path, key, &s);
- if (r == -ENOENT)
- return -ENODATA;
if (r < 0)
return r;
ifis[c] = 0; /* Let's add a 0 ifindex to the end, to be nice */
*ret = TAKE_PTR(ifis);
-
return c;
}
}
int sd_network_monitor_get_fd(sd_network_monitor *m) {
-
assert_return(m, -EINVAL);
return MONITOR_TO_FD(m);
}
int sd_network_monitor_get_events(sd_network_monitor *m) {
-
assert_return(m, -EINVAL);
/* For now we will only return POLLIN here, since we don't