along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.2 2002/04/09 15:32:14 zarq Exp $
+ $Id: device.c,v 1.3 2002/04/13 11:08:31 zarq Exp $
*/
#include "config.h"
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
-#include <syslog.h>
#include <string.h>
#include <utils.h>
#include "conf.h"
#include "net.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: graph.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: graph.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
/* We need to generate two trees from the graph:
#include "config.h"
#include <stdio.h>
-#include <syslog.h>
#include "config.h"
#include <string.h>
#if defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD)
#include "edge.h"
#include "connection.h"
#include "process.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.2 2002/04/09 15:32:14 zarq Exp $
+ $Id: device.c,v 1.3 2002/04/13 11:08:31 zarq Exp $
*/
#include "config.h"
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
-#include <syslog.h>
#include <string.h>
#include <sys/ioctl.h>
#include "conf.h"
#include "net.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: logging.c,v 1.3 2002/04/13 10:43:10 zarq Exp $
+ $Id: logging.c,v 1.4 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
vsyslog(priorities[priority], fmt, ap);
}
-void syslog(int priority, char *fmt, ...)
+void tinc_syslog(int priority, char *fmt, ...)
{
/* Mapping syslog prio -> tinc prio */
- const int priorities[] = { TLOG_CRIT, TLOG_CRIT, TLOG_CRIT, TLOG_ERR,
+ const int priorities[] = { TLOG_CRITICAL, TLOG_CRITICAL, TLOG_CRITICAL, TLOG_ERROR,
TLOG_NOTICE, TLOG_NOTICE, TLOG_INFO, TLOG_DEBUG };
avl_node_t *avlnode;
va_list args;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: meta.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: meta.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <avl_tree.h>
#include <errno.h>
-#include <syslog.h>
#include <unistd.h>
#include <string.h>
/* This line must be below the rest for FreeBSD */
#include "connection.h"
#include "system.h"
#include "protocol.h"
+#include "logging.h"
int send_meta(connection_t *c, char *buffer, int length)
{
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.37 2002/04/09 15:26:00 zarq Exp $
+ $Id: net.c,v 1.38 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#include "route.h"
#include "device.h"
#include "event.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_packet.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: net_packet.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#include "route.h"
#include "device.h"
#include "event.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_setup.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: net_setup.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#include "route.h"
#include "device.h"
#include "event.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_socket.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: net_socket.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
/* SunOS really wants sys/socket.h BEFORE net/if.h,
#include "route.h"
#include "device.h"
#include "event.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.2 2002/04/09 15:32:14 zarq Exp $
+ $Id: device.c,v 1.3 2002/04/13 11:08:31 zarq Exp $
*/
#include "config.h"
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
-#include <syslog.h>
#include <string.h>
#include <utils.h>
#include "conf.h"
#include "net.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: netutl.c,v 1.14 2002/04/09 15:26:00 zarq Exp $
+ $Id: netutl.c,v 1.15 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <string.h>
#include <signal.h>
#include <sys/socket.h>
-#include <syslog.h>
+
#include <arpa/inet.h>
#include <utils.h>
#include "conf.h"
#include "net.h"
#include "netutl.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.2 2002/04/09 15:32:14 zarq Exp $
+ $Id: device.c,v 1.3 2002/04/13 11:08:31 zarq Exp $
*/
#include "config.h"
#include <fcntl.h>
#include <net/if.h>
#include <unistd.h>
-#include <syslog.h>
#include <string.h>
#include <utils.h>
#include "conf.h"
#include "net.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.c,v 1.3 2002/04/13 10:25:38 zarq Exp $
+ $Id: process.c,v 1.4 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <stdio.h>
#include <string.h>
-#include <syslog.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
#include "device.h"
#include "connection.h"
#include "device.h"
+#include "logging.h"
#include "system.h"
void memory_full(int size)
{
- syslog(LOG_ERR, _("Memory exhausted (couldn't allocate %d bytes), exitting."), size);
+ log(0, TLOG_ERROR,
+ _("Memory exhausted (couldn't allocate %d bytes), exitting."),
+ size);
cp_trace();
exit(1);
}
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol.c,v 1.30 2002/04/09 15:26:00 zarq Exp $
+ $Id: protocol.c,v 1.31 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "protocol.h"
#include "meta.h"
#include "connection.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_auth.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: protocol_auth.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "node.h"
#include "edge.h"
#include "graph.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_edge.c,v 1.2 2002/04/09 15:26:00 zarq Exp $
+ $Id: protocol_edge.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "node.h"
#include "edge.h"
#include "graph.h"
+#include "logging.h"
#include "system.h"
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.2 2002/04/09 15:26:01 zarq Exp $
+ $Id: protocol_misc.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "protocol.h"
#include "meta.h"
#include "connection.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: protocol_subnet.c,v 1.2 2002/04/09 15:26:01 zarq Exp $
+ $Id: protocol_subnet.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include "node.h"
#include "edge.h"
#include "graph.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: route.c,v 1.2 2002/04/09 15:26:01 zarq Exp $
+ $Id: route.c,v 1.3 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <netinet/if_ether.h>
#include <utils.h>
#include <xalloc.h>
-#include <syslog.h>
#include <string.h>
#include <avl_tree.h>
#include "route.h"
#include "protocol.h"
#include "device.h"
+#include "logging.h"
#include "system.h"
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: device.c,v 1.2 2002/04/09 15:32:14 zarq Exp $
+ $Id: device.c,v 1.3 2002/04/13 11:08:31 zarq Exp $
*/
#include <sys/socket.h>
#include <net/if.h>
#include <unistd.h>
-#include <syslog.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stropts.h>
#include "conf.h"
#include "net.h"
#include "subnet.h"
+#include "logging.h"
#include "system.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.13 2002/04/13 10:25:38 zarq Exp $
+ $Id: tincd.c,v 1.14 2002/04/13 11:07:12 zarq Exp $
*/
#include "config.h"
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
-#include <syslog.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include "process.h"
#include "protocol.h"
#include "subnet.h"
+#include "logging.h"
#include "system.h"
if(!confbase)
asprintf(&confbase, "%s/tinc/%s", CONFDIR, netname);
else
- syslog(LOG_INFO, _("Both netname and configuration directory given, using the latter..."));
+ log(0, TLOG_INFO, _("Both netname and configuration directory given, using the latter..."));
if(!identname)
asprintf(&identname, "tinc.%s", netname);
}
cleanup_and_exit(1);
}
- syslog(LOG_ERR, _("Unrecoverable error"));
+ log(0, TLOG_ERROR, _("Unrecoverable error"));
cp_trace();
if(do_detach)
{
- syslog(LOG_NOTICE, _("Restarting in %d seconds!"), maxtimeout);
+ log(0, TLOG_NOTICE, _("Restarting in %d seconds!"), maxtimeout);
sleep(maxtimeout);
}
else
{
- syslog(LOG_ERR, _("Not restarting."));
+ log(0, TLOG_ERROR, _("Not restarting."));
exit(1);
}
}