/* Do the parse. */
b = dn_expand(handle->_msg, handle->_eom,
handle->_msg_ptr, rr->name, NS_MAXDNAME); if (b < 0) return (-1);
handle->_msg_ptr += b; if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
RETERR(EMSGSIZE);
NS_GET16(rr->type, handle->_msg_ptr);
NS_GET16(rr->rr_class, handle->_msg_ptr); if (section == ns_s_qd) {
rr->ttl = 0;
rr->rdlength = 0;
rr->rdata = NULL;
} else { if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
RETERR(EMSGSIZE);
NS_GET32(rr->ttl, handle->_msg_ptr);
NS_GET16(rr->rdlength, handle->_msg_ptr); if (handle->_msg_ptr + rr->rdlength > handle->_eom)
RETERR(EMSGSIZE);
rr->rdata = handle->_msg_ptr;
handle->_msg_ptr += rr->rdlength;
} if (++handle->_rrnum > handle->_counts[(int)section])
setsection(handle, (ns_sect)((int)section + 1));
/* All done. */ return (0);
}
/* *Thisisidenticaltotheabovebutusesnetwork-format(uncompressed)names.
*/ int
ns_parserr2(ns_msg *handle, ns_sect section, int rrnum, ns_rr2 *rr) { int b; int tmp;
/* Make section right. */
tmp = section; if (tmp < 0 || section >= ns_s_max)
RETERR(ENODEV); if (section != handle->_sect)
setsection(handle, section);
/* Make rrnum right. */ if (rrnum == -1)
rrnum = handle->_rrnum; if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
RETERR(ENODEV); if (rrnum < handle->_rrnum)
setsection(handle, section); if (rrnum > handle->_rrnum) {
b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
rrnum - handle->_rrnum);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.