]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/sd-dhcp-duid.h
Merge pull request #31000 from flatcar-hub/krnowak/mutable-overlays
[thirdparty/systemd.git] / src / systemd / sd-dhcp-duid.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #ifndef foosddhcpduidhfoo
3 #define foosddhcpduidhfoo
4
5 /***
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <https://www.gnu.org/licenses/>.
18 ***/
19
20 #include <inttypes.h>
21 #include <sys/types.h>
22
23 #include "_sd-common.h"
24
25 _SD_BEGIN_DECLARATIONS;
26
27 enum {
28 SD_DUID_TYPE_LLT = 1,
29 SD_DUID_TYPE_EN = 2,
30 SD_DUID_TYPE_LL = 3,
31 SD_DUID_TYPE_UUID = 4
32 };
33
34 typedef struct sd_dhcp_duid sd_dhcp_duid;
35
36 int sd_dhcp_duid_clear(sd_dhcp_duid *duid);
37
38 int sd_dhcp_duid_is_set(const sd_dhcp_duid *duid);
39
40 int sd_dhcp_duid_get(const sd_dhcp_duid *duid, uint16_t *ret_type, const void **ret_data, size_t *ret_size);
41 int sd_dhcp_duid_get_raw(const sd_dhcp_duid *duid, const void **ret_data, size_t *ret_size);
42
43 int sd_dhcp_duid_set(
44 sd_dhcp_duid *duid,
45 uint16_t duid_type,
46 const void *data,
47 size_t data_size);
48 int sd_dhcp_duid_set_raw(
49 sd_dhcp_duid *duid,
50 const void *data,
51 size_t data_size);
52 int sd_dhcp_duid_set_llt(
53 sd_dhcp_duid *duid,
54 const void *hw_addr,
55 size_t hw_addr_size,
56 uint16_t arp_type,
57 uint64_t usec);
58 int sd_dhcp_duid_set_ll(
59 sd_dhcp_duid *duid,
60 const void *hw_addr,
61 size_t hw_addr_size,
62 uint16_t arp_type);
63 int sd_dhcp_duid_set_en(sd_dhcp_duid *duid);
64 int sd_dhcp_duid_set_uuid(sd_dhcp_duid *duid);
65
66 int sd_dhcp_duid_to_string(const sd_dhcp_duid *duid, char **ret);
67
68 _SD_END_DECLARATIONS;
69
70 #endif