From 241aca98bdc8106221ee7d7dbcea9f2fa17f24bc Mon Sep 17 00:00:00 2001 From: Konstantin Kowalski Date: Fri, 26 Jul 2013 23:07:25 -0400 Subject: A *lot* of style changes. --- core/LAN_discovery.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/LAN_discovery.c') diff --git a/core/LAN_discovery.c b/core/LAN_discovery.c index 3cfcb067..1ac13c33 100644 --- a/core/LAN_discovery.c +++ b/core/LAN_discovery.c @@ -37,24 +37,24 @@ IP broadcast_ip() return -1 if it is not */ int LAN_ip(IP ip) { - if(ip.c[0] == 127)/* Loopback */ + if (ip.c[0] == 127)/* Loopback */ return 0; - if(ip.c[0] == 10)/* 10.0.0.0 to 10.255.255.255 range */ + if (ip.c[0] == 10)/* 10.0.0.0 to 10.255.255.255 range */ return 0; - if(ip.c[0] == 172 && ip.c[1] >= 16 && ip.c[1] <= 31)/* 172.16.0.0 to 172.31.255.255 range */ + if (ip.c[0] == 172 && ip.c[1] >= 16 && ip.c[1] <= 31)/* 172.16.0.0 to 172.31.255.255 range */ return 0; - if(ip.c[0] == 192 && ip.c[1] == 168) /* 192.168.0.0 to 192.168.255.255 range */ + if (ip.c[0] == 192 && ip.c[1] == 168) /* 192.168.0.0 to 192.168.255.255 range */ return 0; - if(ip.c[0] == 169 && ip.c[1] == 254 && ip.c[2] != 0 && ip.c[2] != 255)/* 169.254.1.0 to 169.254.254.255 range */ + if (ip.c[0] == 169 && ip.c[1] == 254 && ip.c[2] != 0 && ip.c[2] != 255)/* 169.254.1.0 to 169.254.254.255 range */ return 0; return -1; } -int handle_LANdiscovery(uint8_t * packet, uint32_t length, IP_Port source) +int handle_LANdiscovery(uint8_t *packet, uint32_t length, IP_Port source) { - if(LAN_ip(source.ip) == -1) + if (LAN_ip(source.ip) == -1) return 1; - if(length != crypto_box_PUBLICKEYBYTES + 1) + if (length != crypto_box_PUBLICKEYBYTES + 1) return 1; DHT_bootstrap(source, packet + 1); return 0; @@ -71,9 +71,9 @@ int send_LANdiscovery(uint16_t port) } -int LANdiscovery_handlepacket(uint8_t * packet, uint32_t length, IP_Port source) +int LANdiscovery_handlepacket(uint8_t *packet, uint32_t length, IP_Port source) { - if(packet[0] == 32) + if (packet[0] == 32) return handle_LANdiscovery(packet, length, source); return 1; } -- cgit v1.2.3