Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/syslogd/syslogd.h
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
#ifndef _SYSLOGD_H_ | #ifndef _SYSLOGD_H_ | ||||
#define _SYSLOGD_H_ | #define _SYSLOGD_H_ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/nv.h> | #include <sys/nv.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/uio.h> | |||||
#define SYSLOG_NAMES | #define SYSLOG_NAMES | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <regex.h> | #include <regex.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include "ttymsg.h" | |||||
#define MAXLINE 8192 /* maximum line length */ | #define MAXLINE 8192 /* maximum line length */ | ||||
#define MAXSVLINE MAXLINE /* maximum saved line length */ | #define MAXSVLINE MAXLINE /* maximum saved line length */ | ||||
#define MAXUNAMES 20 /* maximum number of user names */ | #define MAXUNAMES 20 /* maximum number of user names */ | ||||
/* Timestamps of log entries. */ | /* Timestamps of log entries. */ | ||||
struct logtime { | struct logtime { | ||||
struct tm tm; | struct tm tm; | ||||
suseconds_t usec; | suseconds_t usec; | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | #define FFLAG_NEEDSYNC 0x02 | ||||
struct logtime f_lasttime; /* time of last occurrence */ | struct logtime f_lasttime; /* time of last occurrence */ | ||||
int f_prevpri; /* pri of f_prevline */ | int f_prevpri; /* pri of f_prevline */ | ||||
size_t f_prevlen; /* length of f_prevline */ | size_t f_prevlen; /* length of f_prevline */ | ||||
int f_prevcount; /* repetition cnt of prevline */ | int f_prevcount; /* repetition cnt of prevline */ | ||||
u_int f_repeatcount; /* number of "repeated" msgs */ | u_int f_repeatcount; /* number of "repeated" msgs */ | ||||
STAILQ_ENTRY(filed) next; /* next in linked list */ | STAILQ_ENTRY(filed) next; /* next in linked list */ | ||||
}; | }; | ||||
/* | |||||
* List of iovecs to which entries can be appended. | |||||
* Used for constructing the message to be logged. | |||||
*/ | |||||
struct iovlist { | |||||
struct iovec iov[TTYMSG_IOV_MAX]; | |||||
size_t iovcnt; | |||||
size_t totalsize; | |||||
}; | |||||
extern const char *ConfFile; | extern const char *ConfFile; | ||||
extern char LocalHostName[MAXHOSTNAMELEN]; | extern char LocalHostName[MAXHOSTNAMELEN]; | ||||
void closelogfiles(void); | void closelogfiles(void); | ||||
void logerror(const char *); | void logerror(const char *); | ||||
int p_open(size_t, const char *, pid_t *); | |||||
nvlist_t *readconfigfile(const char *); | nvlist_t *readconfigfile(const char *); | ||||
void wallmsg(const struct filed *, struct iovec *, const int); | |||||
#endif /* !_SYSLOGD_H_ */ | #endif /* !_SYSLOGD_H_ */ |