Commit 80fbd4c3 authored by Marek Vavrusa's avatar Marek Vavrusa

Added debugging option for nsupdate.

parent 6fdb37b8
......@@ -274,6 +274,7 @@ doc/running.texi
src/libknot/zone/zone-diff.h
src/libknot/zone/zone-diff.c
src/utils/common/msg.h
src/utils/common/msg.c
src/utils/common/params.c
src/utils/common/params.h
src/utils/common/resolv.c
......
......@@ -32,6 +32,7 @@ knotc_SOURCES = \
khost_SOURCES = \
utils/common/msg.h \
utils/common/msg.c \
utils/common/exec.c \
utils/common/exec.h \
utils/common/params.c \
......@@ -50,6 +51,7 @@ khost_SOURCES = \
knsupdate_SOURCES = \
utils/common/msg.h \
utils/common/msg.c \
utils/common/params.c \
utils/common/params.h \
utils/common/resolv.c \
......
......@@ -36,8 +36,14 @@
#define ERR(m...) { printf(ERROR_ m); fflush(stdout); }
#define WARN(m...) { printf(WARNING_ m); fflush(stdout); }
/*! \brief Enable/disable debugging. */
int msg_enable_debug(int val);
/*! \brief Print debug message. */
int msg_debug(const char *fmt, ...);
#ifndef NDEBUG
#define DBG(m...) { printf(DEBUG_ m); fflush(stdout); }
#define DBG(m...) msg_debug(DEBUG_ m)
#else
#define DBG(m...)
#endif
......
......@@ -180,6 +180,7 @@ void params_flag_tcp(params_t *params)
void params_flag_verbose(params_t *params)
{
params->format = FORMAT_VERBOSE;
}
int params_parse_interval(const char *value, int32_t *dst)
......
......@@ -721,7 +721,7 @@ int cmd_send(const char* lp, params_t *params)
return KNOT_ERROR;
}
/*! \todo TCP fallback, timeout settings. */
/*! \todo TCP fallback. */
/* Wait for reception. */
uint8_t rwire[MAX_PACKET_SIZE];
......
......@@ -151,9 +151,11 @@ int nsupdate_params_parse(params_t *params, int argc, char *argv[])
}
/* Command line options processing. */
while ((opt = getopt(argc, argv, "dvp:t:r:")) != -1) {
while ((opt = getopt(argc, argv, "dDvp:t:r:")) != -1) {
switch (opt) {
case 'd':
case 'D': /* Extra debugging. */
msg_enable_debug(1);
params_flag_verbose(params);
break;
case 'v':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment