1 /* net.h -- 2 * Created: Sat Feb 22 00:39:54 1997 by faith@dict.org 3 * Copyright 1997, 2000 Rickard E. Faith (faith@dict.org) 4 * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the 8 * Free Software Foundation; either version 1, or (at your option) any 9 * later version. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 extern const char *inet_ntopW (struct sockaddr *sa); 22 extern const char *net_hostname( void ); 23 extern int net_connect_tcp( 24 const char *host, const char *service, int address_family ); 25 extern int net_open_tcp ( 26 const char *address, const char *service, int queueLength, 27 int address_family); 28 extern void net_detach( void ); 29 extern int net_read( int s, char *buf, int maxlen ); 30 extern int net_write( int s, const char *buf, int len ); 31 32 #define NET_NOHOST (-1) 33 #define NET_NOSERVICE (-2) 34 #define NET_NOPROTOCOL (-3) 35 #define NET_NOCONNECT (-4) 36