Lines Matching defs:cn
239 struct rrset_parse* cn = (struct rrset_parse*)regional_alloc(region,
241 if(!cn)
243 memset(cn, 0, sizeof(*cn));
244 cn->rr_first = (struct rr_parse*)regional_alloc(region,
246 if(!cn->rr_first)
248 cn->rr_last = cn->rr_first;
250 cn->dname = (uint8_t*)regional_alloc(region, *snamelen);
251 if(!cn->dname)
253 dname_pkt_copy(pkt, cn->dname, *sname);
254 cn->dname_len = *snamelen;
255 cn->type = LDNS_RR_TYPE_CNAME;
256 cn->section = rrset->section;
257 cn->rrset_class = rrset->rrset_class;
258 cn->rr_count = 1;
259 cn->size = sizeof(uint16_t) + aliaslen;
260 cn->hash=pkt_hash_rrset(pkt, cn->dname, cn->type, cn->rrset_class, 0);
262 memset(cn->rr_first, 0, sizeof(struct rr_parse));
263 cn->rr_first->outside_packet = 1;
264 cn->rr_first->ttl_data = (uint8_t*)regional_alloc(region,
266 if(!cn->rr_first->ttl_data)
268 sldns_write_uint32(cn->rr_first->ttl_data, 0); /* TTL = 0 */
269 sldns_write_uint16(cn->rr_first->ttl_data+4, aliaslen);
270 memmove(cn->rr_first->ttl_data+6, alias, aliaslen);
271 cn->rr_first->size = sizeof(uint16_t)+aliaslen;
274 cn->rrset_all_next = nx;
276 prev->rrset_all_next = cn;
277 else msg->rrset_first = cn;
279 msg->rrset_last = cn;
284 *sname = cn->rr_first->ttl_data + sizeof(uint32_t)+sizeof(uint16_t);
286 return cn;