diff options
| author | Ben Pfaff <blp@nicira.com> | 2011-01-23 20:01:30 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2011-01-27 21:08:37 -0800 |
| commit | c283069c71adc49c182a1ac569a05e2dca949eda (patch) | |
| tree | 5ce28e813049fdb4eedeaefd1dbee931115b7fa9 /include/openvswitch | |
| parent | 4c738a8da5c73229ce0d4ab6f88d081886291f03 (diff) | |
| download | openvswitch-c283069c71adc49c182a1ac569a05e2dca949eda.tar.gz | |
datapath: Change vport type from string to integer enumeration.
I plan to make the vport type part of the standard header stuck on each
Netlink message related to a vport. As such, it is more convenient to use
an integer than a string. In addition, by being fundamentally different
from strings, using an integer may reduce the confusion we've had in the
past over the differences in userspace and kernel names for network device
and vport types.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'include/openvswitch')
| -rw-r--r-- | include/openvswitch/datapath-protocol.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/openvswitch/datapath-protocol.h b/include/openvswitch/datapath-protocol.h index 25f8e1324..1d68445eb 100644 --- a/include/openvswitch/datapath-protocol.h +++ b/include/openvswitch/datapath-protocol.h @@ -176,17 +176,28 @@ struct odp_packet { uint32_t len; }; -#define VPORT_TYPE_SIZE 16 #define VPORT_CONFIG_SIZE 32 struct odp_port { char devname[16]; /* IFNAMSIZ */ - char type[VPORT_TYPE_SIZE]; + uint32_t type; /* One of ODP_VPORT_TYPE_*. */ uint16_t port; uint16_t dp_idx; uint32_t reserved2; __aligned_u64 config[VPORT_CONFIG_SIZE / 8]; /* type-specific */ }; +enum odp_vport_type { + ODP_VPORT_TYPE_UNSPEC, + ODP_VPORT_TYPE_NETDEV, /* network device */ + ODP_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ + ODP_VPORT_TYPE_PATCH, /* virtual tunnel connecting two vports */ + ODP_VPORT_TYPE_GRE, /* GRE tunnel */ + ODP_VPORT_TYPE_CAPWAP, /* CAPWAP tunnel */ + __ODP_VPORT_TYPE_MAX +}; + +#define ODP_VPORT_TYPE_MAX (__ODP_VPORT_TYPE_MAX - 1) + /** * struct odp_vport_dump - ODP_VPORT_DUMP argument. * @port: Points to port structure to fill in. |
