#include <config.h>
#include <arpa/inet.h>
-#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
size_t bytes = (uint8_t *) end - (uint8_t *) first;
size_t n = bytes / NL_A_U32_SIZE;
- assert(bytes % NL_A_U32_SIZE == 0);
+ ovs_assert(bytes % NL_A_U32_SIZE == 0);
qsort(first, n, NL_A_U32_SIZE, compare_output_actions);
}
hmap_init(&actions_per_flow);
NL_ATTR_FOR_EACH (a, left, odp_actions.data, odp_actions.size) {
- if (nl_attr_type(a) == OVS_ACTION_ATTR_POP_VLAN) {
+ const struct ovs_action_push_vlan *push;
+ switch(nl_attr_type(a)) {
+ case OVS_ACTION_ATTR_POP_VLAN:
flow.vlan_tci = htons(0);
continue;
- }
-
- if (nl_attr_type(a) == OVS_ACTION_ATTR_PUSH_VLAN) {
- const struct ovs_action_push_vlan *push;
+ case OVS_ACTION_ATTR_PUSH_VLAN:
push = nl_attr_get_unspec(a, sizeof *push);
flow.vlan_tci = push->vlan_tci;
continue;
HMAP_FOR_EACH (af, hmap_node, &actions_per_flow) {
afs[i++] = af;
}
- assert(i == n_afs);
+ ovs_assert(i == n_afs);
qsort(afs, n_afs, sizeof *afs, compare_actions_for_flow);
printf("no vlan: ");
}
+ if (af->flow.mpls_depth) {
+ printf("mpls(label=%"PRIu32",tc=%d,ttl=%d): ",
+ mpls_lse_to_label(af->flow.mpls_lse),
+ mpls_lse_to_tc(af->flow.mpls_lse),
+ mpls_lse_to_ttl(af->flow.mpls_lse));
+ } else {
+ printf("no mpls: ");
+ }
+
ds_clear(&s);
format_odp_actions(&s, af->actions.data, af->actions.size);
puts(ds_cstr(&s));