diff options
author | Gerald Combs <gerald@wireshark.org> | 2002-11-17 21:47:41 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2002-11-17 21:47:41 +0000 |
commit | b823ff306a73aea1e0adbf4876855e5c14a8cb45 (patch) | |
tree | 19e7ba8314bd1dc27f3148e26f1b2c742c66d357 /randpkt.c | |
parent | 31f4e6b38ff0492e515e6b580b56b81cee50dc6d (diff) |
Clean up the TDS dissector a bit. Change a lot of signed ints to
unsigned, and set their size to match the protocol data assigned to
them. Make sure the number of columns read doesn't exceed MAX_COLUMNS.
Explicitly check for integer values > 0. Switch from using memcpy with
tvb_get_ptr to tvb_memcpy. Make indentation consistent.
Add TDS support to randpkt. Most of the generated packets won't pass
the heuristic checks, but enough should make it through to adequately
test the dissector.
svn path=/trunk/; revision=6653
Diffstat (limited to 'randpkt.c')
-rw-r--r-- | randpkt.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -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.17 2002/10/16 14:45:27 gerald Exp $ + * $Id: randpkt.c,v 1.18 2002/11/17 21:47:41 gerald Exp $ * * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -68,6 +68,7 @@ enum { PKT_NCP2222, PKT_GIOP, PKT_BGP, + PKT_TDS, }; typedef struct { @@ -292,7 +293,26 @@ guint8 pkt_bgp[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +/* Ethernet+IP+TCP, indicating TDS NetLib */ +guint8 pkt_tds[] = { + 0x00, 0x50, 0x8b, 0x0d, + 0x7a, 0xed, 0x00, 0x08, + 0xa3, 0x98, 0x39, 0x81, + 0x08, 0x00, + 0x45, 0x00, 0x03, 0x8d, + 0x90, 0xd4, 0x40, 0x00, + 0x7c, 0x06, 0xc3, 0x1b, + 0xac, 0x14, 0x02, 0x22, + 0x0a, 0xc2, 0xee, 0x82, + + 0x05, 0x99, 0x08, 0xf8, + 0xff, 0x4e, 0x85, 0x46, + 0xa2, 0xb4, 0x42, 0xaa, + 0x50, 0x18, 0x3c, 0x28, + 0x0f, 0xda, 0x00, 0x00, }; /* This little data table drives the whole program */ @@ -345,6 +365,9 @@ pkt_example examples[] = { { "bgp", "Border Gateway Protocol", PKT_BGP, pkt_bgp, WTAP_ENCAP_ETHERNET, array_length(pkt_bgp) }, + { "tds", "TDS NetLib", + PKT_TDS, pkt_tds, WTAP_ENCAP_ETHERNET, array_length(pkt_tds) }, + }; |