return xasprintf("%s: network prefix bits not between 1 and "
"32", s);
} else if (prefix == 32) {
- *mask = htonl(UINT32_MAX);
+ *mask = OVS_BE32_MAX;
} else {
*mask = htonl(((1u << prefix) - 1) << (32 - prefix));
}
} else if (sscanf(s, IP_SCAN_FMT, IP_SCAN_ARGS(ip)) == IP_SCAN_COUNT) {
- *mask = htonl(UINT32_MAX);
+ *mask = OVS_BE32_MAX;
} else {
return xasprintf("%s: invalid IP address", s);
}
if (ofputil_port_from_string(s, &port)) {
*valuep = htons(ofp_to_u16(port));
- *maskp = htons(UINT16_MAX);
+ *maskp = OVS_BE16_MAX;
return NULL;
}
return xasprintf("%s: port value out of range for %s", s, mf->name);
ovs_assert(mf->n_bytes == sizeof(ovs_be32));
if (ofputil_port_from_string(s, &port)) {
*valuep = ofputil_port_to_ofp11(port);
- *maskp = htonl(UINT32_MAX);
+ *maskp = OVS_BE32_MAX;
return NULL;
}
return xasprintf("%s: port value out of range for %s", s, mf->name);
mf_from_tun_flags_string(const char *s, ovs_be16 *valuep, ovs_be16 *maskp)
{
if (!parse_flow_tun_flags(s, flow_tun_flag_to_string, valuep)) {
- *maskp = htons(UINT16_MAX);
+ *maskp = OVS_BE16_MAX;
return NULL;
}
break;
case MFS_IPV4:
- ip_format_masked(value->be32, mask ? mask->be32 : htonl(UINT32_MAX),
- s);
+ ip_format_masked(value->be32, mask ? mask->be32 : OVS_BE32_MAX, s);
break;
case MFS_IPV6: