/* Copyright 1999-2007 The Apache Software Foundation or its licensors, as
 * applicable.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Original Copyright (c) Netmask.IT!® 2006-2007
 *
 * DNS Protocol module for Apache 2.x
 */

#include "mod_dns.h"

DNS_DECLARE(char *) dns_get_name_type(dns_type_t type)
{
    switch (type) {
    case DNS_TYPE_A:
        return "A";
    case DNS_TYPE_NS:
        return "NS";
    case DNS_TYPE_MD:
        return "MD";
    case DNS_TYPE_MF:
        return "MF";
    case DNS_TYPE_CNAME:
        return "CNAME";
    case DNS_TYPE_SOA:
        return "SOA";
    case DNS_TYPE_MB:
        return "MG";
    case DNS_TYPE_MR:
        return "MR";
    case DNS_TYPE_NULL:
        return "NULL";
    case DNS_TYPE_WKS:
        return "WKS";
    case DNS_TYPE_PTR:
        return "HINFO";
    case DNS_TYPE_MINFO:
        return "MINFO";
    case DNS_TYPE_MX:
        return "MX";
    case DNS_TYPE_TXT:
        return "TXT";
    case DNS_QTYPE_AXFR:
        return "AXFR";
    case DNS_QTYPE_MAILA:
        return "MAILA";
    case DNS_QTYPE_MAILB:
        return "MAILB";
    case DNS_QTYPE_ALL:
        return "*";
    default:
        return "INVALID";
    }
}

DNS_DECLARE(char *) dns_get_name_class(dns_class_t type)
{
    switch (type) {
    case DNS_CLASS_IN:
        return "IN";
    case DNS_CLASS_CS:
        return "CS";
    case DNS_CLASS_CH:
        return "CH";
    case DNS_CLASS_HS:
        return "HS";
    case DNS_QCLASS_ALL:
        return "*";
    default:
        return "INVALID";
    }
}
