aboutsummaryrefslogtreecommitdiff
path: root/src/inet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/inet.h')
-rw-r--r--src/inet.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/inet.h b/src/inet.h
index 60be9e4..244a310 100644
--- a/src/inet.h
+++ b/src/inet.h
@@ -1,25 +1,30 @@
1#ifndef INET_H
2#define INET_H
1/*=========================================================================*\ 3/*=========================================================================*\
2* Internet domain functions 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.
3* 16*
4* RCS ID: $Id$ 17* RCS ID: $Id$
5\*=========================================================================*/ 18\*=========================================================================*/
6#ifndef INET_H
7#define INET_H
8
9#include <lua.h> 19#include <lua.h>
10#include "socket.h" 20#include "socket.h"
11 21
12/*-------------------------------------------------------------------------*\
13* Exported functions
14\*-------------------------------------------------------------------------*/
15void inet_open(lua_State *L); 22void inet_open(lua_State *L);
16
17const char *inet_tryconnect(p_sock ps, const char *address, 23const char *inet_tryconnect(p_sock ps, const char *address,
18 unsigned short port); 24 unsigned short port);
19const char *inet_trybind(p_sock ps, const char *address, 25const char *inet_trybind(p_sock ps, const char *address,
20 unsigned short port, int backlog); 26 unsigned short port, int backlog);
21const char *inet_trycreate(p_sock ps, int type); 27const char *inet_trycreate(p_sock ps, int type);
22
23int inet_meth_getpeername(lua_State *L, p_sock ps); 28int inet_meth_getpeername(lua_State *L, p_sock ps);
24int inet_meth_getsockname(lua_State *L, p_sock ps); 29int inet_meth_getsockname(lua_State *L, p_sock ps);
25 30
@@ -27,4 +32,4 @@ int inet_meth_getsockname(lua_State *L, p_sock ps);
27int inet_aton(const char *cp, struct in_addr *inp); 32int inet_aton(const char *cp, struct in_addr *inp);
28#endif 33#endif
29 34
30#endif /* INET_H_ */ 35#endif /* INET_H */