Back to index

nagios-nrpe  2.13
common.h
Go to the documentation of this file.
00001 /************************************************************************
00002  *
00003  * COMMON.H - NRPE Common Include File
00004  * Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
00005  * Last Modified: 11-11-2011
00006  *
00007  * License:
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022  ************************************************************************/
00023 
00024 #include "config.h"
00025 
00026 #define PROGRAM_VERSION "2.13"
00027 #define MODIFICATION_DATE "11-11-2011"
00028 
00029 #define OK           0
00030 #define ERROR        -1
00031 
00032 #define TRUE         1
00033 #define FALSE        0
00034 
00035 #define STATE_UNKNOWN       3      /* service state return codes */
00036 #define       STATE_CRITICAL       2
00037 #define STATE_WARNING       1
00038 #define STATE_OK            0
00039 
00040 
00041 #define DEFAULT_SOCKET_TIMEOUT     10     /* timeout after 10 seconds */
00042 #define DEFAULT_CONNECTION_TIMEOUT 300    /* timeout if daemon is waiting for connection more than this time */
00043 
00044 #define MAX_INPUT_BUFFER    2048   /* max size of most buffers we use */
00045 #define MAX_FILENAME_LENGTH     256
00046 
00047 #define MAX_HOST_ADDRESS_LENGTH    256    /* max size of a host address */
00048 
00049 #define NRPE_HELLO_COMMAND      "_NRPE_CHECK"
00050 
00051 #define MAX_COMMAND_ARGUMENTS   16
00052 
00053 
00054 /**************** PACKET STRUCTURE DEFINITION **********/
00055 
00056 #define QUERY_PACKET        1             /* id code for a packet containing a query */
00057 #define       RESPONSE_PACKET             2             /* id code for a packet containing a response */
00058 
00059 #define NRPE_PACKET_VERSION_3   3               /* packet version identifier */
00060 #define NRPE_PACKET_VERSION_2   2               
00061 #define NRPE_PACKET_VERSION_1      1             /* older packet version identifiers (no longer supported) */
00062 
00063 #define MAX_PACKETBUFFER_LENGTH    1024          /* max amount of data we'll send in one query/response */
00064 
00065 typedef struct packet_struct{
00066        int16_t   packet_version;
00067        int16_t   packet_type;
00068        u_int32_t crc32_value;
00069        int16_t   result_code;
00070        char      buffer[MAX_PACKETBUFFER_LENGTH];
00071         }packet;
00072 
00073 /**************** OPERATING SYSTEM SPECIFIC DEFINITIONS **********/
00074 #ifdef __sun
00075 
00076 #  ifndef LOG_AUTHPRIV
00077 #    define LOG_AUTHPRIV LOG_AUTH
00078 #  endif
00079 
00080 #  ifndef LOG_FTP
00081 #    define LOG_FTP LOG_DAEMON
00082 #  endif
00083 
00084 #endif