sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
dhcp6.h
Go to the documentation of this file.
1
6
7/*
8 * Copyright (c) 2017 Simon Goldschmidt <goldsimon@gmx.de>
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without modification,
12 * are permitted provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright notice,
17 * this list of conditions and the following disclaimer in the documentation
18 * and/or other materials provided with the distribution.
19 * 3. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31 * OF SUCH DAMAGE.
32 *
33 * This file is part of the lwIP TCP/IP stack.
34 *
35 * Author: Simon Goldschmidt <goldsimon@gmx.de>
36 *
37 */
38#ifndef LWIP_HDR_PROT_DHCP6_H
39#define LWIP_HDR_PROT_DHCP6_H
40
41#include "lwip/opt.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#define DHCP6_CLIENT_PORT 546
48#define DHCP6_SERVER_PORT 547
49
50
51 /* DHCPv6 message item offsets and length */
52#define DHCP6_TRANSACTION_ID_LEN 3
53
54#ifdef PACK_STRUCT_USE_INCLUDES
55# include "arch/bpstruct.h"
56#endif
57PACK_STRUCT_BEGIN
60{
61 PACK_STRUCT_FLD_8(u8_t msgtype);
62 PACK_STRUCT_FLD_8(u8_t transaction_id[DHCP6_TRANSACTION_ID_LEN]);
63 /* options follow */
64} PACK_STRUCT_STRUCT;
65PACK_STRUCT_END
66#ifdef PACK_STRUCT_USE_INCLUDES
67# include "arch/epstruct.h"
68#endif
69
70
71/* DHCP6 client states */
72typedef enum {
73 DHCP6_STATE_OFF = 0,
74 DHCP6_STATE_STATELESS_IDLE = 1,
75 DHCP6_STATE_REQUESTING_CONFIG = 2
76} dhcp6_state_enum_t;
77
78/* DHCPv6 message types */
79#define DHCP6_SOLICIT 1
80#define DHCP6_ADVERTISE 2
81#define DHCP6_REQUEST 3
82#define DHCP6_CONFIRM 4
83#define DHCP6_RENEW 5
84#define DHCP6_REBIND 6
85#define DHCP6_REPLY 7
86#define DHCP6_RELEASE 8
87#define DHCP6_DECLINE 9
88#define DHCP6_RECONFIGURE 10
89#define DHCP6_INFOREQUEST 11
90#define DHCP6_RELAYFORW 12
91#define DHCP6_RELAYREPL 13
92/* More message types see https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml */
93
95#define DHCP6_STATUS_SUCCESS 0 /* Success. */
96#define DHCP6_STATUS_UNSPECFAIL 1 /* Failure, reason unspecified; this status code is sent by either a client or a server to indicate a failure not explicitly specified in this document. */
97#define DHCP6_STATUS_NOADDRSAVAIL 2 /* Server has no addresses available to assign to the IA(s). */
98#define DHCP6_STATUS_NOBINDING 3 /* Client record (binding) unavailable. */
99#define DHCP6_STATUS_NOTONLINK 4 /* The prefix for the address is not appropriate for the link to which the client is attached. */
100#define DHCP6_STATUS_USEMULTICAST 5 /* Sent by a server to a client to force the client to send messages to the server using the All_DHCP_Relay_Agents_and_Servers address. */
101/* More status codes see https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml */
102
104#define DHCP6_DUID_LLT 1 /* LLT: Link-layer Address Plus Time */
105#define DHCP6_DUID_EN 2 /* EN: Enterprise number */
106#define DHCP6_DUID_LL 3 /* LL: Link-layer Address */
107#define DHCP6_DUID_UUID 4 /* UUID (RFC 6355) */
108
109/* DHCPv6 options */
110#define DHCP6_OPTION_CLIENTID 1
111#define DHCP6_OPTION_SERVERID 2
112#define DHCP6_OPTION_IA_NA 3
113#define DHCP6_OPTION_IA_TA 4
114#define DHCP6_OPTION_IAADDR 5
115#define DHCP6_OPTION_ORO 6
116#define DHCP6_OPTION_PREFERENCE 7
117#define DHCP6_OPTION_ELAPSED_TIME 8
118#define DHCP6_OPTION_RELAY_MSG 9
119#define DHCP6_OPTION_AUTH 11
120#define DHCP6_OPTION_UNICAST 12
121#define DHCP6_OPTION_STATUS_CODE 13
122#define DHCP6_OPTION_RAPID_COMMIT 14
123#define DHCP6_OPTION_USER_CLASS 15
124#define DHCP6_OPTION_VENDOR_CLASS 16
125#define DHCP6_OPTION_VENDOR_OPTS 17
126#define DHCP6_OPTION_INTERFACE_ID 18
127#define DHCP6_OPTION_RECONF_MSG 19
128#define DHCP6_OPTION_RECONF_ACCEPT 20
129/* More options see https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml */
130#define DHCP6_OPTION_DNS_SERVERS 23 /* RFC 3646 */
131#define DHCP6_OPTION_DOMAIN_LIST 24 /* RFC 3646 */
132#define DHCP6_OPTION_SNTP_SERVERS 31 /* RFC 4075 */
133
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif /* LWIP_HDR_PROT_DHCP6_H */