{
switch (mf->id) {
case MFF_TUN_ID:
- return !wc->masks.tun_id;
+ return !wc->masks.tunnel.tun_id;
case MFF_METADATA:
return !wc->masks.metadata;
case MFF_IN_PORT:
{
switch (mf->id) {
case MFF_TUN_ID:
- mask->be64 = wc->masks.tun_id;
+ mask->be64 = wc->masks.tunnel.tun_id;
break;
case MFF_METADATA:
mask->be64 = wc->masks.metadata;
{
switch (mf->id) {
case MFF_TUN_ID:
- value->be64 = flow->tun_id;
+ value->be64 = flow->tunnel.tun_id;
break;
case MFF_METADATA:
value->be64 = flow->metadata;
{
switch (mf->id) {
case MFF_TUN_ID:
- flow->tun_id = value->be64;
+ flow->tunnel.tun_id = value->be64;
break;
case MFF_METADATA:
flow->metadata = value->be64;
}
}
\f
+/* Makes subfield 'sf' within 'flow' exactly match the 'sf->n_bits'
+ * least-significant bits in 'x'.
+ */
+void
+mf_write_subfield_flow(const struct mf_subfield *sf,
+ const union mf_subvalue *x, struct flow *flow)
+{
+ const struct mf_field *field = sf->field;
+ union mf_value value;
+
+ mf_get_value(field, flow, &value);
+ bitwise_copy(x, sizeof *x, 0, &value, field->n_bytes,
+ sf->ofs, sf->n_bits);
+ mf_set_flow_value(field, &value, flow);
+}
+
/* Makes subfield 'sf' within 'match' exactly match the 'sf->n_bits'
* least-significant bits in 'x'.
*/
}
return s;
}
+
+void
+mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(subvalue->u8); i++) {
+ if (subvalue->u8[i]) {
+ ds_put_format(s, "0x%"PRIx8, subvalue->u8[i]);
+ for (i++; i < ARRAY_SIZE(subvalue->u8); i++) {
+ ds_put_format(s, "%02"PRIx8, subvalue->u8[i]);
+ }
+ return;
+ }
+ }
+ ds_put_char(s, '0');
+}