#include <netinet/in.h>
#include "dynamic-string.h"
#include "nx-match.h"
+#include "ofp-errors.h"
#include "ofp-util.h"
#include "openflow/nicira-ext.h"
#include "packets.h"
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
\f
/* multipath_check(). */
-int
+enum ofperr
multipath_check(const struct nx_action_multipath *mp, const struct flow *flow)
{
uint32_t n_links = ntohs(mp->max_link) + 1;
size_t min_n_bits = log_2_floor(n_links) + 1;
int ofs = nxm_decode_ofs(mp->ofs_nbits);
int n_bits = nxm_decode_n_bits(mp->ofs_nbits);
- int error;
+ enum ofperr error;
error = nxm_dst_check(mp->dst, ofs, n_bits, flow);
if (error) {
return 0;
}
- return ofp_mkerr(OFPET_BAD_ACTION, OFPBAC_BAD_ARGUMENT);
+ return OFPERR_OFPBAC_BAD_ARGUMENT;
}
\f
/* multipath_execute(). */