PERFORCE change 166615 for review

Gabor Pali pgj at FreeBSD.org
Mon Jul 27 13:16:10 UTC 2009


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

Change 166615 by pgj at petymeg-current on 2009/07/27 13:15:45

	- Introduce a general stat_type for protocol-dependent statistics,
	  together with resetting (netstat_zerostat()).
	- Add support for TCP statistics.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/Makefile#13 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#33 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#31 edit
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_stat.c#1 add
.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_util.c#37 edit

Differences ...

==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/Makefile#13 (text+ko) ====

@@ -4,7 +4,7 @@
 
 LIB=	netstat
 SRCS=	netstat_socket.c netstat_mbuf.c netstat_if.c netstat_bpf.c \
-	netstat_util.c
+	netstat_stat.c netstat_util.c
 
 INCS=	netstat.h
 

==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.h#33 (text+ko) ====

@@ -50,6 +50,7 @@
 #define NETSTAT_ERROR_KVM_NOSYMBOL  4
 #define NETSTAT_ERROR_KVM_SHORTREAD 5
 #define NETSTAT_ERROR_UNSUPPORTED   6
+#define NETSTAT_ERROR_INVALID	    7
 
 /* Flags for netstat_socket(): */
 #define	NETSTAT_SOCKET_KVM	    0x01	/* Use KVM. */
@@ -65,6 +66,9 @@
 /* netstat_bpf(): */
 #define NETSTAT_BPF_KVM		    0x01
 
+/* netstat_stat(): */
+#define NETSTAT_STAT_KVM	    0x01
+
 /* Testing flags for interface_type: */
 #define NETSTAT_IF_UP		    0x01	/* interface is up */
 
@@ -110,6 +114,12 @@
     bpfdir_MAX,
 };
 
+enum stat {
+    stat_TCP = 0,
+    stat_MAX,
+    stat_Invalid,
+};
+
 struct socket_type;
 struct sockaddr_type;
 struct sockbuf_type;
@@ -130,6 +140,9 @@
 struct bpf_type_list;
 struct bpf_type_iterator;
 
+struct stat_type;
+struct tcp_stat;
+
 __BEGIN_DECLS
 const char		    *netstat_strerror(int);
 
@@ -306,4 +319,110 @@
 u_int64_t   netstat_bpt_get_slen(const struct bpf_type *);
 u_int64_t   netstat_bpt_get_hlen(const struct bpf_type *);
 const char  *netstat_bpt_get_pidname(const struct bpf_type *);
+
+
+/* Protocol-dependent statistics: */
+struct stat_type    *netstat_stat_alloc(void);
+void		    netstat_stat_free(struct stat_type *);
+int		    netstat_stat_geterror(const struct stat_type *);
+
+int	netstat_stat(enum stat, struct stat_type *, int flags,
+	    void *kvm_handle);
+int	netstat_zerostat(enum stat);
+
+const struct tcp_stat	*netstat_get_tcpstats(const struct stat_type *);
+
+u_int64_t   netstat_tcps_get_connattempt(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_accepts(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_connects(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_drops(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_conndrops(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_minmssdrops(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_closed(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_segstimed(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rttupdated(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_delack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_timeoutdrop(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rexmttimeo(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_persisttimeo(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_keeptimeo(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_keepprobe(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_keepdrops(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndtotal(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndpack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndrexmitpack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndrexmitbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndrexmitbad(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndacks(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndprobe(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndurg(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndwinup(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sndctrl(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvtotal(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvpack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvbadsum(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvbadoff(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvmemdrop(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvshort(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvduppack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvdupbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvpartduppack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvpartdupbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvoopack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvoobyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvpackafterwin(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvbyteafterwin(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvafterclose(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvwinprobe(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvdupack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvacktoomuch(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvackpack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvackbyte(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_rcvwinupd(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_pawsdrop(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_predack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_preddat(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_pcbcachemiss(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_cachedrtt(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_cachedrttvar(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_cachedssthresh(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_usedrtt(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_usedrttvar(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_usedssthresh(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_persistdrop(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_badsyn(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_mturesent(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_listendrop(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_badrst(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_added(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_retransmitted(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_dupsyn(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_dropped(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_completed(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_bucketoverflow(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_cacheoverflow(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_reset(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_stale(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_aborted(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_badack(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_unreach(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_zonefail(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_sendcookie(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sc_recvcookie(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_hc_added(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_hc_bucketoverflow(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_finwait2_drops(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_recovery_episode(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_rexmits(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_rexmit_bytes(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_rcv_blocks(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_send_blocks(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_sack_sboverflow(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_ecn_ce(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_ecn_ect0(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_ecn_ect1(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_ecn_shs(const struct tcp_stat *);
+u_int64_t   netstat_tcps_get_ecn_rcwnd(const struct tcp_stat *);
 #endif /* !_NETSTAT_H_ */

==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_internal.h#31 (text+ko) ====

@@ -270,6 +270,17 @@
 	struct bpf_type		*bpti_next;
 };
 
+/* General statistics type. */
+struct stat_type {
+	enum stat   stt_type;
+	void	    *stt_data;
+	int	    stt_error;
+};
+
+struct tcp_stat {
+	struct tcpstat	s;
+};
+
 int kread_data(kvm_t *kvm, u_long kvm_pointer, void *address, size_t size);
 int kread_string(kvm_t *kvm, u_long kvm_pointer, char *buffer, int buflen);
 

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

@@ -1201,6 +1201,600 @@
 	return (btp->bpt_pidname);
 }
 
+struct stat_type *
+netstat_stat_alloc(void)
+{
+	struct stat_type *sttp;
+
+	sttp = malloc(sizeof(*sttp));
+	if (sttp == NULL)
+		return (NULL);
+
+	bzero(sttp, sizeof(*sttp));
+	return (sttp);
+}
+
+void
+netstat_stat_free(struct stat_type *sttp)
+{
+	free(sttp->stt_data);
+	free(sttp);
+}
+
+int
+netstat_stat_geterror(const struct stat_type *sttp)
+{
+	return (sttp->stt_error);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_connattempt(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_connattempt);
+}
+
+u_int64_t
+netstat_tcps_get_accepts(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_accepts);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_minmssdrops(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_minmssdrops);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_rttupdated(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_rttupdated);
+}
+
+u_int64_t
+netstat_tcps_get_delack(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_delack);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_persisttimeo(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_persisttimeo);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_keepdrops(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_keepdrops);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_sndbyte(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_sndbyte);
+}
+
+u_int64_t
+netstat_tcps_get_sndrexmitpack(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_sndrexmitpack);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_sndacks(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_sndacks);
+}
+
+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);
+}
+
+u_int64_t
+netstat_tcps_get_sndwinup(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_sndwinup);
+}
+
+u_int64_t
+netstat_tcps_get_sndctrl(const struct tcp_stat *tsp)
+{
+	return (tsp->s.tcps_sndctrl);
+}
+
+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);
+}
+
+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 char *
 routename(in_addr_t in, int numeric)
 {


More information about the p4-projects mailing list