2 * (c) Copyright 1992 by Panagiotis Tsirigotis
3 * (c) Sections Copyright 1998-2001 by Rob Braun
4 * All rights reserved. The file named COPYRIGHT specifies the terms
5 * and conditions for redistribution.
11 #include <sys/socket.h>
17 * $Id: log.h,v 1.2 2003/05/08 14:52:24 steveg Exp $
21 * Meaning of logtype flags:
24 * L_FILE: log output goes to a file
25 * L_SYSLOG: log output goes to syslog(3)
26 * L_COMMON_FILE: log output goes to the file specified in defaults
28 typedef enum { L_NONE = 0, L_FILE, L_SYSLOG, L_COMMON_FILE } logtype_e ;
32 char *fl_filename ; /* always malloc'ed */
33 unsigned fl_soft_limit ;
34 unsigned fl_hard_limit ;
37 #define FILELOG_SIZE_CONTROL( flp ) ( flp->fl_soft_limit != 0 )
53 #define LOG_GET_TYPE( lp ) (lp)->l_type
54 #define LOG_SET_TYPE( lp, type ) (lp)->l_type = (type)
56 #define LOG_GET_FILELOG( lp ) (&(lp)->l_fl)
57 #define LOG_GET_SYSLOG( lp ) (&(lp)->l_sl)
59 const char *xaddrname(const union xsockaddr *inaddr);
60 uint16_t xaddrport(const union xsockaddr *inaddr);
61 void svc_log_success(struct service *sp, const connection_s *cp,pid_t pid);
62 void svc_log_failure(struct service *sp, const connection_s *cp,access_e access_failure);
63 void svc_log_exit(struct service *sp,const struct server *serp);
64 void svc_logprint(struct service *sp,const char *line_id,const char *fmt,...)
66 __attribute__ ((format (printf, 3, 4)));