/* Define to the location of if_tun.h */
#undef LINUX_IF_TUN_H
+
+/* Define to 1 if checkpoint tracing is enabled */
+#undef ENABLE_TRACING
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.13.2.15 2000/11/08 00:10:49 guus Exp $
+dnl $Id: configure.in,v 1.13.2.16 2000/11/08 20:52:36 guus Exp $
AC_INIT(src/tincd.c)
AM_INIT_AUTOMAKE(tinc, 1.0pre3)
dnl Check for TUN/TAP support in the kernel
tinc_TUNTAP
+dnl Check if checkpoint tracing has to be enabled
+AC_ARG_ENABLE(tracing,
+ --enable-tracing enable checkpoint tracing (for debugging purposes only),
+ [ AC_DEFINE(ENABLE_TRACING) ]
+)
+
AC_OUTPUT([Makefile src/Makefile
doc/Makefile doc/es/Makefile intl/Makefile lib/Makefile
m4/Makefile po/Makefile.in redhat/Makefile debian/Makefile])
#include <syslog.h>
#include <xalloc.h>
+#ifdef ENABLE_TRACING
volatile int (cp_line[]) = {0, 0, 0, 0, 0, 0, 0, 0};
volatile char (*cp_file[]) = {"?", "?", "?", "?", "?", "?", "?", "?"};
volatile int cp_index = 0;
+#endif
char *hexadecimals = "0123456789ABCDEF";
}
}
+#ifdef ENABLE_TRACING
void cp_trace()
{
syslog(LOG_DEBUG, "Checkpoint trace: %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d ...",
cp_file[cp_index], cp_line[cp_index]
);
}
+#endif
#ifndef HAVE_ASPRINTF
int asprintf(char **buf, const char *fmt, ...)
#define min(a,b) (((a)<(b))?(a):(b))
+#ifdef ENABLE_TRACING
extern volatile int cp_line[];
extern volatile char *cp_file[];
extern volatile int cp_index;
+extern void cp_trace(void);
-#define cp { cp_line[cp_index] = __LINE__; cp_file[cp_index] = __FILE__; cp_index++; cp_index %= 8; }
-#define ecp { fprintf(stderr, "Explicit checkpoint in %s line %d\n", __FILE__, __LINE__); }
+ #define cp { cp_line[cp_index] = __LINE__; cp_file[cp_index] = __FILE__; cp_index++; cp_index %= 8; }
+ #define ecp { fprintf(stderr, "Explicit checkpoint in %s line %d\n", __FILE__, __LINE__); }
+#else
+ #define cp
+ #define ecp
+ #define cp_trace()
+#endif
extern void hex2bin(char *src, char *dst, int length);
extern void bin2hex(char *src, char *dst, int length);
-extern void cp_trace(void);
#endif /* __TINC_UTILS_H__ */
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: tincd.c,v 1.10.4.26 2000/11/08 00:20:06 guus Exp $
+ $Id: tincd.c,v 1.10.4.27 2000/11/08 20:52:37 guus Exp $
*/
#include "config.h"
void memory_full(int size)
{
- syslog(LOG_ERR, _("Memory exhausted (last is %s:%d) (couldn't allocate %d bytes), exiting."), cp_file, cp_line, size);
+ syslog(LOG_ERR, _("Memory exhausted (couldn't allocate %d bytes), exiting."), size);
+ cp_trace();
exit(1);
}
if(!confbase)
asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname);
else
- fprintf(stderr, "Both netname and configuration directory given, using the latter...\n");
+ fprintf(stderr, _("Both netname and configuration directory given, using the latter...\n"));
if(!identname)
asprintf(&identname, "tinc.%s", netname);
}