resolved-dns-rr.h revision 50f1e641a93cacfc693b0c3d300bee5df0c8c460
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
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 "bitmap.h"
#include "hashmap.h"
#include "in-addr-util.h"
#include "dns-type.h"
typedef struct DnsResourceKey DnsResourceKey;
typedef struct DnsResourceRecord DnsResourceRecord;
/* DNS record classes, see RFC 1035 */
enum {
DNS_CLASS_IN = 0x01,
DNS_CLASS_ANY = 0xFF,
_DNS_CLASS_INVALID = -1
};
struct DnsResourceKey {
unsigned n_ref;
char *_name; /* don't access directy, use DNS_RESOURCE_KEY_NAME()! */
};
struct DnsResourceRecord {
unsigned n_ref;
bool unparseable;
union {
struct {
void *data;
} generic;
struct {
char *name;
} srv;
struct {
char *name;
struct {
char *cpu;
char *os;
} hinfo;
struct {
char **strings;
struct {
} a;
struct {
} aaaa;
struct {
char *mname;
char *rname;
} soa;
struct {
char *exchange;
} mx;
struct {
} loc;
struct {
void *digest;
} ds;
struct {
void *key;
} sshfp;
/* http://tools.ietf.org/html/rfc4034#section-2.1 */
struct {
bool zone_key_flag:1;
bool sep_flag:1;
void* key;
} dnskey;
/* http://tools.ietf.org/html/rfc4034#section-3.1 */
struct {
char *signer;
void *signature;
} rrsig;
struct {
char *next_domain_name;
} nsec;
};
};
if (_unlikely_(!key))
return NULL;
return (char*) key + sizeof(DnsResourceKey);
}
int dns_resource_record_new_reverse(DnsResourceRecord **ret, int family, const union in_addr_union *address, const char *name);
extern const struct hash_ops dns_resource_key_hash_ops;