Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / randpkt.c
index 2b1192d7d6586ae3c89d2f50b6aaa9d4209f43f2..639afd206f12d029572792baba55e985ac424a81 100644 (file)
--- 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.12 2002/02/14 17:45:07 gram Exp $
+ * $Id: randpkt.c,v 1.14 2002/05/18 14:58:00 gerald Exp $
  *
  * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu>
  * 
@@ -61,7 +61,8 @@ enum {
        PKT_TR,
        PKT_UDP,
        PKT_BVLC,
-       PKT_NCP2222
+       PKT_NCP2222,
+       PKT_GIOP
 };
 
 typedef struct {
@@ -129,7 +130,7 @@ guint8 pkt_llc[] = {
        0xc4, 0x67
 };
 
-/* Ethernet+IP+UP, indicating NBNS */
+/* Ethernet+IP+UDP, indicating NBNS */
 guint8 pkt_nbns[] = {
        0xff, 0xff, 0xff, 0xff,
        0xff, 0xff, 0x01, 0x01,
@@ -230,6 +231,36 @@ guint8 pkt_ncp2222[] = {
        0x22
 };
 
+/* Ethernet+IP+TCP, indicating GIOP */
+guint8 pkt_giop[] = {
+       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, 0x04, 0x05,
+       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,
+
+       0x47, 0x49, 0x4f, 0x50,
+       0x01, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x30,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x01,
+       0x01
+};
+
 /* This little data table drives the whole program */
 pkt_example examples[] = {
        { "arp", "Address Resolution Protocol",
@@ -274,6 +305,9 @@ pkt_example examples[] = {
        { "ncp2222", "NetWare Core Protocol",
                PKT_NCP2222,    pkt_ncp2222,    WTAP_ENCAP_TOKEN_RING,  array_length(pkt_ncp2222) },
 
+       { "giop", "General Inter-ORB Protocol",
+               PKT_GIOP,       pkt_giop,       WTAP_ENCAP_ETHERNET,    array_length(pkt_giop) },
+
 };
 
 
@@ -304,7 +338,7 @@ main(int argc, char **argv)
        int                     produce_max_bytes = 5000;
        pkt_example             *example;
 
-       while ((opt = getopt(argc, argv, "b:c:t:")) != EOF) {
+       while ((opt = getopt(argc, argv, "b:c:t:")) != -1) {
                switch (opt) {
                        case 'b':       /* max bytes */
                                produce_max_bytes = atoi(optarg);