![]() |
Icinga-core 1.4.0
next gen monitoring
|
00001 /************************************************************************ 00002 * 00003 * IO.H - Common I/O Functions 00004 * Copyright (c) 2005 Ethan Galstad 00005 * Copyright (c) 2009-2011 Icinga Development Team (http://www.icinga.org) 00006 * 00007 ************************************************************************/ 00008 00009 #ifndef _IDO_IO_H 00010 #define _IDO_IO_H 00011 00012 #include "../../../include/config.h" 00013 00014 00015 #define IDO_SINK_FILE 0 00016 #define IDO_SINK_FD 1 00017 #define IDO_SINK_UNIXSOCKET 2 00018 #define IDO_SINK_TCPSOCKET 3 00019 00020 #define IDO_DEFAULT_TCP_PORT 5668 00021 00022 /* fix for sun os */ 00023 #ifndef SUN_LEN 00024 #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path)) 00025 #endif 00026 00027 /* MMAPFILE structure - used for reading files via mmap() */ 00028 typedef struct ido_mmapfile_struct{ 00029 char *path; 00030 int mode; 00031 int fd; 00032 unsigned long file_size; 00033 unsigned long current_position; 00034 unsigned long current_line; 00035 void *mmap_buf; 00036 }ido_mmapfile; 00037 00038 00039 ido_mmapfile *ido_mmap_fopen(char *); 00040 int ido_mmap_fclose(ido_mmapfile *); 00041 char *ido_mmap_fgets(ido_mmapfile *); 00042 00043 int ido_sink_open(char *,int,int,int,int,int *); 00044 int ido_sink_write(int,char *,int); 00045 int ido_sink_write_newline(int); 00046 int ido_sink_flush(int); 00047 int ido_sink_close(int); 00048 int ido_inet_aton(register const char *,struct in_addr *); 00049 00050 void ido_strip_buffer(char *); 00051 char *ido_escape_buffer(char *); 00052 char *ido_unescape_buffer(char *); 00053 00054 #endif