nrpe.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /**************** 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 init(void);
  31. void init_ssl(void);
  32. void log_ssl_startup(void);
  33. void usage(int);
  34. void run_inetd(void);
  35. void run_src(void);
  36. void run_daemon(void);
  37. void set_stdio_sigs(void);
  38. void cleanup(void);
  39. int read_config_file(char *);
  40. int read_config_dir(char *);
  41. int get_log_facility(char *);
  42. int add_command(char *,char *);
  43. command *find_command(char *);
  44. void create_listener(struct addrinfo *ai);
  45. void wait_for_connections(void);
  46. void setup_wait_conn(void);
  47. int wait_conn_fork(int sock);
  48. void conn_check_peer(int sock);
  49. void handle_connection(int);
  50. void init_handle_conn(void);
  51. int handle_conn_ssl(int sock);
  52. int read_packet(int sock, void *ssl_ptr, v2_packet *v2_pkt, v3_packet **v3_pkt);
  53. void free_memory(void);
  54. int my_system(char*, int, int*, char**); /* executes a command via popen(), but also protects against timeouts */
  55. void my_system_sighandler(int); /* handles timeouts when executing commands via my_system() */
  56. void my_connection_sighandler(int); /* handles timeouts of connection */
  57. int drop_privileges(char *,char *);
  58. int write_pid_file(void);
  59. int remove_pid_file(void);
  60. int check_privileges(void);
  61. void sighandler(int);
  62. void child_sighandler(int);
  63. int validate_request(v2_packet *, v3_packet *);
  64. int contains_nasty_metachars(char *);
  65. int process_macros(char *,char *,int);
  66. int process_arguments(int,char **);