From 09ded0ad489630236210a02f2d315816e558d701 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 5 Oct 2011 09:59:51 -0700 Subject: [PATCH] datapath-protocol: Rename enums for consistency. Most of the enum tags in this file are lowercased versions of the uppercase enum prefixes (or slightly less abbreviated versions, e.g. "dp" becomes "datapath"). This commit fixes up the others for consistency. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- include/openvswitch/datapath-protocol.h | 10 +++++----- lib/dpif-linux.c | 2 +- lib/dpif-netdev.c | 2 +- lib/odp-util.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 4e9c32a4..b522edc9 100644 --- a/include/openvswitch/datapath-protocol.h +++ b/include/openvswitch/datapath-protocol.h @@ -99,20 +99,20 @@ enum ovs_datapath_attr { OVS_DP_ATTR_NAME, /* name of dp_ifindex netdev */ OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ - OVS_DP_ATTR_IPV4_FRAGS, /* 32-bit enum ovs_frag_handling */ + OVS_DP_ATTR_IPV4_FRAGS, /* 32-bit enum ovs_datapath_frag */ __OVS_DP_ATTR_MAX }; #define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1) /** - * enum ovs_frag_handling - policy for handling received IPv4 fragments. + * enum ovs_datapath_frag - policy for handling received IPv4 fragments. * @OVS_DP_FRAG_ZERO: Treat IP fragments as IP protocol 0 and transport ports * zero. * @OVS_DP_FRAG_DROP: Drop IP fragments. Do not pass them through the flow * table or up to userspace. */ -enum ovs_frag_handling { +enum ovs_datapath_frag { OVS_DP_FRAG_UNSPEC, OVS_DP_FRAG_ZERO, /* Treat IP fragments as transport port 0. */ OVS_DP_FRAG_DROP /* Drop IP fragments. */ @@ -277,7 +277,7 @@ struct ovs_flow_stats { uint64_t n_bytes; /* Number of matched bytes. */ }; -enum ovs_key_type { +enum ovs_key_attr { OVS_KEY_ATTR_UNSPEC, OVS_KEY_ATTR_TUN_ID, /* 64-bit tunnel ID */ OVS_KEY_ATTR_IN_PORT, /* 32-bit OVS dp port number */ @@ -431,7 +431,7 @@ enum ovs_userspace_attr { #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) /* Action types. */ -enum ovs_action_type { +enum ovs_action_attr { OVS_ACTION_ATTR_UNSPEC, OVS_ACTION_ATTR_OUTPUT, /* Output to switch port. */ OVS_ACTION_ATTR_USERSPACE, /* Nested OVS_USERSPACE_ATTR_*. */ diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 08ac4425..43c21614 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -79,7 +79,7 @@ struct dpif_linux_dp { const char *name; /* OVS_DP_ATTR_NAME. */ const uint32_t *upcall_pid; /* OVS_DP_UPCALL_PID. */ struct ovs_dp_stats stats; /* OVS_DP_ATTR_STATS. */ - enum ovs_frag_handling ipv4_frags; /* OVS_DP_ATTR_IPV4_FRAGS. */ + enum ovs_datapath_frag ipv4_frags; /* OVS_DP_ATTR_IPV4_FRAGS. */ }; static void dpif_linux_dp_init(struct dpif_linux_dp *); diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 1bb306ab..99673226 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1269,7 +1269,7 @@ dp_netdev_execute_actions(struct dp_netdev *dp, NL_ATTR_FOR_EACH_UNSAFE (a, left, actions, actions_len) { int type = nl_attr_type(a); - switch ((enum ovs_action_type) type) { + switch ((enum ovs_action_attr) type) { case OVS_ACTION_ATTR_OUTPUT: dp_netdev_output_port(dp, packet, nl_attr_get_u32(a)); break; diff --git a/lib/odp-util.c b/lib/odp-util.c index 08378a68..a4710991 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -55,7 +55,7 @@ odp_action_len(uint16_t type) return -1; } - switch ((enum ovs_action_type) type) { + switch ((enum ovs_action_attr) type) { case OVS_ACTION_ATTR_OUTPUT: return 4; case OVS_ACTION_ATTR_USERSPACE: return -2; case OVS_ACTION_ATTR_PUSH_VLAN: return 2; @@ -278,7 +278,7 @@ odp_flow_key_attr_len(uint16_t type) return -1; } - switch ((enum ovs_key_type) type) { + switch ((enum ovs_key_attr) type) { case OVS_KEY_ATTR_TUN_ID: return 8; case OVS_KEY_ATTR_IN_PORT: return 4; case OVS_KEY_ATTR_ETHERNET: return sizeof(struct ovs_key_ethernet); @@ -913,7 +913,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len, struct flow *flow) { const struct nlattr *nla; - enum ovs_key_type prev_type; + enum ovs_key_attr prev_type; size_t left; memset(flow, 0, sizeof *flow); -- 2.30.2