From 9afeafe88ec90da1b4478be5006bb2cef5edc966 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 15 Oct 2002 02:29:54 +0000 Subject: Fix signed/unsigned type mismatches, as pointed out by Silvio. Add BGP output to randpkt. svn path=/trunk/; revision=6420 --- randpkt.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'randpkt.c') diff --git a/randpkt.c b/randpkt.c index 342a28edfc..9bc769796e 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.15 2002/08/28 21:00:41 jmayer Exp $ + * $Id: randpkt.c,v 1.16 2002/10/15 02:29:54 gerald Exp $ * * Copyright (C) 1999 by Gilbert Ramirez * @@ -62,7 +62,8 @@ enum { PKT_UDP, PKT_BVLC, PKT_NCP2222, - PKT_GIOP + PKT_GIOP, + PKT_BGP, }; typedef struct { @@ -261,6 +262,35 @@ guint8 pkt_giop[] = { 0x01 }; +/* Ethernet+IP+TCP, indicating BGP */ +guint8 pkt_bgp[] = { + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, + 0x08, 0x00, + + 0x45, 0x00, 0x00, 0xa6, + 0x00, 0x2f, 0x40, 0x00, + 0x40, 0x06, 0x3c, 0x21, + 0x7f, 0x00, 0x00, 0x01, + 0x7f, 0x00, 0x00, 0x01, + + 0x30, 0x39, 0x00, 0xb3, + 0xac, 0x02, 0x1e, 0x69, + 0xab, 0x74, 0xab, 0x64, + 0x80, 0x18, 0x79, 0x60, + 0xc4, 0xb8, 0x00, 0x00, + 0x01, 0x01, 0x08, 0x0a, + 0x00, 0x00, 0x48, 0xf5, + 0x00, 0x00, 0x48, 0xf5, + + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + +}; + /* This little data table drives the whole program */ pkt_example examples[] = { { "arp", "Address Resolution Protocol", @@ -308,6 +338,9 @@ pkt_example examples[] = { { "giop", "General Inter-ORB Protocol", PKT_GIOP, pkt_giop, WTAP_ENCAP_ETHERNET, array_length(pkt_giop) }, + { "bgp", "Border Gateway Protocol", + PKT_BGP, pkt_bgp, WTAP_ENCAP_ETHERNET, array_length(pkt_bgp) }, + }; -- cgit v1.2.3