if (machine_readable) {
print_value("", 2, " packets/sec", cf_info->packet_rate);
} else {
- size_string = format_size((gint64)cf_info->packet_rate, format_size_unit_none);
- printf ("%spackets/sec\n", size_string);
+ size_string = format_size((gint64)cf_info->packet_rate, format_size_unit_packets_s);
+ printf ("%s\n", size_string);
g_free(size_string);
}
}
case format_size_unit_none:
break;
case format_size_unit_bytes:
- g_string_append(human_str, is_small ? "bytes" : "B");
+ g_string_append(human_str, is_small ? " bytes" : "B");
break;
case format_size_unit_bits:
- g_string_append(human_str, is_small ? "bits" : "b");
+ g_string_append(human_str, is_small ? " bits" : "b");
break;
case format_size_unit_bits_s:
- g_string_append(human_str, is_small ? "bits/s" : "bps");
+ g_string_append(human_str, is_small ? " bits/s" : "bps");
break;
case format_size_unit_bytes_s:
- g_string_append(human_str, is_small ? "bytes/s" : "Bps");
+ g_string_append(human_str, is_small ? " bytes/s" : "Bps");
+ break;
+ case format_size_unit_packets:
+ g_string_append(human_str, is_small ? " packets" : "packets");
+ break;
+ case format_size_unit_packets_s:
+ g_string_append(human_str, is_small ? " packets/s" : "packets/s");
break;
default:
g_assert_not_reached();
int ws_xton(char ch);
typedef enum {
- format_size_unit_none = 0, /**< No unit will be appended. You must supply your own. */
- format_size_unit_bytes = 1, /**< "bytes" for un-prefixed sizes, "B" otherwise. */
- format_size_unit_bits = 2, /**< "bits" for un-prefixed sizes, "b" otherwise. */
- format_size_unit_bits_s = 3, /**< "bits/s" for un-prefixed sizes, "bps" otherwise. */
- format_size_unit_bytes_s = 4, /**< "bytes/s" for un-prefixed sizes, "Bps" otherwise. */
+ format_size_unit_none = 0, /**< No unit will be appended. You must supply your own. */
+ format_size_unit_bytes = 1, /**< "bytes" for un-prefixed sizes, "B" otherwise. */
+ format_size_unit_bits = 2, /**< "bits" for un-prefixed sizes, "b" otherwise. */
+ format_size_unit_bits_s = 3, /**< "bits/s" for un-prefixed sizes, "bps" otherwise. */
+ format_size_unit_bytes_s = 4, /**< "bytes/s" for un-prefixed sizes, "Bps" otherwise. */
+ format_size_unit_packets = 5, /**< "packets" */
+ format_size_unit_packets_s = 6, /**< "packets/s" */
format_size_prefix_si = 0 << 8, /**< SI (power of 1000) prefixes will be used. */
format_size_prefix_iec = 1 << 8 /**< IEC (power of 1024) prefixes will be used. */
/* XXX format_size_prefix_default_for_this_particular_os ? */