include/nebmodules.h

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

Generated on Wed Mar 30 17:22:22 2011 for icinga-core by  doxygen 1.4.7