Pike v8.1 release 6

Method Protocols.DNS.server_base()->reply_query()


Method reply_query

protected mapping reply_query(mapping query, mapping udp_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->con will 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 cb must be called with an argument of 0 (zero), and 0 (zero) be returned.

Returns

Returns 0 (zero) when the cb callback will be used, or a result mapping if not:

"rcode" : int

0 (or omit) for success, otherwise one of the Protocols.DNS.* constants

"an" : array(mapping(string:string|int))|void

Answer section:

Array
mapping(string:string|int) entry
"name" : string|array(string)
"type" : int
"cl" : int
"qd" : array|void

Question section, same format as an; omit to return the original question

"ns" : array|void

Authority section (usually NS records), same format as an

"ar" : array|void

Additional section, same format as an

"aa" : int

Set to 1 to include the Authoritative Answer bit in the response

"tc" : int

Set to 1 to include the TrunCated bit in the response

"rd" : int

Set to 1 to include the Recursion Desired bit in the response

"ra" : int

Set to 1 to include the Recursion Available bit in the response

"cd" : int

Set to 1 to include the Checking Disabled bit in the response

"ad" : int

Set to 1 to include the Authenticated Data bit in the response