]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-dhcp6-client.h
DHCP DUID, IAID configuration options
[thirdparty/systemd.git] / src / systemd / sd-dhcp6-client.h
CommitLineData
139b011a
PF
1#ifndef foosddhcp6clienthfoo
2#define foosddhcp6clienthfoo
3
4/***
5 This file is part of systemd.
6
7 Copyright (C) 2014 Intel Corporation. All rights reserved.
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
04c01369 23#include <inttypes.h>
139b011a 24#include <net/ethernet.h>
04c01369 25#include <sys/types.h>
139b011a 26
ea3b3a75 27#include "sd-dhcp6-lease.h"
71d35b6b 28#include "sd-event.h"
ea3b3a75 29
04c01369
LP
30#include "_sd-common.h"
31
32_SD_BEGIN_DECLARATIONS;
33
139b011a 34enum {
10c9ce61
DH
35 SD_DHCP6_CLIENT_EVENT_STOP = 0,
36 SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE = 10,
37 SD_DHCP6_CLIENT_EVENT_RETRANS_MAX = 11,
38 SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE = 12,
39 SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST = 13,
139b011a
PF
40};
41
2c1ab8ca
BG
42enum {
43 SD_DHCP6_OPTION_CLIENTID = 1,
44 SD_DHCP6_OPTION_SERVERID = 2,
45 SD_DHCP6_OPTION_IA_NA = 3,
46 SD_DHCP6_OPTION_IA_TA = 4,
47 SD_DHCP6_OPTION_IAADDR = 5,
48 SD_DHCP6_OPTION_ORO = 6,
49 SD_DHCP6_OPTION_PREFERENCE = 7,
50 SD_DHCP6_OPTION_ELAPSED_TIME = 8,
51 SD_DHCP6_OPTION_RELAY_MSG = 9,
52 /* option code 10 is unassigned */
53 SD_DHCP6_OPTION_AUTH = 11,
54 SD_DHCP6_OPTION_UNICAST = 12,
55 SD_DHCP6_OPTION_STATUS_CODE = 13,
56 SD_DHCP6_OPTION_RAPID_COMMIT = 14,
57 SD_DHCP6_OPTION_USER_CLASS = 15,
58 SD_DHCP6_OPTION_VENDOR_CLASS = 16,
59 SD_DHCP6_OPTION_VENDOR_OPTS = 17,
60 SD_DHCP6_OPTION_INTERFACE_ID = 18,
61 SD_DHCP6_OPTION_RECONF_MSG = 19,
62 SD_DHCP6_OPTION_RECONF_ACCEPT = 20,
63
64 SD_DHCP6_OPTION_DNS_SERVERS = 23, /* RFC 3646 */
65 SD_DHCP6_OPTION_DOMAIN_LIST = 24, /* RFC 3646 */
66
67 SD_DHCP6_OPTION_SNTP_SERVERS = 31, /* RFC 4075, deprecated */
68
69 /* option code 35 is unassigned */
70
71 SD_DHCP6_OPTION_NTP_SERVER = 56, /* RFC 5908 */
72
73 /* option codes 89-142 are unassigned */
74 /* option codes 144-65535 are unassigned */
75};
76
139b011a
PF
77typedef struct sd_dhcp6_client sd_dhcp6_client;
78
ccf86354 79typedef void (*sd_dhcp6_client_callback_t)(sd_dhcp6_client *client, int event,
139b011a
PF
80 void *userdata);
81int sd_dhcp6_client_set_callback(sd_dhcp6_client *client,
ccf86354 82 sd_dhcp6_client_callback_t cb, void *userdata);
139b011a
PF
83
84int sd_dhcp6_client_set_index(sd_dhcp6_client *client, int interface_index);
c601ebf7 85int sd_dhcp6_client_set_local_address(sd_dhcp6_client *client, const struct in6_addr *local_address);
76253e73
DW
86int sd_dhcp6_client_set_mac(sd_dhcp6_client *client, const uint8_t *addr,
87 size_t addr_len, uint16_t arp_type);
413708d1
VK
88int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t duid_type,
89 uint8_t *duid, size_t duid_len);
90int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid);
04c01369
LP
91int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled);
92int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, int *enabled);
da6fe470
PF
93int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client,
94 uint16_t option);
139b011a 95
ea3b3a75
PF
96int sd_dhcp6_client_get_lease(sd_dhcp6_client *client, sd_dhcp6_lease **ret);
97
139b011a
PF
98int sd_dhcp6_client_stop(sd_dhcp6_client *client);
99int sd_dhcp6_client_start(sd_dhcp6_client *client);
f667c150 100int sd_dhcp6_client_is_running(sd_dhcp6_client *client);
32d20645 101int sd_dhcp6_client_attach_event(sd_dhcp6_client *client, sd_event *event, int64_t priority);
139b011a
PF
102int sd_dhcp6_client_detach_event(sd_dhcp6_client *client);
103sd_event *sd_dhcp6_client_get_event(sd_dhcp6_client *client);
104sd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client);
105sd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client);
106int sd_dhcp6_client_new(sd_dhcp6_client **ret);
107
4afd3348
LP
108_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_client, sd_dhcp6_client_unref);
109
04c01369
LP
110_SD_END_DECLARATIONS;
111
139b011a 112#endif