]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
dclass support within the edge protocol
[meshlink] / src / meshlink.c
index 0ecab432912b4dc9c384700aea5043ac9160169c..65a82c97f192f65b48fdd6a125c5d7d7c36c42b7 100644 (file)
@@ -1726,7 +1726,17 @@ static void __attribute__((destructor)) meshlink_exit(void) {
 
 int weight_from_dclass(dclass_t dclass)
 {
-       if(dclass == PORTABLE)
+       switch(dclass)
+       {
+       case BACKBONE:
+               return 1;
+
+       case STATIONARY:
                return 3;
-       return 1;
+
+       case PORTABLE:
+               return 6;
+       }
+
+       return 9;
 }