ifmcstat.c (78737) | ifmcstat.c (121316) |
---|---|
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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 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 * | 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 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 * $FreeBSD: head/usr.sbin/ifmcstat/ifmcstat.c 78737 2001-06-24 23:41:57Z dd $ | 29 * $FreeBSD: head/usr.sbin/ifmcstat/ifmcstat.c 121316 2003-10-21 20:11:47Z ume $ |
30 */ 31 32#include <stdio.h> 33#include <stdlib.h> 34#include <fcntl.h> 35#include <kvm.h> 36#include <nlist.h> 37#include <string.h> --- 44 unchanged lines hidden (view full) --- 82#endif 83 84const char *inet6_n2a(p) 85 struct in6_addr *p; 86{ 87 static char buf[NI_MAXHOST]; 88 struct sockaddr_in6 sin6; 89 u_int32_t scopeid; | 30 */ 31 32#include <stdio.h> 33#include <stdlib.h> 34#include <fcntl.h> 35#include <kvm.h> 36#include <nlist.h> 37#include <string.h> --- 44 unchanged lines hidden (view full) --- 82#endif 83 84const char *inet6_n2a(p) 85 struct in6_addr *p; 86{ 87 static char buf[NI_MAXHOST]; 88 struct sockaddr_in6 sin6; 89 u_int32_t scopeid; |
90#ifdef NI_WITHSCOPEID 91 const int niflags = NI_NUMERICHOST | NI_WITHSCOPEID; 92#else | |
93 const int niflags = NI_NUMERICHOST; | 90 const int niflags = NI_NUMERICHOST; |
94#endif | |
95 96 memset(&sin6, 0, sizeof(sin6)); 97 sin6.sin6_family = AF_INET6; 98 sin6.sin6_len = sizeof(struct sockaddr_in6); 99 sin6.sin6_addr = *p; 100 if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p)) { 101 scopeid = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); 102 if (scopeid) { --- 169 unchanged lines hidden --- | 91 92 memset(&sin6, 0, sizeof(sin6)); 93 sin6.sin6_family = AF_INET6; 94 sin6.sin6_len = sizeof(struct sockaddr_in6); 95 sin6.sin6_addr = *p; 96 if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p)) { 97 scopeid = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); 98 if (scopeid) { --- 169 unchanged lines hidden --- |