win_sock.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           win_sock.h  -  description
00003                              -------------------
00004     begin                : Thu Dec 9 2004
00005     copyright            : (C) 2004 by VooDooMan
00006     email                : vdmfun@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010 
00011 VooDoo cIRCle - an IRC (ro)bot
00012 Copyright (C) 2004 by Marian VooDooMan Meravy (vdmfun@hotmail.com)
00013 
00014 This program is free software; you can redistribute it and/or
00015 modify it under the terms of the GNU General Public License
00016 as published by the Free Software Foundation; either version 2
00017 of the License, or (at your option) any later version.
00018 
00019 This program is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License
00025 along with this program; if not, write to the Free Software
00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 
00028 ****************************************************************************/
00029 
00030 /*!
00031     \file
00032     \brief Provides low-level implementation of Windows(TM) IP sockets (Windows(TM) only)
00033 */
00034 
00035 //---------------------------------------------------------------------------
00036 
00037 #ifndef win_sockH
00038 #define win_sockH
00039 //---------------------------------------------------------------------------
00040 
00041 #ifdef _WIN32
00042 #   include <winsock2.h>
00043 #endif
00044 
00045 #include "sock_shared.h"
00046 #include "sock.h"
00047 
00048 #ifdef IPv6
00049 # ifdef _WIN32
00050 #   include <Ws2tcpip.h>
00051 # endif
00052 #endif
00053 
00054 const char* sock_error(int code);
00055 int sock_startup();
00056 int sock_shutdown();
00057 s_socket sock_connect(char* localIP, char* remote, unsigned short remote_port, int& error_code, bool async);
00058 size_t sock_send(s_socket& socket, const char* data, size_t size, int& error_code);
00059 void sock_close(s_socket& socket);
00060 size_t sock_read(s_socket& socket, char* data, size_t size, int& error_code, bool& connection_closed);
00061 in_addr sock_resolve(const char* domain, char* ip_string); // ip_string can be NULL
00062 void sock_reverse(char* address, char* dns_name, int dns_max_size);
00063 size_t sock_get_receive_size(s_socket& socket);
00064 
00065 // for server
00066 s_socket sock_bind(in_addr local, unsigned short local_port, int& error_code);
00067 s_socket sock_bind6(char* local, unsigned short port, int& error_code);
00068 s_socket sock_accept(s_socket& socket);
00069 s_socket sock_accept6(s_socket& socket);
00070 in_addr sock_get_remote_addr(s_socket& socket, int& error_code);
00071 in_addr6_ sock_get_remote_addr6(s_socket& socket);
00072 
00073 in_addr6_ sock_resolve6(char* domain);
00074 void sock_reverse(in_addr6_ address, char* dns_name, int dns_max_size);
00075 
00076 void sock_set_blocking(s_socket& socket, bool non_blocking);
00077 
00078 #endif

Generated on Sun Jul 10 03:23:04 2005 for VooDoo cIRCle by doxygen 1.4.3

Hosted by SourceForge.net Logo