Merge branch 'mainstream'
[sliver-openvswitch.git] / lib / netdev.c
index 1921ac0..ef1a6b9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -85,6 +85,8 @@ netdev_initialize(void)
         netdev_register_provider(&netdev_tap_class);
         netdev_register_provider(&netdev_bsd_class);
 #endif
+       netdev_register_provider(&netdev_tunnel_class);
+       netdev_register_provider(&netdev_pltap_class);
     }
 }
 
@@ -290,6 +292,18 @@ netdev_get_config(const struct netdev *netdev, struct smap *args)
     return error;
 }
 
+const struct netdev_tunnel_config *
+netdev_get_tunnel_config(const struct netdev *netdev)
+{
+    struct netdev_dev *netdev_dev = netdev_get_dev(netdev);
+
+    if (netdev_dev->netdev_class->get_tunnel_config) {
+        return netdev_dev->netdev_class->get_tunnel_config(netdev_dev);
+    } else {
+        return NULL;
+    }
+}
+
 /* Closes and destroys 'netdev'. */
 void
 netdev_close(struct netdev *netdev)
@@ -771,12 +785,12 @@ netdev_get_next_hop(const struct netdev *netdev,
  * information may be used to populate the status column of the Interface table
  * as defined in ovs-vswitchd.conf.db(5). */
 int
-netdev_get_drv_info(const struct netdev *netdev, struct smap *smap)
+netdev_get_status(const struct netdev *netdev, struct smap *smap)
 {
     struct netdev_dev *dev = netdev_get_dev(netdev);
 
-    return (dev->netdev_class->get_drv_info
-            ? dev->netdev_class->get_drv_info(netdev, smap)
+    return (dev->netdev_class->get_status
+            ? dev->netdev_class->get_status(netdev, smap)
             : EOPNOTSUPP);
 }