diff options
Diffstat (limited to 'vendor/luasocket/src/inet.h')
-rw-r--r-- | vendor/luasocket/src/inet.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/vendor/luasocket/src/inet.h b/vendor/luasocket/src/inet.h new file mode 100644 index 00000000..5618b61b --- /dev/null +++ b/vendor/luasocket/src/inet.h | |||
@@ -0,0 +1,56 @@ | |||
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 | #include "luasocket.h" | ||
18 | #include "socket.h" | ||
19 | #include "timeout.h" | ||
20 | |||
21 | #ifdef _WIN32 | ||
22 | #define LUASOCKET_INET_ATON | ||
23 | #endif | ||
24 | |||
25 | #ifndef _WIN32 | ||
26 | #pragma GCC visibility push(hidden) | ||
27 | #endif | ||
28 | |||
29 | int inet_open(lua_State *L); | ||
30 | |||
31 | int inet_optfamily(lua_State* L, int narg, const char* def); | ||
32 | int inet_optsocktype(lua_State* L, int narg, const char* def); | ||
33 | |||
34 | int inet_meth_getpeername(lua_State *L, p_socket ps, int family); | ||
35 | int inet_meth_getsockname(lua_State *L, p_socket ps, int family); | ||
36 | |||
37 | const char *inet_trycreate(p_socket ps, int family, int type, int protocol); | ||
38 | const char *inet_trydisconnect(p_socket ps, int family, p_timeout tm); | ||
39 | const char *inet_tryconnect(p_socket ps, int *family, const char *address, const char *serv, p_timeout tm, struct addrinfo *connecthints); | ||
40 | const char *inet_tryaccept(p_socket server, int family, p_socket client, p_timeout tm); | ||
41 | const char *inet_trybind(p_socket ps, int *family, const char *address, const char *serv, struct addrinfo *bindhints); | ||
42 | |||
43 | #ifdef LUASOCKET_INET_ATON | ||
44 | int inet_aton(const char *cp, struct in_addr *inp); | ||
45 | #endif | ||
46 | |||
47 | #ifdef LUASOCKET_INET_PTON | ||
48 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt); | ||
49 | int inet_pton(int af, const char *src, void *dst); | ||
50 | #endif | ||
51 | |||
52 | #ifndef _WIN32 | ||
53 | #pragma GCC visibility pop | ||
54 | #endif | ||
55 | |||
56 | #endif /* INET_H */ | ||