summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/res_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/res_debug.c')
-rw-r--r--src/lib/libc/net/res_debug.c117
1 files changed, 1 insertions, 116 deletions
diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c
index 82a067c1f0..8e72c2a5e5 100644
--- a/src/lib/libc/net/res_debug.c
+++ b/src/lib/libc/net/res_debug.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_debug.c,v 1.20 2005/03/30 02:58:28 tedu Exp $ */ 1/* $OpenBSD: res_debug.c,v 1.21 2005/08/06 20:30:04 espie Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1990, 1993 4 * ++Copyright++ 1985, 1990, 1993
@@ -73,15 +73,6 @@
73 * --Copyright-- 73 * --Copyright--
74 */ 74 */
75 75
76#if defined(LIBC_SCCS) && !defined(lint)
77#if 0
78static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
79static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $";
80#else
81static char rcsid[] = "$OpenBSD: res_debug.c,v 1.20 2005/03/30 02:58:28 tedu Exp $";
82#endif
83#endif /* LIBC_SCCS and not lint */
84
85#include <sys/param.h> 76#include <sys/param.h>
86#include <sys/types.h> 77#include <sys/types.h>
87#include <sys/socket.h> 78#include <sys/socket.h>
@@ -836,75 +827,6 @@ __p_rr(const u_char *cp, const u_char *msg, FILE *file)
836 return (cp); 827 return (cp);
837} 828}
838 829
839/*
840 * Names of RR classes and qclasses. Classes and qclasses are the same, except
841 * that C_ANY is a qclass but not a class. (You can ask for records of class
842 * C_ANY, but you can't have any records of that class in the database.)
843 */
844const struct res_sym __p_class_syms[] = {
845 {C_IN, "IN"},
846 {C_CHAOS, "CHAOS"},
847 {C_HS, "HS"},
848 {C_HS, "HESIOD"},
849 {C_ANY, "ANY"},
850 {C_IN, (char *)0}
851};
852
853/*
854 * Names of RR types and qtypes. Types and qtypes are the same, except
855 * that T_ANY is a qtype but not a type. (You can ask for records of type
856 * T_ANY, but you can't have any records of that type in the database.)
857 */
858const struct res_sym __p_type_syms[] = {
859 {T_A, "A", "address"},
860 {T_NS, "NS", "name server"},
861 {T_MD, "MD", "mail destination (deprecated)"},
862 {T_MF, "MF", "mail forwarder (deprecated)"},
863 {T_CNAME, "CNAME", "canonical name"},
864 {T_SOA, "SOA", "start of authority"},
865 {T_MB, "MB", "mailbox"},
866 {T_MG, "MG", "mail group member"},
867 {T_MR, "MR", "mail rename"},
868 {T_NULL, "NULL", "null"},
869 {T_WKS, "WKS", "well-known service (deprecated)"},
870 {T_PTR, "PTR", "domain name pointer"},
871 {T_HINFO, "HINFO", "host information"},
872 {T_MINFO, "MINFO", "mailbox information"},
873 {T_MX, "MX", "mail exchanger"},
874 {T_TXT, "TXT", "text"},
875 {T_RP, "RP", "responsible person"},
876 {T_AFSDB, "AFSDB", "DCE or AFS server"},
877 {T_X25, "X25", "X25 address"},
878 {T_ISDN, "ISDN", "ISDN address"},
879 {T_RT, "RT", "router"},
880 {T_NSAP, "NSAP", "nsap address"},
881 {T_NSAP_PTR, "NSAP_PTR", "domain name pointer"},
882 {T_SIG, "SIG", "signature"},
883 {T_KEY, "KEY", "key"},
884 {T_PX, "PX", "mapping information"},
885 {T_GPOS, "GPOS", "geographical position (withdrawn)"},
886 {T_AAAA, "AAAA", "IPv6 address"},
887 {T_LOC, "LOC", "location"},
888 {T_NXT, "NXT", "next valid name (unimplemented)"},
889 {T_EID, "EID", "endpoint identifier (unimplemented)"},
890 {T_NIMLOC, "NIMLOC", "NIMROD locator (unimplemented)"},
891 {T_SRV, "SRV", "server selection"},
892 {T_ATMA, "ATMA", "ATM address (unimplemented)"},
893 {T_IXFR, "IXFR", "incremental zone transfer"},
894 {T_AXFR, "AXFR", "zone transfer"},
895 {T_MAILB, "MAILB", "mailbox-related data (deprecated)"},
896 {T_MAILA, "MAILA", "mail agent (deprecated)"},
897 {T_UINFO, "UINFO", "user information (nonstandard)"},
898 {T_UID, "UID", "user ID (nonstandard)"},
899 {T_GID, "GID", "group ID (nonstandard)"},
900 {T_NAPTR, "NAPTR", "URN Naming Authority"},
901#ifdef ALLOW_T_UNSPEC
902 {T_UNSPEC, "UNSPEC", "unspecified data (nonstandard)"},
903#endif /* ALLOW_T_UNSPEC */
904 {T_ANY, "ANY", "\"any\""},
905 {0, NULL, NULL}
906};
907
908int 830int
909__sym_ston(const struct res_sym *syms, char *name, int *success) 831__sym_ston(const struct res_sym *syms, char *name, int *success)
910{ 832{
@@ -920,25 +842,6 @@ __sym_ston(const struct res_sym *syms, char *name, int *success)
920 return (syms->number); /* The default value. */ 842 return (syms->number); /* The default value. */
921} 843}
922 844
923const char *
924__sym_ntos(const struct res_sym *syms, int number, int *success)
925{
926 static char unname[20];
927
928 for (; syms->name != 0; syms++) {
929 if (number == syms->number) {
930 if (success)
931 *success = 1;
932 return (syms->name);
933 }
934 }
935
936 snprintf(unname, sizeof unname, "%d", number);
937 if (success)
938 *success = 0;
939 return (unname);
940}
941
942 845
943const char * 846const char *
944__sym_ntop(const struct res_sym *syms, int number, int *success) 847__sym_ntop(const struct res_sym *syms, int number, int *success)
@@ -959,24 +862,6 @@ __sym_ntop(const struct res_sym *syms, int number, int *success)
959} 862}
960 863
961/* 864/*
962 * Return a string for the type
963 */
964const char *
965__p_type(int type)
966{
967 return (__sym_ntos (__p_type_syms, type, (int *)0));
968}
969
970/*
971 * Return a mnemonic for class
972 */
973const char *
974__p_class(int class)
975{
976 return (__sym_ntos (__p_class_syms, class, (int *)0));
977}
978
979/*
980 * Return a mnemonic for an option 865 * Return a mnemonic for an option
981 */ 866 */
982const char * 867const char *