+int
+netdev_open_default(const char *name, struct netdev **netdevp)
+{
+ struct netdev_options options;
+
+ memset(&options, 0, sizeof options);
+
+ options.name = name;
+ options.ethertype = NETDEV_ETH_TYPE_NONE;
+ options.may_create = true;
+ options.may_open = true;
+
+ return netdev_open(&options, netdevp);
+}
+
+/* Reconfigures the device 'netdev' with 'args'. 'args' may be empty
+ * or NULL if none are needed. */
+int
+netdev_reconfigure(struct netdev *netdev, const struct shash *args)
+{
+ struct shash empty_args = SHASH_INITIALIZER(&empty_args);
+ struct netdev_dev *netdev_dev = netdev_get_dev(netdev);
+
+ if (!args) {
+ args = &empty_args;
+ }
+
+ if (netdev_dev->netdev_class->reconfigure) {
+ if (!compare_device_args(netdev_dev, args)) {
+ update_device_args(netdev_dev, args);
+ return netdev_dev->netdev_class->reconfigure(netdev_dev, args);
+ }
+ } else if (!shash_is_empty(args)) {
+ VLOG_WARN("%s: arguments provided to device that does not have a "
+ "reconfigure function", netdev_get_name(netdev));
+ }
+
+ return 0;
+}
+