1 /* $NetBSD: darwin_route.h,v 1.4.72.2 2008/11/01 21:22:25 christos Exp $ */
4 * Copyright (c) 2004 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
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_
37 struct darwin_if_data
{
52 u_long did_collisions
;
59 u_long did_recvtiming
;
60 u_long did_xmittiming
;
61 struct darwin_timeval did_lastchange
;
62 u_long did_default_proto
;
69 struct darwin_if_msghdr
{
72 u_char dim_type
; /* DARWIN_RTM_IFINFO */
76 struct darwin_if_data dim_data
;
78 /* Followed by a struct sockaddr_dl */
81 struct darwin_ifa_msghdr
{
84 u_char diam_type
; /* DARWIN_RTM_NEWADDR */
90 /* Followed by struct sockaddr for netmask, addr, remote, broadcast */
93 struct darwin_ifma_msghdr
{
96 u_char dimam_type
; /* DARWIN_RTM_NEWMADDR ? */
103 #define DARWIN_RTM_VERSION 5
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 */