static void *mx_validate(struct rr *rrv) { RRCAST(mx); if (G.opt.policy_checks[POLICY_MX_ALIAS]) { if (find_rr_set(T_CNAME, rr->exchange)) { return moan(rr->rr.file_name, rr->rr.line, "MX exchange is an alias"); } } return NULL; }
static char* nid_human(struct rr *rrv) { RRCAST(nid); char s[1024]; snprintf(s, 1024, "%d %x:%x:%x:%x", rr->preference, (unsigned)(rr->node_id >> 48) & 0xffff, (unsigned)(rr->node_id >> 32) & 0xffff, (unsigned)(rr->node_id >> 16) & 0xffff, (unsigned)(rr->node_id >> 0) & 0xffff); return quickstrdup_temp(s); }
static char* l32_human(struct rr *rrv) { RRCAST(l32); char s[1024]; snprintf(s, 1024, "%d %d.%d.%d.%d", rr->preference, (rr->locator32 >> 24) & 0xff, (rr->locator32 >> 16) & 0xff, (rr->locator32 >> 8) & 0xff, (rr->locator32 >> 0) & 0xff); return quickstrdup_temp(s); }
static char* l64_human(struct rr *rrv) { RRCAST(l64); char s[1024]; snprintf(s, 1024, "%d %x:%x:%x:%x", rr->preference, (unsigned)(rr->locator64 >> 48) & 0xffff, (unsigned)(rr->locator64 >> 32) & 0xffff, (unsigned)(rr->locator64 >> 16) & 0xffff, (unsigned)(rr->locator64 >> 0) & 0xffff); return quickstrdup_temp(s); }
static struct binary_data txt_wirerdata(struct rr *rrv) { RRCAST(txt); struct binary_data r, t; struct rr_txt_segment *seg = rr->txt; r = bad_binary_data(); t.length = 0; t.data = NULL; while (seg) { r = compose_binary_data("db", 1, t, seg->txt); t = r; seg = seg->next; } return r; }
static char* txt_human(struct rr *rrv) { RRCAST(txt); char ss[1024]; char *s = ss; int l; struct rr_txt_segment *seg = rr->txt; while (seg) { /* XXX would be nice to escape " with \ in strings */ l = snprintf(s, 1024-(s-ss), "\"%s\" ", seg->txt.data); s += l; seg = seg->next; } return quickstrdup_temp(ss); }
static char* dlv_human(struct rr *rrv) { RRCAST(dlv); char ss[4096]; char *s = ss; int l; int i; l = snprintf(s, 4096, "%u %u %u ", rr->key_tag, rr->algorithm, rr->digest_type); s += l; for (i = 0; i < rr->digest.length; i++) { l = snprintf(s, 4096-(s-ss), "%02X", (unsigned char)rr->digest.data[i]); s += l; } return quickstrdup_temp(ss); }
static char* nsec3_human(struct rr *rrv) { RRCAST(nsec3); char ss[1024]; char *s = ss; int l; int i; l = snprintf(s, 1024, "%u %u %u ", rr->hash_algorithm, rr->flags, rr->iterations); s += l; if (rr->salt.length) { for (i = 0; i < rr->salt.length; i++) { l = snprintf(s, 1024-(s-ss), "%02X", (unsigned char)rr->salt.data[i]); s += l; } } else { sprintf(s, "-"); } return quickstrdup_temp(ss); }
static struct binary_data x25_wirerdata(struct rr *rrv) { RRCAST(x25); return compose_binary_data("b", 1, rr->psdn_address); }
static char* x25_human(struct rr *rrv) { RRCAST(x25); return rr->psdn_address.data; }
static struct binary_data l32_wirerdata(struct rr *rrv) { RRCAST(l32); return compose_binary_data("24", 1, rr->preference, rr->locator32); }
static struct binary_data l64_wirerdata(struct rr *rrv) { RRCAST(l64); return compose_binary_data("28", 1, rr->preference, rr->locator64); }
static struct binary_data mr_wirerdata(struct rr *rrv) { RRCAST(mr); return name2wire_name(rr->newname); }
static char* mr_human(struct rr *rrv) { RRCAST(mr); return rr->newname; }
static struct binary_data nid_wirerdata(struct rr *rrv) { RRCAST(nid); return compose_binary_data("28", 1, rr->preference, rr->node_id); }
static struct binary_data nsap_wirerdata(struct rr *rrv) { RRCAST(nsap); return compose_binary_data("d", 1, rr->data); }