3 /*=========================================================================*\
4 * Internet domain functions
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
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.
15 * The Lua functions toip and tohostname are also implemented here.
16 \*=========================================================================*/
25 int inet_open(lua_State
*L
);
27 const char *inet_trycreate(p_socket ps
, int family
, int type
);
28 const char *inet_tryconnect(p_socket ps
, const char *address
,
29 const char *serv
, p_timeout tm
, struct addrinfo
*connecthints
);
30 const char *inet_trybind(p_socket ps
, const char *address
, const char *serv
,
31 struct addrinfo
*bindhints
);
32 const char *inet_trydisconnect(p_socket ps
, int family
, p_timeout tm
);
33 const char *inet_tryaccept(p_socket server
, int family
, p_socket client
, p_timeout tm
);
35 int inet_meth_getpeername(lua_State
*L
, p_socket ps
, int family
);
36 int inet_meth_getsockname(lua_State
*L
, p_socket ps
, int family
);
38 int inet_optfamily(lua_State
* L
, int narg
, const char* def
);
39 int inet_optsocktype(lua_State
* L
, int narg
, const char* def
);
42 int inet_aton(const char *cp
, struct in_addr
*inp
);