/* Wrapper to call ping_start using fully resolve IP4 address  */
static void net_ping_raw(const char *name, ip_addr_t *ipaddr, ping_t nip)
/* Wrapper to call ping_start using fully resolve IP4 address  */
static void net_ping_raw(const char *name, ip_addr_t *ipaddr, ping_t nip)
{
      char ipaddrstr[16];
      ipaddr_ntoa_r(ipaddr, ipaddrstr, sizeof(ipaddrstr));
      NODE_DBG("[net_ping_raw] ip: %s\n", ipaddrstr);
    }    
    lua_State *L = lua_getstate();
    if (!ipaddr || ipaddr->addr == 0xFFFFFFFF) {
        ping_CB(nip, NULL);
        return;
    }
    nip->ping_opt.ip = ipaddr->addr;     
    NODE_DBG("[net_ping_raw] calling ping_start\n");
    if (!ping_start(&(nip->ping_opt))) {
        luaL_unref(L, LUA_REGISTRYINDEX, nip->ping_callback_ref);
        luaL_error(L, "memory allocation error: cannot start ping");
    }
}