do not expect magic numbers

This commit is contained in:
rsc 2006-01-27 08:54:27 +00:00
parent cbf1d02433
commit 6021858725

View file

@ -144,34 +144,77 @@ doquery(char *name, char *type)
return t; return t;
} }
enum
{
/* RR types */
Ta= 1,
Tns= 2,
Tmd= 3,
Tmf= 4,
Tcname= 5,
Tsoa= 6,
Tmb= 7,
Tmg= 8,
Tmr= 9,
Tnull= 10,
Twks= 11,
Tptr= 12,
Thinfo= 13,
Tminfo= 14,
Tmx= 15,
Ttxt= 16,
Trp= 17,
Tsig= 24,
Tkey= 25,
Taaaa= 28,
Tcert= 37,
/* query types (all RR types are also queries) */
Tixfr= 251, /* incremental zone transfer */
Taxfr= 252, /* zone transfer */
Tmailb= 253, /* { Tmb, Tmg, Tmr } */
Tall= 255, /* all records */
/* classes */
Csym= 0, /* internal symbols */
Cin= 1, /* internet */
Ccs, /* CSNET (obsolete) */
Cch, /* Chaos net */
Chs, /* Hesiod (?) */
/* class queries (all class types are also queries) */
Call= 255, /* all classes */
};
static struct { static struct {
char *s; char *s;
int t; int t;
} dnsnames[] = } dnsnames[] =
{ {
"ip", ns_t_a, "ip", Ta,
"ns", ns_t_ns, "ns", Tns,
"md", ns_t_md, "md", Tmd,
"mf", ns_t_mf, "mf", Tmf,
"cname", ns_t_cname, "cname", Tcname,
"soa", ns_t_soa, "soa", Tsoa,
"mb", ns_t_mb, "mb", Tmb,
"mg", ns_t_mg, "mg", Tmg,
"mr", ns_t_mr, "mr", Tmr,
"null", ns_t_null, "null", Tnull,
"ptr", ns_t_ptr, "ptr", Tptr,
"hinfo", ns_t_hinfo, "hinfo", Thinfo,
"minfo", ns_t_minfo, "minfo", Tminfo,
"mx", ns_t_mx, "mx", Tmx,
"txt", ns_t_txt, "txt", Ttxt,
"rp", ns_t_rp, "rp", Trp,
"key", ns_t_key, "key", Tkey,
"cert", ns_t_cert, "cert", Tcert,
"sig", ns_t_sig, "sig", Tsig,
"aaaa", ns_t_aaaa, "aaaa", Taaaa,
"ixfr", ns_t_ixfr, "ixfr", Tixfr,
"axfr", ns_t_axfr, "axfr", Taxfr,
"all", ns_t_any, "all", Call,
}; };
static char* static char*