3 Copyright (C) 2000-2005 Ivo Timmermans,
4 2000-2013 Guus Sliepen <guus@meshlink.io>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 rmode_t routing_mode = RMODE_ROUTER;
29 fmode_t forwarding_mode = FMODE_INTERNAL;
30 bmode_t broadcast_mode = BMODE_MST;
31 bool decrement_ttl = false;
32 bool directonly = false;
33 bool priorityinheritance = false;
35 bool overwrite_mac = false;
36 mac_t mymac = {{0xFE, 0xFD, 0, 0, 0, 0}};
39 static bool ratelimit(int frequency) {
40 static time_t lasttime = 0;
43 if(lasttime == now.tv_sec) {
44 if(count >= frequency)
47 lasttime = now.tv_sec;
55 static bool checklength(node_t *source, vpn_packet_t *packet, length_t length) {
56 if(packet->len < length) {
57 logger(DEBUG_TRAFFIC, LOG_WARNING, "Got too short packet from %s (%s)", source->name, source->hostname);
63 void route(node_t *source, vpn_packet_t *packet) {
64 // TODO: route on name or key