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

packets: Change IP_ARGS interface to take an ovs_be32 instead of a pointer.

An ovs_be32 is a more obvious way to represent an IP address than a
pointer to one.  It is also more type-safe, especially since "sparse" is
able to check that the argument is in network byte order.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ben Pfaff
2012-12-12 15:26:21 -08:00
parent 401d5a6d16
commit ed36537ebf
13 changed files with 30 additions and 34 deletions

View File

@@ -739,8 +739,8 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds)
ds_put_format(ds, "(tun_id=0x%"PRIx64",src="IP_FMT",dst="IP_FMT","
"tos=0x%"PRIx8",ttl=%"PRIu8",flags(",
ntohll(ipv4_tun_key->tun_id),
IP_ARGS(&ipv4_tun_key->ipv4_src),
IP_ARGS(&ipv4_tun_key->ipv4_dst),
IP_ARGS(ipv4_tun_key->ipv4_src),
IP_ARGS(ipv4_tun_key->ipv4_dst),
ipv4_tun_key->ipv4_tos, ipv4_tun_key->ipv4_ttl);
format_flags(ds, odp_tun_flag_to_string,
@@ -774,8 +774,8 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds)
ipv4_key = nl_attr_get(a);
ds_put_format(ds, "(src="IP_FMT",dst="IP_FMT",proto=%"PRIu8
",tos=%#"PRIx8",ttl=%"PRIu8",frag=%s)",
IP_ARGS(&ipv4_key->ipv4_src),
IP_ARGS(&ipv4_key->ipv4_dst),
IP_ARGS(ipv4_key->ipv4_src),
IP_ARGS(ipv4_key->ipv4_dst),
ipv4_key->ipv4_proto, ipv4_key->ipv4_tos,
ipv4_key->ipv4_ttl,
ovs_frag_type_to_string(ipv4_key->ipv4_frag));
@@ -826,7 +826,7 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds)
arp_key = nl_attr_get(a);
ds_put_format(ds, "(sip="IP_FMT",tip="IP_FMT",op=%"PRIu16","
"sha="ETH_ADDR_FMT",tha="ETH_ADDR_FMT")",
IP_ARGS(&arp_key->arp_sip), IP_ARGS(&arp_key->arp_tip),
IP_ARGS(arp_key->arp_sip), IP_ARGS(arp_key->arp_tip),
ntohs(arp_key->arp_op), ETH_ADDR_ARGS(arp_key->arp_sha),
ETH_ADDR_ARGS(arp_key->arp_tha));
break;