X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fdpif.c;h=9577e4faa7719decc75811cf5350f5837f0f2c90;hb=0aeaabc8dbccef7593dc19e891a3f5bbef1991cd;hp=0093f6142479e8d58b97e4977282af05bcaba30f;hpb=78a2d59c1c7fd057e1ca888c92f2f86efcf8b53a;p=sliver-openvswitch.git diff --git a/lib/dpif.c b/lib/dpif.c index 0093f6142..9577e4faa 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -417,6 +417,23 @@ dpif_get_dp_stats(const struct dpif *dpif, struct dpif_dp_stats *stats) return error; } +const char * +dpif_port_open_type(const char *datapath_type, const char *port_type) +{ + struct registered_dpif_class *registered_class; + + datapath_type = dpif_normalize_type(datapath_type); + + registered_class = shash_find_data(&dpif_classes, datapath_type); + if (!registered_class + || !registered_class->dpif_class->port_open_type) { + return port_type; + } + + return registered_class->dpif_class->port_open_type( + registered_class->dpif_class, port_type); +} + /* Attempts to add 'netdev' as a port on 'dpif'. If 'port_nop' is * non-null and its value is not UINT32_MAX, then attempts to use the * value as the port number.