Method Protocols.DNS.server_base()->reply_query()
- Method
reply_query
protectedmapping|zeroreply_query(mappingquery,mappingudp_data,function(mapping:void)cb)- Description
Reply to a query (stub).
- Parameter
query Parsed query.
- Parameter
udp_data Raw UDP data. If the server operates in TCP mode (tcp_server), it will contain an additional tcp_con entry. In that case,
udp_data->tcp_con->conwill contain the TCP connection the request was received on as Stdio.File object.- Parameter
cb Callback you can call with the result instead of returning it. In that case, return
0(zero).Overload this function to implement the proper lookup.
- Note
To indicate the default failure
cbmust be called with an argument of0(zero), and0(zero) be returned.- Returns
Returns
0(zero) when thecbcallback will be used, or a result mapping if not:"rcode":int0 (or omit) for success, otherwise one of the Protocols.DNS.* constants
"an":array(mapping(string:string|int))|voidAnswer section:
Array mapping(string:string|int)entry"name":string|array(string)"type":int"cl":int"qd":array|voidQuestion section, same format as
an; omit to return the original question"ns":array|voidAuthority section (usually NS records), same format as
an"ar":array|voidAdditional section, same format as
an"aa":intSet to 1 to include the Authoritative Answer bit in the response
"tc":intSet to 1 to include the TrunCated bit in the response
"rd":intSet to 1 to include the Recursion Desired bit in the response
"ra":intSet to 1 to include the Recursion Available bit in the response
"cd":intSet to 1 to include the Checking Disabled bit in the response
"ad":intSet to 1 to include the Authenticated Data bit in the response