MODULE SYSLOGDEF IDENT "SYSLOGDEF-1-X"; /*++ /* Facility: /* RFC 3164 - The BSD Syslog Protocol /* /* Abstract: /* This protocol has been used for the transmission of event /* notification messages across networks for many years. While this /* protocol was originally developed on the University of California /* Berkeley Software Distribution (BSD) TCP/IP system implementations, /* its value to operations and management has led it to be ported to /* many other operating systems as well as being embedded into many /* other networked devices. /* See more in the : http://www.faqs.org/rfcs/rfc3164.html /* /* Author: /* Ruslan R. Laishev /* /* Creation Date: 4-FEB-2004 /* /* Modification History: /* /* /*-- CONSTANT port EQUALS 514 PREFIX SLOG_PORT$; CONSTANT maxsz EQUALS 1024 PREFIX SLOG_MSG$; CONSTANT max EQUALS 7 PREFIX SLOG_PRIO$; /* /**++ /** /** syslog Message Facilities /** /**-- /* CONSTANT ( KERNEL, /* 0 kernel messages USER, /* 1 user-level messages MAIL, /* 2 mail system SYSTEM, /* 3 system daemons AUTH, /* 4 security/authorization messages (note 1) INTRN, /* 5 messages generated internally by syslogd LP, /* 6 line printer subsystem NEWS, /* 7 network news subsystem UUCP, /* 8 UUCP subsystem CLOCK9, /* 9 clock daemon (note 2) SECURITY, /* 10 security/authorization messages (note 1) FTP, /* 11 FTP daemon NTP, /* 12 NTP subsystem AUDIT, /* 13 log audit (note 1) ALERT, /* 14 log alert (note 1) CLOCK15, /* 15 clock daemon (note 2) LOCAL0, /* 16 local use 0 (local0) LOCAL1, /* 17 local use 1 (local1) LOCAL2, /* 18 local use 2 (local2) LOCAL3, /* 19 local use 3 (local3) LOCAL4, /* 20 local use 4 (local4) LOCAL5, /* 21 local use 5 (local5) LOCAL6, /* 22 local use 6 (local6) LOCAL7 /* 23 local use 7 (local7) ) EQUALS 0 INCREMENT 1 PREFIX SLOG_FAC$; /* EQUALS 48 INCREMENT 1 PREFIX SLOG_FAC$; /* /**++ /** /** syslog Message Severities /** /**-- /* CONSTANT ( EMERGENCY, /* 0 Emergency: system is unusable ALERT, /* 1 Alert: action must be taken immediately CRITICAL, /* 2 Critical: critical conditions ERROR, /* 3 Error: error conditions WARNING, /* 4 Warning: warning conditions NOTICE, /* 5 Notice: normal but significant condition INFO, /* 6 Informational: informational messages DEBUG /* 7 Debug: debug-level messages ) EQUALS 0 INCREMENT 1 PREFIX SLOG_SEV$; /* /**++ /** /** syslog Message Queue structure /** /**-- /* AGGREGATE slog_msg STRUCTURE PREFIX SLOG_MSG$; flink ADDRESS; blink ADDRESS; dummy LONGWORD UNSIGNED DIMENSION 4 FILL; size WORD UNSIGNED; data BYTE UNSIGNED DIMENSION 1024; END slog_msg; AGGREGATE slog_queue STRUCTURE PREFIX SLOG_QUE$; flink ADDRESS; blink ADDRESS; dummy LONGWORD UNSIGNED DIMENSION 4 FILL; END slog_queue; AGGREGATE slog_ctx STRUCTURE PREFIX SLOG_CTX$; raddr LONGWORD UNSIGNED DIMENSION 4; queue slog_queue DIMENSION 8; END slog_ctx; /* /**++ /** FUNCTIONAL DESCRIPTION: /** /** Initialize SYSLOG API internal context, creates network socket, initialize /** internal queues. /** /** FORMAL PARAMETERS: /** /** newctx: a context to be created /** host: a host IP name/address, ASCIZ string /** port: a UDP port of the target host /** /** RETURN VALUE: /** /** VMS condition code /** /**-- /* ENTRY syslog_init ALIAS SYSLOG_INIT PARAMETER ( ADDRESS (ADDRESS) NAMED newctx OUT, ADDRESS NAMED host IN, WORD UNSIGNED VALUE NAMED port IN ) RETURNS LONGWORD; /* /**++ /** FUNCTIONAL DESCRIPTION: /** /** Close network socket, release a momory allocated for the context. /** /** FORMAL PARAMETERS: /** /** ctx: a created context /** /** RETURN VALUE: /** /** VMS condition code /** /**-- /* ENTRY syslog_shut ALIAS SYSLOG_SHUT PARAMETER ( ADDRESS NAMED ctx IN ) RETURNS LONGWORD; /* /**++ /** FUNCTIONAL DESCRIPTION: /** /** Enueue a new message to sent to a target SYSLOG Server/host to a /** corresponding internal queue according a priority/severity level. /** /** FORMAL PARAMETERS: /** /** ctx: a context to be created /** fac: a facility code, see SLOG_FAC$* constants /** sev: a severity level/priority , see SLOG_SEV$* constants /** timestamp: a timestamp, VMS binary format /** hostname: a host name or IP address, text string /** msg: a message itself, text string /** /** RETURN VALUE: /** /** VMS condition code /** /**-- /* ENTRY syslog_enq ALIAS SYSLOG_ENQ PARAMETER ( ADDRESS NAMED ctx IN, WORD UNSIGNED VALUE NAMED fac IN, WORD UNSIGNED VALUE NAMED sev IN, ADDRESS NAMED timestamp IN, CHARACTER DESCRIPTOR NAMED hostname IN, CHARACTER DESCRIPTOR NAMED msg IN ) RETURNS LONGWORD; END_MODULE SYSLOGDEF;