aboutsummaryrefslogtreecommitdiffstats
path: root/randpkt.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-10-06 20:29:26 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-10-06 20:29:26 +0000
commit48161094d3ea95e1dbbdaa8aefed43d79fe0dd84 (patch)
tree5a199ad0080b77e4473f3a127956debfc674d461 /randpkt.c
parent1b7bd2f14b411ca3955d9d544d1fb2c8591adc26 (diff)
Added ICMP and DNS to randpkt.
svn path=/trunk/; revision=777
Diffstat (limited to 'randpkt.c')
-rw-r--r--randpkt.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/randpkt.c b/randpkt.c
index c3a4c52b5e..746ed812d8 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -4,7 +4,7 @@
* Creates random packet traces. Useful for debugging sniffers by testing
* assumptions about the veracity of the data found in the packet.
*
- * $Id: randpkt.c,v 1.3 1999/09/17 04:38:14 gram Exp $
+ * $Id: randpkt.c,v 1.4 1999/10/06 20:29:26 gram Exp $
*
* Copyright (C) 1999 by Gilbert Ramirez <gram@xiexie.org>
*
@@ -49,8 +49,10 @@
/* Types of produceable packets */
enum {
PKT_ARP,
+ PKT_DNS,
PKT_ETHERNET,
PKT_FDDI,
+ PKT_ICMP,
PKT_IP,
PKT_LLC,
PKT_TCP,
@@ -75,6 +77,38 @@ guint8 pkt_arp[] = {
0x08, 0x06
};
+/* Ethernet+IP+UP, indicating DNS */
+guint8 pkt_dns[] = {
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01,
+ 0x08, 0x00,
+
+ 0x45, 0x00, 0x00, 0x3c,
+ 0xc5, 0x9e, 0x40, 0x00,
+ 0xff, 0x11, 0xd7, 0xe0,
+ 0xd0, 0x15, 0x02, 0xb8,
+ 0x0a, 0x01, 0x01, 0x63,
+
+ 0x05, 0xe8, 0x00, 0x35,
+ 0x00, 0x00, 0x2a, 0xb9,
+ 0x30
+};
+
+/* Ethernet+IP, indicating ICMPP */
+guint8 pkt_icmp[] = {
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01,
+ 0x08, 0x00,
+
+ 0x45, 0x00, 0x00, 0x54,
+ 0x8f, 0xb3, 0x40, 0x00,
+ 0xfd, 0x01, 0x8a, 0x99,
+ 0xcc, 0xfc, 0x66, 0x0b,
+ 0xce, 0x41, 0x62, 0x12
+};
+
/* Ethernet, indicating IP */
guint8 pkt_ip[] = {
0xff, 0xff, 0xff, 0xff,
@@ -127,12 +161,18 @@ pkt_example examples[] = {
{ "arp", "Address Resolution Protocol",
PKT_ARP, pkt_arp, WTAP_ENCAP_ETHERNET, array_length(pkt_arp) },
+ { "dns", "Domain Name Service",
+ PKT_DNS, pkt_dns, WTAP_ENCAP_ETHERNET, array_length(pkt_dns) },
+
{ "eth", "Ethernet",
PKT_ETHERNET, NULL, WTAP_ENCAP_ETHERNET, 0 },
{ "fddi", "Fiber Distributed Data Interface",
PKT_FDDI, NULL, WTAP_ENCAP_FDDI, 0 },
+ { "icmp", "Internet Control Message Protocol",
+ PKT_ICMP, pkt_icmp, WTAP_ENCAP_ETHERNET, array_length(pkt_icmp) },
+
{ "ip", "Internet Protocol",
PKT_IP, pkt_ip, WTAP_ENCAP_ETHERNET, array_length(pkt_ip) },