mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 16:19:20 +02:00
Adjust indentation
This commit is contained in:
parent
24241666fa
commit
45a5d80c49
20
src/client.c
20
src/client.c
|
@ -1458,7 +1458,6 @@ handshake_version(int dns_fd, int *seed)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'v', 'V', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'v', 'V', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read >= 9) {
|
if (read >= 9) {
|
||||||
payload = (((in[4] & 0xff) << 24) |
|
payload = (((in[4] & 0xff) << 24) |
|
||||||
((in[5] & 0xff) << 16) |
|
((in[5] & 0xff) << 16) |
|
||||||
|
@ -1483,7 +1482,6 @@ handshake_version(int dns_fd, int *seed)
|
||||||
}
|
}
|
||||||
} else if (read > 0)
|
} else if (read > 0)
|
||||||
warnx("did not receive proper login challenge");
|
warnx("did not receive proper login challenge");
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying version check...\n");
|
fprintf(stderr, "Retrying version check...\n");
|
||||||
}
|
}
|
||||||
|
@ -1510,7 +1508,6 @@ handshake_login(int dns_fd, int seed)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'l', 'L', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'l', 'L', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
int netmask;
|
int netmask;
|
||||||
if (strncmp("LNAK", in, 4) == 0) {
|
if (strncmp("LNAK", in, 4) == 0) {
|
||||||
|
@ -1533,7 +1530,6 @@ handshake_login(int dns_fd, int seed)
|
||||||
fprintf(stderr, "Received bad handshake\n");
|
fprintf(stderr, "Received bad handshake\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying login...\n");
|
fprintf(stderr, "Retrying login...\n");
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1556,6 @@ handshake_raw_udp(int dns_fd, int seed)
|
||||||
|
|
||||||
len = handshake_waitdns(dns_fd, in, sizeof(in), 'i', 'I', i+1);
|
len = handshake_waitdns(dns_fd, in, sizeof(in), 'i', 'I', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (len == 5 && in[0] == 'I') {
|
if (len == 5 && in[0] == 'I') {
|
||||||
/* Received IP address */
|
/* Received IP address */
|
||||||
remoteaddr = (in[1] & 0xff);
|
remoteaddr = (in[1] & 0xff);
|
||||||
|
@ -1573,7 +1568,6 @@ handshake_raw_udp(int dns_fd, int seed)
|
||||||
server.s_addr = ntohl(remoteaddr);
|
server.s_addr = ntohl(remoteaddr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, ".");
|
fprintf(stderr, ".");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
@ -2098,7 +2092,6 @@ handshake_switch_codec(int dns_fd, int bits)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 's', 'S', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 's', 'S', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
if (strncmp("BADLEN", in, 6) == 0) {
|
if (strncmp("BADLEN", in, 6) == 0) {
|
||||||
fprintf(stderr, "Server got bad message length. ");
|
fprintf(stderr, "Server got bad message length. ");
|
||||||
|
@ -2115,7 +2108,6 @@ handshake_switch_codec(int dns_fd, int bits)
|
||||||
dataenc = tempenc;
|
dataenc = tempenc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying codec switch...\n");
|
fprintf(stderr, "Retrying codec switch...\n");
|
||||||
}
|
}
|
||||||
|
@ -2153,7 +2145,6 @@ handshake_switch_downenc(int dns_fd)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
if (strncmp("BADLEN", in, 6) == 0) {
|
if (strncmp("BADLEN", in, 6) == 0) {
|
||||||
fprintf(stderr, "Server got bad message length. ");
|
fprintf(stderr, "Server got bad message length. ");
|
||||||
|
@ -2169,7 +2160,6 @@ handshake_switch_downenc(int dns_fd)
|
||||||
fprintf(stderr, "Server switched downstream to codec %s\n", in);
|
fprintf(stderr, "Server switched downstream to codec %s\n", in);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying codec switch...\n");
|
fprintf(stderr, "Retrying codec switch...\n");
|
||||||
}
|
}
|
||||||
|
@ -2196,7 +2186,6 @@ handshake_try_lazy(int dns_fd)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
if (strncmp("BADLEN", in, 6) == 0) {
|
if (strncmp("BADLEN", in, 6) == 0) {
|
||||||
fprintf(stderr, "Server got bad message length. ");
|
fprintf(stderr, "Server got bad message length. ");
|
||||||
|
@ -2213,7 +2202,6 @@ handshake_try_lazy(int dns_fd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying lazy mode switch...\n");
|
fprintf(stderr, "Retrying lazy mode switch...\n");
|
||||||
}
|
}
|
||||||
|
@ -2242,14 +2230,12 @@ handshake_lazyoff(int dns_fd)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', 1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', 1);
|
||||||
|
|
||||||
/*XXX START adjust indent 2 tabs back*/
|
|
||||||
if (read == 9 && strncmp("Immediate", in, 9) == 0) {
|
if (read == 9 && strncmp("Immediate", in, 9) == 0) {
|
||||||
warnx("Server switched back to legacy mode.\n");
|
warnx("Server switched back to legacy mode.\n");
|
||||||
lazymode = 0;
|
lazymode = 0;
|
||||||
selecttimeout = 1;
|
selecttimeout = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 2 tabs back*/
|
|
||||||
}
|
}
|
||||||
if (!running)
|
if (!running)
|
||||||
return;
|
return;
|
||||||
|
@ -2304,7 +2290,6 @@ fragsize_check(char *in, int read, int proposed_fragsize, int *max_fragsize)
|
||||||
okay = 1;
|
okay = 1;
|
||||||
v = in[3] & 0xff;
|
v = in[3] & 0xff;
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
for (i = 3; i < read; i++, v = (v + 107) & 0xff)
|
for (i = 3; i < read; i++, v = (v + 107) & 0xff)
|
||||||
if ((in[i] & 0xff) != v) {
|
if ((in[i] & 0xff) != v) {
|
||||||
okay = 0;
|
okay = 0;
|
||||||
|
@ -2325,7 +2310,6 @@ fragsize_check(char *in, int read, int proposed_fragsize, int *max_fragsize)
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
/* notreached */
|
/* notreached */
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -2352,13 +2336,11 @@ handshake_autoprobe_fragsize(int dns_fd)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'r', 'R', 1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'r', 'R', 1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
/* We got a reply */
|
/* We got a reply */
|
||||||
if (fragsize_check(in, read, proposed_fragsize, &max_fragsize) == 1)
|
if (fragsize_check(in, read, proposed_fragsize, &max_fragsize) == 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, ".");
|
fprintf(stderr, ".");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
@ -2422,7 +2404,6 @@ handshake_set_fragsize(int dns_fd, int fragsize)
|
||||||
|
|
||||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'n', 'N', i+1);
|
read = handshake_waitdns(dns_fd, in, sizeof(in), 'n', 'N', i+1);
|
||||||
|
|
||||||
/*XXX START adjust indent 1 tab back*/
|
|
||||||
if (read > 0) {
|
if (read > 0) {
|
||||||
int accepted_fragsize;
|
int accepted_fragsize;
|
||||||
|
|
||||||
|
@ -2437,7 +2418,6 @@ handshake_set_fragsize(int dns_fd, int fragsize)
|
||||||
accepted_fragsize = ((in[0] & 0xff) << 8) | (in[1] & 0xff);
|
accepted_fragsize = ((in[0] & 0xff) << 8) | (in[1] & 0xff);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab back*/
|
|
||||||
|
|
||||||
fprintf(stderr, "Retrying set fragsize...\n");
|
fprintf(stderr, "Retrying set fragsize...\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,6 @@ dns_encode(char *buf, size_t buflen, struct query *q, qr_t qr, char *data, size_
|
||||||
(even CNAME/A/MX, 255+255+header would be >512) */
|
(even CNAME/A/MX, 255+255+header would be >512) */
|
||||||
if (dnsc_use_edns0) {
|
if (dnsc_use_edns0) {
|
||||||
header->arcount = htons(1);
|
header->arcount = htons(1);
|
||||||
/*XXX START adjust indent 1 tab forward*/
|
|
||||||
CHECKLEN(11);
|
CHECKLEN(11);
|
||||||
putbyte(&p, 0x00); /* Root */
|
putbyte(&p, 0x00); /* Root */
|
||||||
putshort(&p, 0x0029); /* OPT */
|
putshort(&p, 0x0029); /* OPT */
|
||||||
|
@ -215,7 +214,6 @@ dns_encode(char *buf, size_t buflen, struct query *q, qr_t qr, char *data, size_
|
||||||
putshort(&p, 0x0000); /* Higher bits/edns version */
|
putshort(&p, 0x0000); /* Higher bits/edns version */
|
||||||
putshort(&p, 0x8000); /* Z */
|
putshort(&p, 0x8000); /* Z */
|
||||||
putshort(&p, 0x0000); /* Data length */
|
putshort(&p, 0x0000); /* Data length */
|
||||||
/*XXX END adjust indent 1 tab forward*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1742,7 +1742,6 @@ handle_full_packet(int tun_fd, int dns_fd, int userid)
|
||||||
write_tun(tun_fd, out, outlen);
|
write_tun(tun_fd, out, outlen);
|
||||||
} else {
|
} else {
|
||||||
/* send the compressed(!) packet to other client */
|
/* send the compressed(!) packet to other client */
|
||||||
/*XXX START adjust indent 1 tab forward*/
|
|
||||||
if (users[touser].conn == CONN_DNS_NULL) {
|
if (users[touser].conn == CONN_DNS_NULL) {
|
||||||
if (users[touser].outpacket.len == 0) {
|
if (users[touser].outpacket.len == 0) {
|
||||||
start_new_outpacket(touser,
|
start_new_outpacket(touser,
|
||||||
|
@ -1766,7 +1765,6 @@ handle_full_packet(int tun_fd, int dns_fd, int userid)
|
||||||
users[userid].inpacket.len, touser,
|
users[userid].inpacket.len, touser,
|
||||||
RAW_HDR_CMD_DATA, &users[touser].q);
|
RAW_HDR_CMD_DATA, &users[touser].q);
|
||||||
}
|
}
|
||||||
/*XXX END adjust indent 1 tab forward*/
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (debug >= 1)
|
if (debug >= 1)
|
||||||
|
|
Loading…
Reference in New Issue