/*
Copyright (C) 1997-2001 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

#ifdef _WIN32
#ifndef _INC_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <winsock2.h>
#elif defined( __unix__ )
#include <unistd.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <errno.h>
#include <arpa/inet.h>
#define SOCKET int
#define INVALID_SOCKET 0
#define SOCKET_ERROR -1
#else
#error Unknown target OS
#endif

void		NET_NetadrToSockadr( const netadr_t *a, struct sockaddr *s );
void		NET_SockadrToNetadr( const struct sockaddr *s, netadr_t *a );
qboolean	NET_StringToSockaddr( const char *s, struct sockaddr *sadr );

SOCKET	Sys_IPSocket( const char *net_interface, int port );
void	Sys_CloseSocket( SOCKET sock );

qboolean	Sys_InitNetworking( void );
void		Sys_ShutdownNetworking( void );

