diff options
Diffstat (limited to 'src/inet.h')
-rw-r--r-- | src/inet.h | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -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 | \*-------------------------------------------------------------------------*/ | ||
15 | void inet_open(lua_State *L); | 22 | void inet_open(lua_State *L); |
16 | |||
17 | const char *inet_tryconnect(p_sock ps, const char *address, | 23 | const char *inet_tryconnect(p_sock ps, const char *address, |
18 | unsigned short port); | 24 | unsigned short port); |
19 | const char *inet_trybind(p_sock ps, const char *address, | 25 | const char *inet_trybind(p_sock ps, const char *address, |
20 | unsigned short port, int backlog); | 26 | unsigned short port, int backlog); |
21 | const char *inet_trycreate(p_sock ps, int type); | 27 | const char *inet_trycreate(p_sock ps, int type); |
22 | |||
23 | int inet_meth_getpeername(lua_State *L, p_sock ps); | 28 | int inet_meth_getpeername(lua_State *L, p_sock ps); |
24 | int inet_meth_getsockname(lua_State *L, p_sock ps); | 29 | int 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); | |||
27 | int inet_aton(const char *cp, struct in_addr *inp); | 32 | int inet_aton(const char *cp, struct in_addr *inp); |
28 | #endif | 33 | #endif |
29 | 34 | ||
30 | #endif /* INET_H_ */ | 35 | #endif /* INET_H */ |