aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-08-09 07:15:19 +0000
committerGuy Harris <guy@alum.mit.edu>2000-08-09 07:15:19 +0000
commit86852f4fe8c22aa7e492fb68cb5efae780c16f7e (patch)
treeb89526124c4f5a4e84ec620221f198e236f16fc3 /packet-dns.c
parent42f7676996d7212f3fd95194689fbd576cf3c357 (diff)
Add #defines for class values, and use them rather than using the
numeric values. (Also, just for laughs and for completeness, turn the CS class into "csnet", even though it's obsolete and supposedly used only in some examples in obsolete RFCs.) svn path=/trunk/; revision=2240
Diffstat (limited to 'packet-dns.c')
-rw-r--r--packet-dns.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/packet-dns.c b/packet-dns.c
index 0e03e204b3..5bc44802d7 100644
--- a/packet-dns.c
+++ b/packet-dns.c
@@ -1,7 +1,7 @@
/* packet-dns.c
* Routines for DNS packet disassembly
*
- * $Id: packet-dns.c,v 1.50 2000/08/08 16:21:23 deniel Exp $
+ * $Id: packet-dns.c,v 1.51 2000/08/09 07:15:19 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -116,6 +116,12 @@ static gint ett_t_key_flags = -1;
#define T_WINS 65281 /* Microsoft's WINS RR */
#define T_WINS_R 65282 /* Microsoft's WINS-R RR */
+/* Class values */
+#define C_IN 1 /* the Internet */
+#define C_CS 2 /* CSNET (obsolete) */
+#define C_CH 3 /* CHAOS */
+#define C_HS 4 /* Hesiod */
+
/* Bit fields in the flags */
#define F_RESPONSE (1<<15) /* packet is response */
#define F_OPCODE (0xF<<11) /* query opcode */
@@ -330,13 +336,16 @@ dns_class_name(int class)
char *class_name;
switch (class) {
- case 1:
+ case C_IN:
class_name = "inet";
break;
- case 3:
+ case C_CS:
+ class_name = "csnet";
+ break;
+ case C_CH:
class_name = "chaos";
break;
- case 4:
+ case C_HS:
class_name = "hesiod";
break;
default:
@@ -737,7 +746,7 @@ dissect_dns_answer(const u_char *pd, int offset, int dns_data_offset,
proto_tree_add_text(rr_tree, NullTVB, cur_offset, 4, "Addr: %s",
ip_to_str((guint8 *)dptr));
}
- if (class == 1) {
+ if (class == C_IN) {
guint32 addr;
memcpy(&addr, dptr, sizeof(addr));
add_host_name(addr, name);