+/* Returns the value of the NXM field corresponding to 'header' at 'ofs_nbits'
+ * in 'flow'. */
+uint64_t
+nxm_read_field_bits(ovs_be32 header, ovs_be16 ofs_nbits,
+ const struct flow *flow)
+{
+ int n_bits = nxm_decode_n_bits(ofs_nbits);
+ int ofs = nxm_decode_ofs(ofs_nbits);
+ uint64_t mask, data;
+
+ mask = n_bits == 64 ? UINT64_MAX : (UINT64_C(1) << n_bits) - 1;
+ data = nxm_read_field(nxm_field_lookup(ntohl(header)), flow);
+ data = (data >> ofs) & mask;
+
+ return data;
+}
+