xdata/xodtemplate.c File Reference

#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/locations.h"
#include "../include/macros.h"
#include "../include/skiplist.h"
#include "xodtemplate.h"

Defines

#define X_SERVICE_IS_FROM_HOSTGROUP   (1 << 1)
#define xodtemplate_set_service_is_from_hostgroup(srv)   srv->have_initial_state |= X_SERVICE_IS_FROM_HOSTGROUP
#define xodtemplate_unset_service_is_from_hostgroup(srv)   srv->have_initial_state &= ~X_SERVICE_IS_FROM_HOSTGROUP
#define xodtemplate_is_service_is_from_hostgroup(srv)   ((srv->have_initial_state & X_SERVICE_IS_FROM_HOSTGROUP) != 0)
#define xod_begin_def(type)

Functions

int xodtemplate_create_escalation_condition (char *, xodtemplate_escalation_condition *)
static char * xodtemplate_config_file_name (int config_file)
int xodtemplate_read_config_data (char *main_config_file, int options, int cache, int precache)
int xodtemplate_grab_config_info (char *main_config_file)
int xodtemplate_process_config_dir (char *dirname, int options)
int xodtemplate_process_config_file (char *filename, int options)
int xodtemplate_begin_object_definition (char *input, int options, int config_file, int start_line)
int xodtemplate_add_object_property (char *input, int options)
int xodtemplate_end_object_definition (int options)
xodtemplate_customvariablesmemberxodtemplate_add_custom_variable_to_host (xodtemplate_host *hst, char *varname, char *varvalue)
xodtemplate_customvariablesmemberxodtemplate_add_custom_variable_to_service (xodtemplate_service *svc, char *varname, char *varvalue)
xodtemplate_customvariablesmemberxodtemplate_add_custom_variable_to_contact (xodtemplate_contact *cntct, char *varname, char *varvalue)
xodtemplate_customvariablesmemberxodtemplate_add_custom_variable_to_object (xodtemplate_customvariablesmember **object_ptr, char *varname, char *varvalue)
int xodtemplate_parse_timeperiod_directive (xodtemplate_timeperiod *tperiod, char *var, char *val)
xodtemplate_daterangexodtemplate_add_exception_to_timeperiod (xodtemplate_timeperiod *period, int type, int syear, int smon, int smday, int swday, int swday_offset, int eyear, int emon, int emday, int ewday, int ewday_offset, int skip_interval, char *timeranges)
int xodtemplate_get_month_from_string (char *str, int *month)
int xodtemplate_get_weekday_from_string (char *str, int *weekday)
int xodtemplate_register_objects (void)
int xodtemplate_register_timeperiod (xodtemplate_timeperiod *this_timeperiod)
int xodtemplate_get_time_ranges (char *buf, unsigned long *range_start, unsigned long *range_end)
int xodtemplate_register_command (xodtemplate_command *this_command)
int xodtemplate_register_contactgroup (xodtemplate_contactgroup *this_contactgroup)
int xodtemplate_register_hostgroup (xodtemplate_hostgroup *this_hostgroup)
int xodtemplate_register_servicegroup (xodtemplate_servicegroup *this_servicegroup)
int xodtemplate_register_servicedependency (xodtemplate_servicedependency *this_servicedependency)
int xodtemplate_register_serviceescalation (xodtemplate_serviceescalation *this_serviceescalation)
int xodtemplate_register_contact (xodtemplate_contact *this_contact)
int xodtemplate_register_host (xodtemplate_host *this_host)
int xodtemplate_register_service (xodtemplate_service *this_service)
int xodtemplate_register_hostdependency (xodtemplate_hostdependency *this_hostdependency)
int xodtemplate_register_hostescalation (xodtemplate_hostescalation *this_hostescalation)
int xodtemplate_init_xobject_skiplists (void)
int xodtemplate_free_xobject_skiplists (void)
int xodtemplate_skiplist_compare_text (const char *val1a, const char *val1b, const char *val2a, const char *val2b)
int xodtemplate_skiplist_compare_host_template (void *a, void *b)
int xodtemplate_skiplist_compare_host (void *a, void *b)
int xodtemplate_skiplist_compare_service_template (void *a, void *b)
int xodtemplate_skiplist_compare_service (void *a, void *b)
int xodtemplate_skiplist_compare_timeperiod_template (void *a, void *b)
int xodtemplate_skiplist_compare_timeperiod (void *a, void *b)
int xodtemplate_skiplist_compare_command_template (void *a, void *b)
int xodtemplate_skiplist_compare_command (void *a, void *b)
int xodtemplate_skiplist_compare_contact_template (void *a, void *b)
int xodtemplate_skiplist_compare_contact (void *a, void *b)
int xodtemplate_skiplist_compare_contactgroup_template (void *a, void *b)
int xodtemplate_skiplist_compare_contactgroup (void *a, void *b)
int xodtemplate_skiplist_compare_hostgroup_template (void *a, void *b)
int xodtemplate_skiplist_compare_hostgroup (void *a, void *b)
int xodtemplate_skiplist_compare_servicegroup_template (void *a, void *b)
int xodtemplate_skiplist_compare_servicegroup (void *a, void *b)
int xodtemplate_skiplist_compare_hostdependency_template (void *a, void *b)
int xodtemplate_skiplist_compare_hostdependency (void *a, void *b)
int xodtemplate_skiplist_compare_servicedependency_template (void *a, void *b)
int xodtemplate_skiplist_compare_servicedependency (void *a, void *b)
int xodtemplate_skiplist_compare_hostescalation_template (void *a, void *b)
int xodtemplate_skiplist_compare_hostescalation (void *a, void *b)
int xodtemplate_skiplist_compare_serviceescalation_template (void *a, void *b)
int xodtemplate_skiplist_compare_serviceescalation (void *a, void *b)
int xodtemplate_skiplist_compare_hostextinfo_template (void *a, void *b)
int xodtemplate_skiplist_compare_serviceextinfo_template (void *a, void *b)
int xodtemplate_free_memory (void)

Variables

xodtemplate_timeperiodxodtemplate_timeperiod_list = NULL
xodtemplate_commandxodtemplate_command_list = NULL
xodtemplate_contactgroupxodtemplate_contactgroup_list = NULL
xodtemplate_hostgroupxodtemplate_hostgroup_list = NULL
xodtemplate_servicegroupxodtemplate_servicegroup_list = NULL
xodtemplate_servicedependencyxodtemplate_servicedependency_list = NULL
xodtemplate_serviceescalationxodtemplate_serviceescalation_list = NULL
xodtemplate_contactxodtemplate_contact_list = NULL
xodtemplate_hostxodtemplate_host_list = NULL
xodtemplate_servicexodtemplate_service_list = NULL
xodtemplate_hostdependencyxodtemplate_hostdependency_list = NULL
xodtemplate_hostescalationxodtemplate_hostescalation_list = NULL
xodtemplate_hostextinfoxodtemplate_hostextinfo_list = NULL
xodtemplate_serviceextinfoxodtemplate_serviceextinfo_list = NULL
xodtemplate_timeperiodxodtemplate_timeperiod_list_tail = NULL
xodtemplate_commandxodtemplate_command_list_tail = NULL
xodtemplate_contactgroupxodtemplate_contactgroup_list_tail = NULL
xodtemplate_hostgroupxodtemplate_hostgroup_list_tail = NULL
xodtemplate_servicegroupxodtemplate_servicegroup_list_tail = NULL
xodtemplate_servicedependencyxodtemplate_servicedependency_list_tail = NULL
xodtemplate_serviceescalationxodtemplate_serviceescalation_list_tail = NULL
xodtemplate_contactxodtemplate_contact_list_tail = NULL
xodtemplate_hostxodtemplate_host_list_tail = NULL
xodtemplate_servicexodtemplate_service_list_tail = NULL
xodtemplate_hostdependencyxodtemplate_hostdependency_list_tail = NULL
xodtemplate_hostescalationxodtemplate_hostescalation_list_tail = NULL
xodtemplate_hostextinfoxodtemplate_hostextinfo_list_tail = NULL
xodtemplate_serviceextinfoxodtemplate_serviceextinfo_list_tail = NULL
skiplistxobject_template_skiplists [NUM_XOBJECT_SKIPLISTS]
skiplistxobject_skiplists [NUM_XOBJECT_SKIPLISTS]
void * xodtemplate_current_object = NULL
int xodtemplate_current_object_type = XODTEMPLATE_NONE
int xodtemplate_current_config_file = 0
char ** xodtemplate_config_files = NULL
char * xodtemplate_cache_file = NULL
char * xodtemplate_precache_file = NULL
int presorted_objects = FALSE
int allow_empty_hostgroup_assignment

Define Documentation

#define X_SERVICE_IS_FROM_HOSTGROUP   (1 << 1)

#define xod_begin_def ( type   ) 

Value:

do { \
                new_##type = (xodtemplate_##type *)calloc(1, sizeof(*new_##type)); \
                if (new_##type == NULL) \
                        return ERROR; \
                new_##type->register_object=TRUE; \
                new_##type->_config_file=config_file; \
                new_##type->_start_line=start_line; \
        \
                /* precached object files are already sorted, so add to tail */ \
                if(presorted_objects==TRUE){ \
                        \
                        if(xodtemplate_##type##_list==NULL){ \
                                xodtemplate_##type##_list=new_##type; \
                                xodtemplate_##type##_list_tail=xodtemplate_##type##_list; \
                        } else { \
                                xodtemplate_##type##_list_tail->next=new_##type; \
                                xodtemplate_##type##_list_tail=new_##type; \
                        } \
        \
                        /* update current object pointer */ \
                        xodtemplate_current_object=xodtemplate_##type##_list_tail; \
                } else { \
                        /* add new object to head of list in memory */ \
                        new_##type->next=xodtemplate_##type##_list; \
                        xodtemplate_##type##_list=new_##type; \
        \
                        /* update current object pointer */ \
                        xodtemplate_current_object=xodtemplate_##type##_list; \
                } \
        } while (0)

#define xodtemplate_is_service_is_from_hostgroup ( srv   )     ((srv->have_initial_state & X_SERVICE_IS_FROM_HOSTGROUP) != 0)

#define xodtemplate_set_service_is_from_hostgroup ( srv   )     srv->have_initial_state |= X_SERVICE_IS_FROM_HOSTGROUP

#define xodtemplate_unset_service_is_from_hostgroup ( srv   )     srv->have_initial_state &= ~X_SERVICE_IS_FROM_HOSTGROUP


Function Documentation

xodtemplate_customvariablesmember* xodtemplate_add_custom_variable_to_contact ( xodtemplate_contact cntct,
char *  varname,
char *  varvalue 
)

xodtemplate_customvariablesmember* xodtemplate_add_custom_variable_to_host ( xodtemplate_host hst,
char *  varname,
char *  varvalue 
)

xodtemplate_customvariablesmember* xodtemplate_add_custom_variable_to_object ( xodtemplate_customvariablesmember **  object_ptr,
char *  varname,
char *  varvalue 
)

xodtemplate_customvariablesmember* xodtemplate_add_custom_variable_to_service ( xodtemplate_service svc,
char *  varname,
char *  varvalue 
)

xodtemplate_daterange* xodtemplate_add_exception_to_timeperiod ( xodtemplate_timeperiod period,
int  type,
int  syear,
int  smon,
int  smday,
int  swday,
int  swday_offset,
int  eyear,
int  emon,
int  emday,
int  ewday,
int  ewday_offset,
int  skip_interval,
char *  timeranges 
)

int xodtemplate_add_object_property ( char *  input,
int  options 
)

int xodtemplate_begin_object_definition ( char *  input,
int  options,
int  config_file,
int  start_line 
)

static char* xodtemplate_config_file_name ( int  config_file  )  [static]

int xodtemplate_create_escalation_condition ( char *  ,
xodtemplate_escalation_condition  
)

int xodtemplate_end_object_definition ( int  options  ) 

int xodtemplate_free_memory ( void   ) 

int xodtemplate_free_xobject_skiplists ( void   ) 

int xodtemplate_get_month_from_string ( char *  str,
int *  month 
)

int xodtemplate_get_time_ranges ( char *  buf,
unsigned long *  range_start,
unsigned long *  range_end 
)

int xodtemplate_get_weekday_from_string ( char *  str,
int *  weekday 
)

int xodtemplate_grab_config_info ( char *  main_config_file  ) 

int xodtemplate_init_xobject_skiplists ( void   ) 

int xodtemplate_parse_timeperiod_directive ( xodtemplate_timeperiod tperiod,
char *  var,
char *  val 
)

int xodtemplate_process_config_dir ( char *  dirname,
int  options 
)

int xodtemplate_process_config_file ( char *  filename,
int  options 
)

int xodtemplate_read_config_data ( char *  main_config_file,
int  options,
int  cache,
int  precache 
)

int xodtemplate_register_command ( xodtemplate_command this_command  ) 

int xodtemplate_register_contact ( xodtemplate_contact this_contact  ) 

int xodtemplate_register_contactgroup ( xodtemplate_contactgroup this_contactgroup  ) 

int xodtemplate_register_host ( xodtemplate_host this_host  ) 

int xodtemplate_register_hostdependency ( xodtemplate_hostdependency this_hostdependency  ) 

int xodtemplate_register_hostescalation ( xodtemplate_hostescalation this_hostescalation  ) 

int xodtemplate_register_hostgroup ( xodtemplate_hostgroup this_hostgroup  ) 

int xodtemplate_register_objects ( void   ) 

int xodtemplate_register_service ( xodtemplate_service this_service  ) 

int xodtemplate_register_servicedependency ( xodtemplate_servicedependency this_servicedependency  ) 

int xodtemplate_register_serviceescalation ( xodtemplate_serviceescalation this_serviceescalation  ) 

int xodtemplate_register_servicegroup ( xodtemplate_servicegroup this_servicegroup  ) 

int xodtemplate_register_timeperiod ( xodtemplate_timeperiod this_timeperiod  ) 

int xodtemplate_skiplist_compare_command ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_command_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_contact ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_contact_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_contactgroup ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_contactgroup_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_host ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_host_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostdependency ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostdependency_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostescalation ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostescalation_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostextinfo_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostgroup ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_hostgroup_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_service ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_service_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_servicedependency ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_servicedependency_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_serviceescalation ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_serviceescalation_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_serviceextinfo_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_servicegroup ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_servicegroup_template ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_text ( const char *  val1a,
const char *  val1b,
const char *  val2a,
const char *  val2b 
)

int xodtemplate_skiplist_compare_timeperiod ( void *  a,
void *  b 
)

int xodtemplate_skiplist_compare_timeperiod_template ( void *  a,
void *  b 
)


Variable Documentation

int allow_empty_hostgroup_assignment

int presorted_objects = FALSE

skiplist* xobject_skiplists[NUM_XOBJECT_SKIPLISTS]

skiplist* xobject_template_skiplists[NUM_XOBJECT_SKIPLISTS]

char* xodtemplate_cache_file = NULL

xodtemplate_command* xodtemplate_command_list = NULL

xodtemplate_command* xodtemplate_command_list_tail = NULL

char** xodtemplate_config_files = NULL

xodtemplate_contact* xodtemplate_contact_list = NULL

xodtemplate_contact* xodtemplate_contact_list_tail = NULL

xodtemplate_contactgroup* xodtemplate_contactgroup_list = NULL

xodtemplate_contactgroup* xodtemplate_contactgroup_list_tail = NULL

int xodtemplate_current_config_file = 0

void* xodtemplate_current_object = NULL

int xodtemplate_current_object_type = XODTEMPLATE_NONE

xodtemplate_host* xodtemplate_host_list = NULL

xodtemplate_host* xodtemplate_host_list_tail = NULL

xodtemplate_hostdependency* xodtemplate_hostdependency_list = NULL

xodtemplate_hostdependency* xodtemplate_hostdependency_list_tail = NULL

xodtemplate_hostescalation* xodtemplate_hostescalation_list = NULL

xodtemplate_hostescalation* xodtemplate_hostescalation_list_tail = NULL

xodtemplate_hostextinfo* xodtemplate_hostextinfo_list = NULL

xodtemplate_hostextinfo* xodtemplate_hostextinfo_list_tail = NULL

xodtemplate_hostgroup* xodtemplate_hostgroup_list = NULL

xodtemplate_hostgroup* xodtemplate_hostgroup_list_tail = NULL

char* xodtemplate_precache_file = NULL

xodtemplate_service* xodtemplate_service_list = NULL

xodtemplate_service* xodtemplate_service_list_tail = NULL

xodtemplate_servicedependency* xodtemplate_servicedependency_list = NULL

xodtemplate_servicedependency* xodtemplate_servicedependency_list_tail = NULL

xodtemplate_serviceescalation* xodtemplate_serviceescalation_list = NULL

xodtemplate_serviceescalation* xodtemplate_serviceescalation_list_tail = NULL

xodtemplate_serviceextinfo* xodtemplate_serviceextinfo_list = NULL

xodtemplate_serviceextinfo* xodtemplate_serviceextinfo_list_tail = NULL

xodtemplate_servicegroup* xodtemplate_servicegroup_list = NULL

xodtemplate_servicegroup* xodtemplate_servicegroup_list_tail = NULL

xodtemplate_timeperiod* xodtemplate_timeperiod_list = NULL

xodtemplate_timeperiod* xodtemplate_timeperiod_list_tail = NULL


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