2003-06-26 18:47:49 +00:00
|
|
|
#ifndef INET_H
|
|
|
|
#define INET_H
|
2002-07-03 19:06:54 +00:00
|
|
|
/*=========================================================================*\
|
2003-05-25 01:54:13 +00:00
|
|
|
* Internet domain functions
|
2003-06-26 18:47:49 +00:00
|
|
|
* LuaSocket toolkit
|
|
|
|
*
|
|
|
|
* This module implements the creation and connection of internet domain
|
|
|
|
* sockets, on top of the socket.h interface, and the interface of with the
|
|
|
|
* resolver.
|
|
|
|
*
|
|
|
|
* The function inet_aton is provided for the platforms where it is not
|
|
|
|
* available. The module also implements the interface of the internet
|
|
|
|
* getpeername and getsockname functions as seen by Lua programs.
|
|
|
|
*
|
|
|
|
* The Lua functions toip and tohostname are also implemented here.
|
2003-03-28 21:08:50 +00:00
|
|
|
*
|
2002-07-03 19:06:54 +00:00
|
|
|
* RCS ID: $Id$
|
|
|
|
\*=========================================================================*/
|
|
|
|
#include <lua.h>
|
2003-06-09 18:23:40 +00:00
|
|
|
#include "socket.h"
|
2004-01-18 00:04:20 +00:00
|
|
|
#include "timeout.h"
|
2002-07-03 19:06:54 +00:00
|
|
|
|
2004-01-17 00:17:46 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#define INET_ATON
|
|
|
|
#endif
|
|
|
|
|
2004-02-04 14:29:11 +00:00
|
|
|
int inet_open(lua_State *L);
|
2004-01-18 00:04:20 +00:00
|
|
|
|
2004-01-21 18:40:52 +00:00
|
|
|
const char *inet_trycreate(p_sock ps, int type);
|
|
|
|
const char *inet_tryconnect(p_sock ps, const char *address,
|
|
|
|
unsigned short port, p_tm tm);
|
2003-05-25 01:54:13 +00:00
|
|
|
const char *inet_trybind(p_sock ps, const char *address,
|
2004-01-24 00:18:19 +00:00
|
|
|
unsigned short port);
|
2004-01-18 00:04:20 +00:00
|
|
|
|
2003-05-25 01:54:13 +00:00
|
|
|
int inet_meth_getpeername(lua_State *L, p_sock ps);
|
|
|
|
int inet_meth_getsockname(lua_State *L, p_sock ps);
|
2002-07-03 19:06:54 +00:00
|
|
|
|
2003-06-11 01:42:18 +00:00
|
|
|
#ifdef INET_ATON
|
|
|
|
int inet_aton(const char *cp, struct in_addr *inp);
|
|
|
|
#endif
|
|
|
|
|
2003-06-26 18:47:49 +00:00
|
|
|
#endif /* INET_H */
|