nrpe.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /************************************************************************
  2. *
  3. * NRPE.H - NRPE Include File
  4. * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org)
  5. * Last Modified: 02-23-2006
  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 add_command(char *,char *);
  36. command *find_command(char *);
  37. void sighandler(int);
  38. int drop_privileges(char *,char *);
  39. int check_privileges(void);
  40. int write_pid_file(void);
  41. int remove_pid_file(void);
  42. void free_memory(void);
  43. int is_an_allowed_host(char *);
  44. int validate_request(packet *);
  45. int contains_nasty_metachars(char *);
  46. int process_macros(char *,char *,int);
  47. int my_system(char *,int,int *,char *,int); /* executes a command via popen(), but also protects against timeouts */
  48. void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */
  49. void my_connection_sighandler(int); /* handles timeouts of connection */
  50. void sighandler(int);
  51. void child_sighandler(int);