1 |
/* Copyright 1999-2007 The Apache Software Foundation or its licensors, as |
2 |
* applicable. |
3 |
* |
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
* you may not use this file except in compliance with the License. |
6 |
* You may obtain a copy of the License at |
7 |
* |
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
* |
10 |
* Unless required by applicable law or agreed to in writing, software |
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
* See the License for the specific language governing permissions and |
14 |
* limitations under the License. |
15 |
*/ |
16 |
|
17 |
/* |
18 |
* Original Copyright (c) Netmask.IT!® 2006-2007 |
19 |
* |
20 |
* DNS Protocol module for Apache 2.x |
21 |
*/ |
22 |
|
23 |
#include "mod_dns.h" |
24 |
|
25 |
DNS_DECLARE(char *) dns_get_name_type(dns_type_t type) |
26 |
{ |
27 |
switch (type) { |
28 |
case DNS_TYPE_A: |
29 |
return "A"; |
30 |
case DNS_TYPE_NS: |
31 |
return "NS"; |
32 |
case DNS_TYPE_MD: |
33 |
return "MD"; |
34 |
case DNS_TYPE_MF: |
35 |
return "MF"; |
36 |
case DNS_TYPE_CNAME: |
37 |
return "CNAME"; |
38 |
case DNS_TYPE_SOA: |
39 |
return "SOA"; |
40 |
case DNS_TYPE_MB: |
41 |
return "MG"; |
42 |
case DNS_TYPE_MR: |
43 |
return "MR"; |
44 |
case DNS_TYPE_NULL: |
45 |
return "NULL"; |
46 |
case DNS_TYPE_WKS: |
47 |
return "WKS"; |
48 |
case DNS_TYPE_PTR: |
49 |
return "HINFO"; |
50 |
case DNS_TYPE_MINFO: |
51 |
return "MINFO"; |
52 |
case DNS_TYPE_MX: |
53 |
return "MX"; |
54 |
case DNS_TYPE_TXT: |
55 |
return "TXT"; |
56 |
case DNS_QTYPE_AXFR: |
57 |
return "AXFR"; |
58 |
case DNS_QTYPE_MAILA: |
59 |
return "MAILA"; |
60 |
case DNS_QTYPE_MAILB: |
61 |
return "MAILB"; |
62 |
case DNS_QTYPE_ALL: |
63 |
return "*"; |
64 |
default: |
65 |
return "INVALID"; |
66 |
} |
67 |
} |
68 |
|
69 |
DNS_DECLARE(char *) dns_get_name_class(dns_class_t type) |
70 |
{ |
71 |
switch (type) { |
72 |
case DNS_CLASS_IN: |
73 |
return "IN"; |
74 |
case DNS_CLASS_CS: |
75 |
return "CS"; |
76 |
case DNS_CLASS_CH: |
77 |
return "CH"; |
78 |
case DNS_CLASS_HS: |
79 |
return "HS"; |
80 |
case DNS_QCLASS_ALL: |
81 |
return "*"; |
82 |
default: |
83 |
return "INVALID"; |
84 |
} |
85 |
} |