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