/*- -- net:write() Write the packet (which must previously have been built up inside the context). */ static int lnet_write(lua_State *L) { libnet_t* ud = checkudata(L); #ifdef NET_DUMP lnet_dump(L); #endif int r = libnet_write(ud); check_error(L, ud, r); lua_pushinteger(L, r); return 1; }
/*- - net:write() Write the packet (which must previously have been built up inside the context). */ static int lnet_write(lua_State *L) { libnet_t** ud = luaL_checkudata(L, 1, L_NET_REGID); luaL_argcheck(L, *ud, 1, "net has been destroyed"); #ifdef NET_DUMP lnet_dump(L); #endif int r = libnet_write(*ud); check_error(L, *ud, r); lua_pushinteger(L, r); return 1; }
/* Called from inside gdb to see current state of libnet stack */ void dump(lua_State* L) { lnet_dump(L); printf("%s\n", lua_tostring(L, -1)); lua_pop(L, 1); }