From: Patrik Flykt Date: Thu, 6 Sep 2018 17:31:48 +0000 (-0600) Subject: dhcp6_client: Add helper for fetching Prefix Delegation information X-Git-Tag: v240~700^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8c51121bb3fe7ee17a06419c91854abd3f7941f;p=platform%2Fupstream%2Fsystemd.git dhcp6_client: Add helper for fetching Prefix Delegation information Add helper function for fetching enabled/disabled state of Prefix Delegation for a DHCPv6 client. Update function setting prefix delegation to use an int instead of a boolean. --- diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index a99ddaa..20e19be 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -325,7 +325,16 @@ int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, uint16_t option) return 0; } -int sd_dhcp6_client_set_prefix_delegation(sd_dhcp6_client *client, bool delegation) { +int sd_dhcp6_client_get_prefix_delegation(sd_dhcp6_client *client, int *delegation) { + assert_return(client, -EINVAL); + assert_return(delegation, -EINVAL); + + *delegation = client->prefix_delegation; + + return 0; +} + +int sd_dhcp6_client_set_prefix_delegation(sd_dhcp6_client *client, int delegation) { assert_return(client, -EINVAL); client->prefix_delegation = delegation; diff --git a/src/systemd/sd-dhcp6-client.h b/src/systemd/sd-dhcp6-client.h index fa36dca..b7e0db1 100644 --- a/src/systemd/sd-dhcp6-client.h +++ b/src/systemd/sd-dhcp6-client.h @@ -21,7 +21,6 @@ #include #include -#include #include #include "sd-dhcp6-lease.h" @@ -120,8 +119,10 @@ int sd_dhcp6_client_get_information_request( int sd_dhcp6_client_set_request_option( sd_dhcp6_client *client, uint16_t option); +int sd_dhcp6_client_get_prefix_delegation(sd_dhcp6_client *client, + int *delegation); int sd_dhcp6_client_set_prefix_delegation(sd_dhcp6_client *client, - bool delegation); + int delegation); int sd_dhcp6_client_get_lease( sd_dhcp6_client *client,