Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/include/netinet6/nd6.h

Source at commit 2862 created 7 years 24 days ago.
By ifabio, Tag 2.3 release, bump svn to 2.4
1/*
2 * Copyright (c) 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29/*$FreeBSD: src/sys/netinet6/nd6.h,v 1.2.2.3 2001/08/13 01:10:49 simokawa Exp $*/
30/*$KAME: nd6.h,v 1.55 2001/04/27 15:09:49 itojun Exp $*/
31
32/*
33 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the project nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 */
60
61#ifndef _NETINET6_ND6_H_
62#define _NETINET6_ND6_H_
63#include <sys/appleapiopts.h>
64
65/* see net/route.h, or net/if_inarp.h */
66#ifndef RTF_ANNOUNCE
67#define RTF_ANNOUNCERTF_PROTO2
68#endif
69
70#include <sys/queue.h>
71
72
73#define ND6_LLINFO_PURGE-3
74#define ND6_LLINFO_NOSTATE-2
75/*
76 * We don't need the WAITDELETE state any more, but we keep the definition
77 * in a comment line instead of removing it. This is necessary to avoid
78 * unintentionally reusing the value for another purpose, which might
79 * affect backward compatibility with old applications.
80 * (20000711 jinmei@kame.net)
81 */
82/* #define ND6_LLINFO_WAITDELETE-1 */
83#define ND6_LLINFO_INCOMPLETE0
84#define ND6_LLINFO_REACHABLE1
85#define ND6_LLINFO_STALE2
86#define ND6_LLINFO_DELAY3
87#define ND6_LLINFO_PROBE4
88
89
90struct nd_ifinfo {
91u_int32_t linkmtu;/* LinkMTU */
92u_int32_t maxmtu;/* Upper bound of LinkMTU */
93u_int32_t basereachable;/* BaseReachableTime */
94u_int32_t reachable;/* Reachable Time */
95u_int32_t retrans;/* Retrans Timer */
96u_int32_t flags;/* Flags */
97int recalctm;/* BaseReacable re-calculation timer */
98u_int8_t chlim;/* CurHopLimit */
99u_int8_t receivedra;
100/* the following 3 members are for privacy extension for addrconf */
101u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */
102u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */
103u_int8_t randomid[8];/* current random ID */
104};
105
106
107#define ND6_IFF_PERFORMNUD0x1
108
109struct in6_nbrinfo {
110char ifname[IFNAMSIZ];/* if name, e.g. "en0" */
111struct in6_addr addr;/* IPv6 address of the neighbor */
112longasked;/* number of queries already sent for this addr */
113intisrouter;/* if it acts as a router */
114intstate;/* reachability state */
115intexpire;/* lifetime for NDP state transition */
116};
117
118
119#define DRLSTSIZ 10
120#define PRLSTSIZ 10
121
122structin6_drlist {
123char ifname[IFNAMSIZ];
124struct {
125structin6_addr rtaddr;
126u_charflags;
127u_shortrtlifetime;
128u_longexpire;
129u_short if_index;
130} defrouter[DRLSTSIZ];
131};
132
133
134structin6_defrouter {
135structsockaddr_in6 rtaddr;
136u_charflags;
137u_shortrtlifetime;
138u_longexpire;
139u_short if_index;
140};
141
142
143structin6_prlist {
144char ifname[IFNAMSIZ];
145struct {
146structin6_addr prefix;
147struct prf_ra raflags;
148u_charprefixlen;
149u_charorigin;
150u_longvltime;
151u_longpltime;
152u_longexpire;
153u_short if_index;
154u_short advrtrs; /* number of advertisement routers */
155structin6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */
156} prefix[PRLSTSIZ];
157};
158
159
160struct in6_prefix {
161structsockaddr_in6 prefix;
162struct prf_ra raflags;
163u_charprefixlen;
164u_charorigin;
165u_longvltime;
166u_longpltime;
167u_longexpire;
168u_int32_t flags;
169int refcnt;
170u_short if_index;
171u_short advrtrs; /* number of advertisement routers */
172/* struct sockaddr_in6 advrtr[] */
173};
174
175
176structin6_ondireq {
177char ifname[IFNAMSIZ];
178struct {
179u_int32_t linkmtu;/* LinkMTU */
180u_int32_t maxmtu;/* Upper bound of LinkMTU */
181u_int32_t basereachable; /* BaseReachableTime */
182u_int32_t reachable;/* Reachable Time */
183u_int32_t retrans;/* Retrans Timer */
184u_int32_t flags;/* Flags */
185int recalctm;/* BaseReacable re-calculation timer */
186u_int8_t chlim;/* CurHopLimit */
187u_int8_t receivedra;
188} ndi;
189};
190
191structin6_ndireq {
192char ifname[IFNAMSIZ];
193struct nd_ifinfo ndi;
194};
195
196structin6_ndifreq {
197char ifname[IFNAMSIZ];
198u_long ifindex;
199};
200
201
202/* Prefix status */
203#define NDPRF_ONLINK0x1
204#define NDPRF_DETACHED0x2
205
206/* protocol constants */
207#define MAX_RTR_SOLICITATION_DELAY1/*1sec*/
208#define RTR_SOLICITATION_INTERVAL4/*4sec*/
209#define MAX_RTR_SOLICITATIONS3
210
211#define ND6_INFINITE_LIFETIME0xffffffff
212
213
214#endif /* _NETINET6_ND6_H_ */
215

Archive Download this file

Revision: 2862