+struct netdev_dev {
+ char *name; /* Name of network device. */
+ const struct netdev_class *netdev_class; /* Functions to control
+ this device. */
+ int ref_cnt; /* Times this devices was opened. */
+ struct shash_node *node; /* Pointer to element in global map. */
+ struct arg *args; /* Argument list from last config. */
+ int n_args; /* Number of arguments in 'args'. */
+};
+
+void netdev_dev_init(struct netdev_dev *, const char *name,
+ const struct netdev_class *);
+void netdev_dev_uninit(struct netdev_dev *, bool destroy);
+const char *netdev_dev_get_type(const struct netdev_dev *);
+const struct netdev_class *netdev_dev_get_class(const struct netdev_dev *);
+const char *netdev_dev_get_name(const struct netdev_dev *);
+struct netdev_dev *netdev_dev_from_name(const char *name);
+void netdev_dev_get_devices(const struct netdev_class *,
+ struct shash *device_list);
+
+static inline void netdev_dev_assert_class(const struct netdev_dev *netdev_dev,
+ const struct netdev_class *class_)
+{
+ assert(netdev_dev->netdev_class == class_);
+}
+
+/* A instance of an open network device.
+ *
+ * This structure should be treated as opaque by network device
+ * implementations. */