route.h (204902) | route.h (205024) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)route.h 8.4 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)route.h 8.4 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/route.h 204902 2010-03-09 01:11:45Z qingli $ | 30 * $FreeBSD: head/sys/net/route.h 205024 2010-03-11 17:56:46Z qingli $ |
31 */ 32 33#ifndef _NET_ROUTE_H_ 34#define _NET_ROUTE_H_ 35 36/* 37 * Kernel resident routing tables. 38 * --- 275 unchanged lines hidden (view full) --- 314 */ 315#define SA_SIZE(sa) \ 316 ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ 317 sizeof(long) : \ 318 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) 319 320#ifdef _KERNEL 321 | 31 */ 32 33#ifndef _NET_ROUTE_H_ 34#define _NET_ROUTE_H_ 35 36/* 37 * Kernel resident routing tables. 38 * --- 275 unchanged lines hidden (view full) --- 314 */ 315#define SA_SIZE(sa) \ 316 ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ 317 sizeof(long) : \ 318 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) 319 320#ifdef _KERNEL 321 |
322#define RT_LINK_IS_UP(ifp) ((ifp)->if_link_state == LINK_STATE_UP) | 322#define RT_LINK_IS_UP(ifp) (((ifp)->if_flags & \ 323 (IFF_LOOPBACK | IFF_POINTOPOINT)) \ 324 || (ifp)->if_link_state == LINK_STATE_UP) |
323 324#define RT_LOCK_INIT(_rt) \ 325 mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) 326#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) 327#define RT_TRYLOCK(_rt) mtx_trylock(&(_rt)->rt_mtx) 328#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) 329#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) 330#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) --- 116 unchanged lines hidden --- | 325 326#define RT_LOCK_INIT(_rt) \ 327 mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) 328#define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) 329#define RT_TRYLOCK(_rt) mtx_trylock(&(_rt)->rt_mtx) 330#define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) 331#define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) 332#define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) --- 116 unchanged lines hidden --- |