in_var.h (178888) | in_var.h (181803) |
---|---|
1/*- 2 * Copyright (c) 1985, 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 * @(#)in_var.h 8.2 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1985, 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 * @(#)in_var.h 8.2 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/netinet/in_var.h 178888 2008-05-09 23:03:00Z julian $ | 30 * $FreeBSD: head/sys/netinet/in_var.h 181803 2008-08-17 23:27:27Z bz $ |
31 */ 32 33#ifndef _NETINET_IN_VAR_H_ 34#define _NETINET_IN_VAR_H_ 35 36#include <sys/queue.h> 37#include <sys/fnv_hash.h> 38 --- 48 unchanged lines hidden (view full) --- 87extern LIST_HEAD(in_ifaddrhashhead, in_ifaddr) *in_ifaddrhashtbl; 88extern TAILQ_HEAD(in_ifaddrhead, in_ifaddr) in_ifaddrhead; 89extern u_long in_ifaddrhmask; /* mask for hash table */ 90 91#define INADDR_NHASH_LOG2 9 92#define INADDR_NHASH (1 << INADDR_NHASH_LOG2) 93#define INADDR_HASHVAL(x) fnv_32_buf((&(x)), sizeof(x), FNV1_32_INIT) 94#define INADDR_HASH(x) \ | 31 */ 32 33#ifndef _NETINET_IN_VAR_H_ 34#define _NETINET_IN_VAR_H_ 35 36#include <sys/queue.h> 37#include <sys/fnv_hash.h> 38 --- 48 unchanged lines hidden (view full) --- 87extern LIST_HEAD(in_ifaddrhashhead, in_ifaddr) *in_ifaddrhashtbl; 88extern TAILQ_HEAD(in_ifaddrhead, in_ifaddr) in_ifaddrhead; 89extern u_long in_ifaddrhmask; /* mask for hash table */ 90 91#define INADDR_NHASH_LOG2 9 92#define INADDR_NHASH (1 << INADDR_NHASH_LOG2) 93#define INADDR_HASHVAL(x) fnv_32_buf((&(x)), sizeof(x), FNV1_32_INIT) 94#define INADDR_HASH(x) \ |
95 (&in_ifaddrhashtbl[INADDR_HASHVAL(x) & in_ifaddrhmask]) | 95 (&V_in_ifaddrhashtbl[INADDR_HASHVAL(x) & V_in_ifaddrhmask]) |
96 97/* 98 * Macro for finding the internet address structure (in_ifaddr) 99 * corresponding to one of our IP addresses (in_addr). 100 */ 101#define INADDR_TO_IFADDR(addr, ia) \ 102 /* struct in_addr addr; */ \ 103 /* struct in_ifaddr *ia; */ \ --- 21 unchanged lines hidden (view full) --- 125/* 126 * Macro for finding the internet address structure (in_ifaddr) corresponding 127 * to a given interface (ifnet structure). 128 */ 129#define IFP_TO_IA(ifp, ia) \ 130 /* struct ifnet *ifp; */ \ 131 /* struct in_ifaddr *ia; */ \ 132{ \ | 96 97/* 98 * Macro for finding the internet address structure (in_ifaddr) 99 * corresponding to one of our IP addresses (in_addr). 100 */ 101#define INADDR_TO_IFADDR(addr, ia) \ 102 /* struct in_addr addr; */ \ 103 /* struct in_ifaddr *ia; */ \ --- 21 unchanged lines hidden (view full) --- 125/* 126 * Macro for finding the internet address structure (in_ifaddr) corresponding 127 * to a given interface (ifnet structure). 128 */ 129#define IFP_TO_IA(ifp, ia) \ 130 /* struct ifnet *ifp; */ \ 131 /* struct in_ifaddr *ia; */ \ 132{ \ |
133 for ((ia) = TAILQ_FIRST(&in_ifaddrhead); \ | 133 for ((ia) = TAILQ_FIRST(&V_in_ifaddrhead); \ |
134 (ia) != NULL && (ia)->ia_ifp != (ifp); \ 135 (ia) = TAILQ_NEXT((ia), ia_link)) \ 136 continue; \ 137} 138#endif 139 140/* 141 * This information should be part of the ifnet structure but we don't wish --- 136 unchanged lines hidden (view full) --- 278 (step).i_inm = LIST_NEXT((step).i_inm, inm_link); \ 279} while(0) 280 281#define IN_FIRST_MULTI(step, inm) \ 282 /* struct in_multistep step; */ \ 283 /* struct in_multi *inm; */ \ 284do { \ 285 IN_MULTI_LOCK_ASSERT(); \ | 134 (ia) != NULL && (ia)->ia_ifp != (ifp); \ 135 (ia) = TAILQ_NEXT((ia), ia_link)) \ 136 continue; \ 137} 138#endif 139 140/* 141 * This information should be part of the ifnet structure but we don't wish --- 136 unchanged lines hidden (view full) --- 278 (step).i_inm = LIST_NEXT((step).i_inm, inm_link); \ 279} while(0) 280 281#define IN_FIRST_MULTI(step, inm) \ 282 /* struct in_multistep step; */ \ 283 /* struct in_multi *inm; */ \ 284do { \ 285 IN_MULTI_LOCK_ASSERT(); \ |
286 (step).i_inm = LIST_FIRST(&in_multihead); \ | 286 (step).i_inm = LIST_FIRST(&V_in_multihead); \ |
287 IN_NEXT_MULTI((step), (inm)); \ 288} while(0) 289 290struct rtentry; 291struct route; 292struct ip_moptions; 293 294size_t imo_match_group(struct ip_moptions *, struct ifnet *, --- 35 unchanged lines hidden --- | 287 IN_NEXT_MULTI((step), (inm)); \ 288} while(0) 289 290struct rtentry; 291struct route; 292struct ip_moptions; 293 294size_t imo_match_group(struct ip_moptions *, struct ifnet *, --- 35 unchanged lines hidden --- |