in6_var.h (53541) | in6_var.h (54263) |
---|---|
1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 46 unchanged lines hidden (view full) --- 55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 * SUCH DAMAGE. 61 * 62 * @(#)in_var.h 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 46 unchanged lines hidden (view full) --- 55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 * SUCH DAMAGE. 61 * 62 * @(#)in_var.h 8.1 (Berkeley) 6/10/93 |
63 * $FreeBSD: head/sys/netinet6/in6_var.h 53541 1999-11-22 02:45:11Z shin $ | 63 * $FreeBSD: head/sys/netinet6/in6_var.h 54263 1999-12-07 17:39:16Z shin $ |
64 */ 65 66#ifndef _NETINET6_IN6_VAR_H_ 67#define _NETINET6_IN6_VAR_H_ 68 69/* 70 * Interface address, Internet version. One of these structures 71 * is allocated for each interface with an Internet address. --- 360 unchanged lines hidden (view full) --- 432 * Macro for finding the internet address structure (in6_ifaddr) corresponding 433 * to a given interface (ifnet structure). 434 */ 435#define IFP_TO_IA6(ifp, ia) \ 436/* struct ifnet *ifp; */ \ 437/* struct in6_ifaddr *ia; */ \ 438do { \ 439 struct ifaddr *ifa; \ | 64 */ 65 66#ifndef _NETINET6_IN6_VAR_H_ 67#define _NETINET6_IN6_VAR_H_ 68 69/* 70 * Interface address, Internet version. One of these structures 71 * is allocated for each interface with an Internet address. --- 360 unchanged lines hidden (view full) --- 432 * Macro for finding the internet address structure (in6_ifaddr) corresponding 433 * to a given interface (ifnet structure). 434 */ 435#define IFP_TO_IA6(ifp, ia) \ 436/* struct ifnet *ifp; */ \ 437/* struct in6_ifaddr *ia; */ \ 438do { \ 439 struct ifaddr *ifa; \ |
440 for (ifa = (ifp)->if_addrlist.tqh_first; ifa; ifa = ifa->ifa_list.tqe_next) { \ | 440 TAILQ_FOREACH(ifa, &(ifp)->if_addrlist, ifa_list) { \ |
441 if (!ifa->ifa_addr) \ 442 continue; \ 443 if (ifa->ifa_addr->sa_family == AF_INET6) \ 444 break; \ 445 } \ 446 (ia) = (struct in6_ifaddr *)ifa; \ 447} while (0) 448#endif /* _KERNEL */ --- 13 unchanged lines hidden (view full) --- 462 struct ifnet *in6m_ifp; /* back pointer to ifnet */ 463 struct ifmultiaddr *in6m_ifma; /* back pointer to ifmultiaddr */ 464 u_int in6m_refcount; /* # membership claims by sockets */ 465 u_int in6m_state; /* state of the membership */ 466 u_int in6m_timer; /* MLD6 listener report timer */ 467}; 468 469#ifdef _KERNEL | 441 if (!ifa->ifa_addr) \ 442 continue; \ 443 if (ifa->ifa_addr->sa_family == AF_INET6) \ 444 break; \ 445 } \ 446 (ia) = (struct in6_ifaddr *)ifa; \ 447} while (0) 448#endif /* _KERNEL */ --- 13 unchanged lines hidden (view full) --- 462 struct ifnet *in6m_ifp; /* back pointer to ifnet */ 463 struct ifmultiaddr *in6m_ifma; /* back pointer to ifmultiaddr */ 464 u_int in6m_refcount; /* # membership claims by sockets */ 465 u_int in6m_state; /* state of the membership */ 466 u_int in6m_timer; /* MLD6 listener report timer */ 467}; 468 469#ifdef _KERNEL |
470 471#ifdef SYSCTL_DECL 472SYSCTL_DECL(_net_inet6_ip6); 473#endif 474 |
|
470extern LIST_HEAD(in6_multihead, in6_multi) in6_multihead; 471 472/* 473 * Structure used by macros below to remember position when stepping through 474 * all of eht in6_multi records. 475 */ 476struct in6_multistep { 477 struct in6_ifaddr *i_ia; --- 29 unchanged lines hidden (view full) --- 507 * and get the first record. Both macros return a NULL "in6m" when there 508 * are no remaining records. 509 */ 510#define IN6_NEXT_MULTI(step, in6m) \ 511/* struct in6_multistep step; */ \ 512/* struct in6_multi *in6m; */ \ 513do { \ 514 if (((in6m) = (step).i_in6m) != NULL) \ | 475extern LIST_HEAD(in6_multihead, in6_multi) in6_multihead; 476 477/* 478 * Structure used by macros below to remember position when stepping through 479 * all of eht in6_multi records. 480 */ 481struct in6_multistep { 482 struct in6_ifaddr *i_ia; --- 29 unchanged lines hidden (view full) --- 512 * and get the first record. Both macros return a NULL "in6m" when there 513 * are no remaining records. 514 */ 515#define IN6_NEXT_MULTI(step, in6m) \ 516/* struct in6_multistep step; */ \ 517/* struct in6_multi *in6m; */ \ 518do { \ 519 if (((in6m) = (step).i_in6m) != NULL) \ |
515 (step).i_in6m = (step).i_in6m->in6m_entry.le_next; \ | 520 (step).i_in6m = LIST_NEXT((step).i_in6m, in6m_entry); \ |
516} while(0) 517 518#define IN6_FIRST_MULTI(step, in6m) \ 519/* struct in6_multistep step; */ \ 520/* struct in6_multi *in6m */ \ 521do { \ | 521} while(0) 522 523#define IN6_FIRST_MULTI(step, in6m) \ 524/* struct in6_multistep step; */ \ 525/* struct in6_multi *in6m */ \ 526do { \ |
522 (step).i_in6m = in6_multihead.lh_first; \ | 527 (step).i_in6m = LIST_FIRST(&in6_multihead); \ |
523 IN6_NEXT_MULTI((step), (in6m)); \ 524} while(0) 525 526int in6_ifinit __P((struct ifnet *, 527 struct in6_ifaddr *, struct sockaddr_in6 *, int)); 528struct in6_multi *in6_addmulti __P((struct in6_addr *, struct ifnet *, 529 int *)); 530void in6_delmulti __P((struct in6_multi *)); --- 24 unchanged lines hidden --- | 528 IN6_NEXT_MULTI((step), (in6m)); \ 529} while(0) 530 531int in6_ifinit __P((struct ifnet *, 532 struct in6_ifaddr *, struct sockaddr_in6 *, int)); 533struct in6_multi *in6_addmulti __P((struct in6_addr *, struct ifnet *, 534 int *)); 535void in6_delmulti __P((struct in6_multi *)); --- 24 unchanged lines hidden --- |