1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #ifndef foosddhcp6clienthfoo
3 #define foosddhcp6clienthfoo
6 Copyright © 2014 Intel Corporation. All rights reserved.
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 #include <net/ethernet.h>
24 #include <sys/types.h>
26 #include "sd-dhcp6-lease.h"
27 #include "sd-dhcp6-option.h"
30 #include "_sd-common.h"
32 _SD_BEGIN_DECLARATIONS
;
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,
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,
64 SD_DHCP6_OPTION_DNS_SERVERS
= 23, /* RFC 3646 */
65 SD_DHCP6_OPTION_DOMAIN_LIST
= 24, /* RFC 3646 */
66 SD_DHCP6_OPTION_IA_PD
= 25, /* RFC 3633, prefix delegation */
67 SD_DHCP6_OPTION_IA_PD_PREFIX
= 26, /* RFC 3633, prefix delegation */
69 SD_DHCP6_OPTION_SNTP_SERVERS
= 31, /* RFC 4075, deprecated */
70 SD_DHCP6_OPTION_INFORMATION_REFRESH_TIME
= 32, /* RFC 8415, sec. 21.23 */
72 /* option code 35 is unassigned */
74 SD_DHCP6_OPTION_FQDN
= 39, /* RFC 4704 */
76 SD_DHCP6_OPTION_NTP_SERVER
= 56, /* RFC 5908 */
77 SD_DHCP6_OPTION_MUD_URL
= 112, /* RFC 8250 */
79 /* option codes 89-142 are unassigned */
80 /* option codes 144-65535 are unassigned */
83 typedef struct sd_dhcp6_client sd_dhcp6_client
;
85 typedef void (*sd_dhcp6_client_callback_t
)(sd_dhcp6_client
*client
, int event
, void *userdata
);
86 int sd_dhcp6_client_set_callback(
87 sd_dhcp6_client
*client
,
88 sd_dhcp6_client_callback_t cb
,
91 int sd_dhcp6_client_set_ifindex(
92 sd_dhcp6_client
*client
,
94 int sd_dhcp6_client_set_local_address(
95 sd_dhcp6_client
*client
,
96 const struct in6_addr
*local_address
);
97 int sd_dhcp6_client_set_mac(
98 sd_dhcp6_client
*client
,
102 int sd_dhcp6_client_set_duid(
103 sd_dhcp6_client
*client
,
107 int sd_dhcp6_client_set_duid_llt(
108 sd_dhcp6_client
*client
,
110 int sd_dhcp6_client_set_iaid(
111 sd_dhcp6_client
*client
,
113 int sd_dhcp6_client_get_iaid(
114 sd_dhcp6_client
*client
,
116 int sd_dhcp6_client_duid_as_string(
117 sd_dhcp6_client
*client
,
119 int sd_dhcp6_client_set_fqdn(
120 sd_dhcp6_client
*client
,
122 int sd_dhcp6_client_set_information_request(
123 sd_dhcp6_client
*client
,
125 int sd_dhcp6_client_get_information_request(
126 sd_dhcp6_client
*client
,
128 int sd_dhcp6_client_set_request_option(
129 sd_dhcp6_client
*client
,
131 int sd_dhcp6_client_set_request_mud_url(
132 sd_dhcp6_client
*client
,
134 int sd_dhcp6_client_set_request_user_class(
135 sd_dhcp6_client
*client
,
136 char * const *user_class
);
137 int sd_dhcp6_client_set_request_vendor_class(
138 sd_dhcp6_client
*client
,
139 char * const *vendor_class
);
140 int sd_dhcp6_client_set_prefix_delegation_hint(
141 sd_dhcp6_client
*client
,
143 const struct in6_addr
*pd_address
);
144 int sd_dhcp6_client_get_prefix_delegation(sd_dhcp6_client
*client
,
146 int sd_dhcp6_client_set_prefix_delegation(sd_dhcp6_client
*client
,
148 int sd_dhcp6_client_get_address_request(sd_dhcp6_client
*client
,
150 int sd_dhcp6_client_set_address_request(sd_dhcp6_client
*client
,
152 int sd_dhcp6_client_set_transaction_id(sd_dhcp6_client
*client
,
153 uint32_t transaction_id
);
154 int sd_dhcp6_client_add_vendor_option(sd_dhcp6_client
*client
,
157 int sd_dhcp6_client_get_lease(
158 sd_dhcp6_client
*client
,
159 sd_dhcp6_lease
**ret
);
161 int sd_dhcp6_client_add_option(sd_dhcp6_client
*client
, sd_dhcp6_option
*v
);
163 int sd_dhcp6_client_stop(sd_dhcp6_client
*client
);
164 int sd_dhcp6_client_start(sd_dhcp6_client
*client
);
165 int sd_dhcp6_client_is_running(sd_dhcp6_client
*client
);
166 int sd_dhcp6_client_attach_event(
167 sd_dhcp6_client
*client
,
170 int sd_dhcp6_client_detach_event(sd_dhcp6_client
*client
);
171 sd_event
*sd_dhcp6_client_get_event(sd_dhcp6_client
*client
);
172 sd_dhcp6_client
*sd_dhcp6_client_ref(sd_dhcp6_client
*client
);
173 sd_dhcp6_client
*sd_dhcp6_client_unref(sd_dhcp6_client
*client
);
174 int sd_dhcp6_client_new(sd_dhcp6_client
**ret
);
176 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp6_client
, sd_dhcp6_client_unref
);
178 _SD_END_DECLARATIONS
;