Scriptable functions

Network

ntohs(netshort)

This subroutine converts values between the host and network byte order. Specifically, ntohs() converts 16-bit quantities from network byte order to host byte order.

Parameters:
  • netshort – 16-bit short addr
Return type:

converted addr

Cache

storeQueryInCache(qstate, qinfo, msgrep, is_referral)

Store pending query in local cache.

Parameters:
Return type:

boolean

invalidateQueryInCache(qstate, qinfo)

Invalidate record in local cache.

Parameters:

Logging

verbose(level, msg)

Log a verbose message, pass the level for this message. No trailing newline is needed.

Parameters:
  • level – verbosity level for this message, compared to global verbosity setting.
  • msg – string message
log_info(msg)

Log informational message. No trailing newline is needed.

Parameters:
  • msg – string message
log_err(msg)

Log error message. No trailing newline is needed.

Parameters:
  • msg – string message
log_warn(msg)

Log warning message. No trailing newline is needed.

Parameters:
  • msg – string message
log_hex(msg, data, length)

Log a hex-string to the log. Can be any length. performs mallocs to do so, slow. But debug useful.

Parameters:
  • msg – string desc to accompany the hexdump.
  • data – data to dump in hex format.
  • length – length of data.
log_dns_msg(str, qinfo, reply)

Log DNS message.

Parameters:
log_query_info(verbosity_value, str, qinf)

Log query information.

Parameters:
  • verbosity_value – see constants
  • str – string message
  • qinfquery_info
regional_log_stats(r)

Log regional statistics.

Parameters:
  • rregional

Debugging

strextstate(module_ext_state)

Debug utility, module external qstate to string.

Parameters:
  • module_ext_state – the state value.
Return type:

descriptive string.

strmodulevent(module_event)

Debug utility, module event to string.

Parameters:
  • module_event – the module event value.
Return type:

descriptive string.

ldns_rr_type2str(atype)
Convert RR type to string.
ldns_rr_class2str(aclass)
Convert RR class to string.

Table Of Contents

Previous topic

Scriptable structures

Next topic

Configuration interface

Quick search