1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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.
This commit is contained in:
Patrik Flykt 2018-09-06 11:31:48 -06:00
parent 214bd9f310
commit d8c51121bb
2 changed files with 13 additions and 3 deletions

View File

@ -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;

View File

@ -21,7 +21,6 @@
#include <inttypes.h>
#include <net/ethernet.h>
#include <stdbool.h>
#include <sys/types.h>
#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,