Add netdev_is_open(), which checks to see if a given netdev is
currently open. It will be used to assist in cleaning up old ports
that are no longer in use.
}
}
+/* Returns true if a network device named 'name' is currently opened,
+ * otherwise false. */
+bool
+netdev_is_open(const char *name)
+{
+ return !!shash_find_data(&netdev_dev_shash, name);
+}
+
/* Clears 'svec' and enumerates the names of all known network devices. */
int
netdev_enumerate(struct svec *svec)
void netdev_close(struct netdev *);
bool netdev_exists(const char *name);
+bool netdev_is_open(const char *name);
int netdev_enumerate(struct svec *);