summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp6-client.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-11-10 15:41:30 +0100
committerTom Gundersen <teg@jklm.no>2015-11-11 15:42:38 +0100
commitf667c150a9116022f348cb6d8f2a553dce2386c3 (patch)
treecf08017221fe8dc43db6f652d47f439425997372 /src/libsystemd-network/sd-dhcp6-client.c
parent63bbe5c767a39ee4d6acaadc5e643d6d3556d9cd (diff)
sd-dhcp6-client: add is_running() method
Diffstat (limited to 'src/libsystemd-network/sd-dhcp6-client.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index e29de60d24..e00ca2b00d 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -1115,11 +1115,19 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) {
}
int sd_dhcp6_client_stop(sd_dhcp6_client *client) {
+ assert_return(client, -EINVAL);
+
client_stop(client, SD_DHCP6_CLIENT_EVENT_STOP);
return 0;
}
+int sd_dhcp6_client_is_running(sd_dhcp6_client *client) {
+ assert_return(client, -EINVAL);
+
+ return client->state != DHCP6_STATE_STOPPED;
+}
+
int sd_dhcp6_client_start(sd_dhcp6_client *client) {
int r = 0;
enum DHCP6State state = DHCP6_STATE_SOLICITATION;