K2.6 patches and update.
[tomato.git] / release / src / router / dhcpv6 / control.h
blobde1214be1072d3c9e911831d80a1b676ff8c1e87
1 /* $KAME: control.h,v 1.7 2005/01/12 06:06:11 suz Exp $ */
3 /*
4 * Copyright (C) 2004 WIDE Project.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
32 #ifdef __sun__
33 #ifndef U_INT16_T_DEFINED
34 #define U_INT16_T_DEFINED
35 typedef uint16_t u_int16_t;
36 #endif
37 #ifndef U_INT32_T_DEFINED
38 #define U_INT32_T_DEFINED
39 typedef uint32_t u_int32_t;
40 #endif
41 #endif
43 #define DEFAULT_SERVER_CONTROL_ADDR "::1" /* default IPv6 address for server
44 * control socket */
45 #define DEFAULT_SERVER_CONTROL_PORT "5547" /* default TCP port for server
46 * control socket */
47 #define DEFAULT_CLIENT_CONTROL_ADDR "::1" /* default IPv6 address for client
48 * control socket */
49 #define DEFAULT_CLIENT_CONTROL_PORT "5546" /* default TCP port for client
50 * control socket */
52 #define DHCP6CTL_VERSION 0
54 /* control commands */
55 #define DHCP6CTL_COMMAND_RELOAD 1
56 #define DHCP6CTL_COMMAND_REMOVE 2
57 #define DHCP6CTL_COMMAND_START 3
58 #define DHCP6CTL_COMMAND_STOP 4
60 /* control objects */
61 #define DHCP6CTL_BINDING 1
62 #define DHCP6CTL_BINDING_IA 2
63 #define DHCP6CTL_IA_PD 3
64 #define DHCP6CTL_INTERFACE 4
65 #define DHCP6CTL_IA_NA 5
68 * Hash protocol/algorithm types. Use same values for DHCPv6 protocol
69 * authentication for code sharing.
71 enum { DHCP6CTL_AUTHPROTO_UNDEF = -1 };
72 enum { DHCP6CTL_AUTHALG_UNDEF = -1, DHCP6CTL_AUTHALG_HMACMD5 = 1 };
75 * Packet formats of command protocol
77 struct dhcp6ctl {
78 u_int16_t command;
79 u_int16_t len;
80 u_int16_t version;
81 u_int16_t reserved;
82 u_int32_t timestamp;
83 } __attribute__ ((__packed__));
85 struct dhcp6ctl_iaspec {
86 u_int32_t flags;
87 u_int32_t type;
88 u_int32_t id;
89 u_int32_t duidlen;
90 /* variable length of DUID follows */
91 } __attribute__ ((__packed__));