Lines Matching +full:pkt +full:- +full:size

8  * (c) NLnet Labs, 2004-2006
43 return packet->_header->_id; in ldns_pkt_id()
49 return packet->_header->_qr; in ldns_pkt_qr()
55 return packet->_header->_aa; in ldns_pkt_aa()
61 return packet->_header->_tc; in ldns_pkt_tc()
67 return packet->_header->_rd; in ldns_pkt_rd()
73 return packet->_header->_cd; in ldns_pkt_cd()
79 return packet->_header->_ra; in ldns_pkt_ra()
85 return packet->_header->_ad; in ldns_pkt_ad()
91 return packet->_header->_opcode; in ldns_pkt_get_opcode()
97 return packet->_header->_rcode; in ldns_pkt_get_rcode()
103 return packet->_header->_qdcount; in ldns_pkt_qdcount()
109 return packet->_header->_ancount; in ldns_pkt_ancount()
115 return packet->_header->_nscount; in ldns_pkt_nscount()
121 return packet->_header->_arcount; in ldns_pkt_arcount()
127 return packet->_question; in ldns_pkt_question()
133 return packet->_answer; in ldns_pkt_answer()
139 return packet->_authority; in ldns_pkt_authority()
145 return packet->_additional; in ldns_pkt_additional()
186 return packet->_size; in ldns_pkt_size()
192 return packet->_querytime; in ldns_pkt_querytime()
198 return packet->_answerfrom; in ldns_pkt_answerfrom()
204 return packet->timestamp; in ldns_pkt_timestamp()
210 return packet->_edns_udp_size; in ldns_pkt_edns_udp_size()
216 return packet->_edns_extended_rcode; in ldns_pkt_edns_extended_rcode()
222 return packet->_edns_version; in ldns_pkt_edns_version()
228 return packet->_edns_z; in ldns_pkt_edns_z()
234 return (packet->_edns_z & LDNS_EDNS_MASK_DO_BIT); in ldns_pkt_edns_do()
241 packet->_edns_z = packet->_edns_z | LDNS_EDNS_MASK_DO_BIT; in ldns_pkt_set_edns_do()
243 packet->_edns_z = packet->_edns_z & ~LDNS_EDNS_MASK_DO_BIT; in ldns_pkt_set_edns_do()
250 return (packet->_edns_z & LDNS_EDNS_MASK_UNASSIGNED); in ldns_pkt_edns_unassigned()
256 packet->_edns_z = (packet->_edns_z & ~LDNS_EDNS_MASK_UNASSIGNED) in ldns_pkt_set_edns_unassigned()
263 return packet->_edns_data; in ldns_pkt_edns_data()
378 ldns_pkt_rr(const ldns_pkt *pkt, ldns_pkt_section sec, const ldns_rr *rr) in ldns_pkt_rr() argument
384 return ldns_rr_list_contains_rr(ldns_pkt_question(pkt), rr); in ldns_pkt_rr()
386 return ldns_rr_list_contains_rr(ldns_pkt_answer(pkt), rr); in ldns_pkt_rr()
388 return ldns_rr_list_contains_rr(ldns_pkt_authority(pkt), rr); in ldns_pkt_rr()
390 return ldns_rr_list_contains_rr(ldns_pkt_additional(pkt), rr); in ldns_pkt_rr()
392 result = ldns_rr_list_contains_rr(ldns_pkt_question(pkt), rr); in ldns_pkt_rr()
396 || ldns_rr_list_contains_rr(ldns_pkt_answer(pkt), rr) in ldns_pkt_rr()
397 || ldns_rr_list_contains_rr(ldns_pkt_authority(pkt), rr) in ldns_pkt_rr()
398 || ldns_rr_list_contains_rr(ldns_pkt_additional(pkt), rr); in ldns_pkt_rr()
466 ldns_rr *ldns_pkt_tsig(const ldns_pkt *pkt) { in ldns_pkt_tsig() argument
467 return pkt->_tsig_rr; in ldns_pkt_tsig()
474 packet->_header->_id = id; in ldns_pkt_set_id()
488 packet->_header->_qr = qr; in ldns_pkt_set_qr()
494 packet->_header->_aa = aa; in ldns_pkt_set_aa()
500 packet->_header->_tc = tc; in ldns_pkt_set_tc()
506 packet->_header->_rd = rd; in ldns_pkt_set_rd()
512 p->_additional = rr; in ldns_pkt_set_additional()
518 p->_question = rr; in ldns_pkt_set_question()
524 p->_answer = rr; in ldns_pkt_set_answer()
530 p->_authority = rr; in ldns_pkt_set_authority()
536 packet->_header->_cd = cd; in ldns_pkt_set_cd()
542 packet->_header->_ra = ra; in ldns_pkt_set_ra()
548 packet->_header->_ad = ad; in ldns_pkt_set_ad()
554 packet->_header->_opcode = opcode; in ldns_pkt_set_opcode()
560 packet->_header->_rcode = rcode; in ldns_pkt_set_rcode()
566 packet->_header->_qdcount = qdcount; in ldns_pkt_set_qdcount()
572 packet->_header->_ancount = ancount; in ldns_pkt_set_ancount()
578 packet->_header->_nscount = nscount; in ldns_pkt_set_nscount()
584 packet->_header->_arcount = arcount; in ldns_pkt_set_arcount()
590 packet->_querytime = time; in ldns_pkt_set_querytime()
596 packet->_answerfrom = answerfrom; in ldns_pkt_set_answerfrom()
602 packet->timestamp.tv_sec = timeval.tv_sec; in ldns_pkt_set_timestamp()
603 packet->timestamp.tv_usec = timeval.tv_usec; in ldns_pkt_set_timestamp()
609 packet->_size = s; in ldns_pkt_set_size()
615 packet->_edns_udp_size = s; in ldns_pkt_set_edns_udp_size()
621 packet->_edns_extended_rcode = c; in ldns_pkt_set_edns_extended_rcode()
627 packet->_edns_version = v; in ldns_pkt_set_edns_version()
633 packet->_edns_z = z; in ldns_pkt_set_edns_z()
639 packet->_edns_data = data; in ldns_pkt_set_edns_data()
645 if (packet->_edns_list) in ldns_pkt_set_edns_option_list()
646 ldns_edns_option_list_deep_free(packet->_edns_list); in ldns_pkt_set_edns_option_list()
647 packet->_edns_list = list; in ldns_pkt_set_edns_option_list()
673 void ldns_pkt_set_tsig(ldns_pkt *pkt, ldns_rr *rr) in ldns_pkt_set_tsig() argument
675 pkt->_tsig_rr = rr; in ldns_pkt_set_tsig()
715 ldns_pkt_safe_push_rr(ldns_pkt *pkt, ldns_pkt_section sec, ldns_rr *rr) in ldns_pkt_safe_push_rr() argument
719 if (ldns_pkt_rr(pkt, sec, rr)) { in ldns_pkt_safe_push_rr()
723 return ldns_pkt_push_rr(pkt, sec, rr); in ldns_pkt_safe_push_rr()
751 ldns_pkt_edns(const ldns_pkt *pkt) in ldns_pkt_edns() argument
753 return (ldns_pkt_edns_udp_size(pkt) > 0 || in ldns_pkt_edns()
754 ldns_pkt_edns_extended_rcode(pkt) > 0 || in ldns_pkt_edns()
755 ldns_pkt_edns_data(pkt) || in ldns_pkt_edns()
756 ldns_pkt_edns_do(pkt) || in ldns_pkt_edns()
757 pkt->_edns_list || in ldns_pkt_edns()
758 pkt->_edns_present in ldns_pkt_edns()
790 size_t size = ldns_read_uint16(&wire[pos+2]); in pkt_edns_data2edns_option_list() local
793 if (pos + size > max) { /* make sure the size fits the data */ in pkt_edns_data2edns_option_list()
797 data = LDNS_XMALLOC(uint8_t, size); in pkt_edns_data2edns_option_list()
803 memcpy(data, &wire[pos], size); in pkt_edns_data2edns_option_list()
804 pos += size; in pkt_edns_data2edns_option_list()
806 edns = ldns_edns_new(code, size, data); in pkt_edns_data2edns_option_list()
825 if (packet->_edns_list != NULL) in ldns_pkt_edns_get_option_list()
826 return packet->_edns_list; in ldns_pkt_edns_get_option_list()
829 * packet->_edns_data in ldns_pkt_edns_get_option_list()
834 return ( packet->_edns_list in ldns_pkt_edns_get_option_list()
850 packet->_header = LDNS_MALLOC(ldns_hdr); in ldns_pkt_new()
851 if (!packet->_header) { in ldns_pkt_new()
856 packet->_question = ldns_rr_list_new(); in ldns_pkt_new()
857 packet->_answer = ldns_rr_list_new(); in ldns_pkt_new()
858 packet->_authority = ldns_rr_list_new(); in ldns_pkt_new()
859 packet->_additional = ldns_rr_list_new(); in ldns_pkt_new()
875 memset(&packet->timestamp, 0, sizeof(packet->timestamp)); in ldns_pkt_new()
887 packet->_edns_list = NULL; in ldns_pkt_new()
888 packet->_edns_present = false; in ldns_pkt_new()
899 LDNS_FREE(packet->_header); in ldns_pkt_free()
900 ldns_rr_list_deep_free(packet->_question); in ldns_pkt_free()
901 ldns_rr_list_deep_free(packet->_answer); in ldns_pkt_free()
902 ldns_rr_list_deep_free(packet->_authority); in ldns_pkt_free()
903 ldns_rr_list_deep_free(packet->_additional); in ldns_pkt_free()
904 ldns_rr_free(packet->_tsig_rr); in ldns_pkt_free()
905 ldns_rdf_deep_free(packet->_edns_data); in ldns_pkt_free()
906 ldns_edns_option_list_deep_free(packet->_edns_list); in ldns_pkt_free()
907 ldns_rdf_deep_free(packet->_answerfrom); in ldns_pkt_free()
1070 packet->_tsig_rr = NULL; in ldns_pkt_query_new_frm_str_internal()
1144 packet->_tsig_rr = NULL; in ldns_pkt_query_new_internal()
1215 ldns_pkt_clone(const ldns_pkt *pkt) in ldns_pkt_clone() argument
1219 if (!pkt) { in ldns_pkt_clone()
1224 ldns_pkt_set_id(new_pkt, ldns_pkt_id(pkt)); in ldns_pkt_clone()
1225 ldns_pkt_set_qr(new_pkt, ldns_pkt_qr(pkt)); in ldns_pkt_clone()
1226 ldns_pkt_set_aa(new_pkt, ldns_pkt_aa(pkt)); in ldns_pkt_clone()
1227 ldns_pkt_set_tc(new_pkt, ldns_pkt_tc(pkt)); in ldns_pkt_clone()
1228 ldns_pkt_set_rd(new_pkt, ldns_pkt_rd(pkt)); in ldns_pkt_clone()
1229 ldns_pkt_set_cd(new_pkt, ldns_pkt_cd(pkt)); in ldns_pkt_clone()
1230 ldns_pkt_set_ra(new_pkt, ldns_pkt_ra(pkt)); in ldns_pkt_clone()
1231 ldns_pkt_set_ad(new_pkt, ldns_pkt_ad(pkt)); in ldns_pkt_clone()
1232 ldns_pkt_set_opcode(new_pkt, ldns_pkt_get_opcode(pkt)); in ldns_pkt_clone()
1233 ldns_pkt_set_rcode(new_pkt, ldns_pkt_get_rcode(pkt)); in ldns_pkt_clone()
1234 ldns_pkt_set_qdcount(new_pkt, ldns_pkt_qdcount(pkt)); in ldns_pkt_clone()
1235 ldns_pkt_set_ancount(new_pkt, ldns_pkt_ancount(pkt)); in ldns_pkt_clone()
1236 ldns_pkt_set_nscount(new_pkt, ldns_pkt_nscount(pkt)); in ldns_pkt_clone()
1237 ldns_pkt_set_arcount(new_pkt, ldns_pkt_arcount(pkt)); in ldns_pkt_clone()
1238 if (ldns_pkt_answerfrom(pkt)) in ldns_pkt_clone()
1240 ldns_rdf_clone(ldns_pkt_answerfrom(pkt))); in ldns_pkt_clone()
1241 ldns_pkt_set_timestamp(new_pkt, ldns_pkt_timestamp(pkt)); in ldns_pkt_clone()
1242 ldns_pkt_set_querytime(new_pkt, ldns_pkt_querytime(pkt)); in ldns_pkt_clone()
1243 ldns_pkt_set_size(new_pkt, ldns_pkt_size(pkt)); in ldns_pkt_clone()
1244 ldns_pkt_set_tsig(new_pkt, ldns_rr_clone(ldns_pkt_tsig(pkt))); in ldns_pkt_clone()
1246 ldns_pkt_set_edns_udp_size(new_pkt, ldns_pkt_edns_udp_size(pkt)); in ldns_pkt_clone()
1248 ldns_pkt_edns_extended_rcode(pkt)); in ldns_pkt_clone()
1249 ldns_pkt_set_edns_version(new_pkt, ldns_pkt_edns_version(pkt)); in ldns_pkt_clone()
1250 new_pkt->_edns_present = pkt->_edns_present; in ldns_pkt_clone()
1251 ldns_pkt_set_edns_z(new_pkt, ldns_pkt_edns_z(pkt)); in ldns_pkt_clone()
1252 if(ldns_pkt_edns_data(pkt)) in ldns_pkt_clone()
1254 ldns_rdf_clone(ldns_pkt_edns_data(pkt))); in ldns_pkt_clone()
1255 ldns_pkt_set_edns_do(new_pkt, ldns_pkt_edns_do(pkt)); in ldns_pkt_clone()
1256 if (pkt->_edns_list) in ldns_pkt_clone()
1258 ldns_edns_option_list_clone(pkt->_edns_list)); in ldns_pkt_clone()
1260 ldns_rr_list_deep_free(new_pkt->_question); in ldns_pkt_clone()
1261 ldns_rr_list_deep_free(new_pkt->_answer); in ldns_pkt_clone()
1262 ldns_rr_list_deep_free(new_pkt->_authority); in ldns_pkt_clone()
1263 ldns_rr_list_deep_free(new_pkt->_additional); in ldns_pkt_clone()
1264 new_pkt->_question = ldns_rr_list_clone(ldns_pkt_question(pkt)); in ldns_pkt_clone()
1265 new_pkt->_answer = ldns_rr_list_clone(ldns_pkt_answer(pkt)); in ldns_pkt_clone()
1266 new_pkt->_authority = ldns_rr_list_clone(ldns_pkt_authority(pkt)); in ldns_pkt_clone()
1267 new_pkt->_additional = ldns_rr_list_clone(ldns_pkt_additional(pkt)); in ldns_pkt_clone()