Lines Matching refs:cn
257 struct rrset_parse* cn = (struct rrset_parse*)regional_alloc(region,
259 if(!cn)
261 memset(cn, 0, sizeof(*cn));
262 cn->rr_first = (struct rr_parse*)regional_alloc(region,
264 if(!cn->rr_first)
266 cn->rr_last = cn->rr_first;
268 cn->dname = (uint8_t*)regional_alloc(region, *snamelen);
269 if(!cn->dname)
271 dname_pkt_copy(pkt, cn->dname, *sname);
272 cn->dname_len = *snamelen;
273 cn->type = LDNS_RR_TYPE_CNAME;
274 cn->section = rrset->section;
275 cn->rrset_class = rrset->rrset_class;
276 cn->rr_count = 1;
277 cn->size = sizeof(uint16_t) + aliaslen;
278 cn->hash=pkt_hash_rrset(pkt, cn->dname, cn->type, cn->rrset_class, 0);
280 memset(cn->rr_first, 0, sizeof(struct rr_parse));
281 cn->rr_first->outside_packet = 1;
282 cn->rr_first->ttl_data = (uint8_t*)regional_alloc(region,
284 if(!cn->rr_first->ttl_data)
286 sldns_write_uint32(cn->rr_first->ttl_data, 0); /* TTL = 0 */
287 sldns_write_uint16(cn->rr_first->ttl_data+4, aliaslen);
288 memmove(cn->rr_first->ttl_data+6, alias, aliaslen);
289 cn->rr_first->size = sizeof(uint16_t)+aliaslen;
292 cn->rrset_all_next = nx;
294 prev->rrset_all_next = cn;
295 else msg->rrset_first = cn;
297 msg->rrset_last = cn;
302 *sname = cn->rr_first->ttl_data + sizeof(uint32_t)+sizeof(uint16_t);
304 return cn;