summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-17 19:38:37 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-17 19:39:50 +0200
commit322345fdb9865ef2477fba8e4bdde0e1183ef505 (patch)
tree6ac6b255f03e86c6b0029d0119eede7f4317d62c /src/resolve/resolved-dns-packet.h
parentc5ed93163e6ef51a7462aa558a7e0912b17c4951 (diff)
resolved: add DNS cache
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r--src/resolve/resolved-dns-packet.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index de3a789a78..67c7bc3dfc 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -57,6 +57,7 @@ struct DnsPacket {
int ifindex;
size_t size, allocated, rindex;
Hashmap *names; /* For name compression */
+ DnsResourceRecord **rrs;
void *data;
};
@@ -92,6 +93,12 @@ static inline uint8_t* DNS_PACKET_DATA(DnsPacket *p) {
((uint16_t) !!cd << 4) | \
((uint16_t) (rcode & 15)))
+static inline unsigned DNS_PACKET_RRCOUNT(DnsPacket *p) {
+ return
+ (unsigned) DNS_PACKET_ANCOUNT(p) +
+ (unsigned) DNS_PACKET_NSCOUNT(p) +
+ (unsigned) DNS_PACKET_ARCOUNT(p);
+}
int dns_packet_new(DnsPacket **p, size_t mtu);
int dns_packet_new_query(DnsPacket **p, size_t mtu);
@@ -123,6 +130,7 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start);
void dns_packet_rewind(DnsPacket *p, size_t idx);
int dns_packet_skip_question(DnsPacket *p);
+int dns_packet_extract_rrs(DnsPacket *p);
enum {
DNS_RCODE_SUCCESS = 0,