Added more debug output and deprecated qmem

This commit is contained in:
frekky 2015-08-29 20:07:44 +08:00
parent b6162241e6
commit 51a59bed24
2 changed files with 10 additions and 4 deletions

View File

@ -35,6 +35,7 @@
#include "encoding.h" #include "encoding.h"
#include "user.h" #include "user.h"
#include "window.h" #include "window.h"
#include "server.h"
struct tun_user *users; struct tun_user *users;
unsigned usercount; unsigned usercount;
@ -77,6 +78,11 @@ init_users(in_addr_t my_ip, int netbits)
snprintf(newip, sizeof(newip), "0.0.0.%d", i + skip + 1); snprintf(newip, sizeof(newip), "0.0.0.%d", i + skip + 1);
ip = ipstart.s_addr + inet_addr(newip); ip = ipstart.s_addr + inet_addr(newip);
} }
if (debug >= 2) {
struct in_addr IP;
IP.s_addr = ip;
fprintf(stderr, "User %d: IP %s\n", i, inet_ntoa(IP));
}
users[i].tun_ip = ip; users[i].tun_ip = ip;
net.s_addr = ip; net.s_addr = ip;
/* Rest is reset on login ('V' packet) or already 0 */ /* Rest is reset on login ('V' packet) or already 0 */

View File

@ -36,22 +36,22 @@ struct tun_user {
struct sockaddr_storage host; struct sockaddr_storage host;
socklen_t hostlen; socklen_t hostlen;
struct query q; struct query q;
struct query q_sendrealsoon; /* TODO: multiple incoming query storage + handling */
int q_sendrealsoon_new;
struct frag_buffer *incoming; struct frag_buffer *incoming;
struct frag_buffer *outgoing; struct frag_buffer *outgoing;
int next_upstream_ack; int next_upstream_ack;
struct encoder *encoder; struct encoder *encoder;
char downenc; char downenc;
int downenc_bits;
int fragsize; int fragsize;
enum connection conn; enum connection conn;
int lazy; int lazy;
unsigned char qmemping_cmc[QMEMPING_LEN * 4]; /*unsigned char qmemping_cmc[QMEMPING_LEN * 4];
unsigned short qmemping_type[QMEMPING_LEN]; unsigned short qmemping_type[QMEMPING_LEN];
int qmemping_lastfilled; int qmemping_lastfilled;
unsigned char qmemdata_cmc[QMEMDATA_LEN * 4]; unsigned char qmemdata_cmc[QMEMDATA_LEN * 4];
unsigned short qmemdata_type[QMEMDATA_LEN]; unsigned short qmemdata_type[QMEMDATA_LEN];
int qmemdata_lastfilled; int qmemdata_lastfilled;*/
#ifdef DNSCACHE_LEN #ifdef DNSCACHE_LEN
struct query dnscache_q[DNSCACHE_LEN]; struct query dnscache_q[DNSCACHE_LEN];
char dnscache_answer[DNSCACHE_LEN][4096]; char dnscache_answer[DNSCACHE_LEN][4096];