X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=c2e0825ed87bc0779fe957d3b0103609b8ce7cd6;hb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;hp=f3a4bcca10d2b6394257c4749c1a2a8a5d04b3fd;hpb=b18d5b572992debb04a7851e43143711319243a0;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index f3a4bcca..c2e0825e 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -26,6 +26,7 @@ #include "conf_net.h" #include "conf.h" #include "connection.h" +#include "compression.h" #include "control.h" #include "device.h" #include "digest.h" @@ -859,10 +860,9 @@ static bool setup_myself(void) { #endif /* Compression */ - if(get_config_int(lookup_config(config_tree, "Compression"), &myself->incompression)) { switch(myself->incompression) { - case 12: + case COMPRESS_LZ4: #ifdef HAVE_LZ4 break; #else @@ -871,8 +871,8 @@ static bool setup_myself(void) { return false; #endif - case 11: - case 10: + case COMPRESS_LZO_HI: + case COMPRESS_LZO_LO: #ifdef HAVE_LZO break; #else @@ -881,15 +881,15 @@ static bool setup_myself(void) { return false; #endif - case 9: - case 8: - case 7: - case 6: - case 5: - case 4: - case 3: - case 2: - case 1: + case COMPRESS_ZLIB_9: + case COMPRESS_ZLIB_8: + case COMPRESS_ZLIB_7: + case COMPRESS_ZLIB_6: + case COMPRESS_ZLIB_5: + case COMPRESS_ZLIB_4: + case COMPRESS_ZLIB_3: + case COMPRESS_ZLIB_2: + case COMPRESS_ZLIB_1: #ifdef HAVE_ZLIB break; #else @@ -898,7 +898,7 @@ static bool setup_myself(void) { return false; #endif - case 0: + case COMPRESS_NONE: break; default: @@ -907,10 +907,10 @@ static bool setup_myself(void) { return false; } } else { - myself->incompression = 0; + myself->incompression = COMPRESS_NONE; } - myself->connection->outcompression = 0; + myself->connection->outcompression = COMPRESS_NONE; /* Done */