]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
139b011a PF |
2 | #pragma once |
3 | ||
4 | /*** | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright (C) 2014 Intel Corporation. All rights reserved. | |
8 | ||
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. | |
13 | ||
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. | |
18 | ||
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/>. | |
21 | ***/ | |
22 | ||
631bbe71 PF |
23 | #include <netinet/ip6.h> |
24 | #include <netinet/udp.h> | |
25 | ||
139b011a PF |
26 | #include "macro.h" |
27 | #include "sparse-endian.h" | |
28 | ||
29 | struct DHCP6Message { | |
30 | union { | |
31 | struct { | |
32 | uint8_t type; | |
33 | uint8_t _pad[3]; | |
34 | } _packed_; | |
35 | be32_t transaction_id; | |
36 | }; | |
37 | } _packed_; | |
38 | ||
39 | typedef struct DHCP6Message DHCP6Message; | |
40 | ||
631bbe71 PF |
41 | #define DHCP6_MIN_OPTIONS_SIZE \ |
42 | 1280 - sizeof(struct ip6_hdr) - sizeof(struct udphdr) | |
43 | ||
34e8c5a2 PF |
44 | #define IN6ADDR_ALL_DHCP6_RELAY_AGENTS_AND_SERVERS_INIT \ |
45 | { { { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | |
46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02 } } } | |
47 | ||
139b011a PF |
48 | enum { |
49 | DHCP6_PORT_SERVER = 547, | |
50 | DHCP6_PORT_CLIENT = 546, | |
51 | }; | |
52 | ||
bbfa43ca PF |
53 | #define DHCP6_INF_TIMEOUT 1 * USEC_PER_SEC |
54 | #define DHCP6_INF_MAX_RT 120 * USEC_PER_SEC | |
d1b0afe3 PF |
55 | #define DHCP6_SOL_MAX_DELAY 1 * USEC_PER_SEC |
56 | #define DHCP6_SOL_TIMEOUT 1 * USEC_PER_SEC | |
57 | #define DHCP6_SOL_MAX_RT 120 * USEC_PER_SEC | |
7246333c PF |
58 | #define DHCP6_REQ_TIMEOUT 1 * USEC_PER_SEC |
59 | #define DHCP6_REQ_MAX_RT 120 * USEC_PER_SEC | |
60 | #define DHCP6_REQ_MAX_RC 10 | |
3dc34fcc PF |
61 | #define DHCP6_REN_TIMEOUT 10 * USEC_PER_SEC |
62 | #define DHCP6_REN_MAX_RT 600 * USEC_PER_SEC | |
63 | #define DHCP6_REB_TIMEOUT 10 * USEC_PER_SEC | |
64 | #define DHCP6_REB_MAX_RT 600 * USEC_PER_SEC | |
d1b0afe3 | 65 | |
139b011a PF |
66 | enum DHCP6State { |
67 | DHCP6_STATE_STOPPED = 0, | |
bbfa43ca | 68 | DHCP6_STATE_INFORMATION_REQUEST = 1, |
d1b0afe3 | 69 | DHCP6_STATE_SOLICITATION = 2, |
7246333c | 70 | DHCP6_STATE_REQUEST = 3, |
a34b57c0 | 71 | DHCP6_STATE_BOUND = 4, |
3dc34fcc PF |
72 | DHCP6_STATE_RENEW = 5, |
73 | DHCP6_STATE_REBIND = 6, | |
139b011a PF |
74 | }; |
75 | ||
76 | enum { | |
77 | DHCP6_SOLICIT = 1, | |
78 | DHCP6_ADVERTISE = 2, | |
79 | DHCP6_REQUEST = 3, | |
80 | DHCP6_CONFIRM = 4, | |
81 | DHCP6_RENEW = 5, | |
82 | DHCP6_REBIND = 6, | |
83 | DHCP6_REPLY = 7, | |
84 | DHCP6_RELEASE = 8, | |
85 | DHCP6_DECLINE = 9, | |
86 | DHCP6_RECONFIGURE = 10, | |
87 | DHCP6_INFORMATION_REQUEST = 11, | |
88 | DHCP6_RELAY_FORW = 12, | |
89 | DHCP6_RELAY_REPL = 13, | |
90 | _DHCP6_MESSAGE_MAX = 14, | |
91 | }; | |
92 | ||
6599680e PF |
93 | enum { |
94 | DHCP6_NTP_SUBOPTION_SRV_ADDR = 1, | |
95 | DHCP6_NTP_SUBOPTION_MC_ADDR = 2, | |
96 | DHCP6_NTP_SUBOPTION_SRV_FQDN = 3, | |
97 | }; | |
98 | ||
139b011a PF |
99 | enum { |
100 | DHCP6_STATUS_SUCCESS = 0, | |
101 | DHCP6_STATUS_UNSPEC_FAIL = 1, | |
102 | DHCP6_STATUS_NO_ADDRS_AVAIL = 2, | |
103 | DHCP6_STATUS_NO_BINDING = 3, | |
104 | DHCP6_STATUS_NOT_ON_LINK = 4, | |
105 | DHCP6_STATUS_USE_MULTICAST = 5, | |
106 | _DHCP6_STATUS_MAX = 6, | |
107 | }; | |
8006aa32 SA |
108 | |
109 | enum { | |
110 | DHCP6_FQDN_FLAG_S = (1 << 0), | |
111 | DHCP6_FQDN_FLAG_O = (1 << 1), | |
112 | DHCP6_FQDN_FLAG_N = (1 << 2), | |
113 | }; |