resolved-dns-rr.h revision 2e276efc7b0398a3086629a52970bdd4ab7252f9
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering This file is part of systemd.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Copyright 2014 Lennart Poettering
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is free software; you can redistribute it and/or modify it
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering under the terms of the GNU Lesser General Public License as published by
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering (at your option) any later version.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering systemd is distributed in the hope that it will be useful, but
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering Lesser General Public License for more details.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering You should have received a copy of the GNU Lesser General Public License
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringtypedef struct DnsResourceKey DnsResourceKey;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poetteringtypedef struct DnsResourceRecord DnsResourceRecord;
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/* DNS record classes, see RFC 1035 */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering/* DNS record types, see RFC 1035 */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* Normal records */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* Special records */
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering char *_name; /* don't access directy, use DNS_RESOURCE_KEY_NAME()! */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* struct { */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* uint16_t priority; */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* uint16_t weight; */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* uint16_t port; */
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart Poettering /* char *name; */
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringstatic inline const char* DNS_RESOURCE_KEY_NAME(const DnsResourceKey *key) {
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poettering return (char*) key + sizeof(DnsResourceKey);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDnsResourceKey* dns_resource_key_new_consume(uint16_t class, uint16_t type, char *name);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDnsResourceKey* dns_resource_key_ref(DnsResourceKey *key);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDnsResourceKey* dns_resource_key_unref(DnsResourceKey *key);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringint dns_resource_key_equal(const DnsResourceKey *a, const DnsResourceKey *b);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringint dns_resource_key_match_rr(const DnsResourceKey *key, const DnsResourceRecord *rr);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart Poetteringint dns_resource_key_match_cname(const DnsResourceKey *key, const DnsResourceRecord *rr);
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poetteringunsigned long dns_resource_key_hash_func(const void *i, const uint8_t hash_key[HASH_KEY_SIZE]);
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poetteringint dns_resource_key_compare_func(const void *a, const void *b);
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringint dns_resource_key_to_string(const DnsResourceKey *key, char **ret);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(DnsResourceKey*, dns_resource_key_unref);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDnsResourceRecord* dns_resource_record_new(DnsResourceKey *key);
8bf52d3d17d364438191077d0750b8b80b5dc53aLennart PoetteringDnsResourceRecord* dns_resource_record_new_full(uint16_t class, uint16_t type, const char *name);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart PoetteringDnsResourceRecord* dns_resource_record_ref(DnsResourceRecord *rr);
74b2466e14a1961bf3ac0e8a60cfaceec705bd59Lennart PoetteringDnsResourceRecord* dns_resource_record_unref(DnsResourceRecord *rr);
623a4c97b9175f95c4b1c6fc34e36c56f1e4ddbfLennart Poetteringint dns_resource_record_new_reverse(DnsResourceRecord **ret, int family, const union in_addr_union *address, const char *name);
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poetteringint dns_resource_record_equal(const DnsResourceRecord *a, const DnsResourceRecord *b);
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringint dns_resource_record_to_string(const DnsResourceRecord *rr, char **ret);
faa133f3aa7a18f26563dc5d6b95898cb315c37aLennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(DnsResourceRecord*, dns_resource_record_unref);
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poetteringconst char *dns_type_to_string(uint16_t type);
2d4c5cbc0ed3ccb09dc086a040088b454c22c644Lennart Poetteringint dns_type_from_string(const char *name, uint16_t *type);
322345fdb9865ef2477fba8e4bdde0e1183ef505Lennart Poetteringconst char *dns_class_to_string(uint16_t type);