123 lines
5.5 KiB
C
123 lines
5.5 KiB
C
/* --------------------------------------------------------------------------- */
|
|
/* - EVMONAPI.H - */
|
|
/* --------------------------------------------------------------------------- */
|
|
/* */
|
|
/* Copyright 1992-1998 Silicon Graphics, Inc. */
|
|
/* All Rights Reserved. */
|
|
/* */
|
|
/* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; */
|
|
/* the contents of this file may not be disclosed to third parties, copied or */
|
|
/* duplicated in any form, in whole or in part, without the prior written */
|
|
/* permission of Silicon Graphics, Inc. */
|
|
/* */
|
|
/* RESTRICTED RIGHTS LEGEND: */
|
|
/* Use, duplication or disclosure by the Government is subject to restrictions */
|
|
/* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data */
|
|
/* and Computer Software clause at DFARS 252.227-7013, and/or in similar or */
|
|
/* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - */
|
|
/* rights reserved under the Copyright Laws of the United States. */
|
|
/* */
|
|
/* --------------------------------------------------------------------------- */
|
|
/* EventMon API is a set of functions for connecting to and communicating with */
|
|
/* EventMon demon. (EventMon demon is a system demon responsible for */
|
|
/* intercepting all system events messages from syslog demon, filtering and */
|
|
/* buffering them.) */
|
|
/* EventMon API functions use two named pipe, provided by EventMon demon, and */
|
|
/* internal commands for communication with EventMon demon. EventMon API uses */
|
|
/* reduced set of error codes in functions. */
|
|
/* --------------------------------------------------------------------------- */
|
|
/* $Revision: 1.1 $ */
|
|
#ifndef H_EVMONAPI_H
|
|
#define H_EVMONAPI_H
|
|
|
|
#ifdef _MSC_VER
|
|
#define EVMONAPI _cdecl
|
|
#endif
|
|
|
|
#ifndef EVMONAPI
|
|
#define EVMONAPI
|
|
#endif
|
|
|
|
#define EVMONAPI_MAXEVENTSIZE (1024*16) /* EventMon API max event message size
|
|
(sorry for this limitation, but you can increase
|
|
this value if you need more:), this is
|
|
middle ceiling value */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* ----------------------- emapiIsDaemonInstalled ---------------------------- */
|
|
/* Check file location of eventmonitor file - "eventmond" in /usr/etc directory.
|
|
(exist or not exist (to be or not to be:))
|
|
parameter(s):
|
|
none
|
|
return result(s):
|
|
!= 0 - daemon binary file exist, == 0 - file not found
|
|
note:
|
|
useful function for very accurate people and installation rountines.
|
|
*/
|
|
int EVMONAPI emapiIsDaemonInstalled();
|
|
typedef int EVMONAPI FPemapiIsDaemonInstalled();
|
|
|
|
/* ----------------------- emapiIsDaemonStarted ------------------------------ */
|
|
/* Check eventmonitor daemon started status.
|
|
parameter(s):
|
|
none
|
|
return result(s):
|
|
!= 0 - daemon started, == 0 - daemon not started
|
|
*/
|
|
int EVMONAPI emapiIsDaemonStarted();
|
|
typedef int EVMONAPI FPemapiIsDaemonStarted();
|
|
|
|
/*---------------------- emapiDeclareDaemonUnload ---------------------------- */
|
|
/* Declare daemon unload prcedure
|
|
parameter(s):
|
|
none
|
|
return result(s):
|
|
!= 0 - daemon unload procedure started,
|
|
== 0 - daemon unload procedure not started
|
|
note:
|
|
application(caller) must have root permissions
|
|
*/
|
|
int EVMONAPI emapiDeclareDaemonUnload();
|
|
typedef int EVMONAPI FPemapiDeclareDaemonUnload();
|
|
|
|
/* ------------------ emapiDeclareDaemonReloadConfig ------------------------- */
|
|
/* Declare 'start' daemon 'reload configuration info prcedure'
|
|
parameter(s):
|
|
none
|
|
return result(s):
|
|
!= 0 - daemon will start 'reload configuration info',
|
|
== 0 - can't start 'reload configuration info'
|
|
note:
|
|
a) application(caller) must have root permissions
|
|
b) really 'reload config info' can be very slow process, eventmod
|
|
used special thread for this process.
|
|
*/
|
|
int EVMONAPI emapiDeclareDaemonReloadConfig();
|
|
typedef int EVMONAPI FPemapiDeclareDaemonReloadConfig();
|
|
|
|
/* ------------------------ emapiSendEvent------------------------------------ */
|
|
/* Send event to eventmon daemon.
|
|
parameter(s):
|
|
char *hostname - host name from event coming (can be 0 for "localhost")
|
|
unsigned long time - the time value since 00:00:00 GMT, Jan. 1, 1970,
|
|
measured in seconds. If time equ 0 - not defined.
|
|
int etype - event type (message seq. number)
|
|
int epri - event priority/facility
|
|
char *eventbuffer - event message buffer (ASCIZ string)
|
|
return result(s):
|
|
!= 0 - event message sent successfuly, else some error
|
|
note:
|
|
this function used eventmonitor 'out of band' protocol agreements
|
|
*/
|
|
int EVMONAPI emapiSendEvent(char *hostname_from,unsigned long time,int etype,int epri,char *eventbuffer);
|
|
typedef int EVMONAPI FPemapiSendEvent(char *hostname_from,unsigned long time,int etype,int epri,char *eventbuffer);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* #ifndef H_EVMONAPI_H */
|
|
|