dns-type.h revision d07b43a18e2234e8abebc1cd4d93bfd78ab62001
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 Zbigniew Jędrzejewski-Szmek
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/>.
***/
#pragma once
#include "macro.h"
/* DNS record types, taken from
*/
enum {
/* Normal records */
DNS_TYPE_A = 0x01,
DNS_TYPE_OPT, /* EDNS0 option */
DNS_TYPE_HIP = 0x37,
DNS_TYPE_SPF = 0x63,
DNS_TYPE_TKEY = 0xF9,
DNS_TYPE_TA = 0x8000,
_DNS_TYPE_INVALID = -1
};
/* DNS record classes, see RFC 1035 */
enum {
DNS_CLASS_IN = 0x01,
DNS_CLASS_ANY = 0xFF,
_DNS_CLASS_INVALID = -1
};
int dns_type_to_af(uint16_t t);
const char *dns_type_to_string(int type);
int dns_type_from_string(const char *s);
int dns_class_from_string(const char *name);