add tcp.in_errs

This commit is contained in:
Doug MacEachern 2007-08-08 06:11:20 +00:00
parent bde8f07e8b
commit eec869f6d7
9 changed files with 16 additions and 5 deletions

View File

@ -1063,6 +1063,11 @@ my %classes = (
desc => '', desc => '',
plat => '' plat => ''
}, },
{
name => 'in_errs', type => 'Long',
desc => '',
plat => ''
},
{ {
name => 'out_rsts', type => 'Long', name => 'out_rsts', type => 'Long',
desc => '', desc => '',

View File

@ -171,7 +171,7 @@ public class Netstat extends SigarCommandBase {
println(dnt + stat.getInSegs() + " segments received"); println(dnt + stat.getInSegs() + " segments received");
println(dnt + stat.getOutSegs() + " segments send out"); println(dnt + stat.getOutSegs() + " segments send out");
println(dnt + stat.getRetransSegs() + " segments retransmited"); println(dnt + stat.getRetransSegs() + " segments retransmited");
//println(dnt + stat.getInErrs() + " bad segments received."); println(dnt + stat.getInErrs() + " bad segments received.");
println(dnt + stat.getOutRsts() + " resets sent"); println(dnt + stat.getOutRsts() + " resets sent");
} }

View File

@ -696,6 +696,7 @@ typedef struct {
sigar_uint64_t in_segs; sigar_uint64_t in_segs;
sigar_uint64_t out_segs; sigar_uint64_t out_segs;
sigar_uint64_t retrans_segs; sigar_uint64_t retrans_segs;
sigar_uint64_t in_errs;
sigar_uint64_t out_rsts; sigar_uint64_t out_rsts;
} sigar_tcp_t; } sigar_tcp_t;

View File

@ -2288,7 +2288,7 @@ sigar_tcp_get(sigar_t *sigar,
tcp->in_segs = proto.u.tcp.ipackets; tcp->in_segs = proto.u.tcp.ipackets;
tcp->out_segs = proto.u.tcp.opackets; tcp->out_segs = proto.u.tcp.opackets;
tcp->retrans_segs = 0; tcp->retrans_segs = 0;
/* tcp->inerrs = proto.u.tcp.ierrors; */ tcp->in_errs = proto.u.tcp.ierrors;
tcp->out_rsts = 0; tcp->out_rsts = 0;
} }

View File

@ -2233,6 +2233,11 @@ sigar_tcp_get(sigar_t *sigar,
tcp->in_segs = mib.tcps_rcvtotal; tcp->in_segs = mib.tcps_rcvtotal;
tcp->out_segs = mib.tcps_sndtotal - mib.tcps_sndrexmitpack; tcp->out_segs = mib.tcps_sndtotal - mib.tcps_sndrexmitpack;
tcp->retrans_segs = mib.tcps_sndrexmitpack; tcp->retrans_segs = mib.tcps_sndrexmitpack;
tcp->in_errs =
mib.tcps_rcvbadsum +
mib.tcps_rcvbadoff +
mib.tcps_rcvmemdrop +
mib.tcps_rcvshort;
tcp->out_rsts = mib.tcps_sndctrl - mib.tcps_closed; tcp->out_rsts = mib.tcps_sndctrl - mib.tcps_closed;
return SIGAR_OK; return SIGAR_OK;

View File

@ -1063,9 +1063,7 @@ static struct {
{ ID_tcpInSegs, tcpsoff(in_segs) }, { ID_tcpInSegs, tcpsoff(in_segs) },
{ ID_tcpOutSegs, tcpsoff(out_segs) }, { ID_tcpOutSegs, tcpsoff(out_segs) },
{ ID_tcpRetransSegs, tcpsoff(retrans_segs) }, { ID_tcpRetransSegs, tcpsoff(retrans_segs) },
#if 0
{ ID_tcpInErrs, tcpsoff(in_errs) }, { ID_tcpInErrs, tcpsoff(in_errs) },
#endif
{ ID_tcpOutRsts, tcpsoff(out_rsts) } { ID_tcpOutRsts, tcpsoff(out_rsts) }
}; };

View File

@ -2160,7 +2160,7 @@ sigar_tcp_get(sigar_t *sigar,
tcp->in_segs = sigar_strtoull(ptr); tcp->in_segs = sigar_strtoull(ptr);
tcp->out_segs = sigar_strtoull(ptr); tcp->out_segs = sigar_strtoull(ptr);
tcp->retrans_segs = sigar_strtoull(ptr); tcp->retrans_segs = sigar_strtoull(ptr);
(void)sigar_strtoull(ptr); /* InErrs */ tcp->in_errs = sigar_strtoull(ptr);
tcp->out_rsts = sigar_strtoull(ptr); tcp->out_rsts = sigar_strtoull(ptr);
} }

View File

@ -2411,6 +2411,7 @@ sigar_tcp_get(sigar_t *sigar,
tcp->in_segs = mib->tcpInSegs; tcp->in_segs = mib->tcpInSegs;
tcp->out_segs = mib->tcpOutSegs; tcp->out_segs = mib->tcpOutSegs;
tcp->retrans_segs = mib->tcpRetransSegs; tcp->retrans_segs = mib->tcpRetransSegs;
tcp->in_errs = SIGAR_FIELD_NOTIMPL; /* XXX mib2_ip_t.tcpInErrs */
tcp->out_rsts = mib->tcpOutRsts; tcp->out_rsts = mib->tcpOutRsts;
return SIGAR_OK; return SIGAR_OK;
} }

View File

@ -2812,6 +2812,7 @@ sigar_tcp_get(sigar_t *sigar,
tcp->in_segs = mib.dwInSegs; tcp->in_segs = mib.dwInSegs;
tcp->out_segs = mib.dwOutSegs; tcp->out_segs = mib.dwOutSegs;
tcp->retrans_segs = mib.dwRetransSegs; tcp->retrans_segs = mib.dwRetransSegs;
tcp->in_errs = mib.dwInErrs;
tcp->out_rsts = mib.dwOutRsts; tcp->out_rsts = mib.dwOutRsts;
return SIGAR_OK; return SIGAR_OK;