route.h revision 550b6e4083768ca350e9e7c3a1ebbf720b23dcad
/*
*/
/*
* Copyright (c) 1980, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Kernel resident routing tables.
*
* The routing tables are initialized when interface addresses
* are set by making entries for all directly connected interfaces.
*/
#ifndef _NET_ROUTE_H
#define _NET_ROUTE_H
/* from UCB 8.5 (Berkeley) 2/8/95 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* A route consists of a destination address and a reference
* to a routing entry. These are often held by protocols
* in their control blocks, e.g. inpcb.
*/
struct route {
};
/*
* These numbers are used by reliable protocols for determining
* retransmission behavior and are included in the routing structure.
*
* rmx_rtt and rmx_rttvar are stored as microseconds;
*/
typedef struct rt_metrics {
/* alone */
} rt_metrics_t;
/*
* OLD rtentry structure not used in the kernel. Instead the kernel
*
* We distinguish between routes to hosts and routes to networks,
* preferring the former if available. For each route we infer
* the interface to use from the gateway address supplied when
* the route was entered. Routes that forward packets through
* gateways are marked so that the output routines know to address the
* gateway rather than the ultimate destination.
*/
struct rtentry {
short rt_refcnt; /* # held references */
/*
* The kernel does not use this field, and without it the structure is
* datamodel independent.
*/
#if !defined(_KERNEL)
#endif /* !defined(_KERNEL) */
};
/*
*
* Routing statistics.
*/
struct rtstat {
short rts_badredirect; /* bogus redirect calls */
short rts_dynamic; /* routes created by redirects */
short rts_newgateway; /* routes modified by redirects */
short rts_unreach; /* lookups which failed */
short rts_wildcard; /* lookups satisfied by a wildcard */
};
/*
* Structures for routing messages.
*/
typedef struct rt_msghdr {
int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
int rtm_addrs; /* bitmask identifying sockaddrs in msg */
int rtm_seq; /* for sender to identify action */
int rtm_errno; /* why failed */
int rtm_use; /* from rtentry */
} rt_msghdr_t;
/*
* Bitmask values for rtm_addr.
*/
/*
* Index offsets for sockaddr_storage array for alternate internal encoding.
* There should be an RTAX_* associated with each RTA_*.
*/
#define RTAX_DST 0
#define RTAX_GATEWAY 1
#define RTAX_NETMASK 2
#define RTAX_GENMASK 3
#define RTAX_IFP 4
#define RTAX_IFA 5
#define RTAX_AUTHOR 6
#define RTAX_BRD 7
#define RTAX_SRC 8
/*
* Routing socket message extension after sockaddrs.
*/
typedef struct rtm_ext_s {
} rtm_ext_t;
#define RTMEX_MAX RTMEX_GATEWAY_SECATTR
/*
* Trusted Solaris route security attributes extension.
*/
typedef struct rtsa_s {
} rtsa_t;
typedef struct tsol_rtsecattr_s {
#define TSOL_RTSECATTR_SIZE(n) \
/*
* Routing socket options.
*/
/*
* Supported RT_AWARE values. As a convenience, the bit-values here mirror
* the LIFC_* values.
*/
#ifdef __cplusplus
}
#endif
#endif /* _NET_ROUTE_H */