iPXE
Macros | Functions
syslog.h File Reference

Syslog protocol. More...

#include <syslog.h>

Go to the source code of this file.

Macros

#define SYSLOG_PORT   514
 Syslog server port. More...
 
#define SYSLOG_BUFSIZE   128
 Syslog line buffer size. More...
 
#define SYSLOG_DEFAULT_FACILITY   0 /* kernel */
 Syslog default facility. More...
 
#define SYSLOG_DEFAULT_SEVERITY   LOG_INFO
 Syslog default severity. More...
 
#define SYSLOG_PRIORITY(facility, severity)   ( 8 * (facility) + (severity) )
 Syslog priority. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
int syslog_send (struct interface *xfer, unsigned int severity, const char *message, const char *terminator)
 Transmit formatted syslog message. More...
 

Detailed Description

Syslog protocol.

Definition in file syslog.h.

Macro Definition Documentation

◆ SYSLOG_PORT

#define SYSLOG_PORT   514

Syslog server port.

Definition at line 15 of file syslog.h.

◆ SYSLOG_BUFSIZE

#define SYSLOG_BUFSIZE   128

Syslog line buffer size.

This is a policy decision

Definition at line 21 of file syslog.h.

◆ SYSLOG_DEFAULT_FACILITY

#define SYSLOG_DEFAULT_FACILITY   0 /* kernel */

Syslog default facility.

This is a policy decision

Definition at line 27 of file syslog.h.

◆ SYSLOG_DEFAULT_SEVERITY

#define SYSLOG_DEFAULT_SEVERITY   LOG_INFO

Syslog default severity.

This is a policy decision

Definition at line 33 of file syslog.h.

◆ SYSLOG_PRIORITY

#define SYSLOG_PRIORITY (   facility,
  severity 
)    ( 8 * (facility) + (severity) )

Syslog priority.

Definition at line 36 of file syslog.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ syslog_send()

int syslog_send ( struct interface xfer,
unsigned int  severity,
const char *  message,
const char *  terminator 
)

Transmit formatted syslog message.

Parameters
xferData transfer interface
severitySeverity
messageMessage
terminatorMessage terminator
Return values
rcReturn status code

Definition at line 97 of file syslog.c.

98  {
99  const char *hostname = ( syslog_hostname ? syslog_hostname : "" );
100  const char *domain = ( ( hostname[0] && syslog_domain ) ?
101  syslog_domain : "" );
102 
103  return xfer_printf ( xfer, "<%d>%s%s%s%sipxe: %s%s",
105  severity ), hostname,
106  ( domain[0] ? "." : "" ), domain,
107  ( hostname[0] ? " " : "" ), message, terminator );
108 }
#define SYSLOG_PRIORITY(facility, severity)
Syslog priority.
Definition: syslog.h:36
static char * syslog_domain
Domain name (for log messages)
Definition: syslog.c:86
static char * syslog_hostname
Host name (for log messages)
Definition: syslog.c:83
int xfer_printf(struct interface *intf, const char *format,...)
Deliver formatted string.
Definition: xfer.c:333
char message[VMCONSOLE_BUFSIZE]
Definition: vmconsole.c:54
#define SYSLOG_DEFAULT_FACILITY
Syslog default facility.
Definition: syslog.h:27
struct eth_slow_terminator_tlv terminator
Terminator.
Definition: eth_slow.h:20
struct ntlm_data domain
Domain name.
Definition: ntlm.h:16

References domain, message, SYSLOG_DEFAULT_FACILITY, syslog_domain, syslog_hostname, SYSLOG_PRIORITY, terminator, and xfer_printf().

Referenced by syslog_putchar(), and syslogs_putchar().