route.h revision 1.1.4.2 1 1.1.4.2 rmind /* $NetBSD: route.h,v 1.1.4.2 2011/03/05 20:52:54 rmind Exp $ */
2 1.1.4.2 rmind
3 1.1.4.2 rmind /*
4 1.1.4.2 rmind * Copyright (c) 1980, 1986, 1993
5 1.1.4.2 rmind * The Regents of the University of California. All rights reserved.
6 1.1.4.2 rmind *
7 1.1.4.2 rmind * Redistribution and use in source and binary forms, with or without
8 1.1.4.2 rmind * modification, are permitted provided that the following conditions
9 1.1.4.2 rmind * are met:
10 1.1.4.2 rmind * 1. Redistributions of source code must retain the above copyright
11 1.1.4.2 rmind * notice, this list of conditions and the following disclaimer.
12 1.1.4.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.4.2 rmind * notice, this list of conditions and the following disclaimer in the
14 1.1.4.2 rmind * documentation and/or other materials provided with the distribution.
15 1.1.4.2 rmind * 3. Neither the name of the University nor the names of its contributors
16 1.1.4.2 rmind * may be used to endorse or promote products derived from this software
17 1.1.4.2 rmind * without specific prior written permission.
18 1.1.4.2 rmind *
19 1.1.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1.4.2 rmind * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1.4.2 rmind * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1.4.2 rmind * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1.4.2 rmind * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1.4.2 rmind * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1.4.2 rmind * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1.4.2 rmind * SUCH DAMAGE.
30 1.1.4.2 rmind *
31 1.1.4.2 rmind * @(#)route.h 8.5 (Berkeley) 2/8/95
32 1.1.4.2 rmind */
33 1.1.4.2 rmind
34 1.1.4.2 rmind #ifndef _COMPAT_NET_ROUTE_H_
35 1.1.4.2 rmind #define _COMPAT_NET_ROUTE_H_
36 1.1.4.2 rmind
37 1.1.4.2 rmind #include <sys/queue.h>
38 1.1.4.2 rmind #include <sys/socket.h>
39 1.1.4.2 rmind #include <sys/types.h>
40 1.1.4.2 rmind #include <net/if.h>
41 1.1.4.2 rmind
42 1.1.4.2 rmind #if !(defined(_KERNEL) || defined(_STANDALONE))
43 1.1.4.2 rmind #include <stdbool.h>
44 1.1.4.2 rmind #endif
45 1.1.4.2 rmind
46 1.1.4.2 rmind /*
47 1.1.4.2 rmind * These numbers are used by reliable protocols for determining
48 1.1.4.2 rmind * retransmission behavior and are included in the routing structure.
49 1.1.4.2 rmind */
50 1.1.4.2 rmind struct rt_metrics50 {
51 1.1.4.2 rmind u_long rmx_locks; /* Kernel must leave these values alone */
52 1.1.4.2 rmind u_long rmx_mtu; /* MTU for this path */
53 1.1.4.2 rmind u_long rmx_hopcount; /* max hops expected */
54 1.1.4.2 rmind u_long rmx_expire; /* lifetime for route, e.g. redirect */
55 1.1.4.2 rmind u_long rmx_recvpipe; /* inbound delay-bandwidth product */
56 1.1.4.2 rmind u_long rmx_sendpipe; /* outbound delay-bandwidth product */
57 1.1.4.2 rmind u_long rmx_ssthresh; /* outbound gateway buffer limit */
58 1.1.4.2 rmind u_long rmx_rtt; /* estimated round trip time */
59 1.1.4.2 rmind u_long rmx_rttvar; /* estimated rtt variance */
60 1.1.4.2 rmind u_long rmx_pksent; /* packets sent using this route */
61 1.1.4.2 rmind };
62 1.1.4.2 rmind
63 1.1.4.2 rmind /*
64 1.1.4.2 rmind * Structures for routing messages.
65 1.1.4.2 rmind */
66 1.1.4.2 rmind struct rt_msghdr50 {
67 1.1.4.2 rmind u_short rtm_msglen; /* to skip over non-understood messages */
68 1.1.4.2 rmind u_char rtm_version; /* future binary compatibility */
69 1.1.4.2 rmind u_char rtm_type; /* message type */
70 1.1.4.2 rmind u_short rtm_index; /* index for associated ifp */
71 1.1.4.2 rmind int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
72 1.1.4.2 rmind int rtm_addrs; /* bitmask identifying sockaddrs in msg */
73 1.1.4.2 rmind pid_t rtm_pid; /* identify sender */
74 1.1.4.2 rmind int rtm_seq; /* for sender to identify action */
75 1.1.4.2 rmind int rtm_errno; /* why failed */
76 1.1.4.2 rmind int rtm_use; /* from rtentry */
77 1.1.4.2 rmind u_long rtm_inits; /* which metrics we are initializing */
78 1.1.4.2 rmind struct rt_metrics50 rtm_rmx; /* metrics themselves */
79 1.1.4.2 rmind };
80 1.1.4.2 rmind
81 1.1.4.2 rmind #ifdef _KERNEL
82 1.1.4.2 rmind extern struct route_info compat_50_route_info;
83 1.1.4.2 rmind void compat_50_route_enqueue(struct mbuf *, int);
84 1.1.4.2 rmind void compat_50_rt_ifannouncemsg(struct ifnet *, int);
85 1.1.4.2 rmind void compat_50_rt_ieee80211msg(struct ifnet *, int, void *, size_t);
86 1.1.4.2 rmind void compat_50_rt_ifmsg(struct ifnet *);
87 1.1.4.2 rmind void compat_50_rt_missmsg(int, const struct rt_addrinfo *, int, int);
88 1.1.4.2 rmind struct mbuf *
89 1.1.4.2 rmind compat_50_rt_msg1(int, struct rt_addrinfo *, void *, int);
90 1.1.4.2 rmind void compat_50_rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *);
91 1.1.4.2 rmind #endif
92 1.1.4.2 rmind
93 1.1.4.2 rmind #define RTM_OVERSION 3 /* Up the ante and ignore older versions */
94 1.1.4.2 rmind
95 1.1.4.2 rmind #define RT_OROUNDUP(a) RT_ROUNDUP2((a), sizeof(long))
96 1.1.4.2 rmind #define RT_OADVANCE(x, n) (x += RT_OROUNDUP((n)->sa_len))
97 1.1.4.2 rmind
98 1.1.4.2 rmind #endif /* !_COMPAT_NET_ROUTE_H_ */
99