iPXE
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.
#define SYSLOG_BUFSIZE   128
 Syslog line buffer size.
#define SYSLOG_DEFAULT_FACILITY   0 /* kernel */
 Syslog default facility.
#define SYSLOG_DEFAULT_SEVERITY   LOG_INFO
 Syslog default severity.
#define SYSLOG_PRIORITY(facility, severity)
 Syslog priority.

Functions

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

Detailed Description

Syslog protocol.

Definition in file syslog.h.

Macro Definition Documentation

◆ SYSLOG_PORT

#define SYSLOG_PORT   514

Syslog server port.

Definition at line 16 of file syslog.h.

Referenced by apply_syslogs_settings().

◆ SYSLOG_BUFSIZE

#define SYSLOG_BUFSIZE   128

Syslog line buffer size.

This is a policy decision

Definition at line 22 of file syslog.h.

◆ SYSLOG_DEFAULT_FACILITY

#define SYSLOG_DEFAULT_FACILITY   0 /* kernel */

Syslog default facility.

This is a policy decision

Definition at line 28 of file syslog.h.

Referenced by syslog_send().

◆ SYSLOG_DEFAULT_SEVERITY

#define SYSLOG_DEFAULT_SEVERITY   LOG_INFO

Syslog default severity.

This is a policy decision

Definition at line 34 of file syslog.h.

Referenced by syslog_handle_priority(), and syslogs_handle_priority().

◆ SYSLOG_PRIORITY

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

Syslog priority.

Definition at line 37 of file syslog.h.

Referenced by syslog_send().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ syslog_send()

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

Transmit formatted syslog message.

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

Definition at line 99 of file syslog.c.

100 {
101 const char *hostname = ( syslog_hostname ? syslog_hostname : "" );
102 const char *domain = ( ( hostname[0] && syslog_domain ) ?
103 syslog_domain : "" );
104
105 return xfer_printf ( xfer, "<%d>%s%s%s%sipxe: %s%s",
107 severity ), hostname,
108 ( domain[0] ? "." : "" ), domain,
109 ( hostname[0] ? " " : "" ), message, terminator );
110}
struct eth_slow_terminator_tlv terminator
Terminator.
Definition eth_slow.h:9
#define SYSLOG_PRIORITY(facility, severity)
Syslog priority.
Definition syslog.h:37
#define SYSLOG_DEFAULT_FACILITY
Syslog default facility.
Definition syslog.h:28
static char * syslog_domain
Domain name (for log messages)
Definition syslog.c:88
static char * syslog_hostname
Host name (for log messages)
Definition syslog.c:85
char message[VMCONSOLE_BUFSIZE]
Definition vmconsole.c:54
int xfer_printf(struct interface *intf, const char *format,...)
Deliver formatted string.
Definition xfer.c:335

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

Referenced by syslog_putchar(), and syslogs_putchar().