PERFORCE change 166716 for review

Gabor Pali pgj at FreeBSD.org
Wed Jul 29 03:03:38 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166716

Change 166716 by pgj at petymeg-current on 2009/07/29 03:03:18

	Shrink accessor functions by adding some simple preprocessor macros.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#46 edit

Differences ...

==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#46 (text+ko) ====

@@ -1228,1313 +1228,303 @@
 }
 
 
-#define STATS_ACC(returns, stats, field)				    \
+#define STATS_ACCX(returns, stats, f1, f2)				    \
 returns									    \
-netstat_##stats##s_get_##field(const struct stats##_stat *a)		    \
+netstat_##stats##s_get_##f1(const struct stats##_stat *a)		    \
 {									    \
-	return (a->s.stats##s_##field);					    \
+	return (a->s.f2);						    \
 }
 
-const struct tcp_stat *
-netstat_get_tcpstats(const struct stat_type *sttp)
-{
-	if (sttp->stt_type == stat_TCP) {
-		return ((const struct tcp_stat *) sttp->stt_data);
-	}
-	return (NULL);
-}
+#define STATS_ACC(returns, stats, field) \
+	STATS_ACCX(returns, stats, field, stats##s_##field)
 
-u_int64_t
-netstat_tcps_get_connattempt(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_connattempt);
+#define STATS_GET(S,I)							    \
+const struct S##_stat *							    \
+netstat_get_##S##stats(const struct stat_type *sttp)			    \
+{									    \
+	if (sttp->stt_type == stat_##I)					    \
+		return ((const struct S##_stat *)sttp->stt_data);	    \
+	return (NULL);							    \
 }
 
-u_int64_t
-netstat_tcps_get_accepts(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_accepts);
+#define STATS_ACCXA(returns, stats, f1, f2, limit)			    \
+returns									    \
+netstat_##stats##s_get_##f1(const struct stats##_stat *a, int i)	    \
+{									    \
+	if (0 <= i && i < (limit))					    \
+		return (a->s.f2[i]);					    \
+	return (0);							    \
 }
 
-u_int64_t
-netstat_tcps_get_connects(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_connects);
-}
 
-u_int64_t
-netstat_tcps_get_drops(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_drops);
-}
 
-u_int64_t
-netstat_tcps_get_conndrops(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_conndrops);
-}
+#define TCP_ACC(field) \
+    STATS_ACC(u_int64_t,tcp,field)
 
-u_int64_t
-netstat_tcps_get_minmssdrops(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_minmssdrops);
-}
+STATS_GET(tcp,TCP);
+TCP_ACC(connattempt);
+TCP_ACC(accepts);
+TCP_ACC(connects);
+TCP_ACC(drops);
+TCP_ACC(conndrops);
+TCP_ACC(minmssdrops);
+TCP_ACC(closed);
+TCP_ACC(segstimed);
+TCP_ACC(rttupdated);
+TCP_ACC(delack);
+TCP_ACC(timeoutdrop);
+TCP_ACC(rexmttimeo);
+TCP_ACC(persisttimeo);
+TCP_ACC(keeptimeo);
+TCP_ACC(keepprobe);
+TCP_ACC(keepdrops);
+TCP_ACC(sndtotal);
+TCP_ACC(sndpack);
+TCP_ACC(sndbyte);
+TCP_ACC(sndrexmitpack);
+TCP_ACC(sndrexmitbyte);
+TCP_ACC(sndrexmitbad);
+TCP_ACC(sndacks);
+TCP_ACC(sndprobe);
+TCP_ACC(sndurg);
+TCP_ACC(sndwinup);
+TCP_ACC(sndctrl);
+TCP_ACC(rcvtotal);
+TCP_ACC(rcvpack);
+TCP_ACC(rcvbyte);
+TCP_ACC(rcvbadsum);
+TCP_ACC(rcvbadoff);
+TCP_ACC(rcvmemdrop);
+TCP_ACC(rcvshort);
+TCP_ACC(rcvduppack);
+TCP_ACC(rcvdupbyte);
+TCP_ACC(rcvpartduppack);
+TCP_ACC(rcvpartdupbyte);
+TCP_ACC(rcvoopack);
+TCP_ACC(rcvoobyte);
+TCP_ACC(rcvpackafterwin);
+TCP_ACC(rcvbyteafterwin);
+TCP_ACC(rcvafterclose);
+TCP_ACC(rcvwinprobe);
+TCP_ACC(rcvdupack);
+TCP_ACC(rcvacktoomuch);
+TCP_ACC(rcvackpack);
+TCP_ACC(rcvackbyte);
+TCP_ACC(rcvwinupd);
+TCP_ACC(pawsdrop);
+TCP_ACC(predack);
+TCP_ACC(preddat);
+TCP_ACC(pcbcachemiss);
+TCP_ACC(cachedrtt);
+TCP_ACC(cachedrttvar);
+TCP_ACC(cachedssthresh);
+TCP_ACC(usedrtt);
+TCP_ACC(usedrttvar);
+TCP_ACC(usedssthresh);
+TCP_ACC(persistdrop);
+TCP_ACC(badsyn);
+TCP_ACC(mturesent);
+TCP_ACC(listendrop);
+TCP_ACC(badrst);
+TCP_ACC(sc_added);
+TCP_ACC(sc_retransmitted);
+TCP_ACC(sc_dupsyn);
+TCP_ACC(sc_dropped);
+TCP_ACC(sc_completed);
+TCP_ACC(sc_bucketoverflow);
+TCP_ACC(sc_cacheoverflow);
+TCP_ACC(sc_reset);
+TCP_ACC(sc_stale);
+TCP_ACC(sc_aborted);
+TCP_ACC(sc_badack);
+TCP_ACC(sc_unreach);
+TCP_ACC(sc_zonefail);
+TCP_ACC(sc_sendcookie);
+TCP_ACC(sc_recvcookie);
+TCP_ACC(hc_added);
+TCP_ACC(hc_bucketoverflow);
+TCP_ACC(finwait2_drops);
+TCP_ACC(sack_recovery_episode);
+TCP_ACC(sack_rexmits);
+TCP_ACC(sack_rexmit_bytes);
+TCP_ACC(sack_rcv_blocks);
+TCP_ACC(sack_send_blocks);
+TCP_ACC(sack_sboverflow);
+TCP_ACC(ecn_ce);
+TCP_ACC(ecn_ect0);
+TCP_ACC(ecn_ect1);
+TCP_ACC(ecn_shs);
+TCP_ACC(ecn_rcwnd);
+#undef TCP_ACC
 
-u_int64_t
-netstat_tcps_get_closed(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_closed);
-}
 
-u_int64_t
-netstat_tcps_get_segstimed(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_segstimed);
-}
+#define UDP_ACC(field) \
+    STATS_ACC(u_int64_t,udp,field)
 
-u_int64_t
-netstat_tcps_get_rttupdated(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rttupdated);
-}
+#define UDP_ACCX(f1,f2) \
+    STATS_ACCX(u_int64_t,udp,f1,f2)
 
-u_int64_t
-netstat_tcps_get_delack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_delack);
-}
+STATS_GET(udp,UDP);
+UDP_ACC(ipackets);
+UDP_ACC(hdrops);
+UDP_ACC(badsum);
+UDP_ACC(nosum);
+UDP_ACC(badlen);
+UDP_ACC(noport);
+UDP_ACC(noportbcast);
+UDP_ACC(fullsock);
+UDP_ACCX(pcbcachemiss,udpps_pcbcachemiss);
+UDP_ACCX(pcbhashmiss,udpps_pcbhashmiss);
+UDP_ACC(delivered);
+UDP_ACC(opackets);
+UDP_ACC(fastout);
+UDP_ACC(noportmcast);
+UDP_ACC(filtermcast);
+#undef UDP_ACC
+#undef UDP_ACCX
 
-u_int64_t
-netstat_tcps_get_timeoutdrop(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_timeoutdrop);
-}
 
-u_int64_t
-netstat_tcps_get_rexmttimeo(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rexmttimeo);
-}
+#define CARP_ACC(field) \
+    STATS_ACC(u_int64_t,carp,field)
 
-u_int64_t
-netstat_tcps_get_persisttimeo(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_persisttimeo);
-}
+STATS_GET(carp,CARP);
+CARP_ACC(ipackets);
+CARP_ACC(ipackets6);
+CARP_ACC(badif);
+CARP_ACC(badttl);
+CARP_ACC(hdrops);
+CARP_ACC(badsum);
+CARP_ACC(badver);
+CARP_ACC(badlen);
+CARP_ACC(badauth);
+CARP_ACC(badvhid);
+CARP_ACC(badaddrs);
+CARP_ACC(opackets);
+CARP_ACC(opackets6);
+CARP_ACC(onomem);
+CARP_ACC(ostates);
+CARP_ACC(preempt);
+#undef CARP_ACC
 
-u_int64_t
-netstat_tcps_get_keeptimeo(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_keeptimeo);
-}
 
-u_int64_t
-netstat_tcps_get_keepprobe(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_keepprobe);
-}
+#define IP_ACC(field) \
+    STATS_ACC(u_int64_t,ip,field)
 
-u_int64_t
-netstat_tcps_get_keepdrops(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_keepdrops);
-}
+STATS_GET(ip,IP);
+IP_ACC(total);
+IP_ACC(badsum);
+IP_ACC(tooshort);
+IP_ACC(toosmall);
+IP_ACC(badhlen);
+IP_ACC(badlen);
+IP_ACC(fragments);
+IP_ACC(fragdropped);
+IP_ACC(fragtimeout);
+IP_ACC(forward);
+IP_ACC(fastforward);
+IP_ACC(cantforward);
+IP_ACC(redirectsent);
+IP_ACC(noproto);
+IP_ACC(delivered);
+IP_ACC(localout);
+IP_ACC(odropped);
+IP_ACC(reassembled);
+IP_ACC(fragmented);
+IP_ACC(ofragments);
+IP_ACC(cantfrag);
+IP_ACC(badoptions);
+IP_ACC(noroute);
+IP_ACC(badvers);
+IP_ACC(rawout);
+IP_ACC(toolong);
+IP_ACC(notmember);
+IP_ACC(nogif);
+IP_ACC(badaddr);
+#undef IP_ACC
 
-u_int64_t
-netstat_tcps_get_sndtotal(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndtotal);
-}
 
-u_int64_t
-netstat_tcps_get_sndpack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndpack);
-}
+#define ICMP_ACC(field) \
+    STATS_ACCX(u_int64_t,icmp,field,icps_##field)
 
-u_int64_t
-netstat_tcps_get_sndbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndbyte);
-}
+#define ICMP_ACCA(field) \
+    STATS_ACCXA(u_int64_t,icmp,field,icps_##field,ICMP_MAXTYPE)
 
-u_int64_t
-netstat_tcps_get_sndrexmitpack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndrexmitpack);
-}
+STATS_GET(icmp,ICMP);
+ICMP_ACCA(inhist);
+ICMP_ACCA(outhist);
+ICMP_ACC(error);
+ICMP_ACC(oldshort);
+ICMP_ACC(oldicmp);
+ICMP_ACC(badcode);
+ICMP_ACC(tooshort);
+ICMP_ACC(checksum);
+ICMP_ACC(badlen);
+ICMP_ACC(reflect);
+ICMP_ACC(bmcastecho);
+ICMP_ACC(bmcasttstamp);
+ICMP_ACC(badaddr);
+ICMP_ACC(noroute);
+#undef ICMP_ACC
+#undef ICMP_ACCA
 
-u_int64_t
-netstat_tcps_get_sndrexmitbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndrexmitbyte);
-}
 
-u_int64_t
-netstat_tcps_get_sndrexmitbad(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndrexmitbad);
-}
+#define PIM_ACC(field) \
+    STATS_ACC(u_int64_t,pim,field)
 
-u_int64_t
-netstat_tcps_get_sndacks(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndacks);
-}
+STATS_GET(pim,PIM);
+PIM_ACC(rcv_total_msgs);
+PIM_ACC(rcv_total_bytes);
+PIM_ACC(rcv_tooshort);
+PIM_ACC(rcv_badsum);
+PIM_ACC(rcv_badversion);
+PIM_ACC(rcv_registers_msgs);
+PIM_ACC(rcv_registers_bytes);
+PIM_ACC(rcv_registers_wrongiif);
+PIM_ACC(rcv_badregisters);
+PIM_ACC(snd_registers_msgs);
+PIM_ACC(snd_registers_bytes);
+#undef PIM_ACC
 
-u_int64_t
-netstat_tcps_get_sndprobe(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndprobe);
-}
 
-u_int64_t
-netstat_tcps_get_sndurg(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndurg);
-}
+#define IGMP_ACC(field) \
+    STATS_ACCX(u_int64_t,igmp,field,igps_##field)
 
-u_int64_t
-netstat_tcps_get_sndwinup(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndwinup);
-}
+STATS_GET(igmp,IGMP);
+IGMP_ACC(rcv_total);
+IGMP_ACC(rcv_tooshort);
+IGMP_ACC(rcv_badttl);
+IGMP_ACC(rcv_badsum);
+IGMP_ACC(rcv_v1v2_queries);
+IGMP_ACC(rcv_v3_queries);
+IGMP_ACC(rcv_badqueries);
+IGMP_ACC(rcv_gen_queries);
+IGMP_ACC(rcv_group_queries);
+IGMP_ACC(rcv_gsr_queries);
+IGMP_ACC(drop_gsr_queries);
+IGMP_ACC(rcv_reports);
+IGMP_ACC(rcv_badreports);
+IGMP_ACC(rcv_ourreports);
+IGMP_ACC(rcv_nora);
+IGMP_ACC(snd_reports);
+#undef IGMP_ACC
 
-u_int64_t
-netstat_tcps_get_sndctrl(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sndctrl);
-}
+#define DDP_ACC(field) \
+    STATS_ACC(u_int64_t,ddp,field)
 
-u_int64_t
-netstat_tcps_get_rcvtotal(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvtotal);
-}
-
-u_int64_t
-netstat_tcps_get_rcvpack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvpack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvbyte);
-}
-
-u_int64_t
-netstat_tcps_get_rcvbadsum(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvbadsum);
-}
-
-u_int64_t
-netstat_tcps_get_rcvbadoff(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvbadoff);
-}
-
-u_int64_t
-netstat_tcps_get_rcvmemdrop(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvmemdrop);
-}
-
-u_int64_t
-netstat_tcps_get_rcvshort(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvshort);
-}
-
-u_int64_t
-netstat_tcps_get_rcvduppack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvduppack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvdupbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvdupbyte);
-}
-
-u_int64_t
-netstat_tcps_get_rcvpartduppack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvpartduppack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvpartdupbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvpartdupbyte);
-}
-
-u_int64_t
-netstat_tcps_get_rcvoopack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvoopack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvoobyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvoobyte);
-}
-
-u_int64_t
-netstat_tcps_get_rcvpackafterwin(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvpackafterwin);
-}
-
-u_int64_t
-netstat_tcps_get_rcvbyteafterwin(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvbyteafterwin);
-}
-
-u_int64_t
-netstat_tcps_get_rcvafterclose(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvafterclose);
-}
-
-u_int64_t
-netstat_tcps_get_rcvwinprobe(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvwinprobe);
-}
-
-u_int64_t
-netstat_tcps_get_rcvdupack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvdupack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvacktoomuch(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvacktoomuch);
-}
-
-u_int64_t
-netstat_tcps_get_rcvackpack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvackpack);
-}
-
-u_int64_t
-netstat_tcps_get_rcvackbyte(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvackbyte);
-}
-
-u_int64_t
-netstat_tcps_get_rcvwinupd(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_rcvwinupd);
-}
-
-u_int64_t
-netstat_tcps_get_pawsdrop(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_pawsdrop);
-}
-
-u_int64_t
-netstat_tcps_get_predack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_predack);
-}
-
-u_int64_t
-netstat_tcps_get_preddat(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_preddat);
-}
-
-u_int64_t
-netstat_tcps_get_pcbcachemiss(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_pcbcachemiss);
-}
-
-u_int64_t
-netstat_tcps_get_cachedrtt(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_cachedrtt);
-}
-
-u_int64_t
-netstat_tcps_get_cachedrttvar(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_cachedrttvar);
-}
-
-u_int64_t
-netstat_tcps_get_cachedssthresh(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_cachedssthresh);
-}
-
-u_int64_t
-netstat_tcps_get_usedrtt(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_usedrtt);
-}
+STATS_GET(ddp,DDP);
+DDP_ACC(short);
+DDP_ACC(long);
+DDP_ACC(nosum);
+DDP_ACC(badsum);
+DDP_ACC(tooshort);
+DDP_ACC(toosmall);
+DDP_ACC(forward);
+DDP_ACC(encap);
+DDP_ACC(cantforward);
+DDP_ACC(nosockspace);
+#undef DDP_ACC
 
-u_int64_t
-netstat_tcps_get_usedrttvar(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_usedrttvar);
-}
 
-u_int64_t
-netstat_tcps_get_usedssthresh(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_usedssthresh);
-}
-
-u_int64_t
-netstat_tcps_get_persistdrop(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_persistdrop);
-}
-
-u_int64_t
-netstat_tcps_get_badsyn(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_badsyn);
-}
-
-u_int64_t
-netstat_tcps_get_mturesent(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_mturesent);
-}
-
-u_int64_t
-netstat_tcps_get_listendrop(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_listendrop);
-}
-
-u_int64_t
-netstat_tcps_get_badrst(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_badrst);
-}
-
-u_int64_t
-netstat_tcps_get_sc_added(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_added);
-}
-
-u_int64_t
-netstat_tcps_get_sc_retransmitted(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_retransmitted);
-}
-
-u_int64_t
-netstat_tcps_get_sc_dupsyn(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_dupsyn);
-}
-
-u_int64_t
-netstat_tcps_get_sc_dropped(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_dropped);
-}
-
-u_int64_t
-netstat_tcps_get_sc_completed(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_completed);
-}
-
-u_int64_t
-netstat_tcps_get_sc_bucketoverflow(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_bucketoverflow);
-}
-
-u_int64_t
-netstat_tcps_get_sc_cacheoverflow(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_cacheoverflow);
-}
-
-u_int64_t
-netstat_tcps_get_sc_reset(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_reset);
-}
-
-u_int64_t
-netstat_tcps_get_sc_stale(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_stale);
-}
-
-u_int64_t
-netstat_tcps_get_sc_aborted(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_aborted);
-}
-
-u_int64_t
-netstat_tcps_get_sc_badack(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_badack);
-}
-
-u_int64_t
-netstat_tcps_get_sc_unreach(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_unreach);
-}
-
-u_int64_t
-netstat_tcps_get_sc_zonefail(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_zonefail);
-}
-
-u_int64_t
-netstat_tcps_get_sc_sendcookie(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_sendcookie);
-}
-
-u_int64_t
-netstat_tcps_get_sc_recvcookie(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sc_recvcookie);
-}
-
-u_int64_t
-netstat_tcps_get_hc_added(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_hc_added);
-}
-
-u_int64_t
-netstat_tcps_get_hc_bucketoverflow(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_hc_bucketoverflow);
-}
-
-u_int64_t
-netstat_tcps_get_finwait2_drops(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_finwait2_drops);
-}
-
-u_int64_t
-netstat_tcps_get_sack_recovery_episode(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_recovery_episode);
-}
-
-u_int64_t
-netstat_tcps_get_sack_rexmits(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_rexmits);
-}
-
-u_int64_t
-netstat_tcps_get_sack_rexmit_bytes(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_rexmit_bytes);
-}
-
-u_int64_t
-netstat_tcps_get_sack_rcv_blocks(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_rcv_blocks);
-}
-
-u_int64_t
-netstat_tcps_get_sack_send_blocks(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_send_blocks);
-}
-
-u_int64_t
-netstat_tcps_get_sack_sboverflow(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_sack_sboverflow);
-}
-
-u_int64_t
-netstat_tcps_get_ecn_ce(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_ecn_ce);
-}
-
-u_int64_t
-netstat_tcps_get_ecn_ect0(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_ecn_ect0);
-}
-
-u_int64_t
-netstat_tcps_get_ecn_ect1(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_ecn_ect1);
-}
-
-u_int64_t
-netstat_tcps_get_ecn_shs(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_ecn_shs);
-}
-
-u_int64_t
-netstat_tcps_get_ecn_rcwnd(const struct tcp_stat *tsp)
-{
-	return (tsp->s.tcps_ecn_rcwnd);
-}
-
-const struct udp_stat *
-netstat_get_udpstats(const struct stat_type *sttp)
-{
-	if (sttp->stt_type == stat_UDP) {
-		return ((const struct udp_stat *) sttp->stt_data);
-	}
-	return (NULL);
-}
-
-u_int64_t
-netstat_udps_get_ipackets(const struct udp_stat *usp)
-{
-	return (usp->s.udps_ipackets);
-}
-
-u_int64_t
-netstat_udps_get_hdrops(const struct udp_stat *usp)
-{
-	return (usp->s.udps_hdrops);
-}
-
-u_int64_t
-netstat_udps_get_badsum(const struct udp_stat *usp)
-{
-	return (usp->s.udps_badsum);
-}
-
-u_int64_t
-netstat_udps_get_nosum(const struct udp_stat *usp)
-{
-	return (usp->s.udps_nosum);
-}
-
-u_int64_t
-netstat_udps_get_badlen(const struct udp_stat *usp)
-{
-	return (usp->s.udps_badlen);
-}
-
-u_int64_t
-netstat_udps_get_noport(const struct udp_stat *usp)
-{
-	return (usp->s.udps_noport);
-}
-
-u_int64_t
-netstat_udps_get_noportbcast(const struct udp_stat *usp)
-{
-	return (usp->s.udps_noportbcast);
-}
-
-u_int64_t
-netstat_udps_get_fullsock(const struct udp_stat *usp)
-{
-	return (usp->s.udps_fullsock);
-}
-
-u_int64_t
-netstat_udps_get_pcbcachemiss(const struct udp_stat *usp)
-{
-	return (usp->s.udpps_pcbcachemiss);
-}
-
-u_int64_t
-netstat_udps_get_pcbhashmiss(const struct udp_stat *usp)
-{
-	return (usp->s.udpps_pcbhashmiss);
-}
-
-u_int64_t
-netstat_udps_get_delivered(const struct udp_stat *usp)
-{
-	return (usp->s.udps_delivered);
-}
-
-u_int64_t
-netstat_udps_get_opackets(const struct udp_stat *usp)
-{
-	return (usp->s.udps_opackets);
-}
-
-u_int64_t
-netstat_udps_get_fastout(const struct udp_stat *usp)
-{
-	return (usp->s.udps_fastout);
-}
-
-u_int64_t
-netstat_udps_get_noportmcast(const struct udp_stat *usp)
-{
-	return (usp->s.udps_noportmcast);
-}
-
-u_int64_t
-netstat_udps_get_filtermcast(const struct udp_stat *usp)
-{
-	return (usp->s.udps_filtermcast);
-}
-
-const struct carp_stat *
-netstat_get_carpstats(const struct stat_type *sttp)
-{
-	if (sttp->stt_type == stat_CARP) {
-		return ((const struct carp_stat *) sttp->stt_data);
-	}
-	return (NULL);
-}
-
-u_int64_t
-netstat_carps_get_ipackets(const struct carp_stat *csp)
-{
-	return (csp->s.carps_ipackets);
-}
-
-u_int64_t
-netstat_carps_get_ipackets6(const struct carp_stat *csp)
-{
-	return (csp->s.carps_ipackets6);
-}
-
-u_int64_t
-netstat_carps_get_badif(const struct carp_stat *csp)
-{
-	return (csp->s.carps_badif);
-}
-
-u_int64_t
-netstat_carps_get_badttl(const struct carp_stat *csp)
-{
-	return (csp->s.carps_badttl);
-}
-
-u_int64_t
-netstat_carps_get_hdrops(const struct carp_stat *csp)
-{
-	return (csp->s.carps_hdrops);
-}
-
-u_int64_t
-netstat_carps_get_badsum(const struct carp_stat *csp)
-{
-	return (csp->s.carps_badsum);
-}
-
-u_int64_t
-netstat_carps_get_badver(const struct carp_stat *csp)
-{
-	return (csp->s.carps_badver);
-}

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list