NetconEthernetTap.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. * ZeroTier One - Network Virtualization Everywhere
  3. * Copyright (C) 2011-2015 ZeroTier, Inc.
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * --
  19. *
  20. * ZeroTier may be used and distributed under the terms of the GPLv3, which
  21. * are available at: http://www.gnu.org/licenses/gpl-3.0.html
  22. *
  23. * If you would like to embed ZeroTier into a commercial application or
  24. * redistribute it in a modified binary form, please contact ZeroTier Networks
  25. * LLC. Start here: http://www.zerotier.com/
  26. */
  27. #ifdef ZT_ENABLE_NETCON
  28. #include "NetconEthernetTap.hpp"
  29. #include "../osdep/OSUtils.hpp"
  30. #include "../osdep/Phy.hpp"
  31. namespace ZeroTier {
  32. NetconEthernetTap::NetconEthernetTap(
  33. const char *homePath,
  34. const MAC &mac,
  35. unsigned int mtu,
  36. unsigned int metric,
  37. uint64_t nwid,
  38. const char *friendlyName,
  39. void (*handler)(void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
  40. void *arg) :
  41. _handler(handler),
  42. _arg(arg),
  43. _nwid(nwid),
  44. _thread(),
  45. _homePath(homePath),
  46. _dev(),
  47. _multicastGroups(),
  48. _mtu(mtu),
  49. _enabled(true)
  50. {
  51. _thread = Thread::start(this);
  52. }
  53. NetconEthernetTap::~NetconEthernetTap()
  54. {
  55. }
  56. void NetconEthernetTap::setEnabled(bool en)
  57. {
  58. _enabled = en;
  59. }
  60. bool NetconEthernetTap::enabled() const
  61. {
  62. return _enabled;
  63. }
  64. bool NetconEthernetTap::addIp(const InetAddress &ip)
  65. {
  66. }
  67. bool NetconEthernetTap::removeIp(const InetAddress &ip)
  68. {
  69. }
  70. std::vector<InetAddress> NetconEthernetTap::ips() const
  71. {
  72. }
  73. void NetconEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
  74. {
  75. }
  76. std::string NetconEthernetTap::deviceName() const
  77. {
  78. return _dev;
  79. }
  80. void NetconEthernetTap::setFriendlyName(const char *friendlyName)
  81. {
  82. }
  83. void NetconEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed)
  84. {
  85. }
  86. void NetconEthernetTap::threadMain()
  87. throw()
  88. {
  89. }
  90. } // namespace ZeroTier
  91. #endif // ZT_ENABLE_NETCON