X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fopenvswitch%2Ftypes.h;h=d07c1e8725595dab134050093a2a3ca6dae6ee6d;hb=4e022ec09e14;hp=72caa5c385dd10272a48615e0db9dc8c80237b7a;hpb=e6cc0babc25de1800aeffad66d2804e64e5bd602;p=sliver-openvswitch.git diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h index 72caa5c38..d07c1e872 100644 --- a/include/openvswitch/types.h +++ b/include/openvswitch/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011 Nicira, Inc. + * Copyright (c) 2010, 2011, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,4 +60,16 @@ typedef struct { ovs_be32 hi, lo; } ovs_32aligned_be64; +/* ofp_port_t represents the port number of a OpenFlow switch. + * odp_port_t represents the port number on the datapath. + * ofp11_port_t represents the OpenFlow-1.1 port number. */ +typedef uint16_t OVS_BITWISE ofp_port_t; +typedef uint32_t OVS_BITWISE odp_port_t; +typedef uint32_t OVS_BITWISE ofp11_port_t; + +/* Macro functions that cast int types to ofp/odp/ofp11 types. */ +#define OFP_PORT_C(X) ((OVS_FORCE ofp_port_t) (X)) +#define ODP_PORT_C(X) ((OVS_FORCE odp_port_t) (X)) +#define OFP11_PORT_C(X) ((OVS_FORCE ofp11_port_t) (X)) + #endif /* openvswitch/types.h */