resolved-dns-rr.c revision 623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbf
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "resolved-dns-domain.h"
#include "resolved-dns-rr.h"
DnsResourceKey *k;
size_t l;
if (!k)
return NULL;
k->n_ref = 1;
return k;
}
DnsResourceKey *k;
if (!k)
return NULL;
k->n_ref = 1;
return k;
}
if (!k)
return NULL;
k->n_ref++;
return k;
}
if (!k)
return NULL;
if (k->n_ref == 1) {
free(k);
} else
k->n_ref--;
return NULL;
}
int r;
if (r <= 0)
return r;
return 0;
return 0;
return 1;
}
return 0;
return 0;
}
return 0;
return 0;
}
const DnsResourceKey *k = i;
unsigned long ul;
return ul;
}
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;
return -1;
return 1;
return -1;
return 1;
return 0;
}
if (!rr)
return NULL;
return rr;
}
if (!rr)
return NULL;
return rr;
}
if (!rr)
return NULL;
return NULL;
}
}
return NULL;
}
int dns_resource_record_new_reverse(DnsResourceRecord **ret, int family, const union in_addr_union *address, const char *hostname) {
int r;
if (r < 0)
return r;
if (!key)
return -ENOMEM;
if (!rr)
return -ENOMEM;
return -ENOMEM;
return 0;
}
int r;
assert(a);
assert(b);
if (r <= 0)
return r;
if (r <= 0)
return r;
if (r <= 0)
return r;
} else
}
switch (class) {
case DNS_CLASS_IN:
return "IN";
case DNS_CLASS_ANY:
return "ANY";
}
return NULL;
}
switch (type) {
case DNS_TYPE_A:
return "A";
case DNS_TYPE_NS:
return "NS";
case DNS_TYPE_CNAME:
return "CNAME";
case DNS_TYPE_SOA:
return "SOA";
case DNS_TYPE_PTR:
return "PTR";
case DNS_TYPE_HINFO:
return "HINFO";
case DNS_TYPE_MX:
return "MX";
case DNS_TYPE_TXT:
return "TXT";
case DNS_TYPE_AAAA:
return "AAAA";
case DNS_TYPE_SRV:
return "SRV";
case DNS_TYPE_SSHFP:
return "SSHFP";
case DNS_TYPE_DNAME:
return "DNAME";
case DNS_TYPE_ANY:
return "ANY";
case DNS_TYPE_OPT:
return "OPT";
case DNS_TYPE_TKEY:
return "TKEY";
case DNS_TYPE_TSIG:
return "TSIG";
case DNS_TYPE_IXFR:
return "IXFR";
case DNS_TYPE_AXFR:
return "AXFR";
}
return NULL;
}