chiark / gitweb /
sd-dhcp6-client: Add initial DHCPv6 client files
[elogind.git] / src / libsystemd-network / dhcp6-protocol.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #pragma once
4
5 /***
6   This file is part of systemd.
7
8   Copyright (C) 2014 Intel Corporation. All rights reserved.
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 ***/
23
24 #include "macro.h"
25 #include "sparse-endian.h"
26
27 struct DHCP6Message {
28         union {
29                 struct {
30                         uint8_t type;
31                         uint8_t _pad[3];
32                 } _packed_;
33                 be32_t transaction_id;
34         };
35 } _packed_;
36
37 typedef struct DHCP6Message DHCP6Message;
38
39 enum {
40         DHCP6_PORT_SERVER                       = 547,
41         DHCP6_PORT_CLIENT                       = 546,
42 };
43
44 enum {
45         DHCP6_DUID_LLT                          = 1,
46         DHCP6_DUID_EN                           = 2,
47         DHCP6_DUID_LL                           = 3,
48         DHCP6_DUID_UUID                         = 4,
49 };
50
51 enum DHCP6State {
52         DHCP6_STATE_STOPPED                     = 0,
53         DHCP6_STATE_RS                          = 1,
54 };
55
56 enum {
57         DHCP6_SOLICIT                           = 1,
58         DHCP6_ADVERTISE                         = 2,
59         DHCP6_REQUEST                           = 3,
60         DHCP6_CONFIRM                           = 4,
61         DHCP6_RENEW                             = 5,
62         DHCP6_REBIND                            = 6,
63         DHCP6_REPLY                             = 7,
64         DHCP6_RELEASE                           = 8,
65         DHCP6_DECLINE                           = 9,
66         DHCP6_RECONFIGURE                       = 10,
67         DHCP6_INFORMATION_REQUEST               = 11,
68         DHCP6_RELAY_FORW                        = 12,
69         DHCP6_RELAY_REPL                        = 13,
70         _DHCP6_MESSAGE_MAX                      = 14,
71 };
72
73 enum {
74         DHCP6_OPTION_CLIENTID                   = 1,
75         DHCP6_OPTION_SERVERID                   = 2,
76         DHCP6_OPTION_IA_NA                      = 3,
77         DHCP6_OPTION_IA_TA                      = 4,
78         DHCP6_OPTION_IAADDR                     = 5,
79         DHCP6_OPTION_ORO                        = 6,
80         DHCP6_OPTION_PREFERENCE                 = 7,
81         DHCP6_OPTION_ELAPSED_TIME               = 8,
82         DHCP6_OPTION_RELAY_MSG                  = 9,
83         /* option code 10 is unassigned */
84         DHCP6_OPTION_AUTH                       = 11,
85         DHCP6_OPTION_UNICAST                    = 12,
86         DHCP6_OPTION_STATUS_CODE                = 13,
87         DHCP6_OPTION_RAPID_COMMIT               = 14,
88         DHCP6_OPTION_USER_CLASS                 = 15,
89         DHCP6_OPTION_VENDOR_CLASS               = 16,
90         DHCP6_OPTION_VENDOR_OPTS                = 17,
91         DHCP6_OPTION_INTERFACE_ID               = 18,
92         DHCP6_OPTION_RECONF_MSG                 = 19,
93         DHCP6_OPTION_RECONF_ACCEPT              = 20,
94 };
95
96 enum {
97         DHCP6_STATUS_SUCCESS                    = 0,
98         DHCP6_STATUS_UNSPEC_FAIL                = 1,
99         DHCP6_STATUS_NO_ADDRS_AVAIL             = 2,
100         DHCP6_STATUS_NO_BINDING                 = 3,
101         DHCP6_STATUS_NOT_ON_LINK                = 4,
102         DHCP6_STATUS_USE_MULTICAST              = 5,
103         _DHCP6_STATUS_MAX                       = 6,
104 };