1 #ifndef INET_H 2 #define INET_H 3 /*=========================================================================*\ 4 * Internet domain functions 5 * LuaSocket toolkit 6 * 7 * This module implements the creation and connection of internet domain 8 * sockets, on top of the socket.h interface, and the interface of with the 9 * resolver. 10 * 11 * The function inet_aton is provided for the platforms where it is not 12 * available. The module also implements the interface of the internet 13 * getpeername and getsockname functions as seen by Lua programs. 14 * 15 * The Lua functions toip and tohostname are also implemented here. 16 * 17 * RCS ID: $Id: inet.h,v 1.16 2005/10/07 04:40:59 diego Exp $ 18 \*=========================================================================*/ 19 #include "lua.h" 20 #include "socket.h" 21 #include "timeout.h" 22 23 #ifdef _WIN32 24 #define INET_ATON 25 #endif 26 27 int inet_open(lua_State *L); 28 29 const char *inet_trycreate(p_socket ps, int type); 30 const char *inet_tryconnect(p_socket ps, const char *address, 31 unsigned short port, p_timeout tm); 32 const char *inet_trybind(p_socket ps, const char *address, 33 unsigned short port); 34 35 int inet_meth_getpeername(lua_State *L, p_socket ps); 36 int inet_meth_getsockname(lua_State *L, p_socket ps); 37 38 #ifdef INET_ATON 39 int inet_aton(const char *cp, struct in_addr *inp); 40 #endif 41 42 #endif /* INET_H */ 43