#include "compiler.h"
#include "dynamic-string.h"
#include "flow.h"
+#include "ofp-util.h"
#include "ofpbuf.h"
#include "openflow/openflow.h"
#include "openflow/nicira-ext.h"
ds_put_cstr(string, name);
}
+static void
+print_note(struct ds *string, const struct nx_action_note *nan)
+{
+ size_t len;
+ size_t i;
+
+ ds_put_cstr(string, "note:");
+ len = ntohs(nan->len) - offsetof(struct nx_action_note, note);
+ for (i = 0; i < len; i++) {
+ if (i) {
+ ds_put_char(string, '.');
+ }
+ ds_put_format(string, "%02"PRIx8, nan->note[i]);
+ }
+}
+
static void
ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
{
ds_put_cstr(string, "pop_queue");
break;
+ case NXAST_NOTE:
+ print_note(string, (const struct nx_action_note *) nah);
+ break;
+
default:
ds_put_format(string, "***unknown Nicira action:%d***",
ntohs(nah->subtype));
return -1;
}
- if ((len % 8) != 0) {
+ if ((len % OFP_ACTION_ALIGN) != 0) {
ds_put_format(string,
- "***action %"PRIu16" length not a multiple of 8***\n",
- type);
+ "***action %"PRIu16" length not a multiple of %d***\n",
+ type, OFP_ACTION_ALIGN);
return -1;
}