summaryrefslogtreecommitdiff
path: root/src/network/sd-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-03 18:45:07 +0200
committerTom Gundersen <teg@jklm.no>2014-08-04 16:56:34 +0200
commitbd8f65387673e29f46136a4ed172097035002c23 (patch)
treee55d55a020662e8c524bd115c55b2f2d94927f8f /src/network/sd-network.c
parent9ccde88c5ae32991e73fbdcc0a75f60bc99327d6 (diff)
networkd: add and expose per-link LLMNR config option
Diffstat (limited to 'src/network/sd-network.c')
-rw-r--r--src/network/sd-network.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/network/sd-network.c b/src/network/sd-network.c
index bfb8321c87..a0f147e023 100644
--- a/src/network/sd-network.c
+++ b/src/network/sd-network.c
@@ -107,6 +107,25 @@ _public_ int sd_network_get_link_operational_state(int ifindex, char **state) {
return 0;
}
+_public_ int sd_network_get_llmnr(int ifindex, char **llmnr) {
+ _cleanup_free_ char *s = NULL, *p = NULL;
+ int r;
+
+ assert_return(ifindex > 0, -EINVAL);
+ assert_return(llmnr, -EINVAL);
+
+ r = parse_env_file(p, NEWLINE, "LLMNR", &s, NULL);
+ if (r == -ENOENT)
+ return -ENODATA;
+ else if (r < 0)
+ return r;
+
+ *llmnr = s;
+ s = NULL;
+
+ return 0;
+}
+
_public_ int sd_network_get_dhcp_lease(int ifindex, sd_dhcp_lease **ret) {
_cleanup_free_ char *p = NULL, *s = NULL;
sd_dhcp_lease *lease = NULL;