]> git.meshlink.io Git - meshlink/commitdiff
Remove forwarding_mode, broadcast_mode, directonly, priorityinheritance, macexpire...
authorGuus Sliepen <guus@meshlink.io>
Fri, 18 Apr 2014 18:23:17 +0000 (20:23 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 18 Apr 2014 18:23:17 +0000 (20:23 +0200)
src/net_packet.c
src/net_setup.c
src/route.c
src/route.h

index 37bac9366105c4820d4bf132eeb64199bdb81c2a..583835b928ef01425b32be554a3c945e5dfe55e0 100644 (file)
@@ -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) {
index e1250a4a74293daf3d81be6b920e6084da2558db..2cc7ddf55a46c5555cd5a93ba0ecf54e1e214705 100644 (file)
@@ -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;
index 764d9b82ca309a78bc54d750f3a46e55f2187275..8a952a7817404ab402baedb04ff64cd3779c8ecf 100644 (file)
 #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;
 }
index 80a9d2d4c09920e85cc228a5a6b15722c2d312ce..4180d4a2d2a0d04426e24e7da8772353cdce05e3 100644 (file)
 #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 *);