-moreutils (0.20) UNRELEASED; urgency=low
+moreutils (0.20) unstable; urgency=low
* Typo fixes from Ralf Wildenhues.
+ * ifdata: Add -bips and -bops options contributed by André Appel,
+ to print the number of bytes of incoming/outgoing traffic per second.
- -- Joey Hess <joeyh@debian.org> Sun, 26 Nov 2006 14:48:57 -0500
+ -- Joey Hess <joeyh@debian.org> Sat, 23 Dec 2006 15:55:45 -0500
moreutils (0.19) unstable; urgency=low
DO_SOUTMULTICAST,
DO_PNETWORK,
DO_PHWADDRESS,
+ DO_BIPS,
+ DO_BOPS
};
struct if_stat {
{ "-sox", DO_SOUTCOLLS, 1, "Print # of out collisions" },
{ "-soc", DO_SOUTCARRIER, 1, "Print # of out carrier loss" },
{ "-som", DO_SOUTMULTICAST, 1, "Print # of out multicast" },
+ { "-bips",DO_BIPS, 1, "Print # of incoming bytes per second" },
+ { "-bops",DO_BOPS, 1, "Print # of outgoing bytes per second" },
};
void usage(const char *name) {
print_quad(sadr);
}
-struct if_stat *ifstats;
+struct if_stat *ifstats, *ifstats2 = NULL;
void please_do(int ndo, int *todo, const char *ifname) {
int i;
case DO_SOUTMULTICAST:
printf("%llu",ifstats->out_multicast);
break;
+ case DO_BIPS:
+ if (ifstats2 == NULL) {
+ sleep(1);
+ ifstats2 = get_stats(ifname);
+ }
+ printf("%llu", ifstats2->in_bytes-ifstats->in_bytes);
+ break;
+ case DO_BOPS:
+ if (ifstats2 == NULL) {
+ sleep(1);
+ ifstats2 = get_stats(ifname);
+ }
+ printf("%llu", ifstats2->out_bytes-ifstats->out_bytes);
+ break;
case DO_SOUTALL:
printf("%llu %llu %llu %llu %llu %llu %llu %llu",
ifstats->out_bytes, ifstats->out_packets,
packets.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><option>-bips</option></term>
+ <listitem>
+ <para>Prints the number of bytes of
+ incoming traffic measured in one second.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-bops</option></term>
+ <listitem>
+ <para>Prints the number of bytes of
+ outgoing traffic measured in one second.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>