nebmodules.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * NEBMODULES.H - Include file for event broker modules
00004  *
00005  * Copyright (c) 2002-2005 Ethan Galstad (nagios@nagios.org)
00006  * Last Modified:   12-17-2005
00007  *
00008  * License:
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License version 2 as
00012  * published by the Free Software Foundation.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022  *
00023  *****************************************************************************/
00024 
00025 #ifndef _NEBMODULES_H
00026 #define _NEBMODULES_H
00027 
00028 #ifdef __cplusplus
00029   extern "C" {
00030 #endif
00031 
00032 /***** MODULE VERSION INFORMATION *****/
00033 
00034 #define NEB_API_VERSION(x) int __neb_api_version = x;
00035 #define CURRENT_NEB_API_VERSION    2
00036 
00037 
00038 
00039 /***** MODULE INFORMATION *****/
00040 
00041 #define NEBMODULE_MODINFO_NUMITEMS  6
00042 #define NEBMODULE_MODINFO_TITLE     0
00043 #define NEBMODULE_MODINFO_AUTHOR    1
00044 #define NEBMODULE_MODINFO_COPYRIGHT 2
00045 #define NEBMODULE_MODINFO_VERSION   3
00046 #define NEBMODULE_MODINFO_LICENSE   4
00047 #define NEBMODULE_MODINFO_DESC      5
00048 
00049 
00050 
00051 /***** MODULE LOAD/UNLOAD OPTIONS *****/
00052 
00053 #define NEBMODULE_NORMAL_LOAD       0    /* module is being loaded normally */
00054 #define NEBMODULE_REQUEST_UNLOAD    0    /* request module to unload (but don't force it) */
00055 #define NEBMODULE_FORCE_UNLOAD      1    /* force module to unload */
00056 
00057 
00058 
00059 /***** MODULES UNLOAD REASONS *****/
00060 
00061 #define NEBMODULE_NEB_SHUTDOWN      1    /* event broker is shutting down */
00062 #define NEBMODULE_NEB_RESTART       2    /* event broker is restarting */
00063 #define NEBMODULE_ERROR_NO_INIT     3    /* _module_init() function was not found in module */
00064 #define NEBMODULE_ERROR_BAD_INIT    4    /* _module_init() function returned a bad code */
00065 #define NEBMODULE_ERROR_API_VERSION 5    /* module version is incompatible with current api */
00066 
00067 
00068 
00069 /***** MODULE STRUCTURES *****/
00070 
00071 /* NEB module structure */
00072 typedef struct nebmodule_struct{
00073    char            *filename;
00074    char            *args;
00075    char            *info[NEBMODULE_MODINFO_NUMITEMS];
00076    int             should_be_loaded;
00077    int             is_currently_loaded;
00078 #ifdef USE_LTDL
00079    lt_dlhandle     module_handle;
00080    lt_ptr          init_func;
00081    lt_ptr          deinit_func;
00082 #else
00083    void            *module_handle;
00084    void            *init_func;
00085    void            *deinit_func;
00086 #endif
00087 #ifdef HAVE_PTHREAD_H
00088    pthread_t       thread_id;
00089 #endif
00090    struct nebmodule_struct *next;
00091         }nebmodule;
00092 
00093 
00094 
00095 /***** MODULE FUNCTIONS *****/
00096 int neb_set_module_info(void *,int,char *);
00097 
00098 #ifdef __cplusplus
00099   }
00100 #endif
00101 
00102 #endif

Generated on Tue Apr 13 15:15:28 2010 for DNX by  doxygen 1.5.6