ds_put_cstr(string, name);
}
+
static void
print_note(struct ds *string, const struct nx_action_note *nan)
{
}
}
+static int
+nx_action_len(enum nx_action_subtype subtype)
+{
+ switch (subtype) {
+ case NXAST_SNAT__OBSOLETE: return -1;
+ case NXAST_RESUBMIT: return sizeof(struct nx_action_resubmit);
+ case NXAST_SET_TUNNEL: return sizeof(struct nx_action_set_tunnel);
+ case NXAST_DROP_SPOOFED_ARP:
+ return sizeof(struct nx_action_drop_spoofed_arp);
+ case NXAST_SET_QUEUE: return sizeof(struct nx_action_set_queue);
+ case NXAST_POP_QUEUE: return sizeof(struct nx_action_pop_queue);
+ case NXAST_REG_MOVE: return sizeof(struct nx_action_reg_move);
+ case NXAST_REG_LOAD: return sizeof(struct nx_action_reg_load);
+ case NXAST_NOTE: return -1;
+ case NXAST_SET_TUNNEL64: return sizeof(struct nx_action_set_tunnel64);
+ default: return -1;
+ }
+}
+
static void
ofp_print_nx_action(struct ds *string, const struct nx_action_header *nah)
{
uint16_t subtype = ntohs(nah->subtype);
+ int required_len = nx_action_len(subtype);
+ int len = ntohs(nah->len);
+
+ if (required_len != -1 && required_len != len) {
+ ds_put_format(string, "***Nicira action %"PRIu16" wrong length: %d***",
+ subtype, len);
+ return;
+ }
if (subtype <= TYPE_MAXIMUM(enum nx_action_subtype)) {
+ const struct nx_action_set_tunnel64 *nast64;
const struct nx_action_set_tunnel *nast;
const struct nx_action_set_queue *nasq;
const struct nx_action_resubmit *nar;
+ const struct nx_action_reg_move *move;
+ const struct nx_action_reg_load *load;
switch ((enum nx_action_subtype) subtype) {
case NXAST_RESUBMIT:
return;
case NXAST_REG_MOVE:
+ move = (const struct nx_action_reg_move *) nah;
+ nxm_format_reg_move(move, string);
+ return;
+
case NXAST_REG_LOAD:
- /* XXX */
+ load = (const struct nx_action_reg_load *) nah;
+ nxm_format_reg_load(load, string);
+ return;
+
+ case NXAST_SET_TUNNEL64:
+ nast64 = (struct nx_action_set_tunnel64 *) nah;
+ ds_put_format(string, "set_tunnel64:%#"PRIx64,
+ ntohll(nast64->tun_id));
return;
case NXAST_SNAT__OBSOLETE:
int match_len;
int error;
+ ds_put_char(string, '\n');
+
fs = ofpbuf_try_pull(&b, sizeof *fs);
if (!fs) {
ds_put_format(string, " ***%td leftover bytes at end***", b.size);
ds_put_char(string, ' ');
ofp_print_actions(string, (const struct ofp_action_header *) actions,
n_actions * sizeof *actions);
- ds_put_char(string, '\n');
}
}