/********************************************************************************************************************************/ /* Created: 9-FEB-2004 15:40:23 by OpenVMS SDL EV1-60 */ /* Source: 9-FEB-2004 15:40:17 DISK$SYSMAN:[LAISHEV.WORK.SYSLOG]SYSLOGDEF.SDL; */ /********************************************************************************************************************************/ /*** MODULE SYSLOGDEF IDENT SYSLOGDEF-1-X ***/ #ifndef __SYSLOGDEF_LOADED #define __SYSLOGDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /*++ */ /* 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: */ /* */ /* */ /*-- */ #define SLOG_PORT$K_PORT 514 #define SLOG_MSG$K_MAXSZ 1024 #define SLOG_PRIO$K_MAX 7 /* */ /**++ */ /** */ /** syslog Message Facilities */ /** */ /**-- */ /* */ #define SLOG_FAC$K_KERNEL 0 /* 0 kernel messages */ #define SLOG_FAC$K_USER 1 /* 1 user-level messages */ #define SLOG_FAC$K_MAIL 2 /* 2 mail system */ #define SLOG_FAC$K_SYSTEM 3 /* 3 system daemons */ #define SLOG_FAC$K_AUTH 4 /* 4 security/authorization messages (note 1) */ #define SLOG_FAC$K_INTRN 5 /* 5 messages generated internally by syslogd */ #define SLOG_FAC$K_LP 6 /* 6 line printer subsystem */ #define SLOG_FAC$K_NEWS 7 /* 7 network news subsystem */ #define SLOG_FAC$K_UUCP 8 /* 8 UUCP subsystem */ #define SLOG_FAC$K_CLOCK9 9 /* 9 clock daemon (note 2) */ #define SLOG_FAC$K_SECURITY 10 /* 10 security/authorization messages (note 1) */ #define SLOG_FAC$K_FTP 11 /* 11 FTP daemon */ #define SLOG_FAC$K_NTP 12 /* 12 NTP subsystem */ #define SLOG_FAC$K_AUDIT 13 /* 13 log audit (note 1) */ #define SLOG_FAC$K_ALERT 14 /* 14 log alert (note 1) */ #define SLOG_FAC$K_CLOCK15 15 /* 15 clock daemon (note 2) */ #define SLOG_FAC$K_LOCAL0 16 /* 16 local use 0 (local0) */ #define SLOG_FAC$K_LOCAL1 17 /* 17 local use 1 (local1) */ #define SLOG_FAC$K_LOCAL2 18 /* 18 local use 2 (local2) */ #define SLOG_FAC$K_LOCAL3 19 /* 19 local use 3 (local3) */ #define SLOG_FAC$K_LOCAL4 20 /* 20 local use 4 (local4) */ #define SLOG_FAC$K_LOCAL5 21 /* 21 local use 5 (local5) */ #define SLOG_FAC$K_LOCAL6 22 /* 22 local use 6 (local6) */ #define SLOG_FAC$K_LOCAL7 23 /* 23 local use 7 (local7) */ /* EQUALS 48 INCREMENT 1 PREFIX SLOG_FAC$; */ /* */ /**++ */ /** */ /** syslog Message Severities */ /** */ /**-- */ /* */ #define SLOG_SEV$K_EMERGENCY 0 /* 0 Emergency: system is unusable */ #define SLOG_SEV$K_ALERT 1 /* 1 Alert: action must be taken immediately */ #define SLOG_SEV$K_CRITICAL 2 /* 2 Critical: critical conditions */ #define SLOG_SEV$K_ERROR 3 /* 3 Error: error conditions */ #define SLOG_SEV$K_WARNING 4 /* 4 Warning: warning conditions */ #define SLOG_SEV$K_NOTICE 5 /* 5 Notice: normal but significant condition */ #define SLOG_SEV$K_INFO 6 /* 6 Informational: informational messages */ #define SLOG_SEV$K_DEBUG 7 /* 7 Debug: debug-level messages */ /* */ /**++ */ /** */ /** syslog Message Queue structure */ /** */ /**-- */ /* */ #ifdef __NEW_STARLET typedef struct _slog_msg { void *slog_msg$a_flink; void *slog_msg$a_blink; unsigned int slog_msg$l_dummy [4]; unsigned short int slog_msg$w_size; unsigned char slog_msg$b_data [1024]; } SLOG_MSG; #else /* __OLD_STARLET */ struct slog_msg { void *slog_msg$a_flink; void *slog_msg$a_blink; unsigned int slog_msg$l_dummy [4]; unsigned short int slog_msg$w_size; unsigned char slog_msg$b_data [1024]; } ; #endif /* #ifdef __NEW_STARLET */ #ifdef __NEW_STARLET typedef struct _slog_queue { void *slog_que$a_flink; void *slog_que$a_blink; unsigned int slog_que$l_dummy [4]; } SLOG_QUEUE; #else /* __OLD_STARLET */ struct slog_queue { void *slog_que$a_flink; void *slog_que$a_blink; unsigned int slog_que$l_dummy [4]; } ; #endif /* #ifdef __NEW_STARLET */ #ifdef __NEW_STARLET typedef struct _slog_ctx { unsigned int slog_ctx$l_raddr [4]; SLOG_QUEUE slog_ctx$r_queue [8]; } SLOG_CTX; #else /* __OLD_STARLET */ struct slog_ctx { unsigned int slog_ctx$l_raddr [4]; struct slog_queue slog_ctx$r_queue [8]; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** 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 address, INADDR structure */ /** port: a UDP port of the target host */ /** */ /** RETURN VALUE: */ /** */ /** VMS condition code */ /** */ /**-- */ /* */ #define syslog_init SYSLOG_INIT #ifdef __NEW_STARLET int syslog_init( void *(*(newctx)), void *host, unsigned short int port); #else /* __OLD_STARLET */ int syslog_init(__unknown_params); #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** FUNCTIONAL DESCRIPTION: */ /** */ /** Close network socket, release a momory allocated for the context. */ /** */ /** FORMAL PARAMETERS: */ /** */ /** ctx: a created context */ /** */ /** RETURN VALUE: */ /** */ /** VMS condition code */ /** */ /**-- */ /* */ #define syslog_shut SYSLOG_SHUT #ifdef __NEW_STARLET int syslog_shut( void *ctx); #else /* __OLD_STARLET */ int syslog_shut(__unknown_params); #endif /* #ifdef __NEW_STARLET */ /* */ /**++ */ /** 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 */ /** */ /**-- */ /* */ #define syslog_enq SYSLOG_ENQ #ifdef __NEW_STARLET int syslog_enq( void *ctx, unsigned short int fac, unsigned short int sev, void *timestamp, void *hostname, void *msg); #else /* __OLD_STARLET */ int syslog_enq(__unknown_params); #endif /* #ifdef __NEW_STARLET */ #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __SYSLOGDEF_LOADED */