00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _CGIUTILS_H
00025 #define _CGIUTILS_H
00026
00027 #include "config.h"
00028 #include "logging.h"
00029 #include "objects.h"
00030 #include "cgiauth.h"
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036
00037
00038
00039 #define DEFAULT_REFRESH_RATE 60
00040
00041
00042
00043
00044 #define AVAIL_CGI "avail.cgi"
00045 #define CMD_CGI "cmd.cgi"
00046 #define CONFIG_CGI "config.cgi"
00047 #define EXTINFO_CGI "extinfo.cgi"
00048 #define HISTOGRAM_CGI "histogram.cgi"
00049 #define HISTORY_CGI "history.cgi"
00050 #define NOTIFICATIONS_CGI "notifications.cgi"
00051 #define OUTAGES_CGI "outages.cgi"
00052 #define SHOWLOG_CGI "showlog.cgi"
00053 #define STATUS_CGI "status.cgi"
00054 #define STATUSMAP_CGI "statusmap.cgi"
00055 #define STATUSWML_CGI "statuswml.cgi"
00056 #define STATUSWRL_CGI "statuswrl.cgi"
00057 #define SUMMARY_CGI "summary.cgi"
00058 #define TAC_CGI "tac.cgi"
00059 #define TRENDS_CGI "trends.cgi"
00060
00061
00062 #define TRACEROUTE_CGI "traceroute.cgi"
00063 #define CHECKSANITY_CGI "checksanity.cgi"
00064 #define MINISTATUS_CGI "ministatus.cgi"
00065
00066
00067
00068
00069 #define AVAIL_CGI_ID 1
00070 #define CMD_CGI_ID 2
00071 #define CONFIG_CGI_ID 3
00072 #define EXTINFO_CGI_ID 4
00073 #define HISTOGRAM_CGI_ID 5
00074 #define HISTORY_CGI_ID 6
00075 #define NOTIFICATIONS_CGI_ID 7
00076 #define OUTAGES_CGI_ID 8
00077 #define SHOWLOG_CGI_ID 9
00078 #define STATUS_CGI_ID 10
00079 #define STATUSMAP_CGI_ID 11
00080 #define STATUSWML_CGI_ID 12
00081 #define STATUSWRL_CGI_ID 13
00082 #define SUMMARY_CGI_ID 14
00083 #define TAC_CGI_ID 15
00084 #define TRENDS_CGI_ID 16
00085
00086
00087 #define TRACEROUTE_CGI_ID 17
00088 #define CHECKSANITY_CGI_ID 18
00089 #define MINISTATUS_CGI_ID 19
00090
00091
00092 #define ERROR_CGI_ID 20
00093
00094
00095
00096
00097 #define ERROR_CGI_STATUS_DATA 1
00098 #define ERROR_CGI_OBJECT_DATA 2
00099 #define ERROR_CGI_CFG_FILE 3
00100 #define ERROR_CGI_MAIN_CFG 4
00101
00102
00103
00104
00105 #define COMMON_CSS "common.css"
00106 #define JQUERY_DD_CSS "dd.css"
00107
00108 #define AVAIL_CSS "avail.css"
00109 #define CMD_CSS "cmd.css"
00110 #define CONFIG_CSS "config.css"
00111 #define EXTINFO_CSS "extinfo.css"
00112 #define HISTOGRAM_CSS "histogram.css"
00113 #define HISTORY_CSS "history.css"
00114 #define NOTIFICATIONS_CSS "notifications.css"
00115 #define OUTAGES_CSS "outages.css"
00116 #define SHOWLOG_CSS "showlog.css"
00117 #define STATUS_CSS "status.css"
00118 #define STATUSMAP_CSS "statusmap.css"
00119 #define SUMMARY_CSS "summary.css"
00120 #define TAC_CSS "tac.css"
00121 #define TRENDS_CSS "trends.css"
00122
00123
00124 #define CHECKSANITY_CSS "checksanity.css"
00125 #define MINISTATUS_CSS "ministatus.css"
00126
00127
00128
00129
00130 #define CHECKBOX_FUNCTIONS_JS "checkbox_functions.js"
00131 #define JQUERY_MAIN_JS "jquery-1.4.2.min.js"
00132 #define JQUERY_DD_JS "jquery.dd.js"
00133 #define SKINNYTIP_JS "skinnytip.js"
00134
00135
00136
00137
00138 #define STATUS_ICON_WIDTH 20
00139 #define STATUS_ICON_HEIGHT 20
00140
00141 #define INFO_ICON "info.png"
00142 #define INFO_ICON_ALT "Informational Message"
00143 #define START_ICON "start.gif"
00144 #define START_ICON_ALT "Program Start"
00145 #define STOP_ICON "stop.gif"
00146 #define STOP_ICON_ALT "Program End"
00147 #define RESTART_ICON "restart.gif"
00148 #define RESTART_ICON_ALT "Program Restart"
00149 #define OK_ICON "recovery.png"
00150 #define OK_ICON_ALT "Service Ok"
00151 #define CRITICAL_ICON "critical.png"
00152 #define CRITICAL_ICON_ALT "Service Critical"
00153 #define WARNING_ICON "warning.png"
00154 #define WARNING_ICON_ALT "Service Warning"
00155 #define UNKNOWN_ICON "unknown.png"
00156 #define UNKNOWN_ICON_ALT "Service Unknown"
00157 #define NOTIFICATION_ICON "notify.gif"
00158 #define NOTIFICATION_ICON_ALT "Service Notification"
00159 #define LOG_ROTATION_ICON "logrotate.png"
00160 #define LOG_ROTATION_ICON_ALT "Log Rotation"
00161 #define EXTERNAL_COMMAND_ICON "command.png"
00162 #define EXTERNAL_COMMAND_ICON_ALT "External Command"
00163
00164 #define STATUS_DETAIL_ICON "status2.gif"
00165 #define STATUS_OVERVIEW_ICON "status.gif"
00166 #define STATUSMAP_ICON "status3.gif"
00167 #define STATUSWORLD_ICON "status4.gif"
00168 #define EXTINFO_ICON "extinfo.gif"
00169 #define HISTORY_ICON "history.gif"
00170 #define CONTACTGROUP_ICON "contactgroup.gif"
00171 #define TRENDS_ICON "trends.gif"
00172 #define COLLAPSE_ICON "icon_collapse.gif"
00173 #define EXPAND_ICON "icon_expand.gif"
00174
00175 #define DISABLED_ICON "disabled.gif"
00176 #define ENABLED_ICON "enabled.gif"
00177 #define PASSIVE_ONLY_ICON "passiveonly.gif"
00178 #define NOTIFICATIONS_DISABLED_ICON "ndisabled.gif"
00179 #define ACKNOWLEDGEMENT_ICON "ack.gif"
00180 #define REMOVE_ACKNOWLEDGEMENT_ICON "noack.gif"
00181 #define COMMENT_ICON "comment.gif"
00182 #define DELETE_ICON "delete.gif"
00183 #define DELAY_ICON "delay.gif"
00184 #define DOWNTIME_ICON "downtime.gif"
00185 #define PASSIVE_ICON "passiveonly.gif"
00186 #define RIGHT_ARROW_ICON "right.gif"
00187 #define LEFT_ARROW_ICON "left.gif"
00188 #define UP_ARROW_ICON "up.gif"
00189 #define DOWN_ARROW_ICON "down.gif"
00190 #define FLAPPING_ICON "flapping.gif"
00191 #define SCHEDULED_DOWNTIME_ICON "downtime.gif"
00192 #define EMPTY_ICON "empty.gif"
00193 #define CMD_STOP_ICON "cmd_stop.png"
00194
00195 #define ACTIVE_ICON "active.gif"
00196 #define ACTIVE_ICON_ALT "Active Mode"
00197 #define STANDBY_ICON "standby.gif"
00198 #define STANDBY_ICON_ALT "Standby Mode"
00199
00200 #define HOST_DOWN_ICON "critical.png"
00201 #define HOST_DOWN_ICON_ALT "Host Down"
00202 #define HOST_UNREACHABLE_ICON "critical.png"
00203 #define HOST_UNREACHABLE_ICON_ALT "Host Unreachable"
00204 #define HOST_UP_ICON "recovery.png"
00205 #define HOST_UP_ICON_ALT "Host Up"
00206 #define HOST_NOTIFICATION_ICON "notify.gif"
00207 #define HOST_NOTIFICATION_ICON_ALT "Host Notification"
00208
00209 #define SERVICE_EVENT_ICON "serviceevent.gif"
00210 #define SERVICE_EVENT_ICON_ALT "Service Event Handler"
00211 #define HOST_EVENT_ICON "hostevent.gif"
00212 #define HOST_EVENT_ICON_ALT "Host Event Handler"
00213
00214 #define THERM_OK_IMAGE "thermok.png"
00215 #define THERM_WARNING_IMAGE "thermwarn.png"
00216 #define THERM_CRITICAL_IMAGE "thermcrit.png"
00217
00218 #define CONFIGURATION_ICON "config.gif"
00219 #define NOTES_ICON "notes.gif"
00220 #define ACTION_ICON "action.gif"
00221 #define DETAIL_ICON "detail.gif"
00222
00223 #define PARENT_TRAVERSAL_ICON "parentup.gif"
00224
00225 #define TAC_DISABLED_ICON "tacdisabled.png"
00226 #define TAC_ENABLED_ICON "tacenabled.png"
00227
00228 #define ZOOM1_ICON "zoom1.gif"
00229 #define ZOOM2_ICON "zoom2.gif"
00230
00231 #define CONTEXT_HELP_ICON1 "contexthelp1.gif"
00232 #define CONTEXT_HELP_ICON2 "contexthelp2.gif"
00233
00234 #define SPLUNK_SMALL_WHITE_ICON "splunk1.gif"
00235 #define SPLUNK_SMALL_BLACK_ICON "splunk2.gif"
00236
00237
00238
00239
00240 #define STATE_OK 0
00241 #define STATE_WARNING 1
00242 #define STATE_CRITICAL 2
00243 #define STATE_UNKNOWN 3
00244
00245
00246
00247
00248 #define DISPLAY_PROCESS_INFO 0
00249 #define DISPLAY_HOST_INFO 1
00250 #define DISPLAY_SERVICE_INFO 2
00251 #define DISPLAY_COMMENTS 3
00252 #define DISPLAY_PERFORMANCE 4
00253 #define DISPLAY_HOSTGROUP_INFO 5
00254 #define DISPLAY_DOWNTIME 6
00255 #define DISPLAY_SCHEDULING_QUEUE 7
00256 #define DISPLAY_SERVICEGROUP_INFO 8
00257
00258
00259
00260
00261 #define CMDMODE_NONE 0
00262 #define CMDMODE_REQUEST 1
00263 #define CMDMODE_COMMIT 2
00264
00265
00266
00267 #define HTML_CONTENT 0
00268 #define WML_CONTENT 1
00269 #define IMAGE_CONTENT 2
00270 #define CSV_CONTENT 3
00271
00272
00273
00274 #define CSV_DELIMITER ";"
00275 #define CSV_DATA_ENCLOSURE "'"
00276
00277
00278
00279
00280 #define NOTIFICATION_ALL 0
00281 #define NOTIFICATION_SERVICE_ALL 1
00282 #define NOTIFICATION_HOST_ALL 2
00283 #define NOTIFICATION_SERVICE_WARNING 4
00284 #define NOTIFICATION_SERVICE_UNKNOWN 8
00285 #define NOTIFICATION_SERVICE_CRITICAL 16
00286 #define NOTIFICATION_SERVICE_RECOVERY 32
00287 #define NOTIFICATION_HOST_DOWN 64
00288 #define NOTIFICATION_HOST_UNREACHABLE 128
00289 #define NOTIFICATION_HOST_RECOVERY 256
00290 #define NOTIFICATION_SERVICE_ACK 512
00291 #define NOTIFICATION_HOST_ACK 1024
00292 #define NOTIFICATION_SERVICE_FLAP 2048
00293 #define NOTIFICATION_HOST_FLAP 4096
00294 #define NOTIFICATION_SERVICE_CUSTOM 8192
00295 #define NOTIFICATION_HOST_CUSTOM 16384
00296
00297
00298
00299
00300 #define HISTORY_ALL 0
00301 #define HISTORY_SERVICE_ALL 1
00302 #define HISTORY_HOST_ALL 2
00303 #define HISTORY_SERVICE_WARNING 4
00304 #define HISTORY_SERVICE_UNKNOWN 8
00305 #define HISTORY_SERVICE_CRITICAL 16
00306 #define HISTORY_SERVICE_RECOVERY 32
00307 #define HISTORY_HOST_DOWN 64
00308 #define HISTORY_HOST_UNREACHABLE 128
00309 #define HISTORY_HOST_RECOVERY 256
00310
00311
00312
00313
00314 #define SORT_NONE 0
00315 #define SORT_ASCENDING 1
00316 #define SORT_DESCENDING 2
00317
00318
00319
00320
00321 #define SORT_NOTHING 0
00322 #define SORT_HOSTNAME 1
00323 #define SORT_SERVICENAME 2
00324 #define SORT_SERVICESTATUS 3
00325 #define SORT_LASTCHECKTIME 4
00326 #define SORT_CURRENTATTEMPT 5
00327 #define SORT_STATEDURATION 6
00328 #define SORT_NEXTCHECKTIME 7
00329 #define SORT_HOSTSTATUS 8
00330
00331
00332
00333
00334 #define HOST_SCHEDULED_DOWNTIME 1
00335 #define HOST_NO_SCHEDULED_DOWNTIME 2
00336 #define HOST_STATE_ACKNOWLEDGED 4
00337 #define HOST_STATE_UNACKNOWLEDGED 8
00338 #define HOST_CHECKS_DISABLED 16
00339 #define HOST_CHECKS_ENABLED 32
00340 #define HOST_EVENT_HANDLER_DISABLED 64
00341 #define HOST_EVENT_HANDLER_ENABLED 128
00342 #define HOST_FLAP_DETECTION_DISABLED 256
00343 #define HOST_FLAP_DETECTION_ENABLED 512
00344 #define HOST_IS_FLAPPING 1024
00345 #define HOST_IS_NOT_FLAPPING 2048
00346 #define HOST_NOTIFICATIONS_DISABLED 4096
00347 #define HOST_NOTIFICATIONS_ENABLED 8192
00348 #define HOST_PASSIVE_CHECKS_DISABLED 16384
00349 #define HOST_PASSIVE_CHECKS_ENABLED 32768
00350 #define HOST_PASSIVE_CHECK 65536
00351 #define HOST_ACTIVE_CHECK 131072
00352 #define HOST_HARD_STATE 262144
00353 #define HOST_SOFT_STATE 524288
00354
00355
00356 #define SERVICE_SCHEDULED_DOWNTIME 1
00357 #define SERVICE_NO_SCHEDULED_DOWNTIME 2
00358 #define SERVICE_STATE_ACKNOWLEDGED 4
00359 #define SERVICE_STATE_UNACKNOWLEDGED 8
00360 #define SERVICE_CHECKS_DISABLED 16
00361 #define SERVICE_CHECKS_ENABLED 32
00362 #define SERVICE_EVENT_HANDLER_DISABLED 64
00363 #define SERVICE_EVENT_HANDLER_ENABLED 128
00364 #define SERVICE_FLAP_DETECTION_ENABLED 256
00365 #define SERVICE_FLAP_DETECTION_DISABLED 512
00366 #define SERVICE_IS_FLAPPING 1024
00367 #define SERVICE_IS_NOT_FLAPPING 2048
00368 #define SERVICE_NOTIFICATIONS_DISABLED 4096
00369 #define SERVICE_NOTIFICATIONS_ENABLED 8192
00370 #define SERVICE_PASSIVE_CHECKS_DISABLED 16384
00371 #define SERVICE_PASSIVE_CHECKS_ENABLED 32768
00372 #define SERVICE_PASSIVE_CHECK 65536
00373 #define SERVICE_ACTIVE_CHECK 131072
00374 #define SERVICE_HARD_STATE 262144
00375 #define SERVICE_SOFT_STATE 524288
00376
00377
00378
00379
00380 #define SSI_HEADER 0
00381 #define SSI_FOOTER 1
00382
00383
00384
00385
00386 #define CONTEXTHELP_STATUS_DETAIL "A1"
00387 #define CONTEXTHELP_STATUS_HGOVERVIEW "A2"
00388 #define CONTEXTHELP_STATUS_HGSUMMARY "A3"
00389 #define CONTEXTHELP_STATUS_HGGRID "A4"
00390 #define CONTEXTHELP_STATUS_SVCPROBLEMS "A5"
00391 #define CONTEXTHELP_STATUS_HOST_DETAIL "A6"
00392 #define CONTEXTHELP_STATUS_HOSTPROBLEMS "A7"
00393 #define CONTEXTHELP_STATUS_SGOVERVIEW "A8"
00394 #define CONTEXTHELP_STATUS_SGSUMMARY "A9"
00395 #define CONTEXTHELP_STATUS_SGGRID "A10"
00396
00397 #define CONTEXTHELP_TAC "B1"
00398
00399 #define CONTEXTHELP_MAP "C1"
00400
00401 #define CONTEXTHELP_LOG "D1"
00402
00403 #define CONTEXTHELP_HISTORY "E1"
00404
00405 #define CONTEXTHELP_NOTIFICATIONS "F1"
00406
00407 #define CONTEXTHELP_TRENDS_MENU1 "G1"
00408 #define CONTEXTHELP_TRENDS_MENU2 "G2"
00409 #define CONTEXTHELP_TRENDS_MENU3 "G3"
00410 #define CONTEXTHELP_TRENDS_MENU4 "G4"
00411 #define CONTEXTHELP_TRENDS_HOST "G5"
00412 #define CONTEXTHELP_TRENDS_SERVICE "G6"
00413
00414 #define CONTEXTHELP_AVAIL_MENU1 "H1"
00415 #define CONTEXTHELP_AVAIL_MENU2 "H2"
00416 #define CONTEXTHELP_AVAIL_MENU3 "H3"
00417 #define CONTEXTHELP_AVAIL_MENU4 "H4"
00418 #define CONTEXTHELP_AVAIL_MENU5 "H5"
00419 #define CONTEXTHELP_AVAIL_HOSTGROUP "H6"
00420 #define CONTEXTHELP_AVAIL_HOST "H7"
00421 #define CONTEXTHELP_AVAIL_SERVICE "H8"
00422 #define CONTEXTHELP_AVAIL_SERVICEGROUP "H9"
00423
00424 #define CONTEXTHELP_EXT_HOST "I1"
00425 #define CONTEXTHELP_EXT_SERVICE "I2"
00426 #define CONTEXTHELP_EXT_HOSTGROUP "I3"
00427 #define CONTEXTHELP_EXT_PROCESS "I4"
00428 #define CONTEXTHELP_EXT_PERFORMANCE "I5"
00429 #define CONTEXTHELP_EXT_COMMENTS "I6"
00430 #define CONTEXTHELP_EXT_DOWNTIME "I7"
00431 #define CONTEXTHELP_EXT_QUEUE "I8"
00432 #define CONTEXTHELP_EXT_SERVICEGROUP "I9"
00433
00434 #define CONTEXTHELP_CMD_INPUT "J1"
00435 #define CONTEXTHELP_CMD_COMMIT "J2"
00436
00437 #define CONTEXTHELP_OUTAGES "K1"
00438
00439 #define CONTEXTHELP_CONFIG_MENU "L1"
00440 #define CONTEXTHELP_CONFIG_HOSTS "L2"
00441 #define CONTEXTHELP_CONFIG_HOSTDEPENDENCIES "L3"
00442 #define CONTEXTHELP_CONFIG_HOSTESCALATIONS "L4"
00443 #define CONTEXTHELP_CONFIG_HOSTGROUPS "L5"
00444 #define CONTEXTHELP_CONFIG_HOSTGROUPESCALATIONS "L6"
00445 #define CONTEXTHELP_CONFIG_SERVICES "L7"
00446 #define CONTEXTHELP_CONFIG_SERVICEDEPENDENCIES "L8"
00447 #define CONTEXTHELP_CONFIG_SERVICEESCALATIONS "L9"
00448 #define CONTEXTHELP_CONFIG_CONTACTS "L10"
00449 #define CONTEXTHELP_CONFIG_CONTACTGROUPS "L11"
00450 #define CONTEXTHELP_CONFIG_TIMEPERIODS "L12"
00451 #define CONTEXTHELP_CONFIG_COMMANDS "L13"
00452 #define CONTEXTHELP_CONFIG_HOSTEXTINFO "L14"
00453 #define CONTEXTHELP_CONFIG_SERVICEEXTINFO "L15"
00454 #define CONTEXTHELP_CONFIG_SERVICEGROUPS "L16"
00455
00456 #define CONTEXTHELP_HISTOGRAM_MENU1 "M1"
00457 #define CONTEXTHELP_HISTOGRAM_MENU2 "M2"
00458 #define CONTEXTHELP_HISTOGRAM_MENU3 "M3"
00459 #define CONTEXTHELP_HISTOGRAM_MENU4 "M4"
00460 #define CONTEXTHELP_HISTOGRAM_HOST "M5"
00461 #define CONTEXTHELP_HISTOGRAM_SERVICE "M6"
00462
00463 #define CONTEXTHELP_SUMMARY_MENU "N1"
00464 #define CONTEXTHELP_SUMMARY_RECENT_ALERTS "N2"
00465 #define CONTEXTHELP_SUMMARY_ALERT_TOTALS "N3"
00466 #define CONTEXTHELP_SUMMARY_HOSTGROUP_ALERT_TOTALS "N4"
00467 #define CONTEXTHELP_SUMMARY_HOST_ALERT_TOTALS "N5"
00468 #define CONTEXTHELP_SUMMARY_SERVICE_ALERT_TOTALS "N6"
00469 #define CONTEXTHELP_SUMMARY_ALERT_PRODUCERS "N7"
00470 #define CONTEXTHELP_SUMMARY_SERVICEGROUP_ALERT_TOTALS "N8"
00471
00472
00473
00474
00475 #define LIFO_OK 0
00476 #define LIFO_ERROR_MEMORY 1
00477 #define LIFO_ERROR_FILE 2
00478 #define LIFO_ERROR_DATA 3
00479
00480
00481
00482
00483 #define DEFAULT_HTTP_CHARSET "utf-8"
00484
00485
00486
00487
00488 #define MAX_MESSAGE_BUFFER 4096
00489
00490
00491
00492
00493 #define DISPLAY_NONE -1
00494 #define DISPLAY_HOSTS 0
00495 #define DISPLAY_HOSTGROUPS 1
00496 #define DISPLAY_SERVICEGROUPS 2
00497 #define DISPLAY_CONTACTS 3
00498 #define DISPLAY_CONTACTGROUPS 4
00499 #define DISPLAY_SERVICES 5
00500 #define DISPLAY_TIMEPERIODS 6
00501 #define DISPLAY_COMMANDS 7
00502 #define DISPLAY_HOSTGROUPESCALATIONS 8
00503 #define DISPLAY_SERVICEDEPENDENCIES 9
00504 #define DISPLAY_SERVICEESCALATIONS 10
00505 #define DISPLAY_HOSTDEPENDENCIES 11
00506 #define DISPLAY_HOSTESCALATIONS 12
00507 #define DISPLAY_COMMAND_EXPANSION 16211
00508
00509 #define STYLE_OVERVIEW 0
00510 #define STYLE_DETAIL 1
00511 #define STYLE_SUMMARY 2
00512 #define STYLE_GRID 3
00513 #define STYLE_HOST_DETAIL 4
00514
00515
00516
00517 #define SERVICE_HISTORY 0
00518 #define HOST_HISTORY 1
00519 #define SERVICE_FLAPPING_HISTORY 2
00520 #define HOST_FLAPPING_HISTORY 3
00521 #define SERVICE_DOWNTIME_HISTORY 4
00522 #define HOST_DOWNTIME_HISTORY 5
00523
00524
00525
00526 #define STATE_ALL 0
00527 #define STATE_SOFT 1
00528 #define STATE_HARD 2
00529
00530
00531
00532
00533
00534
00535 typedef struct lifo_struct{
00536 char *data;
00537 struct lifo_struct *next;
00538 }lifo;
00539
00540
00541
00542
00543 void reset_cgi_vars(void);
00544 void free_memory(void);
00545
00546 char * get_cgi_config_location(void);
00547 char * get_cmd_file_location(void);
00548
00549 int read_cgi_config_file(char *);
00550 int read_main_config_file(char *);
00551 int read_all_object_configuration_data(char *,int);
00552 int read_all_status_data(char *,int);
00553
00554 char *unescape_newlines(char *);
00555 char *escape_newlines(char *);
00556 void sanitize_plugin_output(char *);
00557 void strip_html_brackets(char *);
00558
00559 void get_time_string(time_t *,char *,int,int);
00560 void get_interval_time_string(double,char *,int);
00561
00562 char * url_encode(char *);
00563 char * html_encode(char *,int);
00564 char * escape_string(char *);
00565
00566 void get_log_archive_to_use(int,char *,int);
00567 void determine_log_rotation_times(int);
00568 int determine_archive_to_use_from_time(time_t);
00569
00570 void print_extra_hostgroup_url(char *,char *);
00571 void print_extra_servicegroup_url(char *,char *);
00572
00573 void display_info_table(char *,int,authdata *, int);
00574 void display_nav_table(char *,int);
00575
00576 void display_splunk_host_url(host *);
00577 void display_splunk_service_url(service *);
00578 void display_splunk_generic_url(char *,int);
00579 void strip_splunk_query_terms(char *);
00580
00581 void include_ssi_files(char *,int);
00582 void include_ssi_file(char *);
00583
00584 void cgi_config_file_error(char *);
00585 void main_config_file_error(char *);
00586 void object_data_error(void);
00587 void status_data_error(void);
00588 void print_error(char*, int);
00589
00590 void display_context_help(char *);
00591
00592 int read_file_into_lifo(char *);
00593 void free_lifo_memory(void);
00594 int push_lifo(char *);
00595 char *pop_lifo(void);
00596
00597 void document_header(int,int);
00598 void document_footer(int);
00599
00600 void write_popup_code(int);
00601 int check_daemon_running(void);
00602
00603 void print_generic_error_message(char *, char *, int);
00604
00605 char *get_export_csv_link(char *);
00606
00607
00608
00609 #ifndef DISABLE_MULTIURL
00610
00611 #define MU_PATCH_ID "+MU"
00612
00613 int MU_lasturl, MU_thisurl;
00614 char MU_iconstr[16], *MU_origstr, *MU_ptr;
00615
00616
00617
00618 #define BEGIN_MULTIURL_LOOP \
00619 MU_lasturl=0; MU_iconstr[0]='\0'; \
00620 for (MU_origstr=MU_ptr=processed_string; (*MU_ptr)!='\0'; ) { \
00621 MU_thisurl=MU_lasturl; \
00622 for (;isspace(*MU_ptr);MU_ptr++) ; \
00623 for (;(*MU_ptr)=='\'';MU_ptr++) MU_thisurl=MU_lasturl+1; \
00624 if (MU_thisurl>MU_lasturl) { \
00625 sprintf(MU_iconstr,"%u-",MU_thisurl); \
00626 processed_string=MU_ptr; \
00627 for (;((*MU_ptr)!='\0')&&((*MU_ptr)!='\'');MU_ptr++) ; \
00628 if ((*MU_ptr)=='\'') { (*MU_ptr)='\0'; MU_ptr++; \
00629 for (;isspace(*MU_ptr);MU_ptr++) ; } \
00630 } else { \
00631 MU_iconstr[0]='\0'; MU_ptr=""; \
00632 }
00633
00634
00635
00636 #define END_MULTIURL_LOOP \
00637 MU_lasturl=MU_thisurl; processed_string=MU_ptr; \
00638 } \
00639 processed_string=MU_origstr;
00640
00641
00642
00643 #else
00644
00645 #define MU_PATCH_ID ""
00646 char *MU_iconstr="";
00647
00648 #endif
00649
00650
00651
00652 #ifdef __cplusplus
00653 }
00654 #endif
00655
00656 #endif
00657