iPXE
|
Syslog protocol. More...
#include <stdint.h>
#include <stdlib.h>
#include <ctype.h>
#include <byteswap.h>
#include <ipxe/xfer.h>
#include <ipxe/open.h>
#include <ipxe/tcpip.h>
#include <ipxe/dhcp.h>
#include <ipxe/dhcpv6.h>
#include <ipxe/settings.h>
#include <ipxe/console.h>
#include <ipxe/lineconsole.h>
#include <ipxe/syslog.h>
#include <config/console.h>
Go to the source code of this file.
Macros | |
#define | CONSOLE_SYSLOG ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI ) |
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... | |
static void | syslog_handle_priority (struct ansiesc_context *ctx __unused, unsigned int count __unused, int params[]) |
Handle ANSI set syslog priority (private sequence) More... | |
static void | syslog_putchar (int character) |
Print a character to syslog console. More... | |
const struct setting syslog_setting | __setting (SETTING_MISC, syslog) |
IPv4 syslog server setting. More... | |
const struct setting syslog6_setting | __setting (SETTING_MISC, syslog6) |
IPv6 syslog server setting. More... | |
static void | syslog_fix_name (char *name) |
Strip invalid characters from host/domain name. More... | |
static int | apply_syslog_settings (void) |
Apply syslog settings. More... | |
Variables | |
union { | |
struct sockaddr sa | |
struct sockaddr_tcpip st | |
struct sockaddr_in sin | |
struct sockaddr_in6 sin6 | |
} | logserver |
The syslog server. More... | |
static struct interface_operation | syslogger_operations [] = {} |
Syslog UDP interface operations. More... | |
static struct interface_descriptor | syslogger_desc |
Syslog UDP interface descriptor. More... | |
static struct interface | syslogger = INTF_INIT ( syslogger_desc ) |
The syslog UDP interface. More... | |
static char * | syslog_hostname |
Host name (for log messages) More... | |
static char * | syslog_domain |
Domain name (for log messages) More... | |
static char | syslog_buffer [SYSLOG_BUFSIZE] |
Syslog line buffer. More... | |
static unsigned int | syslog_severity = SYSLOG_DEFAULT_SEVERITY |
Syslog severity. More... | |
static struct ansiesc_handler | syslog_handlers [] |
Syslog ANSI escape sequence handlers. More... | |
static struct line_console | syslog_line |
Syslog line console. More... | |
static int | syslog_entered |
Syslog recursion marker. More... | |
struct console_driver syslog_console | __console_driver |
Syslog console driver. More... | |
struct settings_applicator syslog_applicator | __settings_applicator |
Syslog settings applicator. More... | |
Syslog protocol.
Definition in file syslog.c.
#define CONSOLE_SYSLOG ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_TUI ) |
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.
xfer | Data transfer interface |
severity | Severity |
message | Message |
terminator | Message terminator |
rc | Return status code |
Definition at line 97 of file syslog.c.
References message, SYSLOG_DEFAULT_FACILITY, syslog_domain, syslog_hostname, SYSLOG_PRIORITY, terminator, and xfer_printf().
Referenced by syslog_putchar(), and syslogs_putchar().
|
static |
Handle ANSI set syslog priority (private sequence)
ctx | ANSI escape sequence context |
count | Parameter count |
params | List of graphic rendition aspects |
Definition at line 130 of file syslog.c.
References SYSLOG_DEFAULT_SEVERITY, and syslog_severity.
|
static |
Print a character to syslog console.
character | Character to be printed |
Definition at line 163 of file syslog.c.
References DBG, line_putchar(), rc, strerror(), syslog_buffer, syslog_entered, syslog_line, syslog_send(), syslog_severity, and syslogger.
const struct setting syslog_setting __setting | ( | SETTING_MISC | , |
syslog | |||
) |
IPv4 syslog server setting.
const struct setting syslog6_setting __setting | ( | SETTING_MISC | , |
syslog6 | |||
) |
IPv6 syslog server setting.
|
static |
|
static |
Apply syslog settings.
rc | Return status code |
Definition at line 246 of file syslog.c.
References AF_INET, AF_INET6, CONSOLE_DISABLED, DBG, fetch_ipv4_setting(), fetch_ipv6_setting(), fetch_string_setting_copy(), free, intf_restart(), logserver, memcmp(), memcpy(), NULL, rc, SOCK_DGRAM, sock_ntoa(), strerror(), syslog_domain, syslog_fix_name(), syslog_hostname, syslogger, and xfer_open_socket().
struct sockaddr sa |
Definition at line 55 of file syslog.c.
Referenced by apply_dns_settings(), comboot_resolv_done(), dns_resolv(), dns_send_packet(), efi_pxe_ip_sockaddr(), efi_pxe_udp_write(), fc_fill_sockaddr(), fetch_next_server_and_filename(), ftp_reply(), ib_create_path(), ib_create_service_madx(), ib_mcast_mad(), ipv4_sock_aton(), ipv4_sock_ntoa(), ipv6_sock_aton(), ipv6_sock_ntoa(), named_resolv_done(), nslookup_resolv_done(), numeric_resolv(), peerdisc_socket_tx(), pxe_tftp_open(), resolv(), resolv_done(), resolv_setting(), sock_aton(), sock_ntoa(), start_dhcpv6(), start_ntp(), tftp_process_multicast(), tkip_michael(), and x509_check_ipaddress().
u8 st |
Definition at line 56 of file syslog.c.
Referenced by arbel_create_cq(), arbel_create_eq(), dns_send_packet(), efi_pxe_udp_write(), hermon_create_cq(), hermon_create_eq(), ipv4_rx(), ipv6_rx(), peerdisc_socket_tx(), and start_ntp().
struct sockaddr_in sin |
Definition at line 57 of file syslog.c.
Referenced by apply_dns_settings(), comboot_resolv_done(), dns_send_packet(), fetch_next_server_and_filename(), ftp_reply(), ipv4_rx(), ipv4_sock_aton(), ipv4_sock_ntoa(), nslookup_resolv_done(), pxe_tftp_open(), tftp_process_multicast(), and x509_check_ipaddress().
struct sockaddr_in6 sin6 |
Definition at line 58 of file syslog.c.
Referenced by apply_dns_settings(), dns_send_packet(), ipv6_rx(), ipv6_sock_aton(), ipv6_sock_ntoa(), nslookup_resolv_done(), start_dhcpv6(), and x509_check_ipaddress().
union { ... } logserver |
The syslog server.
Referenced by apply_syslog_settings().
|
static |
|
static |
Syslog UDP interface descriptor.
|
static |
The syslog UDP interface.
Definition at line 73 of file syslog.c.
Referenced by apply_syslog_settings(), and syslog_putchar().
|
static |
Host name (for log messages)
Definition at line 83 of file syslog.c.
Referenced by apply_syslog_settings(), and syslog_send().
|
static |
Domain name (for log messages)
Definition at line 86 of file syslog.c.
Referenced by apply_syslog_settings(), and syslog_send().
|
static |
|
static |
Syslog severity.
Definition at line 121 of file syslog.c.
Referenced by syslog_handle_priority(), and syslog_putchar().
|
static |
Syslog ANSI escape sequence handlers.
|
static |
Syslog line console.
Definition at line 147 of file syslog.c.
Referenced by syslog_putchar().
|
static |
struct console_driver syslog_console __console_driver |
Syslog console driver.
struct settings_applicator syslog_applicator __settings_applicator |
Syslog settings applicator.