floodlight/loxigen — pull request #243 by rlane (2014-04-07 21:47:58+00:00)
Title: loci: add clean API to get OXM from a set-field action

Reviewer: @kenchiang

Right now users of loci need to dig into the wire buffer and internal loci
functions to parse the OXM in a set-field action. This is because loci doesn't
have good support for subtyped fields (as opposed to list elements).

This commit doesn't add generic support for subtyped fields, but it does add a
reasonable API over the special case code.

Before:
```
of_oxm_t oxm;
of_oxm_header_init(&oxm.header, act.header.version, 0, 1);
oxm.header.wbuf = act.header.wbuf;
oxm.header.obj_offset = act.header.obj_offset + 4; /* skip action header */
oxm.header.parent = &act.header;
of_object_wire_init(&oxm.header, OF_OXM, 0);
if (oxm.header.length == 0) {
LOG_ERROR("failed to parse set-field action");
return INDIGO_ERROR_COMPAT;
}
```

After:
```
of_oxm_t oxm;
of_action_set_field_field_bind(&act.set_field, &oxm.header);
```