]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/dhcp-identifier.h
0ccee7a718758033c8b04e661094e33ecccd5ac7
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright (C) 2015 Tom Gundersen <teg@jklmen>
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 #include "sparse-endian.h"
27 #include "unaligned.h"
29 typedef enum DUIDType
{
35 _DUID_TYPE_INVALID
= -1,
38 /* RFC 3315 section 9.1:
39 * A DUID can be no more than 128 octets long (not including the type code).
41 #define MAX_DUID_LEN 128
43 /* https://tools.ietf.org/html/rfc3315#section-9.1 */
68 uint8_t data
[MAX_DUID_LEN
];
73 int dhcp_validate_duid_len(uint16_t duid_type
, size_t duid_len
);
74 int dhcp_identifier_set_duid_en(struct duid
*duid
, size_t *len
);
75 int dhcp_identifier_set_iaid(int ifindex
, uint8_t *mac
, size_t mac_len
, void *_id
);