2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofp-util: Centralize decoding of OpenFlow actions.

This significantly simplifies code in ofp-print and ofproto-dpif and is
likely to simplify any new ofproto implementations whose support for
actions differs from ofproto-dpif.
This commit is contained in:
Ben Pfaff
2011-06-30 10:05:52 -07:00
parent b4b8c7812b
commit 38f2e36072
4 changed files with 427 additions and 531 deletions

View File

@@ -275,6 +275,38 @@ struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
/* Actions. */
enum ofputil_action_code {
/* OFPAT_* actions. */
OFPUTIL_OFPAT_OUTPUT,
OFPUTIL_OFPAT_SET_VLAN_VID,
OFPUTIL_OFPAT_SET_VLAN_PCP,
OFPUTIL_OFPAT_STRIP_VLAN,
OFPUTIL_OFPAT_SET_DL_SRC,
OFPUTIL_OFPAT_SET_DL_DST,
OFPUTIL_OFPAT_SET_NW_SRC,
OFPUTIL_OFPAT_SET_NW_DST,
OFPUTIL_OFPAT_SET_NW_TOS,
OFPUTIL_OFPAT_SET_TP_SRC,
OFPUTIL_OFPAT_SET_TP_DST,
OFPUTIL_OFPAT_ENQUEUE,
/* NXAST_* actions. */
OFPUTIL_NXAST_RESUBMIT,
OFPUTIL_NXAST_SET_TUNNEL,
OFPUTIL_NXAST_SET_QUEUE,
OFPUTIL_NXAST_POP_QUEUE,
OFPUTIL_NXAST_REG_MOVE,
OFPUTIL_NXAST_REG_LOAD,
OFPUTIL_NXAST_NOTE,
OFPUTIL_NXAST_SET_TUNNEL64,
OFPUTIL_NXAST_MULTIPATH,
OFPUTIL_NXAST_AUTOPATH
};
int ofputil_decode_action(const union ofp_action *);
enum ofputil_action_code ofputil_decode_action_unsafe(
const union ofp_action *);
#define OFP_ACTION_ALIGN 8 /* Alignment of ofp_actions. */
static inline union ofp_action *