ofp-actions: Add action bitmap abstraction.

Until now, sets of actions have been abstracted separately outside
ofp-actions, as enum ofputil_action_bitmap.  Drawing sets of actions into
ofp-actions, as done in this commit, makes for a better overall
abstraction of actions, with better consistency.

A big part of this commit is shifting from using ofp12_table_stats as if
it were an abstraction for OpenFlow table stats, toward using a new
struct ofputil_table_stats, which is what we generally do with other
OpenFlow structures and fits better with the rest of the code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-actions: Add instructions bitmaps and fix related bug.

This will allow, later, to centralize all of the knowledge of instruction
encoding inside ofp-actions.

OFPIT11_ALL and OFPIT13_ALL are no longer used, so this commit removes
them.  Their definitions were wrong (they did not shift each bit into
position correctly), so this commit is also a small bug fix.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Correctly report table miss configuration in table stats.

OFPTC11_TABLE_MISS_MASK isn't a valid value at all, let alone always the
value in use.  We should report the value actually in use, as this commit
does.

There is a remaining problem: the default table configuration is
OFPROTO_TABLE_MISS_DEFAULT, which doesn't correspond to any particular
OFPTC11_* value or, more precisely, corresponds to a different OFPTC11_*
value based on the OpenFlow version.  The following commit fixes that
problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Abstract table miss configuration and fix related bugs.

The ofproto implementation has had an abstraction layer on top of
OFPTC11_TABLE_MISS for a while.  This commit pushes that abstraction layer
farther down, into ofp-util.  This will be more useful in an upcoming
commit.

During the conversion I realized that the previous implementation was
not entirely correct.  In particular, the OpenFlow 1.3+ "table mod" was
still being treated as if it had table miss configuration bits, even
though it doesn't.  This commit fixes that issue and updates the tests.

OpenFlow 1.4 adds some more OFPTC_* flags that this new abstraction doesn't
yet support, but OVS didn't support those flags any better before this
commit, so abstracting those is left as future work.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Fix decoding multiple tables in ofputil_decode_table_features().

Table features replies can be packed back-to-back within a single
multipart reply.  The code here didn't properly parse properties when this
occurred.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-util: Fix table features decoding of action and instruction fields.

Parsing of actions was wrong because OF1.3 says that non-experimenter
actions are 4 bytes and don't include padding.  This fixes the problem.

Parsing of instructions seems wrong too because OF1.3 says that
non-experimenter instructions are 4 bytes (though it is not explicit about
padding as it is for actions).  This fixes the problem there too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto: Implement OpenFlow 1.3+ table features request.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Un-document "apply_actions" because it does not exist.

"apply_actions" is assumed, any other instruction has to be specified
explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-parse: Make string conversion functions available outside this file.

An upcoming commit will use them from ofp-actions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
work