diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-07-25 16:16:05 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-07-25 16:16:05 -0400 |
| commit | 27aa6ea44e848bea720c94ccb3cbeb48876cabc9 (patch) | |
| tree | d6140705091f4ac8f30959a67c6f167574d70d50 /node/osdep/LinuxRoutingTable.hpp | |
| parent | 7475c4047e81cf83f16eed4449ad8408eeaacaec (diff) | |
| download | infinitytier-27aa6ea44e848bea720c94ccb3cbeb48876cabc9.tar.gz infinitytier-27aa6ea44e848bea720c94ccb3cbeb48876cabc9.zip | |
Linux routing table support work.
Diffstat (limited to 'node/osdep/LinuxRoutingTable.hpp')
| -rw-r--r-- | node/osdep/LinuxRoutingTable.hpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/node/osdep/LinuxRoutingTable.hpp b/node/osdep/LinuxRoutingTable.hpp index e69de29b..9a5d3fd6 100644 --- a/node/osdep/LinuxRoutingTable.hpp +++ b/node/osdep/LinuxRoutingTable.hpp @@ -0,0 +1,49 @@ +/* + * ZeroTier One - Global Peer to Peer Ethernet + * Copyright (C) 2011-2014 ZeroTier Networks LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * -- + * + * ZeroTier may be used and distributed under the terms of the GPLv3, which + * are available at: http://www.gnu.org/licenses/gpl-3.0.html + * + * If you would like to embed ZeroTier into a commercial application or + * redistribute it in a modified binary form, please contact ZeroTier Networks + * LLC. Start here: http://www.zerotier.com/ + */ + +#ifndef ZT_LINUXROUTINGTABLE_HPP +#define ZT_LINUXROUTINGTABLE_HPP + +#include "../RoutingTable.hpp" + +namespace ZeroTier { + +/** + * Routing table interface via /proc/net/route, /proc/net/ipv6_route, and /sbin/route command + */ +class LinuxRoutingTable : public RoutingTable +{ +public: + LinuxRoutingTable(); + virtual ~LinuxRoutingTable(); + virtual std::vector<RoutingTable::Entry> get(bool includeLinkLocal = false,bool includeLoopback = false) const; + virtual RoutingTable::Entry set(const InetAddress &destination,const InetAddress &gateway,const char *device,int metric); +}; + +} // namespace ZeroTier + +#endif |
