1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| | /* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright (c) 2021 Red Hat GmbH
* Author: Stefano Brivio <sbrivio@redhat.com>
*/
#ifndef DHCP_H
#define DHCP_H
/**
* enum dhcp_opt_type - DHCP option value types per RFC 2132
* @DHCP_OPT_NONE: Unsupported or unknown option
* @DHCP_OPT_STR: Variable-length string
* @DHCP_OPT_IPV4: Single IPv4 address
* @DHCP_OPT_IPV4_LIST:Multiple IPv4 addresses, comma-separated
* @DHCP_OPT_INTEGER: Unsigned integer (1, 2, or 4 bytes)
*/
enum dhcp_opt_type {
DHCP_OPT_NONE,
DHCP_OPT_STR,
DHCP_OPT_IPV4,
DHCP_OPT_IPV4_LIST,
DHCP_OPT_INTEGER,
};
int dhcp(const struct ctx *c, struct iov_tail *data);
void dhcp_init(void);
int dhcp_opt_parse(uint8_t code, const char *str, uint8_t *buf, size_t buf_len);
#endif /* DHCP_H */
|