-------------------------------------------------------------------------*\ * Returns all information provided by the resolver given a host name * or ip address \*-------------------------------------------------------------------------*/
| 127 | * or ip address |
| 128 | \*-------------------------------------------------------------------------*/ |
| 129 | static int inet_global_toip(lua_State *L) |
| 130 | { |
| 131 | const char *address = luaL_checkstring(L, 1); |
| 132 | struct hostent *hp = NULL; |
| 133 | int err = inet_gethost(address, &hp); |
| 134 | if (err != IO_DONE) { |
| 135 | lua_pushnil(L); |
| 136 | lua_pushstring(L, socket_hoststrerror(err)); |
| 137 | return 2; |
| 138 | } |
| 139 | lua_pushstring(L, inet_ntoa(*((struct in_addr *) hp->h_addr))); |
| 140 | inet_pushresolved(L, hp); |
| 141 | return 2; |
| 142 | } |
| 143 | |
| 144 | int inet_optfamily(lua_State* L, int narg, const char* def) |
| 145 | { |
nothing calls this directly
no test coverage detected