-/**/
+/*
+ * parse.c
+ * - parsing assistance functions (mainly for domains inside datagrams)
+ */
+/*
+ * This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
#include "internal.h"
if (!(lablen & 0x0c000)) break;
if ((lablen & 0x0c000) != 0x0c000) return adns_s_unknownreply;
if (jumped++) {
- adns__diag(ads,serv,"compressed datagram contains loop");
+ adns__diag(ads,fls->serv,fls->qu,"compressed datagram contains loop");
return adns_s_serverfaulty;
}
if (fls->dmend_r) *(fls->dmend_r)= fls->cbyte;
return adns_s_ok;
x_serverfaulty:
- adns__diag(ads,serv,"label in domain runs beyond end of domain");
+ adns__diag(ads,fls->serv,fls->qu,"label in domain runs beyond end of domain");
return adns_s_serverfaulty;
}
-adns_status adns__parse_domain(adns_state ads, int serv, vbuf *vb,
+adns_status adns__parse_domain(adns_state ads, int serv, vbuf *vb, int flags,
const byte *dgram, int dglen,
int *cbyte_io, int max) {
findlabel_state fls;
if (!lablen) break;
if (vb->used)
if (!adns__vbuf_append(&qu->ans,".",1)) return adns_s_nolocalmem;
- if (qu->flags & adns_qf_anyquote) {
+ if (flags & adns_qf_anyquote) {
if (!vbuf__append_quoted1035(&qu->ans,dgram+labstart,lablen))
return adns_s_nolocalmem;
} else {
if (!adns__vbuf_append(&qu->ans,"",1)) return adns_s_nolocalmem;
return adns_s_ok;
}
-
+
adns_status adns__findrr(adns_state ads, int serv,
const byte *dgram, int dglen, int *cbyte_io,
int *type_r, int *class_r, int *rdlen_r, int *rdstart_r,