save link activation policy to state file and display in networkctl
This commit is contained in:
@@ -212,6 +212,27 @@ _public_ int sd_network_link_get_required_operstate_for_online(int ifindex, char
|
||||
return 0;
|
||||
}
|
||||
|
||||
_public_ int sd_network_link_get_activation_policy(int ifindex, char **policy) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
int r;
|
||||
|
||||
assert_return(policy, -EINVAL);
|
||||
|
||||
r = network_link_get_string(ifindex, "ACTIVATION_POLICY", &s);
|
||||
if (r < 0) {
|
||||
if (r != -ENODATA)
|
||||
return r;
|
||||
|
||||
/* For compatibility, assuming up. */
|
||||
s = strdup("up");
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
*policy = TAKE_PTR(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_public_ int sd_network_link_get_llmnr(int ifindex, char **llmnr) {
|
||||
return network_link_get_string(ifindex, "LLMNR", llmnr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user