aboutsummaryrefslogtreecommitdiff
path: root/lib/mac-learning.h
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2013-06-19 16:58:44 -0700
committerBen Pfaff <blp@nicira.com>2013-06-20 10:42:37 -0700
commit4e022ec09e14ac89add74c1b4b8e3ff3873edbf0 (patch)
treea6817234d1d992d2a7970865c1464dfaaf247c7f /lib/mac-learning.h
parente6cc0babc25de1800aeffad66d2804e64e5bd602 (diff)
Create specific types for ofp and odp port
Until now, datapath ports and openflow ports were both represented by unsigned integers of various sizes. With implicit conversions, etc., it is easy to mix them up and use one where the other is expected. This commit creates two typedefs, ofp_port_t and odp_port_t. Both of these two types are marked by "__attribute__((bitwise))" so that sparse can be used to detect any misuse. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/mac-learning.h')
-rw-r--r--lib/mac-learning.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mac-learning.h b/lib/mac-learning.h
index 1cbacfe0..9feca005 100644
--- a/lib/mac-learning.h
+++ b/lib/mac-learning.h
@@ -49,7 +49,7 @@ struct mac_entry {
/* Learned port. */
union {
void *p;
- uint16_t ofp_port;
+ ofp_port_t ofp_port;
} port;
};