

The functions in this module can be used to encode strings in base64 and toĭecode base64 encoded strings. This document was generated from the Lua/APR 0.23.1 source code.
Lua table insert sorted inmemory code#
Source code of the binding to prevent that documentation and implementation The entries for all functions are automatically generated from the C and Lua The official documentation didn’t suffice. Most of the documentation is based on the official APR documentation but I’ve had to consult the APR source code here and there when This document contains the documentationįor the Lua/APR binding.
Lua table insert sorted inmemory portable#
The library provides an API for online signing and verification of records.The Lua/APR binding aims to bring most of the functionality in theĪpache Portable Runtime (APR) to the small and flexible If (rr, ) then print('yes, has cookie') endĭns.edns.option(, 'abcdefgh')Īssert(() = 'abcdefgh') Retrieve packet section copy as Lua table Write out the packet in text format (same as ISC dig) If answer:answers(pkt) then print('indeed') end If answer:parse() then print('success!') end Packet parser returns true|false depending on the result Create packet over existing wire, it will not be allocated Enter ADDITIONAL section, the OPT must be last in the packetĪs it's an API over binary string, it can be used for parsing packet from wire format as well. Add EDNS option (numeric code, binary string of data) Create OPT RR (optional version, payload) This is where you can set maximum UDP payload and DO bit to signalize DNSSEC OK. It also MUST be the last RR in the ADDITIONAL section (with the exception of TSIG). The library treats it as a RR with only minimal hand-holding, but provides a handful of convenience functions. The EDNS OPT is a special type of RR, because it uses its fields for a different purpose. Put RR in this answer (shortened method) Count domain name labelsĪssert.same(dname:split(), The library provides a handful of useful functions over domain names, use string package for more complex operations. Convert back to string using tostring()Īssert(tostring(dname) = '.') Local dname = dns.dname('\7example\3com') The library supports conversion between textual representation and wire format. Print() - "TYPE55555"ĭomain names are stored in a wire format as a sequence of labels prefixed by their length. Use dns.tostring table to convert constants to text format Constants are numbers, they don't have implicit tostring() conversion If qtype = then print('is AAAA question') end For unknown/custom types, simply use their numeric value. There are symbolic constants for all used RR types as of today (not deprecated). Record types are declared as numeric constants in dns.type table. You can convert them back to the text representation with dns.tostring. Since they're constants, LuaJIT can inline them.

There are numeric constants for DNS classes, types, opcodes and rcodes. The library provides several utilities for convenience, see tools/README.md.

A contemporary DNS library using LuaJIT FFI focused on performance, and a lightning-fast zone file parser.
