From cd773445d9117289614743597840591105f01dab Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 18 Apr 2014 20:23:17 +0200 Subject: [PATCH] Remove forwarding_mode, broadcast_mode, directonly, priorityinheritance, macexpire and pcap. --- src/net_packet.c | 28 +++------------------------- src/net_setup.c | 1 - src/route.c | 12 ------------ src/route.h | 26 -------------------------- 4 files changed, 3 insertions(+), 64 deletions(-) diff --git a/src/net_packet.c b/src/net_packet.c index 37bac936..583835b9 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -602,31 +602,9 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) { logger(DEBUG_TRAFFIC, LOG_INFO, "Broadcasting packet of %d bytes from %s (%s)", packet->len, from->name, from->hostname); - switch(broadcast_mode) { - // In MST mode, broadcast packets travel via the Minimum Spanning Tree. - // This guarantees all nodes receive the broadcast packet, and - // usually distributes the sending of broadcast packets over all nodes. - case BMODE_MST: - for list_each(connection_t, c, connection_list) - if(c->status.active && c->status.mst && c != from->nexthop->connection) - send_packet(c->node, packet); - break; - - // In direct mode, we send copies to each node we know of. - // However, this only reaches nodes that can be reached in a single hop. - // We don't have enough information to forward broadcast packets in this case. - case BMODE_DIRECT: - if(from != myself) - break; - - for splay_each(node_t, n, node_tree) - if(n->status.reachable && n != myself && ((n->via == myself && n->nexthop == n) || n->via == n)) - send_packet(n, packet); - break; - - default: - break; - } + for list_each(connection_t, c, connection_list) + if(c->status.active && c->status.mst && c != from->nexthop->connection) + send_packet(c->node, packet); } static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) { diff --git a/src/net_setup.c b/src/net_setup.c index e1250a4a..2cc7ddf5 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -196,7 +196,6 @@ char *get_name(void) { bool setup_myself_reloadable(void) { localdiscovery = true; - macexpire = 600; // TODO: remove keylifetime = 3600; // TODO: check if this can be removed as well maxtimeout = 900; autoconnect = 3; diff --git a/src/route.c b/src/route.c index 764d9b82..8a952a78 100644 --- a/src/route.c +++ b/src/route.c @@ -25,14 +25,7 @@ #include "utils.h" #include "libmeshlink.h" -fmode_t forwarding_mode = FMODE_INTERNAL; -bmode_t broadcast_mode = BMODE_MST; bool decrement_ttl = false; -bool directonly = false; -bool priorityinheritance = false; -int macexpire = 600; -mac_t mymac = {{0xFE, 0xFD, 0, 0, 0, 0}}; -bool pcap = false; static bool ratelimit(int frequency) { static time_t lasttime = 0; @@ -97,11 +90,6 @@ void route(node_t *source,vpn_packet_t *packet) { return; } - if (directonly && owner!=via) { - logger(DEBUG_TRAFFIC, LOG_WARNING, "Direct Only is requested. Dropping packet because direct connection not available \n"); - return; - } - send_packet(owner,packet); return; } diff --git a/src/route.h b/src/route.h index 80a9d2d4..4180d4a2 100644 --- a/src/route.h +++ b/src/route.h @@ -23,33 +23,7 @@ #include "net.h" #include "node.h" -typedef enum rmode_t { - RMODE_HUB = 0, - RMODE_SWITCH, - RMODE_ROUTER, -} rmode_t; - -typedef enum fmode_t { - FMODE_OFF = 0, - FMODE_INTERNAL, - FMODE_KERNEL, -} fmode_t; - -typedef enum bmode_t { - BMODE_NONE = 0, - BMODE_MST, - BMODE_DIRECT, -} bmode_t; - -extern fmode_t forwarding_mode; -extern bmode_t broadcast_mode; extern bool decrement_ttl; -extern bool directonly; -extern bool priorityinheritance; -extern int macexpire; -extern bool pcap; - -extern mac_t mymac; extern void route(struct node_t *, struct vpn_packet_t *); -- 2.39.5