• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/libc/nameser/

Lines Matching refs:handle

77 int ns_msg_getflag(ns_msg handle, int flag) {
78 return(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift);
106 ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
110 handle->_msg = msg;
111 handle->_eom = eom;
114 NS_GET16(handle->_id, msg);
117 NS_GET16(handle->_flags, msg);
121 NS_GET16(handle->_counts[i], msg);
124 if (handle->_counts[i] == 0)
125 handle->_sections[i] = NULL;
128 handle->_counts[i]);
132 handle->_sections[i] = msg;
137 setsection(handle, ns_s_max);
142 ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
150 if (section != handle->_sect)
151 setsection(handle, section);
155 rrnum = handle->_rrnum;
156 if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
158 if (rrnum < handle->_rrnum)
159 setsection(handle, section);
160 if (rrnum > handle->_rrnum) {
161 b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
162 rrnum - handle->_rrnum);
166 handle->_msg_ptr += b;
167 handle->_rrnum = rrnum;
171 b = dn_expand(handle->_msg, handle->_eom,
172 handle->_msg_ptr, rr->name, NS_MAXDNAME);
175 handle->_msg_ptr += b;
176 if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
178 NS_GET16(rr->type, handle->_msg_ptr);
179 NS_GET16(rr->rr_class, handle->_msg_ptr);
185 if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
187 NS_GET32(rr->ttl, handle->_msg_ptr);
188 NS_GET16(rr->rdlength, handle->_msg_ptr);
189 if (handle->_msg_ptr + rr->rdlength > handle->_eom)
191 rr->rdata = handle->_msg_ptr;
192 handle->_msg_ptr += rr->rdlength;
194 if (++handle->_rrnum > handle->_counts[(int)section])
195 setsection(handle, (ns_sect)((int)section + 1));
205 ns_parserr2(ns_msg *handle, ns_sect section, int rrnum, ns_rr2 *rr) {
212 if (section != handle->_sect)
213 setsection(handle, section);
217 rrnum = handle->_rrnum;
218 if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
220 if (rrnum < handle->_rrnum)
221 setsection(handle, section);
222 if (rrnum > handle->_rrnum) {
223 b = ns_skiprr(handle->_msg_ptr, handle->_eom, section,
224 rrnum - handle->_rrnum);
228 handle->_msg_ptr += b;
229 handle->_rrnum = rrnum;
233 b = ns_name_unpack2(handle->_msg, handle->_eom, handle->_msg_ptr,
237 handle->_msg_ptr += b;
238 if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
240 NS_GET16(rr->type, handle->_msg_ptr);
241 NS_GET16(rr->rr_class, handle->_msg_ptr);
247 if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
249 NS_GET32(rr->ttl, handle->_msg_ptr);
250 NS_GET16(rr->rdlength, handle->_msg_ptr);
251 if (handle->_msg_ptr + rr->rdlength > handle->_eom)
253 rr->rdata = handle->_msg_ptr;
254 handle->_msg_ptr += rr->rdlength;
256 if (++handle->_rrnum > handle->_counts[(int)section])
257 setsection(handle, (ns_sect)((int)section + 1));