nrpe.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /************************************************************************
  2. *
  3. * NRPE.H - NRPE Include File
  4. * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
  5. * Last Modified: 08-10-2011 by Konstantin Malov
  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. /*
  25. * 08-10-2011 IPv4 subnetworks support added.
  26. * Main change in nrpe.c is that is_an_allowed_host() moved to acl.c
  27. *
  28. */
  29. /**************** COMMAND STRUCTURE DEFINITION **********/
  30. typedef struct command_struct{
  31. char *command_name;
  32. char *command_line;
  33. struct command_struct *next;
  34. }command;
  35. int process_arguments(int,char **);
  36. void wait_for_connections(void);
  37. void handle_connection(int);
  38. int read_config_file(char *);
  39. int read_config_dir(char *);
  40. int get_log_facility(char *);
  41. int add_command(char *,char *);
  42. command *find_command(char *);
  43. void sighandler(int);
  44. int drop_privileges(char *,char *);
  45. int check_privileges(void);
  46. int write_pid_file(void);
  47. int remove_pid_file(void);
  48. void free_memory(void);
  49. int validate_request(packet *);
  50. int contains_nasty_metachars(char *);
  51. int process_macros(char *,char *,int);
  52. int my_system(char *,int,int *,char *,int); /* executes a command via popen(), but also protects against timeouts */
  53. void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */
  54. void my_connection_sighandler(int); /* handles timeouts of connection */
  55. void sighandler(int);
  56. void child_sighandler(int);