nrpe.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /************************************************************************
  2. *
  3. * NRPE.H - NRPE Include File
  4. * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
  5. * Last Modified: 11-23-2007
  6. *
  7. * License:
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. *
  23. ************************************************************************/
  24. /**************** COMMAND STRUCTURE DEFINITION **********/
  25. typedef struct command_struct{
  26. char *command_name;
  27. char *command_line;
  28. struct command_struct *next;
  29. }command;
  30. int process_arguments(int,char **);
  31. void wait_for_connections(void);
  32. void handle_connection(int);
  33. int read_config_file(char *);
  34. int read_config_dir(char *);
  35. int get_log_facility(char *);
  36. int add_command(char *,char *);
  37. command *find_command(char *);
  38. void sighandler(int);
  39. int drop_privileges(char *,char *);
  40. int check_privileges(void);
  41. int write_pid_file(void);
  42. int remove_pid_file(void);
  43. void free_memory(void);
  44. int is_an_allowed_host(char *);
  45. int validate_request(packet *);
  46. int contains_nasty_metachars(char *);
  47. int process_macros(char *,char *,int);
  48. int my_system(char *,int,int *,char *,int); /* executes a command via popen(), but also protects against timeouts */
  49. void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */
  50. void my_connection_sighandler(int); /* handles timeouts of connection */
  51. void sighandler(int);
  52. void child_sighandler(int);