X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_misc.c;h=36054f0a4edc925061e5c8dd5c86c039a680c210;hp=363c8c3f08e523f811d941c5b3e8d647b09d6654;hb=0b9175e998c2180e5d73ef3d644a49d620c68cad;hpb=868104703003605711582c984b57f8933bf361ee diff --git a/src/protocol_misc.c b/src/protocol_misc.c index 363c8c3f..36054f0a 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -17,14 +17,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: protocol_misc.c,v 1.1.4.7 2002/09/09 22:33:04 guus Exp $ + $Id: protocol_misc.c,v 1.1.4.8 2003/07/06 22:11:33 guus Exp $ */ #include "config.h" #include #include -#include #include #include #include @@ -37,6 +36,7 @@ #include "protocol.h" #include "meta.h" #include "connection.h" +#include "logger.h" #include "system.h" @@ -60,15 +60,13 @@ int status_h(connection_t *c) cp(); if(sscanf(c->buffer, "%*d %d " MAX_STRING, &statusno, statusstring) != 2) { - syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "STATUS", + logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "STATUS", c->name, c->hostname); return -1; } - if(debug_lvl >= DEBUG_STATUS) { - syslog(LOG_NOTICE, _("Status message from %s (%s): %s: %s"), + logger(DEBUG_STATUS, LOG_NOTICE, _("Status message from %s (%s): %s: %s"), c->name, c->hostname, status_text[statusno], statusstring); - } return 0; } @@ -91,15 +89,13 @@ int error_h(connection_t *c) cp(); if(sscanf(c->buffer, "%*d %d " MAX_STRING, &err, errorstring) != 2) { - syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ERROR", + logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "ERROR", c->name, c->hostname); return -1; } - if(debug_lvl >= DEBUG_ERROR) { - syslog(LOG_NOTICE, _("Error message from %s (%s): %s: %s"), + logger(DEBUG_ERROR, LOG_NOTICE, _("Error message from %s (%s): %s: %s"), c->name, c->hostname, strerror(err), errorstring); - } terminate_connection(c, c->status.active); @@ -185,7 +181,7 @@ int tcppacket_h(connection_t *c) cp(); if(sscanf(c->buffer, "%*d %hd", &len) != 1) { - syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "PACKET", c->name, + logger(DEBUG_ALWAYS, LOG_ERR, _("Got bad %s from %s (%s)"), "PACKET", c->name, c->hostname); return -1; }