+/*
+ * _strpair (mf,cs)
+ */
+
+static void mf_strpair(adns_query qu, void *datap) {
+ adns_rr_strpair *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->array[0]);
+ adns__makefinal_str(qu,&rrp->array[1]);
+}
+
+static adns_status cs_strpair(vbuf *vb, const void *datap) {
+ const adns_rr_strpair *rrp= datap;
+ adns_status st;
+
+ st= csp_qstring(vb,rrp->array[0]); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_qstring(vb,rrp->array[1]); if (st) return st;
+
+ return adns_s_ok;
+}
+
+/*
+ * _intstrpair (mf,cs)
+ */
+
+static void mf_intstrpair(adns_query qu, void *datap) {
+ adns_rr_intstrpair *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->array[0].str);
+ adns__makefinal_str(qu,&rrp->array[1].str);
+}
+
+static adns_status cs_intstrpair(vbuf *vb, const void *datap) {
+ const adns_rr_intstrpair *rrp= datap;
+ adns_status st;
+
+ st= csp_intstr(vb,&rrp->array[0]); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_intstr(vb,&rrp->array[1]); if (st) return st;
+
+ return adns_s_ok;
+}
+
+/*
+ * _hinfo (pa)
+ */
+
+static adns_status pa_hinfo(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_intstrpair *rrp= datap;
+ adns_status st;
+ int i;
+
+ for (i=0; i<2; i++) {
+ st= pap_string(pai, &cbyte, max, &rrp->array[i].i, &rrp->array[i].str);
+ if (st) return st;
+ }
+
+ if (cbyte != max) return adns_s_invaliddata;
+
+ return adns_s_ok;
+}
+
+/*
+ * _mailbox (pap)
+ */
+
+static adns_status pap_mailbox(const parseinfo *pai, int *cbyte_io, int max,
+ char **mb_r) {
+ return pap_domain(pai, cbyte_io, max, mb_r, pdf_quoteok);
+ /* fixme: mailbox quoting */
+}
+
+/*
+ * _rp (pa)
+ */
+
+static adns_status pa_rp(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_strpair *rrp= datap;
+ adns_status st;
+
+ st= pap_mailbox(pai, &cbyte, max, &rrp->array[0]);
+ if (st) return st;
+
+ st= pap_domain(pai, &cbyte, max, &rrp->array[1], pdf_quoteok);
+ if (st) return st;
+
+ if (cbyte != max) return adns_s_invaliddata;
+ return adns_s_ok;
+}
+
+/*
+ * _soa (pa,mf,cs)
+ */
+
+static adns_status pa_soa(const parseinfo *pai, int cbyte, int max, void *datap) {
+ adns_rr_soa *rrp= datap;
+ const byte *dgram= pai->dgram;
+ adns_status st;
+ int msw, lsw, i;
+
+ st= pap_domain(pai, &cbyte, max, &rrp->mname,
+ pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+ if (st) return st;
+
+ st= pap_mailbox(pai, &cbyte, max, &rrp->rname);
+ if (st) return st;
+
+ if (cbyte+20 != max) return adns_s_invaliddata;
+
+ for (i=0; i<5; i++) {
+ GET_W(cbyte,msw);
+ GET_W(cbyte,lsw);
+ (&rrp->serial)[i]= (msw<<16) | lsw;
+ }
+
+ return adns_s_ok;
+}
+
+static void mf_soa(adns_query qu, void *datap) {
+ adns_rr_soa *rrp= datap;
+
+ adns__makefinal_str(qu,&rrp->mname);
+ adns__makefinal_str(qu,&rrp->rname);
+}
+
+static adns_status cs_soa(vbuf *vb, const void *datap) {
+ const adns_rr_soa *rrp= datap;
+ char buf[20];
+ int i;
+ adns_status st;
+
+ st= csp_qstring(vb,rrp->mname); if (st) return st;
+ CSP_ADDSTR(" ");
+ st= csp_qstring(vb,rrp->rname); if (st) return st;
+
+ for (i=0; i<5; i++) {
+ sprintf(buf," %lu",(&rrp->serial)[i]);
+ CSP_ADDSTR(buf);
+ }
+
+ return adns_s_ok;
+}
+