[getdns-api] Extra defines for rcodes, opcodes and classes?

Willem Toorop willem at nlnetlabs.nl
Thu Feb 13 06:18:25 MST 2014


What do you think of some extra defines for rcodes, opcodes and classes?
 If only to show them in getdns_pretty_print_dict?

i.e.:

#define GETDNS_OPCODE_QUERY    0
#define GETDNS_OPCODE_IQUERY   1
#define GETDNS_OPCODE_STATUS   2
#define GETDNS_OPCODE_NOTIFY   4
#define GETDNS_OPCODE_UPDATE   5

#define GETDNS_RCODE_NOERROR   0
#define GETDNS_RCODE_FORMERR   1
#define GETDNS_RCODE_SERVFAIL  2
#define GETDNS_RCODE_NXDOMAIN  3
#define GETDNS_RCODE_NOTIMPL   4
#define GETDNS_RCODE_REFUSED   5
#define GETDNS_RCODE_YXDOMAIN  6
#define GETDNS_RCODE_YXRRSET   7
#define GETDNS_RCODE_NXRRSET   8
#define GETDNS_RCODE_NOTAUTH   9
#define GETDNS_RCODE_NOTZONE  10

#define GETDNS_RR_CLASS_IN     1
#define GETDNS_RR_CLASS_CH     3
#define GETDNS_RR_CLASS_HS     4
#define GETDNS_RR_CLASS_NONE 254
#define GETDNS_RR_CLASS_ANY  255


Example pretty_print_dict output:

{
  "answer_type": GETDNS_NAMETYPE_DNS,
  "status": GETDNS_RESPSTATUS_GOOD,
  "canonical_name": <bindata of "www.example.com.">,
  "replies_tree":
  [
    {
      "header":
      {
        "opcode": GETDNS_OPCODE_QUERY,
        "rcode": GETDNS_RCODE_NOERROR,
        "qdcount": 1, "ancount": 2, ",
        . . .
      },
      "question":
      {
        "qclass": GETDNS_RR_CLASS_IN,
        "qname": <bindata for www.example.com.>,
        "qtype": GETDNS_RRTYPE_A
      },
      "answer":
      [
        {
          "class": GETDNS_RR_CLASS_IN,
          "name": <bindata for www.example.com.>,
          "rdata":
          {
            "ipv4_address": <bindata of 0x5db8d877>,
            "rdata_raw": <bindata of 0x5db8d877>
          },
          "ttl": 86400,
          "type": GETDNS_RRTYPE_A
        },
        . . .
      ],
      . . .
    }
  ],
  . . .
}


More information about the getdns-api mailing list