Lines Matching defs: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 memmove(cn->rr_first->ttl_data, rrset->rr_first->ttl_data,
288 sldns_write_uint16(cn->rr_first->ttl_data+4, aliaslen);
289 memmove(cn->rr_first->ttl_data+6, alias, aliaslen);
290 cn->rr_first->size = sizeof(uint16_t)+aliaslen;
293 cn->rrset_all_next = nx;
295 prev->rrset_all_next = cn;
296 else msg->rrset_first = cn;
298 msg->rrset_last = cn;
303 *sname = cn->rr_first->ttl_data + sizeof(uint32_t)+sizeof(uint16_t);
305 return cn;