58 static int DnsGetDnsRrname(
lua_State *luastate)
66 return SCDnsLuaGetRrname(luastate, tx);
69 static int DnsGetTxid(
lua_State *luastate)
77 SCDnsLuaGetTxId(luastate, tx);
81 static int DnsGetRcode(
lua_State *luastate)
89 return SCDnsLuaGetRcode(luastate, tx);
92 static int DnsGetRecursionDesired(
lua_State *luastate)
100 uint16_t
flags = SCDnsTxGetResponseFlags(tx);
101 int recursion_desired =
flags & 0x0080 ? 1 : 0;
102 lua_pushboolean(luastate, recursion_desired);
106 static int DnsGetQueryTable(
lua_State *luastate)
114 return SCDnsLuaGetQueryTable(luastate, tx);
117 static int DnsGetAnswerTable(
lua_State *luastate)
122 return SCDnsLuaGetAnswerTable(luastate, tx);
125 static int DnsGetAuthorityTable(
lua_State *luastate)
130 return SCDnsLuaGetAuthorityTable(luastate, tx);
137 lua_pushcfunction(luastate, DnsGetDnsRrname);
138 lua_setglobal(luastate,
"DnsGetDnsRrname");
140 lua_pushcfunction(luastate, DnsGetQueryTable);
141 lua_setglobal(luastate,
"DnsGetQueries");
143 lua_pushcfunction(luastate, DnsGetAnswerTable);
144 lua_setglobal(luastate,
"DnsGetAnswers");
146 lua_pushcfunction(luastate, DnsGetAuthorityTable);
147 lua_setglobal(luastate,
"DnsGetAuthorities");
149 lua_pushcfunction(luastate, DnsGetTxid);
150 lua_setglobal(luastate,
"DnsGetTxid");
152 lua_pushcfunction(luastate, DnsGetRcode);
153 lua_setglobal(luastate,
"DnsGetRcode");
155 lua_pushcfunction(luastate, DnsGetRecursionDesired);
156 lua_setglobal(luastate,
"DnsGetRecursionDesired");