#include <config.h>
#include "netdev.h"
-#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <netinet/in.h>
inited = true;
fatal_signal_add_hook(close_all_netdevs, NULL, NULL, true);
+ netdev_vport_patch_register();
#ifdef LINUX_DATAPATH
netdev_register_provider(&netdev_linux_class);
netdev_register_provider(&netdev_internal_class);
netdev_register_provider(&netdev_tap_class);
- netdev_vport_register();
+ netdev_vport_tunnel_register();
#endif
#ifdef __FreeBSD__
netdev_register_provider(&netdev_tap_class);
if (error) {
return error;
}
- assert(netdev_dev->netdev_class == class);
+ ovs_assert(netdev_dev->netdev_class == class);
}
if (netdev) {
struct netdev_dev *netdev_dev = netdev_get_dev(netdev);
- assert(netdev_dev->ref_cnt);
+ ovs_assert(netdev_dev->ref_cnt);
netdev_dev->ref_cnt--;
netdev_uninit(netdev, true);
int (*recv)(struct netdev *, void *, size_t);
int retval;
- assert(buffer->size == 0);
- assert(ofpbuf_tailroom(buffer) >= ETH_TOTAL_MIN);
+ ovs_assert(buffer->size == 0);
+ ovs_assert(ofpbuf_tailroom(buffer) >= ETH_TOTAL_MIN);
recv = netdev_get_dev(netdev)->netdev_class->recv;
retval = (recv
netdev_dev_init(struct netdev_dev *netdev_dev, const char *name,
const struct netdev_class *netdev_class)
{
- assert(!shash_find(&netdev_dev_shash, name));
+ ovs_assert(!shash_find(&netdev_dev_shash, name));
memset(netdev_dev, 0, sizeof *netdev_dev);
netdev_dev->netdev_class = netdev_class;
{
char *name = netdev_dev->name;
- assert(!netdev_dev->ref_cnt);
+ ovs_assert(!netdev_dev->ref_cnt);
shash_delete(&netdev_dev_shash, netdev_dev->node);
return netdev_get_dev(netdev)->netdev_class->type;
}
+
+const char *
+netdev_get_type_from_name(const char *name)
+{
+ const struct netdev_dev *dev = netdev_dev_from_name(name);
+ return dev ? netdev_dev_get_type(dev) : NULL;
+}
+
struct netdev_dev *
netdev_get_dev(const struct netdev *netdev)
{