af_inet.c (227738) | af_inet.c (228571) |
---|---|
1/* 2 * Copyright (c) 1983, 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 --- 15 unchanged lines hidden (view full) --- 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 30#ifndef lint 31static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 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 --- 15 unchanged lines hidden (view full) --- 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 30#ifndef lint 31static const char rcsid[] = |
32 "$FreeBSD: head/sbin/ifconfig/af_inet.c 227738 2011-11-19 19:06:08Z glebius $"; | 32 "$FreeBSD: head/sbin/ifconfig/af_inet.c 228571 2011-12-16 12:16:56Z glebius $"; |
33#endif /* not lint */ 34 35#include <sys/types.h> 36#include <sys/ioctl.h> 37#include <sys/socket.h> 38#include <net/if.h> 39 40#include <ctype.h> --- 38 unchanged lines hidden (view full) --- 79 sin = (struct sockaddr_in *)ifa->ifa_netmask; 80 if (sin == NULL) 81 sin = &null_sin; 82 printf("netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); 83 84 if (ifa->ifa_flags & IFF_BROADCAST) { 85 sin = (struct sockaddr_in *)ifa->ifa_broadaddr; 86 if (sin != NULL && sin->sin_addr.s_addr != 0) | 33#endif /* not lint */ 34 35#include <sys/types.h> 36#include <sys/ioctl.h> 37#include <sys/socket.h> 38#include <net/if.h> 39 40#include <ctype.h> --- 38 unchanged lines hidden (view full) --- 79 sin = (struct sockaddr_in *)ifa->ifa_netmask; 80 if (sin == NULL) 81 sin = &null_sin; 82 printf("netmask 0x%lx ", (unsigned long)ntohl(sin->sin_addr.s_addr)); 83 84 if (ifa->ifa_flags & IFF_BROADCAST) { 85 sin = (struct sockaddr_in *)ifa->ifa_broadaddr; 86 if (sin != NULL && sin->sin_addr.s_addr != 0) |
87 printf("broadcast %s", inet_ntoa(sin->sin_addr)); | 87 printf("broadcast %s ", inet_ntoa(sin->sin_addr)); |
88 } | 88 } |
89 90 print_vhid(ifa, " "); 91 |
|
89 putchar('\n'); 90} 91 92#define SIN(x) ((struct sockaddr_in *) &(x)) 93static struct sockaddr_in *sintab[] = { 94 SIN(in_ridreq.ifr_addr), SIN(in_addreq.ifra_addr), 95 SIN(in_addreq.ifra_mask), SIN(in_addreq.ifra_broadaddr) 96}; --- 112 unchanged lines hidden --- | 92 putchar('\n'); 93} 94 95#define SIN(x) ((struct sockaddr_in *) &(x)) 96static struct sockaddr_in *sintab[] = { 97 SIN(in_ridreq.ifr_addr), SIN(in_addreq.ifra_addr), 98 SIN(in_addreq.ifra_mask), SIN(in_addreq.ifra_broadaddr) 99}; --- 112 unchanged lines hidden --- |