utils.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /****************************************************************************
  2. *
  3. * utils.h - NRPE Utility Functions header file
  4. *
  5. * License: GPLv2
  6. * Copyright (c) 2009-2017 Nagios Enterprises
  7. * 1999-2008 Ethan Galstad (nagios@nagios.org)
  8. *
  9. * License Notice:
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. *
  25. ****************************************************************************/
  26. #ifndef NRPE_UTILS_H_INCLUDED
  27. #define NRPE_UTILS_H_INCLUDED
  28. #include "../include/config.h"
  29. void generate_crc32_table(void);
  30. unsigned long calculate_crc32(char*, int);
  31. void randomize_buffer(char*,int);
  32. int my_tcp_connect(char*, int, int*);
  33. #ifdef HAVE_STRUCT_SOCKADDR_STORAGE
  34. int my_connect(const char*, struct sockaddr_storage*, u_short, int, const char*, int);
  35. #else
  36. int my_connect(const char*, struct sockaddr*, u_short, int, const char*, int);
  37. #endif
  38. void add_listen_addr(struct addrinfo**, int, char*, int);
  39. int clean_environ(const char *keep_env_vars, const char *nrpe_user);
  40. char* strip(char*);
  41. int sendall(int, char*, int*);
  42. int recvall(int, char*, int*, int);
  43. char *my_strsep(char**, const char*);
  44. void open_log_file();
  45. void logit(int priority, const char *format, ...);
  46. void close_log_file();
  47. void display_license(void);
  48. extern int disable_syslog;
  49. #endif