X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fresolve%2Fresolved-dns-packet.h;h=4e3001911e7c74a64e27ff9c4946c699b286a5fc;hb=8db0d2f5c37e7e8f5bfce016cfdad7947a3ea939;hp=af51f16c3c8dac822933260b3f2371bd49db2462;hpb=ea917db9e662ae6e6d0ae07e0118b323688c8616;p=elogind.git diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h index af51f16c3..4e3001911 100644 --- a/src/resolve/resolved-dns-packet.h +++ b/src/resolve/resolved-dns-packet.h @@ -192,3 +192,11 @@ DnsProtocol dns_protocol_from_string(const char *s) _pure_; #define LLMNR_MULTICAST_IPV4_ADDRESS ((struct in_addr) { .s_addr = htobe32(224U << 24 | 252U) }) #define LLMNR_MULTICAST_IPV6_ADDRESS ((struct in6_addr) { .s6_addr = { 0xFF, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03 } }) + +#define DNSKEY_FLAG_ZONE_KEY (1u << 8) +#define DNSKEY_FLAG_SEP (1u << 0) + +static inline uint16_t dnskey_to_flags(const DnsResourceRecord *rr) { + return (rr->dnskey.zone_key_flag * DNSKEY_FLAG_ZONE_KEY | + rr->dnskey.sep_flag * DNSKEY_FLAG_SEP); +}