/*
- * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if (!p) {
VLOG_DBG_RL(&rl, "nx_match length %u, rounded up to a "
"multiple of 8, is longer than space in message (max "
- "length %zu)", match_len, b->size);
+ "length %"PRIuSIZE")", match_len, b->size);
return OFPERR_OFPBMC_BAD_LEN;
}
}
if (!p) {
VLOG_DBG_RL(&rl, "oxm length %u, rounded up to a "
"multiple of 8, is longer than space in message (max "
- "length %zu)", match_len, b->size);
+ "length %"PRIuSIZE")", match_len, b->size);
return OFPERR_OFPBMC_BAD_LEN;
}
int match_len;
int i;
- BUILD_ASSERT_DECL(FLOW_WC_SEQ == 23);
+ BUILD_ASSERT_DECL(FLOW_WC_SEQ == 24);
/* Metadata. */
if (match->wc.masks.in_port.ofp_port) {
/* MPLS. */
if (eth_type_mpls(flow->dl_type)) {
- if (match->wc.masks.mpls_lse & htonl(MPLS_TC_MASK)) {
- nxm_put_8(b, OXM_OF_MPLS_TC, mpls_lse_to_tc(flow->mpls_lse));
+ if (match->wc.masks.mpls_lse[0] & htonl(MPLS_TC_MASK)) {
+ nxm_put_8(b, OXM_OF_MPLS_TC, mpls_lse_to_tc(flow->mpls_lse[0]));
}
- if (match->wc.masks.mpls_lse & htonl(MPLS_BOS_MASK)) {
- nxm_put_8(b, OXM_OF_MPLS_BOS, mpls_lse_to_bos(flow->mpls_lse));
+ if (match->wc.masks.mpls_lse[0] & htonl(MPLS_BOS_MASK)) {
+ nxm_put_8(b, OXM_OF_MPLS_BOS, mpls_lse_to_bos(flow->mpls_lse[0]));
}
- if (match->wc.masks.mpls_lse & htonl(MPLS_LABEL_MASK)) {
+ if (match->wc.masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) {
nxm_put_32(b, OXM_OF_MPLS_LABEL,
- htonl(mpls_lse_to_label(flow->mpls_lse)));
+ htonl(mpls_lse_to_label(flow->mpls_lse[0])));
}
}
{
int match_len = nx_put_raw(b, false, match, cookie, cookie_mask);
- ofpbuf_put_zeros(b, ROUND_UP(match_len, 8) - match_len);
+ ofpbuf_put_zeros(b, PAD_SIZE(match_len, 8));
return match_len;
}
ofpbuf_put_uninit(b, sizeof *omh);
match_len = nx_put_raw(b, true, match, cookie, cookie_mask) + sizeof *omh;
- ofpbuf_put_zeros(b, ROUND_UP(match_len, 8) - match_len);
+ ofpbuf_put_zeros(b, PAD_SIZE(match_len, 8));
omh = ofpbuf_at(b, start_len, sizeof *omh);
omh->type = htons(OFPMT_OXM);
nx_match_from_string(const char *s, struct ofpbuf *b)
{
int match_len = nx_match_from_string_raw(s, b);
- ofpbuf_put_zeros(b, ROUND_UP(match_len, 8) - match_len);
+ ofpbuf_put_zeros(b, PAD_SIZE(match_len, 8));
return match_len;
}
ofpbuf_put_uninit(b, sizeof *omh);
match_len = nx_match_from_string_raw(s, b) + sizeof *omh;
- ofpbuf_put_zeros(b, ROUND_UP(match_len, 8) - match_len);
+ ofpbuf_put_zeros(b, PAD_SIZE(match_len, 8));
omh = ofpbuf_at(b, start_len, sizeof *omh);
omh->type = htons(OFPMT_OXM);