mroute.c (56722) | mroute.c (62584) |
---|---|
1/* 2 * Copyright (c) 1989 Stephen Deering 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Stephen Deering of Stanford University. 8 * --- 25 unchanged lines hidden (view full) --- 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)mroute.c 8.2 (Berkeley) 4/28/95 38 */ 39 40#ifndef lint 41static const char rcsid[] = | 1/* 2 * Copyright (c) 1989 Stephen Deering 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Stephen Deering of Stanford University. 8 * --- 25 unchanged lines hidden (view full) --- 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)mroute.c 8.2 (Berkeley) 4/28/95 38 */ 39 40#ifndef lint 41static const char rcsid[] = |
42 "$FreeBSD: head/usr.bin/netstat/mroute.c 56722 2000-01-28 05:10:56Z shin $"; | 42 "$FreeBSD: head/usr.bin/netstat/mroute.c 62584 2000-07-04 16:26:46Z itojun $"; |
43#endif /* not lint */ 44 45/* 46 * Print DVMRP multicast routing structures and statistics. 47 * 48 * MROUTING 1.0 49 */ 50 | 43#endif /* not lint */ 44 45/* 46 * Print DVMRP multicast routing structures and statistics. 47 * 48 * MROUTING 1.0 49 */ 50 |
51 | |
52#include <sys/param.h> 53#include <sys/queue.h> 54#include <sys/socket.h> 55#include <sys/socketvar.h> 56#include <sys/protosw.h> 57#include <sys/mbuf.h> 58#include <sys/time.h> 59 --- 58 unchanged lines hidden (view full) --- 118 kread(mfcaddr, (char *)&mfctable, sizeof(mfctable)); 119 banner_printed = 0; 120 for (i = 0; i < MFCTBLSIZ; ++i) { 121 m = mfctable[i]; 122 while(m) { 123 kread((u_long)m, (char *)&mfc, sizeof mfc); 124 125 if (!banner_printed) { | 51#include <sys/param.h> 52#include <sys/queue.h> 53#include <sys/socket.h> 54#include <sys/socketvar.h> 55#include <sys/protosw.h> 56#include <sys/mbuf.h> 57#include <sys/time.h> 58 --- 58 unchanged lines hidden (view full) --- 117 kread(mfcaddr, (char *)&mfctable, sizeof(mfctable)); 118 banner_printed = 0; 119 for (i = 0; i < MFCTBLSIZ; ++i) { 120 m = mfctable[i]; 121 while(m) { 122 kread((u_long)m, (char *)&mfc, sizeof mfc); 123 124 if (!banner_printed) { |
126 printf("\nMulticast Forwarding Cache\n" | 125 printf("\nIPv4 Multicast Forwarding Cache\n" |
127 " Origin Group " 128 " Packets In-Vif Out-Vifs:Ttls\n"); 129 banner_printed = 1; 130 } 131 132 printf(" %-15.15s", routename(mfc.mfc_origin.s_addr)); 133 printf(" %-15.15s", routename(mfc.mfc_mcastgrp.s_addr)); 134 printf(" %9lu", mfc.mfc_pkt_cnt); --- 17 unchanged lines hidden (view full) --- 152 153void 154mrt_stats(mstaddr) 155 u_long mstaddr; 156{ 157 struct mrtstat mrtstat; 158 159 if (mstaddr == 0) { | 126 " Origin Group " 127 " Packets In-Vif Out-Vifs:Ttls\n"); 128 banner_printed = 1; 129 } 130 131 printf(" %-15.15s", routename(mfc.mfc_origin.s_addr)); 132 printf(" %-15.15s", routename(mfc.mfc_mcastgrp.s_addr)); 133 printf(" %9lu", mfc.mfc_pkt_cnt); --- 17 unchanged lines hidden (view full) --- 151 152void 153mrt_stats(mstaddr) 154 u_long mstaddr; 155{ 156 struct mrtstat mrtstat; 157 158 if (mstaddr == 0) { |
160 printf("No multicast routing compiled into this system.\n"); | 159 printf("No IPv4 multicast routing compiled into this system.\n"); |
161 return; 162 } 163 164 kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat)); | 160 return; 161 } 162 163 kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat)); |
165 printf("multicast forwarding:\n"); | 164 printf("IPv4 multicast forwarding:\n"); |
166 printf(" %10lu multicast forwarding cache lookup%s\n", 167 mrtstat.mrts_mfc_lookups, plural(mrtstat.mrts_mfc_lookups)); 168 printf(" %10lu multicast forwarding cache miss%s\n", 169 mrtstat.mrts_mfc_misses, plurales(mrtstat.mrts_mfc_misses)); 170 printf(" %10lu upcall%s to mrouted\n", 171 mrtstat.mrts_upcalls, plural(mrtstat.mrts_upcalls)); 172 printf(" %10lu upcall queue overflow%s\n", 173 mrtstat.mrts_upq_ovflw, plural(mrtstat.mrts_upq_ovflw)); --- 19 unchanged lines hidden --- | 165 printf(" %10lu multicast forwarding cache lookup%s\n", 166 mrtstat.mrts_mfc_lookups, plural(mrtstat.mrts_mfc_lookups)); 167 printf(" %10lu multicast forwarding cache miss%s\n", 168 mrtstat.mrts_mfc_misses, plurales(mrtstat.mrts_mfc_misses)); 169 printf(" %10lu upcall%s to mrouted\n", 170 mrtstat.mrts_upcalls, plural(mrtstat.mrts_upcalls)); 171 printf(" %10lu upcall queue overflow%s\n", 172 mrtstat.mrts_upq_ovflw, plural(mrtstat.mrts_upq_ovflw)); --- 19 unchanged lines hidden --- |