]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-dhcp-client.h
Add dhcp client prefix lease information to networkd json output
[thirdparty/systemd.git] / src / systemd / sd-dhcp-client.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
011feef8
PF
2#ifndef foosddhcpclienthfoo
3#define foosddhcpclienthfoo
4
5/***
810adae9 6 Copyright © 2013 Intel Corporation. All rights reserved.
011feef8
PF
7
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.
12
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.
17
18 You should have received a copy of the GNU Lesser General Public License
85fce6f4 19 along with systemd; If not, see <https://www.gnu.org/licenses/>.
011feef8
PF
20***/
21
04c01369 22#include <inttypes.h>
46a66b79 23#include <net/ethernet.h>
04c01369
LP
24#include <netinet/in.h>
25#include <sys/types.h>
8217ed5e 26#include <stdbool.h>
011feef8 27
be615f7c 28#include "sd-device.h"
fe8db0c5 29#include "sd-dhcp-lease.h"
461dbb2f 30#include "sd-dhcp-option.h"
71d35b6b 31#include "sd-event.h"
d3d8ac2f 32
04c01369
LP
33#include "_sd-common.h"
34
35_SD_BEGIN_DECLARATIONS;
36
3e3d8f78 37enum {
03748142
DH
38 SD_DHCP_CLIENT_EVENT_STOP = 0,
39 SD_DHCP_CLIENT_EVENT_IP_ACQUIRE = 1,
40 SD_DHCP_CLIENT_EVENT_IP_CHANGE = 2,
41 SD_DHCP_CLIENT_EVENT_EXPIRED = 3,
42 SD_DHCP_CLIENT_EVENT_RENEW = 4,
727b5734 43 SD_DHCP_CLIENT_EVENT_SELECTING = 5,
5476cb98
JJ
44 SD_DHCP_CLIENT_EVENT_TRANSIENT_FAILURE = 6 /* Sent when we have not received a reply after the first few attempts.
45 * The client may want to start acquiring link-local addresses. */
3e3d8f78
PF
46};
47
3cb62efe 48/* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml#options */
22805d92 49enum {
3cb62efe
YW
50 SD_DHCP_OPTION_PAD = 0, /* [RFC2132] */
51 SD_DHCP_OPTION_SUBNET_MASK = 1, /* [RFC2132] */
52 SD_DHCP_OPTION_TIME_OFFSET = 2, /* [RFC2132], deprecated by 100 and 101 */
53 SD_DHCP_OPTION_ROUTER = 3, /* [RFC2132] */
54 SD_DHCP_OPTION_TIME_SERVER = 4, /* [RFC2132] */
55 SD_DHCP_OPTION_NAME_SERVER = 5, /* [RFC2132] */
56 SD_DHCP_OPTION_DOMAIN_NAME_SERVER = 6, /* [RFC2132] */
57 SD_DHCP_OPTION_LOG_SERVER = 7, /* [RFC2132] */
58 SD_DHCP_OPTION_QUOTES_SERVER = 8, /* [RFC2132] */
59 SD_DHCP_OPTION_LPR_SERVER = 9, /* [RFC2132] */
60 SD_DHCP_OPTION_IMPRESS_SERVER = 10, /* [RFC2132] */
61 SD_DHCP_OPTION_RLP_SERVER = 11, /* [RFC2132] */
62 SD_DHCP_OPTION_HOST_NAME = 12, /* [RFC2132] */
63 SD_DHCP_OPTION_BOOT_FILE_SIZE = 13, /* [RFC2132] */
64 SD_DHCP_OPTION_MERIT_DUMP_FILE = 14, /* [RFC2132] */
65 SD_DHCP_OPTION_DOMAIN_NAME = 15, /* [RFC2132] */
66 SD_DHCP_OPTION_SWAP_SERVER = 16, /* [RFC2132] */
67 SD_DHCP_OPTION_ROOT_PATH = 17, /* [RFC2132] */
68 SD_DHCP_OPTION_EXTENSION_FILE = 18, /* [RFC2132] */
69 SD_DHCP_OPTION_FORWARD = 19, /* [RFC2132] */
70 SD_DHCP_OPTION_SOURCE_ROUTE = 20, /* [RFC2132] */
71 SD_DHCP_OPTION_POLICY_FILTER = 21, /* [RFC2132] */
72 SD_DHCP_OPTION_MAX_DATAGRAM_ASSEMBLY = 22, /* [RFC2132] */
73 SD_DHCP_OPTION_DEFAULT_IP_TTL = 23, /* [RFC2132] */
74 SD_DHCP_OPTION_MTU_TIMEOUT = 24, /* [RFC2132] */
75 SD_DHCP_OPTION_MTU_PLATEAU = 25, /* [RFC2132] */
76 SD_DHCP_OPTION_MTU_INTERFACE = 26, /* [RFC2132] */
77 SD_DHCP_OPTION_MTU_SUBNET = 27, /* [RFC2132] */
78 SD_DHCP_OPTION_BROADCAST = 28, /* [RFC2132] */
79 SD_DHCP_OPTION_MASK_DISCOVERY = 29, /* [RFC2132] */
80 SD_DHCP_OPTION_MASK_SUPPLIER = 30, /* [RFC2132] */
81 SD_DHCP_OPTION_ROUTER_DISCOVERY = 31, /* [RFC2132] */
82 SD_DHCP_OPTION_ROUTER_REQUEST = 32, /* [RFC2132] */
83 SD_DHCP_OPTION_STATIC_ROUTE = 33, /* [RFC2132] */
84 SD_DHCP_OPTION_TRAILERS = 34, /* [RFC2132] */
85 SD_DHCP_OPTION_ARP_TIMEOUT = 35, /* [RFC2132] */
86 SD_DHCP_OPTION_ETHERNET = 36, /* [RFC2132] */
87 SD_DHCP_OPTION_DEFAULT_TCP_TTL = 37, /* [RFC2132] */
88 SD_DHCP_OPTION_KEEPALIVE_TIME = 38, /* [RFC2132] */
89 SD_DHCP_OPTION_KEEPALIVE_DATA = 39, /* [RFC2132] */
90 SD_DHCP_OPTION_NIS_DOMAIN = 40, /* [RFC2132] */
91 SD_DHCP_OPTION_NIS_SERVER = 41, /* [RFC2132] */
92 SD_DHCP_OPTION_NTP_SERVER = 42, /* [RFC2132] */
93 SD_DHCP_OPTION_VENDOR_SPECIFIC = 43, /* [RFC2132] */
94 SD_DHCP_OPTION_NETBIOS_NAME_SERVER = 44, /* [RFC2132] */
95 SD_DHCP_OPTION_NETBIOS_DIST_SERVER = 45, /* [RFC2132] */
96 SD_DHCP_OPTION_NETBIOS_NODE_TYPE = 46, /* [RFC2132] */
97 SD_DHCP_OPTION_NETBIOS_SCOPE = 47, /* [RFC2132] */
98 SD_DHCP_OPTION_X_WINDOW_FONT = 48, /* [RFC2132] */
99 SD_DHCP_OPTION_X_WINDOW_MANAGER = 49, /* [RFC2132] */
100 SD_DHCP_OPTION_REQUESTED_IP_ADDRESS = 50, /* [RFC2132] */
101 SD_DHCP_OPTION_IP_ADDRESS_LEASE_TIME = 51, /* [RFC2132] */
102 SD_DHCP_OPTION_OVERLOAD = 52, /* [RFC2132] */
103 SD_DHCP_OPTION_MESSAGE_TYPE = 53, /* [RFC2132] */
104 SD_DHCP_OPTION_SERVER_IDENTIFIER = 54, /* [RFC2132] */
105 SD_DHCP_OPTION_PARAMETER_REQUEST_LIST = 55, /* [RFC2132] */
106 SD_DHCP_OPTION_ERROR_MESSAGE = 56, /* [RFC2132] */
107 SD_DHCP_OPTION_MAXIMUM_MESSAGE_SIZE = 57, /* [RFC2132] */
108 SD_DHCP_OPTION_RENEWAL_TIME = 58, /* [RFC2132] */
109 SD_DHCP_OPTION_REBINDING_TIME = 59, /* [RFC2132] */
110 SD_DHCP_OPTION_VENDOR_CLASS_IDENTIFIER = 60, /* [RFC2132] */
111 SD_DHCP_OPTION_CLIENT_IDENTIFIER = 61, /* [RFC2132] */
112 SD_DHCP_OPTION_NETWARE_IP_DOMAIN = 62, /* [RFC2242] */
113 SD_DHCP_OPTION_NETWARE_IP_OPTION = 63, /* [RFC2242] */
114 SD_DHCP_OPTION_NIS_DOMAIN_NAME = 64, /* [RFC2132] */
115 SD_DHCP_OPTION_NIS_SERVER_ADDR = 65, /* [RFC2132] */
116 SD_DHCP_OPTION_BOOT_SERVER_NAME = 66, /* [RFC2132] */
117 SD_DHCP_OPTION_BOOT_FILENAME = 67, /* [RFC2132] */
118 SD_DHCP_OPTION_HOME_AGENT_ADDRESSES = 68, /* [RFC2132] */
119 SD_DHCP_OPTION_SMTP_SERVER = 69, /* [RFC2132] */
120 SD_DHCP_OPTION_POP3_SERVER = 70, /* [RFC2132] */
121 SD_DHCP_OPTION_NNTP_SERVER = 71, /* [RFC2132] */
122 SD_DHCP_OPTION_WWW_SERVER = 72, /* [RFC2132] */
123 SD_DHCP_OPTION_FINGER_SERVER = 73, /* [RFC2132] */
124 SD_DHCP_OPTION_IRC_SERVER = 74, /* [RFC2132] */
125 SD_DHCP_OPTION_STREETTALK_SERVER = 75, /* [RFC2132] */
126 SD_DHCP_OPTION_STDA_SERVER = 76, /* [RFC2132] */
127 SD_DHCP_OPTION_USER_CLASS = 77, /* [RFC3004] */
128 SD_DHCP_OPTION_DIRECTORY_AGENT = 78, /* [RFC2610] */
129 SD_DHCP_OPTION_SERVICE_SCOPE = 79, /* [RFC2610] */
130 SD_DHCP_OPTION_RAPID_COMMIT = 80, /* [RFC4039] */
131 SD_DHCP_OPTION_FQDN = 81, /* [RFC4702] */
132 SD_DHCP_OPTION_RELAY_AGENT_INFORMATION = 82, /* [RFC3046] */
133 SD_DHCP_OPTION_ISNS = 83, /* [RFC4174] */
134 /* option code 84 is unassigned [RFC3679] */
135 SD_DHCP_OPTION_NDS_SERVER = 85, /* [RFC2241] */
136 SD_DHCP_OPTION_NDS_TREE_NAME = 86, /* [RFC2241] */
137 SD_DHCP_OPTION_NDS_CONTEXT = 87, /* [RFC2241] */
f697ab35 138 SD_DHCP_OPTION_BCMCS_CONTROLLER_DOMAIN_NAME = 88, /* [RFC4280] */
3cb62efe
YW
139 SD_DHCP_OPTION_BCMCS_CONTROLLER_ADDRESS = 89, /* [RFC4280] */
140 SD_DHCP_OPTION_AUTHENTICATION = 90, /* [RFC3118] */
141 SD_DHCP_OPTION_CLIENT_LAST_TRANSACTION_TIME = 91, /* [RFC4388] */
142 SD_DHCP_OPTION_ASSOCIATED_IP = 92, /* [RFC4388] */
143 SD_DHCP_OPTION_CLIENT_SYSTEM = 93, /* [RFC4578] */
144 SD_DHCP_OPTION_CLIENT_NDI = 94, /* [RFC4578] */
145 SD_DHCP_OPTION_LDAP = 95, /* [RFC3679] */
146 /* option code 96 is unassigned [RFC3679] */
147 SD_DHCP_OPTION_UUID = 97, /* [RFC4578] */
148 SD_DHCP_OPTION_USER_AUTHENTICATION = 98, /* [RFC2485] */
149 SD_DHCP_OPTION_GEOCONF_CIVIC = 99, /* [RFC4776] */
150 SD_DHCP_OPTION_POSIX_TIMEZONE = 100, /* [RFC4833] */
151 SD_DHCP_OPTION_TZDB_TIMEZONE = 101, /* [RFC4833] */
152 /* option codes 102-107 are unassigned [RFC3679] */
153 SD_DHCP_OPTION_IPV6_ONLY_PREFERRED = 108, /* [RFC8925] */
154 SD_DHCP_OPTION_DHCP4O6_SOURCE_ADDRESS = 109, /* [RFC8539] */
155 /* option codes 110-111 are unassigned [RFC3679] */
156 SD_DHCP_OPTION_NETINFO_ADDRESS = 112, /* [RFC3679] */
157 SD_DHCP_OPTION_NETINFO_TAG = 113, /* [RFC3679] */
158 SD_DHCP_OPTION_DHCP_CAPTIVE_PORTAL = 114, /* [RFC8910] */
159 /* option code 115 is unassigned [RFC3679] */
160 SD_DHCP_OPTION_AUTO_CONFIG = 116, /* [RFC2563] */
161 SD_DHCP_OPTION_NAME_SERVICE_SEARCH = 117, /* [RFC2937] */
162 SD_DHCP_OPTION_SUBNET_SELECTION = 118, /* [RFC3011] */
163 SD_DHCP_OPTION_DOMAIN_SEARCH = 119, /* [RFC3397] */
164 SD_DHCP_OPTION_SIP_SERVER = 120, /* [RFC3361] */
165 SD_DHCP_OPTION_CLASSLESS_STATIC_ROUTE = 121, /* [RFC3442] */
166 SD_DHCP_OPTION_CABLELABS_CLIENT_CONFIGURATION = 122, /* [RFC3495] */
167 SD_DHCP_OPTION_GEOCONF = 123, /* [RFC6225] */
168 SD_DHCP_OPTION_VENDOR_CLASS = 124, /* [RFC3925] */
169 SD_DHCP_OPTION_VENDOR_SPECIFIC_INFORMATION = 125, /* [RFC3925] */
170 /* option codes 126-127 are unassigned [RFC3679] */
171 /* option codes 128-135 are assigned to use by PXE, but they are vendor specific [RFC4578] */
172 SD_DHCP_OPTION_PANA_AGENT = 136, /* [RFC5192] */
173 SD_DHCP_OPTION_LOST_SERVER_FQDN = 137, /* [RFC5223] */
174 SD_DHCP_OPTION_CAPWAP_AC_ADDRESS = 138, /* [RFC5417] */
175 SD_DHCP_OPTION_MOS_ADDRESS = 139, /* [RFC5678] */
176 SD_DHCP_OPTION_MOS_FQDN = 140, /* [RFC5678] */
f697ab35 177 SD_DHCP_OPTION_SIP_SERVICE_DOMAIN = 141, /* [RFC6011] */
3cb62efe
YW
178 SD_DHCP_OPTION_ANDSF_ADDRESS = 142, /* [RFC6153] */
179 SD_DHCP_OPTION_SZTP_REDIRECT = 143, /* [RFC8572] */
180 SD_DHCP_OPTION_GEOLOC = 144, /* [RFC6225] */
181 SD_DHCP_OPTION_FORCERENEW_NONCE_CAPABLE = 145, /* [RFC6704] */
182 SD_DHCP_OPTION_RDNSS_SELECTION = 146, /* [RFC6731] */
183 SD_DHCP_OPTION_DOTS_RI = 147, /* [RFC8973] */
184 SD_DHCP_OPTION_DOTS_ADDRESS = 148, /* [RFC8973] */
185 /* option code 149 is unassigned [RFC3942] */
186 SD_DHCP_OPTION_TFTP_SERVER_ADDRESS = 150, /* [RFC5859] */
187 SD_DHCP_OPTION_STATUS_CODE = 151, /* [RFC6926] */
188 SD_DHCP_OPTION_BASE_TIME = 152, /* [RFC6926] */
189 SD_DHCP_OPTION_START_TIME_OF_STATE = 153, /* [RFC6926] */
190 SD_DHCP_OPTION_QUERY_START_TIME = 154, /* [RFC6926] */
191 SD_DHCP_OPTION_QUERY_END_TIME = 155, /* [RFC6926] */
192 SD_DHCP_OPTION_DHCP_STATE = 156, /* [RFC6926] */
193 SD_DHCP_OPTION_DATA_SOURCE = 157, /* [RFC6926] */
194 SD_DHCP_OPTION_PCP_SERVER = 158, /* [RFC7291] */
195 SD_DHCP_OPTION_PORT_PARAMS = 159, /* [RFC7618] */
196 /* option code 160 is unassigned [RFC7710][RFC8910] */
197 SD_DHCP_OPTION_MUD_URL = 161, /* [RFC8520] */
198 /* option codes 162-174 are unassigned [RFC3942] */
199 /* option codes 175-177 are temporary assigned. */
200 /* option codes 178-207 are unassigned [RFC3942] */
201 SD_DHCP_OPTION_PXELINUX_MAGIC = 208, /* [RFC5071] Deprecated */
202 SD_DHCP_OPTION_CONFIGURATION_FILE = 209, /* [RFC5071] */
203 SD_DHCP_OPTION_PATH_PREFIX = 210, /* [RFC5071] */
204 SD_DHCP_OPTION_REBOOT_TIME = 211, /* [RFC5071] */
205 SD_DHCP_OPTION_6RD = 212, /* [RFC5969] */
206 SD_DHCP_OPTION_ACCESS_DOMAIN = 213, /* [RFC5986] */
207 /* option codes 214-219 are unassigned */
208 SD_DHCP_OPTION_SUBNET_ALLOCATION = 220, /* [RFC6656] */
209 SD_DHCP_OPTION_VIRTUAL_SUBNET_SELECTION = 221, /* [RFC6607] */
210 /* option codes 222-223 are unassigned [RFC3942] */
211 /* option codes 224-254 are reserved for private use */
85ede495 212 SD_DHCP_OPTION_PRIVATE_BASE = 224,
3cb62efe
YW
213 SD_DHCP_OPTION_PRIVATE_CLASSLESS_STATIC_ROUTE = 249, /* [RFC7844] */
214 SD_DHCP_OPTION_PRIVATE_PROXY_AUTODISCOVERY = 252, /* [RFC7844] */
85ede495 215 SD_DHCP_OPTION_PRIVATE_LAST = 254,
5476cb98 216 SD_DHCP_OPTION_END = 255 /* [RFC2132] */
22805d92
BG
217};
218
11c38d3e
YA
219/* Suboptions for SD_DHCP_OPTION_RELAY_AGENT_INFORMATION option */
220enum {
221 SD_DHCP_RELAY_AGENT_CIRCUIT_ID = 1,
5476cb98 222 SD_DHCP_RELAY_AGENT_REMOTE_ID = 2
11c38d3e
YA
223};
224
011feef8
PF
225typedef struct sd_dhcp_client sd_dhcp_client;
226
727b5734 227typedef int (*sd_dhcp_client_callback_t)(sd_dhcp_client *client, int event, void *userdata);
4b558378
ZJS
228int sd_dhcp_client_set_callback(
229 sd_dhcp_client *client,
230 sd_dhcp_client_callback_t cb,
231 void *userdata);
232
233int sd_dhcp_client_set_request_option(
234 sd_dhcp_client *client,
235 uint8_t option);
236int sd_dhcp_client_set_request_address(
237 sd_dhcp_client *client,
238 const struct in_addr *last_address);
239int sd_dhcp_client_set_request_broadcast(
240 sd_dhcp_client *client,
241 int broadcast);
2f8e7633 242int sd_dhcp_client_set_ifindex(
4b558378
ZJS
243 sd_dhcp_client *client,
244 int interface_index);
61a9fa8f
YW
245int sd_dhcp_client_set_ifname(
246 sd_dhcp_client *client,
247 const char *interface_name);
5977b71f 248int sd_dhcp_client_get_ifname(sd_dhcp_client *client, const char **ret);
4b558378
ZJS
249int sd_dhcp_client_set_mac(
250 sd_dhcp_client *client,
7e5c25b2 251 const uint8_t *hw_addr,
14b66dbc 252 const uint8_t *bcast_addr,
4b558378
ZJS
253 size_t addr_len,
254 uint16_t arp_type);
255int sd_dhcp_client_set_client_id(
256 sd_dhcp_client *client,
257 uint8_t type,
258 const uint8_t *data,
259 size_t data_len);
53488ea3 260__extension__ int sd_dhcp_client_set_iaid_duid_llt(
4b558378 261 sd_dhcp_client *client,
8217ed5e 262 bool iaid_set,
4b558378 263 uint32_t iaid,
53488ea3
YW
264 uint64_t llt_time);
265__extension__ int sd_dhcp_client_set_iaid_duid_ll(
266 sd_dhcp_client *client,
267 bool iaid_set,
268 uint32_t iaid);
269__extension__ int sd_dhcp_client_set_iaid_duid_en(
270 sd_dhcp_client *client,
271 bool iaid_set,
272 uint32_t iaid);
273__extension__ int sd_dhcp_client_set_iaid_duid_uuid(
274 sd_dhcp_client *client,
275 bool iaid_set,
276 uint32_t iaid);
277__extension__ int sd_dhcp_client_set_iaid_duid_raw(
7e90a499 278 sd_dhcp_client *client,
8217ed5e 279 bool iaid_set,
7e90a499 280 uint32_t iaid,
53488ea3
YW
281 uint16_t duid_type,
282 const uint8_t *duid,
283 size_t duid_len);
4b558378
ZJS
284int sd_dhcp_client_get_client_id(
285 sd_dhcp_client *client,
f04c991a
YW
286 uint8_t *ret_type,
287 const uint8_t **ret_data,
288 size_t *ret_data_len);
4b558378
ZJS
289int sd_dhcp_client_set_mtu(
290 sd_dhcp_client *client,
291 uint32_t mtu);
715cedfb
SS
292int sd_dhcp_client_set_max_attempts(
293 sd_dhcp_client *client,
294 uint64_t attempt);
9faed222
SS
295int sd_dhcp_client_set_client_port(
296 sd_dhcp_client *client,
297 uint16_t port);
4b558378
ZJS
298int sd_dhcp_client_set_hostname(
299 sd_dhcp_client *client,
300 const char *hostname);
301int sd_dhcp_client_set_vendor_class_identifier(
302 sd_dhcp_client *client,
303 const char *vci);
d11d4a64
SS
304int sd_dhcp_client_set_mud_url(
305 sd_dhcp_client *client,
306 const char *mudurl);
af1c0de0
SS
307int sd_dhcp_client_set_user_class(
308 sd_dhcp_client *client,
e4336c0a 309 char * const *user_class);
4b558378
ZJS
310int sd_dhcp_client_get_lease(
311 sd_dhcp_client *client,
312 sd_dhcp_lease **ret);
afe42aef
SC
313int sd_dhcp_client_set_service_type(
314 sd_dhcp_client *client,
315 int type);
ea577968 316int sd_dhcp_client_set_socket_priority(
317 sd_dhcp_client *client,
318 int so_priority);
4c0b8d56
SS
319int sd_dhcp_client_set_fallback_lease_lifetime(
320 sd_dhcp_client *client,
321 uint32_t fallback_lease_lifetime);
a6cc569e 322
7354900d
DW
323int sd_dhcp_client_add_option(sd_dhcp_client *client, sd_dhcp_option *v);
324int sd_dhcp_client_add_vendor_option(sd_dhcp_client *client, sd_dhcp_option *v);
cb29c156 325
041ea9f9 326int sd_dhcp_client_is_running(sd_dhcp_client *client);
bbdf06d9 327int sd_dhcp_client_stop(sd_dhcp_client *client);
46a66b79 328int sd_dhcp_client_start(sd_dhcp_client *client);
1501b429 329int sd_dhcp_client_send_release(sd_dhcp_client *client);
0f3ff4ea 330int sd_dhcp_client_send_decline(sd_dhcp_client *client);
1c9a2e26 331int sd_dhcp_client_send_renew(sd_dhcp_client *client);
8fb6320e 332int sd_dhcp_client_get_lease_timestamp(sd_dhcp_client *client, uint64_t *timestamp);
e5b04c8d
PF
333
334sd_dhcp_client *sd_dhcp_client_ref(sd_dhcp_client *client);
335sd_dhcp_client *sd_dhcp_client_unref(sd_dhcp_client *client);
336
db3d2358 337/* NOTE: anonymize parameter is used to initialize PRL memory with different
338 * options when using RFC7844 Anonymity Profiles */
339int sd_dhcp_client_new(sd_dhcp_client **ret, int anonymize);
b25ef18b 340
7be32612
MAL
341int sd_dhcp_client_id_to_string(const void *data, size_t len, char **ret);
342
4b558378
ZJS
343int sd_dhcp_client_attach_event(
344 sd_dhcp_client *client,
345 sd_event *event,
346 int64_t priority);
b25ef18b
TG
347int sd_dhcp_client_detach_event(sd_dhcp_client *client);
348sd_event *sd_dhcp_client_get_event(sd_dhcp_client *client);
be615f7c 349int sd_dhcp_client_attach_device(sd_dhcp_client *client, sd_device *dev);
011feef8 350
4afd3348
LP
351_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_client, sd_dhcp_client_unref);
352
04c01369
LP
353_SD_END_DECLARATIONS;
354
011feef8 355#endif