vport-netdev.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2007-2011 Nicira, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of version 2 of the GNU General Public
  6. * License as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301, USA
  17. */
  18. #ifndef VPORT_NETDEV_H
  19. #define VPORT_NETDEV_H 1
  20. #include <linux/netdevice.h>
  21. #include <linux/rcupdate.h>
  22. #include "vport.h"
  23. struct vport *ovs_netdev_get_vport(struct net_device *dev);
  24. struct netdev_vport {
  25. struct rcu_head rcu;
  26. struct net_device *dev;
  27. };
  28. static inline struct netdev_vport *
  29. netdev_vport_priv(const struct vport *vport)
  30. {
  31. return vport_priv(vport);
  32. }
  33. const char *ovs_netdev_get_name(const struct vport *);
  34. void ovs_netdev_detach_dev(struct vport *);
  35. int __init ovs_netdev_init(void);
  36. void ovs_netdev_exit(void);
  37. #endif /* vport_netdev.h */