2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

Convert remaining network-byte-order "uint<N>_t"s into "ovs_be<N>"s.

I looked at almost every uint<N>_t in the tree to determine whether it was
really in network byte order, and converted the ones that were.

The only remaining ones, modulo my mistakes, are in openflow.h.  I'm not
sure whether we should convert those, because there might be some value
in remaining close to upstream for this header.
This commit is contained in:
Ben Pfaff
2011-03-29 14:42:20 -07:00
parent 118c46769f
commit dbba996be2
15 changed files with 75 additions and 71 deletions

View File

@@ -430,10 +430,10 @@ get_unix_name_len(socklen_t sun_len)
: 0);
}
uint32_t
guess_netmask(uint32_t ip)
ovs_be32
guess_netmask(ovs_be32 ip_)
{
ip = ntohl(ip);
uint32_t ip = ntohl(ip_);
return ((ip >> 31) == 0 ? htonl(0xff000000) /* Class A */
: (ip >> 30) == 2 ? htonl(0xffff0000) /* Class B */
: (ip >> 29) == 6 ? htonl(0xffffff00) /* Class C */