]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-dhcp6-client.h
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / systemd / sd-dhcp6-client.h
CommitLineData
139b011a
PF
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3#ifndef foosddhcp6clienthfoo
4#define foosddhcp6clienthfoo
5
6/***
7 This file is part of systemd.
8
9 Copyright (C) 2014 Intel Corporation. All rights reserved.
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23***/
24
25#include <net/ethernet.h>
07630cea 26#include <stdbool.h>
139b011a
PF
27
28#include "sd-event.h"
29
ea3b3a75
PF
30#include "sd-dhcp6-lease.h"
31
139b011a 32enum {
10c9ce61
DH
33 SD_DHCP6_CLIENT_EVENT_STOP = 0,
34 SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE = 10,
35 SD_DHCP6_CLIENT_EVENT_RETRANS_MAX = 11,
36 SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE = 12,
37 SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST = 13,
139b011a
PF
38};
39
40typedef struct sd_dhcp6_client sd_dhcp6_client;
41
42typedef void (*sd_dhcp6_client_cb_t)(sd_dhcp6_client *client, int event,
43 void *userdata);
44int sd_dhcp6_client_set_callback(sd_dhcp6_client *client,
45 sd_dhcp6_client_cb_t cb, void *userdata);
46
47int sd_dhcp6_client_set_index(sd_dhcp6_client *client, int interface_index);
76253e73
DW
48int sd_dhcp6_client_set_mac(sd_dhcp6_client *client, const uint8_t *addr,
49 size_t addr_len, uint16_t arp_type);
ebe207d4 50int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *duid,
66eac120 51 size_t duid_len);
bbfa43ca
PF
52int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client,
53 bool enabled);
54int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client,
55 bool *enabled);
da6fe470
PF
56int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client,
57 uint16_t option);
139b011a 58
ea3b3a75
PF
59int sd_dhcp6_client_get_lease(sd_dhcp6_client *client, sd_dhcp6_lease **ret);
60
139b011a
PF
61int sd_dhcp6_client_stop(sd_dhcp6_client *client);
62int sd_dhcp6_client_start(sd_dhcp6_client *client);
63int sd_dhcp6_client_attach_event(sd_dhcp6_client *client, sd_event *event,
64 int priority);
65int sd_dhcp6_client_detach_event(sd_dhcp6_client *client);
66sd_event *sd_dhcp6_client_get_event(sd_dhcp6_client *client);
67sd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client);
68sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client);
69int sd_dhcp6_client_new(sd_dhcp6_client **ret);
70
71#endif