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