]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/sd-dhcp-client-id.h
man/systemd-sysext.xml: document mutable extensions
[thirdparty/systemd.git] / src / systemd / sd-dhcp-client-id.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #ifndef foosddhcpclientidhfoo
3 #define foosddhcpclientidhfoo
4
5 /***
6 Copyright © 2013 Intel Corporation. All rights reserved.
7 systemd is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
11
12 systemd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with systemd; If not, see <https://www.gnu.org/licenses/>.
19 ***/
20
21 #include <inttypes.h>
22 #include <sys/types.h>
23
24 #include "sd-dhcp-duid.h"
25
26 #include "_sd-common.h"
27
28 _SD_BEGIN_DECLARATIONS;
29
30 typedef struct sd_dhcp_client_id sd_dhcp_client_id;
31
32 int sd_dhcp_client_id_new(sd_dhcp_client_id **ret);
33 sd_dhcp_client_id* sd_dhcp_client_id_free(sd_dhcp_client_id *client_id);
34 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_client_id, sd_dhcp_client_id_free);
35
36 int sd_dhcp_client_id_clear(sd_dhcp_client_id *client_id);
37
38 int sd_dhcp_client_id_is_set(const sd_dhcp_client_id *client_id);
39
40 int sd_dhcp_client_id_get(const sd_dhcp_client_id *client_id, uint8_t *ret_type, const void **ret_data, size_t *ret_size);
41 int sd_dhcp_client_id_get_raw(const sd_dhcp_client_id *client_id, const void **ret_data, size_t *ret_size);
42
43 int sd_dhcp_client_id_set(
44 sd_dhcp_client_id *client_id,
45 uint8_t type,
46 const void *data,
47 size_t data_size);
48 int sd_dhcp_client_id_set_raw(
49 sd_dhcp_client_id *client_id,
50 const void *data,
51 size_t data_size);
52 int sd_dhcp_client_id_set_iaid_duid(
53 sd_dhcp_client_id *client_id,
54 uint32_t iaid,
55 sd_dhcp_duid *duid);
56
57 int sd_dhcp_client_id_to_string(const sd_dhcp_client_id *client_id, char **ret);
58 int sd_dhcp_client_id_to_string_from_raw(const void *data, size_t data_size, char **ret);
59
60 _SD_END_DECLARATIONS;
61
62 #endif