Sync usage with man page.
[netbsd-mini2440.git] / sys / compat / darwin / darwin_route.h
blob975db776f2fc1825307ac310484beacfdbf7c97a
1 /* $NetBSD: darwin_route.h,v 1.4.72.2 2008/11/01 21:22:25 christos Exp $ */
3 /*-
4 * Copyright (c) 2004 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Emmanuel Dreyfus
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _DARWIN_ROUTE_H_
33 #define _DARWIN_ROUTE_H_
35 #include <net/if.h>
37 struct darwin_if_data {
38 u_char did_type;
39 u_char did_typelen;
40 u_char did_physical;
41 u_char did_addrlen;
42 u_char did_hdrlen;
43 u_char did_recquota;
44 u_char did_xmitquota;
45 u_long did_mtu;
46 u_long did_metric;
47 u_long did_baudrate;
48 u_long did_ipackets;
49 u_long did_ierrors;
50 u_long did_opackets;
51 u_long did_oerrors;
52 u_long did_collisions;
53 u_long did_ibytes;
54 u_long did_obytes;
55 u_long did_imcasts;
56 u_long did_omcasts;
57 u_long did_iqdrops;
58 u_long did_noproto;
59 u_long did_recvtiming;
60 u_long did_xmittiming;
61 struct darwin_timeval did_lastchange;
62 u_long did_default_proto;
63 u_long did_hwassist;
64 u_long did_reserved1;
65 u_long did_reserved2;
66 } __packed;
69 struct darwin_if_msghdr {
70 u_short dim_len;
71 u_char dim_vers;
72 u_char dim_type; /* DARWIN_RTM_IFINFO */
73 int dim_addrs;
74 int dim_flags;
75 u_short dim_index;
76 struct darwin_if_data dim_data;
77 char dim_pad1[3];
78 /* Followed by a struct sockaddr_dl */
79 } __packed;
81 struct darwin_ifa_msghdr {
82 u_short diam_len;
83 u_char diam_vers;
84 u_char diam_type; /* DARWIN_RTM_NEWADDR */
85 int diam_addrs;
86 int diam_flags;
87 u_short diam_index;
88 u_short diam_pad;
89 int diam_metric;
90 /* Followed by struct sockaddr for netmask, addr, remote, broadcast */
91 } __packed;
93 struct darwin_ifma_msghdr {
94 u_short dimam_len;
95 u_char dimam_vers;
96 u_char dimam_type; /* DARWIN_RTM_NEWMADDR ? */
97 int dimam_addrs;
98 int dimam_flags;
99 u_short dimam_index;
100 } __packed;
102 /* dim_vers */
103 #define DARWIN_RTM_VERSION 5
105 /* dim_type */
106 #define DARWIN_RTM_ADD 0x1
107 #define DARWIN_RTM_DELETE 0x2
108 #define DARWIN_RTM_CHANGE 0x3
109 #define DARWIN_RTM_GET 0x4
110 #define DARWIN_RTM_LOSING 0x5
111 #define DARWIN_RTM_REDIRECT 0x6
112 #define DARWIN_RTM_MISS 0x7
113 #define DARWIN_RTM_LOCK 0x8
114 #define DARWIN_RTM_OLDADD 0x9
115 #define DARWIN_RTM_OLDDEL 0xa
116 #define DARWIN_RTM_RESOLVE 0xb
117 #define DARWIN_RTM_NEWADDR 0xc
118 #define DARWIN_RTM_DELADDR 0xd
119 #define DARWIN_RTM_IFINFO 0xe
120 #define DARWIN_RTM_NEWMADDR 0xf
121 #define DARWIN_RTM_DELMADDR 0x10
123 #define DARWIN_RTA_DST 0x1
124 #define DARWIN_RTA_GATEWAY 0x2
125 #define DARWIN_RTA_NETMASK 0x4
126 #define DARWIN_RTA_GENMASK 0x8
127 #define DARWIN_RTA_IFP 0x10
128 #define DARWIN_RTA_IFA 0x20
129 #define DARWIN_RTA_AUTHOR 0x40
130 #define DARWIN_RTA_BRD 0x80
132 /* sysctl for PF_ROUTE */
133 #define DARWIN_NET_RT_DUMP 1
134 #define DARWIN_NET_RT_FLAGS 2
135 #define DARWIN_NET_RT_IFLIST 3
137 int darwin_ifaddrs(int, char *, size_t *);
139 #endif /* _DARWIN_ROUTE_H */