net.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C), 2000-2002 by Contributors to the monit codebase. 
00003  * All Rights Reserved.
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software Foundation,
00017  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00018  */
00019 
00020 
00021 #ifndef NET_H
00022 #define NET_H
00023 
00024 #include <config.h>
00025 
00026 #include "monitor.h"
00027 
00028 #define SELECT_TIMEOUT     5
00029 #define LINGER_TIMEOUT     10
00030 #define TRUE               1
00031 #define FALSE              0
00032 
00033 int  check_connect(char*, int, int);
00034 int  check_host(char *);
00035 int  check_connection_io(Port_T);
00036 int  check_socket(int);
00037 int  check_udp_socket(int);
00038 int  create_socket(char*, int, int);
00039 int  create_generic_socket(Port_T);
00040 int  create_unix_socket(char*, int);
00041 int  create_server_socket(int, int, char *bindAddr);
00042 int  close_socket(int);
00043 int  set_sotimeout(int, int);
00044 int  set_noblock(int);
00045 int  set_block(int);
00046 int  sock_send(int, const char *, int, int);
00047 int  sock_recv(int, char *, int, int);
00048 int  port_send(Port_T p, const char *, int, int);
00049 int  port_recv(Port_T p, char *, int, int);
00050 char *get_localhostname(); 
00051 char *get_remote_host(int);
00052 
00053 #endif