Lines Matching defs:DnsPacket

31 typedef struct DnsPacket DnsPacket;
71 struct DnsPacket {
92 DnsPacket *more;
100 static inline uint8_t* DNS_PACKET_DATA(DnsPacket *p) {
107 return ((uint8_t*) p) + ALIGN(sizeof(DnsPacket));
121 static inline uint16_t DNS_PACKET_RCODE(DnsPacket *p) {
152 static inline unsigned DNS_PACKET_RRCOUNT(DnsPacket *p) {
159 int dns_packet_new(DnsPacket **p, DnsProtocol protocol, size_t mtu);
160 int dns_packet_new_query(DnsPacket **p, DnsProtocol protocol, size_t mtu, bool dnssec_checking_disabled);
162 void dns_packet_set_flags(DnsPacket *p, bool dnssec_checking_disabled, bool truncated);
164 DnsPacket *dns_packet_ref(DnsPacket *p);
165 DnsPacket *dns_packet_unref(DnsPacket *p);
167 DEFINE_TRIVIAL_CLEANUP_FUNC(DnsPacket*, dns_packet_unref);
169 int dns_packet_validate(DnsPacket *p);
170 int dns_packet_validate_reply(DnsPacket *p);
171 int dns_packet_validate_query(DnsPacket *p);
173 int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key);
175 int dns_packet_append_blob(DnsPacket *p, const void *d, size_t sz, size_t *start);
176 int dns_packet_append_uint8(DnsPacket *p, uint8_t v, size_t *start);
177 int dns_packet_append_uint16(DnsPacket *p, uint16_t v, size_t *start);
178 int dns_packet_append_uint32(DnsPacket *p, uint32_t v, size_t *start);
179 int dns_packet_append_string(DnsPacket *p, const char *s, size_t *start);
180 int dns_packet_append_raw_string(DnsPacket *p, const void *s, size_t size, size_t *start);
181 int dns_packet_append_label(DnsPacket *p, const char *s, size_t l, bool canonical_candidate, size_t *start);
182 int dns_packet_append_name(DnsPacket *p, const char *name, bool allow_compression, bool canonical_candidate, size_t *start);
183 int dns_packet_append_key(DnsPacket *p, const DnsResourceKey *key, size_t *start);
184 int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, size_t *start, size_t *rdata_start);
185 int dns_packet_append_opt(DnsPacket *p, uint16_t max_udp_size, bool edns0_do, size_t *start);
187 void dns_packet_truncate(DnsPacket *p, size_t sz);
188 int dns_packet_truncate_opt(DnsPacket *p);
190 int dns_packet_read(DnsPacket *p, size_t sz, const void **ret, size_t *start);
191 int dns_packet_read_blob(DnsPacket *p, void *d, size_t sz, size_t *start);
192 int dns_packet_read_uint8(DnsPacket *p, uint8_t *ret, size_t *start);
193 int dns_packet_read_uint16(DnsPacket *p, uint16_t *ret, size_t *start);
194 int dns_packet_read_uint32(DnsPacket *p, uint32_t *ret, size_t *start);
195 int dns_packet_read_string(DnsPacket *p, char **ret, size_t *start);
196 int dns_packet_read_raw_string(DnsPacket *p, const void **ret, size_t *size, size_t *start);
197 int dns_packet_read_name(DnsPacket *p, char **ret, bool allow_compression, size_t *start);
198 int dns_packet_read_key(DnsPacket *p, DnsResourceKey **ret, bool *ret_cache_flush, size_t *start);
199 int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, bool *ret_cache_flush, size_t *start);
201 void dns_packet_rewind(DnsPacket *p, size_t idx);
203 int dns_packet_skip_question(DnsPacket *p);
204 int dns_packet_extract(DnsPacket *p);
206 static inline bool DNS_PACKET_SHALL_CACHE(DnsPacket *p) {