/*
 * Tentun - covert tunneling project
 *
 * Copyright (C) 2003 David Gordon
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 */


#ifndef _DEBUG_H
#define _DEBUG_H


#define DEBUG_TENTUN 1


#define DEBUG_TEXT "Tentun: "

#define DEBUG_ALL             		0xffffffff
#define DEBUG_INIT            		0x00000001
#define DEBUG_PKTIO			0x00000002
#define DEBUG_PKTPROC		  	0x00000004
#define DEBUG_SIGNAL		  	0x00000008
#define DEBUG_TCP_PKT                   0x00000010
#define DEBUG_TCP_FULL                  0x00000020 | DEBUG_TCP_PKT
#define DEBUG_HTTP_SIMPLE               0x00000040
#define DEBUG_TUN_PKT                   0x00000080
#define DEBUG_DNS                       0x00000100



/* Debug functions */

void dump_buffer_in_hex(int level, const char *buf, int size);
void dump_buffer_ascii(int debug, const char *buf, int size);


/* Default value for debuglevel is defined in tentun.c */

#ifdef DEBUG_TENTUN
#define TENTUN_DEBUG(dbg,fmt,arg...) \
   if (debuglevel & dbg) printf(DEBUG_TEXT fmt,##arg);
#else
#define TENTUN_DEBUG(dbg,fmt,arg...)
#endif

#define TENTUN_PRINT(fmt,arg...) \
   printf(DEBUG_TEXT fmt,##arg);


#endif				/* _DEBUG_H */
