#ifndef __LOGSYSLOGFAST_H__
#define __LOGSYSLOGFAST_H__
#include <time.h>
#define LOG_RFC3164 0
#define LOG_RFC5424 1
#define LOG_RFC3164_LOCAL 2
typedef
struct
{
int
priority;
char
* sender;
char
* name;
int
pid;
int
format;
int
sock;
time_t
last_time;
char
* linebuf;
int
bufsize;
size_t
prefix_len;
char
* msg_start;
const
char
* time_format;
const
char
* msg_format;
const
char
* err;
} LogSyslogFast;
LogSyslogFast* LSF_alloc();
int
LSF_init(LogSyslogFast* logger,
int
proto,
const
char
* hostname,
int
port,
int
facility,
int
severity,
const
char
* sender,
const
char
* name);
int
LSF_destroy(LogSyslogFast* logger);
int
LSF_set_receiver(LogSyslogFast* logger,
int
proto,
const
char
* hostname,
int
port);
void
LSF_set_priority(LogSyslogFast* logger,
int
facility,
int
severity);
void
LSF_set_facility(LogSyslogFast* logger,
int
facility);
void
LSF_set_severity(LogSyslogFast* logger,
int
severity);
int
LSF_set_sender(LogSyslogFast* logger,
const
char
* sender);
int
LSF_set_name(LogSyslogFast* logger,
const
char
* name);
void
LSF_set_pid(LogSyslogFast* logger,
int
pid);
int
LSF_set_format(LogSyslogFast* logger,
int
format);
int
LSF_get_priority(LogSyslogFast* logger);
int
LSF_get_facility(LogSyslogFast* logger);
int
LSF_get_severity(LogSyslogFast* logger);
const
char
* LSF_get_sender(LogSyslogFast* logger);
const
char
* LSF_get_name(LogSyslogFast* logger);
int
LSF_get_pid(LogSyslogFast* logger);
int
LSF_get_format(LogSyslogFast* logger);
int
LSF_get_sock(LogSyslogFast* logger);
int
LSF_send(LogSyslogFast* logger,
const
char
* msg,
int
len,
time_t
t);
#endif