if_var.h (108036) | if_var.h (108172) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * From: @(#)if.h 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * From: @(#)if.h 8.1 (Berkeley) 6/10/93 |
34 * $FreeBSD: head/sys/net/if_var.h 108036 2002-12-18 12:41:03Z hsu $ | 34 * $FreeBSD: head/sys/net/if_var.h 108172 2002-12-22 05:35:03Z hsu $ |
35 */ 36 37#ifndef _NET_IF_VAR_H_ 38#define _NET_IF_VAR_H_ 39 40/* 41 * Structures defining a network interface, providing a packet 42 * transport mechanism (ala level 0 of the PUP protocols). --- 362 unchanged lines hidden (view full) --- 405 406#define IFAREF(ifa) \ 407 do { \ 408 IFA_LOCK(ifa); \ 409 ++(ifa)->ifa_refcnt; \ 410 IFA_UNLOCK(ifa); \ 411 } while (0) 412 | 35 */ 36 37#ifndef _NET_IF_VAR_H_ 38#define _NET_IF_VAR_H_ 39 40/* 41 * Structures defining a network interface, providing a packet 42 * transport mechanism (ala level 0 of the PUP protocols). --- 362 unchanged lines hidden (view full) --- 405 406#define IFAREF(ifa) \ 407 do { \ 408 IFA_LOCK(ifa); \ 409 ++(ifa)->ifa_refcnt; \ 410 IFA_UNLOCK(ifa); \ 411 } while (0) 412 |
413extern struct mtx ifnet_lock; 414#define IFNET_LOCK_INIT() mtx_init(&ifnet_lock, "ifnet", NULL, MTX_DEF) 415#define IFNET_WLOCK() mtx_lock(&ifnet_lock) 416#define IFNET_WUNLOCK() mtx_unlock(&ifnet_lock) 417#define IFNET_RLOCK() IFNET_WLOCK() 418#define IFNET_RUNLOCK() IFNET_WUNLOCK() 419 |
|
413struct ifindex_entry { 414 struct ifnet *ife_ifnet; 415 struct ifaddr *ife_ifnet_addr; 416 dev_t ife_dev; 417}; 418 419#define ifnet_byindex(idx) ifindex_table[(idx)].ife_ifnet 420#define ifaddr_byindex(idx) ifindex_table[(idx)].ife_ifnet_addr --- 61 unchanged lines hidden --- | 420struct ifindex_entry { 421 struct ifnet *ife_ifnet; 422 struct ifaddr *ife_ifnet_addr; 423 dev_t ife_dev; 424}; 425 426#define ifnet_byindex(idx) ifindex_table[(idx)].ife_ifnet 427#define ifaddr_byindex(idx) ifindex_table[(idx)].ife_ifnet_addr --- 61 unchanged lines hidden --- |