resolved-dns-rr.c revision 0f84a72e3c0f58d71cff2121e6df1611eaf9c9ea
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync This file is part of systemd.
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync Copyright 2014 Lennart Poettering
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync systemd is free software; you can redistribute it and/or modify it
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync under the terms of the GNU Lesser General Public License as published by
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync the Free Software Foundation; either version 2.1 of the License, or
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync (at your option) any later version.
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync systemd is distributed in the hope that it will be useful, but
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync WITHOUT ANY WARRANTY; without even the implied warranty of
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync Lesser General Public License for more details.
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync You should have received a copy of the GNU Lesser General Public License
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsync along with systemd; If not, see <http://www.gnu.org/licenses/>.
a260560bdbc7bd737d59547882cd5e8d77b80d0avboxsyncDnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
return NULL;
DnsResourceKey *k;
return NULL;
return NULL;
k->n_ref++;
return NULL;
free(k);
k->n_ref--;
return NULL;
static unsigned long dns_resource_key_hash_func(const void *i, const uint8_t hash_key[HASH_KEY_SIZE]) {
const DnsResourceKey *k = i;
unsigned long ul;
return ul;
static int dns_resource_key_compare_func(const void *a, const void *b) {
const DnsResourceKey *x = a, *y = b;
int ret;
if (ret != 0)
return ret;
c = cbuf;
t = tbuf;
return -ENOMEM;
*ret = s;
if (!rr)
return NULL;
return rr;
if (!key)
return NULL;
if (!rr)
return NULL;
return rr;
if (!rr)
return NULL;
return NULL;
case DNS_TYPE_SRV:
case DNS_TYPE_PTR:
case DNS_TYPE_NS:
case DNS_TYPE_CNAME:
case DNS_TYPE_DNAME:
case DNS_TYPE_HINFO:
case DNS_TYPE_TXT:
case DNS_TYPE_SPF:
case DNS_TYPE_SOA:
case DNS_TYPE_MX:
case DNS_TYPE_SSHFP:
case DNS_TYPE_DNSKEY:
case DNS_TYPE_RRSIG:
case DNS_TYPE_LOC:
case DNS_TYPE_A:
case DNS_TYPE_AAAA:
return NULL;
int dns_resource_record_new_reverse(DnsResourceRecord **ret, int family, const union in_addr_union *address, const char *hostname) {
if (!key)
return -ENOMEM;
if (!rr)
return -ENOMEM;
return -ENOMEM;
assert(a);
assert(b);
case DNS_TYPE_SRV:
case DNS_TYPE_PTR:
case DNS_TYPE_NS:
case DNS_TYPE_CNAME:
case DNS_TYPE_DNAME:
case DNS_TYPE_HINFO:
case DNS_TYPE_TXT:
case DNS_TYPE_A:
case DNS_TYPE_AAAA:
case DNS_TYPE_SOA:
case DNS_TYPE_MX:
case DNS_TYPE_LOC:
case DNS_TYPE_SSHFP:
case DNS_TYPE_DNSKEY:
case DNS_TYPE_RRSIG:
NS,
EW,
return NULL;
case DNS_TYPE_SRV:
return -ENOMEM;
case DNS_TYPE_PTR:
case DNS_TYPE_NS:
case DNS_TYPE_CNAME:
case DNS_TYPE_DNAME:
return -ENOMEM;
case DNS_TYPE_HINFO:
return -ENOMEM;
case DNS_TYPE_TXT:
return -ENOMEM;
return -ENOMEM;
case DNS_TYPE_A: {
return -ENOMEM;
case DNS_TYPE_AAAA:
return -ENOMEM;
case DNS_TYPE_SOA:
return -ENOMEM;
case DNS_TYPE_MX:
return -ENOMEM;
case DNS_TYPE_LOC:
return -ENOMEM;
return -ENOMEM;
case DNS_TYPE_SSHFP:
return -ENOMEM;
return -ENOMEM;
case DNS_TYPE_DNSKEY: {
const char *alg;
return -ENOMEM;
return -ENOMEM;
case DNS_TYPE_RRSIG: {
return -ENOMEM;
* http://tools.ietf.org/html/rfc3597#section-5 */
return -ENOMEM;
return -ENOMEM;
return -ENOMEM;
*ret = s;
switch (class) {
case DNS_CLASS_IN:
case DNS_CLASS_ANY:
return NULL;
assert(s);
return -EINVAL;