-
-void
-format_odp_flow_stats(struct ds *ds, const struct odp_flow_stats *s)
-{
- ds_put_format(ds, "packets:%llu, bytes:%llu, used:",
- (unsigned long long int) s->n_packets,
- (unsigned long long int) s->n_bytes);
- if (s->used_sec) {
- long long int used = s->used_sec * 1000 + s->used_nsec / 1000000;
- ds_put_format(ds, "%.3fs", (time_msec() - used) / 1000.0);
- } else {
- ds_put_format(ds, "never");
- }
-}
-
-void
-format_odp_flow(struct ds *ds, const struct odp_flow *f)
-{
- odp_flow_key_format(f->key, f->key_len, ds);
- ds_put_cstr(ds, ", ");
- format_odp_flow_stats(ds, &f->stats);
- ds_put_cstr(ds, ", actions:");
- format_odp_actions(ds, f->actions, f->actions_len);
-}