1 /* SPDX-License-Identifier: LGPL-2.1+ */
7 #include "sparse-endian.h"
11 typedef enum DUIDType
{
17 _DUID_TYPE_INVALID
= -1,
20 /* RFC 3315 section 9.1:
21 * A DUID can be no more than 128 octets long (not including the type code).
23 #define MAX_DUID_LEN 128
25 /* https://tools.ietf.org/html/rfc3315#section-9.1 */
50 uint8_t data
[MAX_DUID_LEN
];
55 int dhcp_validate_duid_len(uint16_t duid_type
, size_t duid_len
);
56 int dhcp_identifier_set_duid_llt(struct duid
*duid
, usec_t t
, const uint8_t *addr
, size_t addr_len
, uint16_t arp_type
, size_t *len
);
57 int dhcp_identifier_set_duid_ll(struct duid
*duid
, const uint8_t *addr
, size_t addr_len
, uint16_t arp_type
, size_t *len
);
58 int dhcp_identifier_set_duid_en(struct duid
*duid
, size_t *len
);
59 int dhcp_identifier_set_duid_uuid(struct duid
*duid
, size_t *len
);
60 int dhcp_identifier_set_iaid(int ifindex
, const uint8_t *mac
, size_t mac_len
, bool legacy_unstable_byteorder
, void *_id
);