summaryrefslogtreecommitdiff
path: root/ofproto/pktbuf.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 /ofproto/pktbuf.h
parente6cc0babc25de1800aeffad66d2804e64e5bd602 (diff)
downloadopenvswitch-4e022ec09e14ac89add74c1b4b8e3ff3873edbf0.tar.gz
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 'ofproto/pktbuf.h')
-rw-r--r--ofproto/pktbuf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ofproto/pktbuf.h b/ofproto/pktbuf.h
index ec99aead3..eb1b1fff3 100644
--- a/ofproto/pktbuf.h
+++ b/ofproto/pktbuf.h
@@ -30,10 +30,10 @@ int pktbuf_capacity(void);
struct pktbuf *pktbuf_create(void);
void pktbuf_destroy(struct pktbuf *);
uint32_t pktbuf_save(struct pktbuf *, const void *buffer, size_t buffer_size,
- uint16_t in_port);
+ ofp_port_t in_port);
uint32_t pktbuf_get_null(void);
enum ofperr pktbuf_retrieve(struct pktbuf *, uint32_t id,
- struct ofpbuf **bufferp, uint16_t *in_port);
+ struct ofpbuf **bufferp, ofp_port_t *in_port);
void pktbuf_discard(struct pktbuf *, uint32_t id);
unsigned int pktbuf_count_packets(const struct pktbuf *);