Commit Graph

58 Commits

Author SHA1 Message Date
Jörg Mayer 1900bf87fc done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account

2do:

     52 packet-ieee80211.c: 2DO
      2 packet-nfs.c: 2DO - too many side effects
     33 packet-bgp.c: 2DO
     18 packet-dns.c: 2DO
     14 packet-dcm.c: 2DO
     13 packet-x11.c: 2DO
     11 packet-kerberos.c: 2DO
     10 packet-diameter.c: 2DO
      9 packet-snmp.c: 2DO
      9 packet-pgm.c: 2DO
      7 packet-nbns.c: 2DO
      6 packet-fcswils.c: 2DO
      5 packet-wccp.c: 2DO
      5 packet-cops.c: 2DO
      4 packet-wtp.c: 2DO


svn path=/trunk/; revision=17038
2006-01-16 07:59:44 +00:00
Jaap Keuter 356cbd3a5a From Thomas Sillaber
here is the Patch for:
    - AVA (Alcatel Automatic VLAN Assignment)
    - QBSS ( QOS Basic Service Set)

svn path=/trunk/; revision=17008
2006-01-11 22:05:43 +00:00
Ronnie Sahlberg fc97105f24 add Jaap K's extensions
also change one (of several:-( )  arrays to be accessed through accessor functions so proper bounds checking is done.


there are many other inbstances of arrays in this dissector that are accessed with no proper bounds checking and the same thing should be done for them




svn path=/trunk/; revision=16891
2005-12-23 23:54:35 +00:00
Jörg Mayer 409ea74249 As reported by Mark Millet <mmillet@cisco.com>
Add message types 13-17 for option 53 decoding.


svn path=/trunk/; revision=16879
2005-12-22 02:37:22 +00:00
Anders Broman 604d8a8026 From Stephen Donovan:
Allow Ethereal to decode the IP address inside of Option 118

svn path=/trunk/; revision=16275
2005-10-20 05:29:53 +00:00
Ronnie Sahlberg bc655dfba3 improve get_dns_name now that we have cheap emem allocated buffers
and get rid of a few strcpy()
a whole lot of arrays from the stack
and make the function prototype slightly nicer.



svn path=/trunk/; revision=16166
2005-10-08 12:31:06 +00:00
Guy Harris 973920e91d Convert some more "tvb_memcpy()"s fetching IPv4 and IPv6 addresses to
calls to "tvb_get_ipv4()" and "tvb_get_ipv6()".

Fix a call in the BGP dissector to properly fetch an IEEE floating-point
number.

Update some I-D info.

svn path=/trunk/; revision=15774
2005-09-13 00:50:43 +00:00
Guy Harris 25c4bc9379 Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,
and that extract IPv6 addresses into a "struct e_in6_addr", with
tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we
remove, by using proto_tree_add_item(), rather than replacing.

Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct
e_in6_addr" (not necessary to declare the tvbuff routines, but including
it there means "struct e_in6_addr" is guaranteed to be defined before
those declarations, so we don't get compiler complaints if we define it
*after* those declarations).

svn path=/trunk/; revision=15758
2005-09-11 21:25:37 +00:00
Guy Harris 0ab779b04c Get rid of a no-longer-used #define.
svn path=/trunk/; revision=15659
2005-09-01 18:03:02 +00:00
Guy Harris 471fa4924d Use "proto_tree_append_text()" rather than appending to an ep_alloced
buffer (that buffer wasn't getting cleared for each item).

svn path=/trunk/; revision=15655
2005-09-01 10:38:41 +00:00
Ronnie Sahlberg 88a76dc44d change g_string_sprintf[a]() to g_snprintf() and emem allocated memory.
svn path=/trunk/; revision=15631
2005-08-31 08:09:00 +00:00
Ronnie Sahlberg 57ad54abdc remove some g_string_printf[a]() and replace it with g_snprintf() to ememified buffers
svn path=/trunk/; revision=15622
2005-08-30 09:38:06 +00:00
Ronnie Sahlberg 927b1668d8 another value_string that was not terminated
fix a bug from the previous checking as well.

svn path=/trunk/; revision=15577
2005-08-28 01:51:50 +00:00
Ronnie Sahlberg a0b48c724a add missing value_string termination
svn path=/trunk/; revision=15576
2005-08-28 01:44:30 +00:00
Anders Broman 9c99a261f0 From Maynard, Chris :
The attached patches, generated via  svn diff , correct various compiler 

& lint warnings, among them: 

 

lemon.c(2582) : warning C4090: '=' : different 'const' qualifiers

packet-ber.c(212) : warning C4018: '<=' : signed/unsigned mismatch

packet-ber.c(228) : warning C4018: '>=' : signed/unsigned mismatch

packet-bootp.c(2112) : warning C4018: '<' : signed/unsigned mismatch

packet-iscsi.c(801) : warning C4018: '>=' : signed/unsigned mismatch


svn path=/trunk/; revision=15085
2005-07-26 09:52:06 +00:00
Jörg Mayer fb0b83fedf One forgotten warning fix
svn path=/trunk/; revision=14974
2005-07-21 17:17:16 +00:00
Jörg Mayer 9bed71737c small warning fixes
svn path=/trunk/; revision=14973
2005-07-21 17:04:10 +00:00
Gerald Combs 1d3ba8764b From Steve Grubb: Fix off by one errors. Fixes part of bug 217.
svn path=/trunk/; revision=14494
2005-05-30 20:53:08 +00:00
Gerald Combs 1c650087ac Add extra TLV length checks and signedness fixes. Fixes the infinite loop in
bug 196.

svn path=/trunk/; revision=14425
2005-05-24 16:46:18 +00:00
Gilbert Ramirez 61e5a33ea2 A fix for the previous fix for the infinite loop in bootp, bug #160.
svn path=/trunk/; revision=14323
2005-05-06 02:08:30 +00:00
Gilbert Ramirez 01a3ed9c58 Check the offset delta while we loop through the options.
Make sure the delta is > 0.
This intends to fix bug 160, although with a capture file
to test it, I can't be totally sure.

svn path=/trunk/; revision=14322
2005-05-06 01:56:40 +00:00
Jörg Mayer b6db235c77 Change 802.11f -> F, 802.1d -> D, 802.1x -> X, 802.1q -Q, 802.1P -> p
svn path=/trunk/; revision=14321
2005-05-05 17:07:58 +00:00
Gerald Combs 2078bfc8b4 Fix a pile of format string bugs.
svn path=/trunk/; revision=14141
2005-04-19 20:59:41 +00:00
Ronnie Sahlberg c2bfab2249 some updates from T Anders
svn path=/trunk/; revision=14125
2005-04-18 10:46:17 +00:00
Ronnie Sahlberg eb98d35922 use proto_item_appent_text() instead of proto_item_append_string() since the hf field is not neccessarily a FT_STRING value always.
svn path=/trunk/; revision=14019
2005-04-05 20:20:21 +00:00
Guy Harris 873bd2bc91 The correlation ID is a 32-bit integer, not a string.
svn path=/trunk/; revision=13887
2005-03-23 22:30:37 +00:00
Guy Harris 7176376813 The DNS name data starts at the beginning of the suboption data, not the
beginning of the suboption.

svn path=/trunk/; revision=13886
2005-03-23 21:42:40 +00:00
Guy Harris 06009efc45 When checking whether suboption data fits within the option, check
whether the suboption data offset plus the suboption data length is >,
not >=, the end of the option data - the end of the option data is the
first byte *after* the option data.

For CableLabs string suboptions, use the right offset when fetching the
data.

svn path=/trunk/; revision=13884
2005-03-23 21:22:18 +00:00
Guy Harris d49241d087 Use symbolic names for ARP types.
Clean up indentation.

svn path=/trunk/; revision=13015
2005-01-13 07:49:31 +00:00
Guy Harris 71217a8007 As we've made the tap_specific_data field of a tap_packet_t structure a
const pointer (so that we don't get complaints when we make the
tap-specific data argument to "tap_queue_packet()" a const pointer,
allowing dissectors to hand const data to a tap without a complaint), we
should make the tap per-packet function take a const pointer as an
argument as well.  Do so.

In some taps, use _U_, or actually use the argument, rather than
sticking in dummy "X = X" assignments to fake use of parameters.  (This
means that the tap functions in question no longer have the notion that
they act on a particular static structure wired in.)

svn path=/trunk/; revision=12910
2005-01-01 02:57:02 +00:00
Guy Harris 1220516388 From Yaniv Kaul: add Ethernet address-to-name (or, at least, address-to-
vendor-name-and-next-three-bytes-in-hex) resolution for Ethernet/802.x
hardware addresses.

Move the ARP hardware types into a header file, for use by dissectors
other than the ARP dissector.

svn path=/trunk/; revision=12839
2004-12-26 22:26:02 +00:00
Guy Harris e20d80ea57 Use "plurality()" rather than locally-defined "PLURALIZE()" macros, and
get rid of the definition of "PLURALIZE()" in modules that don't use it.

svn path=/trunk/; revision=12791
2004-12-20 22:13:48 +00:00
Gerald Combs 7053cbed3b Rename the "boolean" enum to "val_boolean" lest the Microsoft compiler let
its displeasure be known.

svn path=/trunk/; revision=12396
2004-10-26 16:08:16 +00:00
Guy Harris 4011ff29b7 Add a "data" item to the opt_info structure, containing a "const void
*".  For val_u_byte, if non-null, it points to a "value_string" table to
be used to interpret the value.  Replace "toggle" and "yes_no" with
"boolean, and have the "data" pointer point to a "struct
true_false_string" to be used to interpret the value.

The NetBIOS-over-TCP/IP Node Type option can now be a regular val_u_byte
value, with the appropriate value_string table.

Construct the item for DHCP options by initializing it without the value
and appending the value to the item's string with
"proto_item_append_text()".

svn path=/trunk/; revision=12391
2004-10-26 07:00:23 +00:00
Guy Harris 671cd939ae Make yes_no work in "dissect_netware_ip_suboption()" the way it works
elsewhere, and replace "struct o63_opt_info" with "struct opt_info".

svn path=/trunk/; revision=12390
2004-10-25 23:25:59 +00:00
Guy Harris 32539c3e28 "struct o43pxeclient_opt_info" and "struct o43cablelabs_opt_info" look
just like "struct opt_info", except for the name of the "enum
field_type" field; use "opt_info" instead of them.  Rename the
equivalent field in "struct o63_opt_info", as well, with an eye towards
changing "struct opt_info" to be able to replace "struct o63_opt_info"
as well.

svn path=/trunk/; revision=12389
2004-10-25 09:31:13 +00:00
Guy Harris ec3230d492 Remove val_s_long as it's unimplemented and unused - put it back if it's
ever necessary.

Make some options, that have only one IPv4 address, use ipv4 rather than
ipv4_list.

Add val_u_short_list, and have val_u_short accept one and only one
16-bit integer.  Give options the appropriate type.

Shuffle the types a bit in the enum, and shuffle the cases for types
around to match the order in the enum.

svn path=/trunk/; revision=12388
2004-10-25 08:56:39 +00:00
Guy Harris b140c74433 Rename "ipv4" to "ipv4_list", as it's used for lists of IPv4 addresses,
and add a separate "ipv4"; use that in the dissector for Netware IP
options.

Add a "presence" option type, for options with no value whose presence
is significant; use that in the dissector for Netware IP options.

svn path=/trunk/; revision=12387
2004-10-25 08:33:39 +00:00
Guy Harris a7b17234c3 Pass to the the routines that dissect suboption lists the offset of the
end of the option, and have them do bounds checking.  Also, in some
places, check the suboption length.

In "dissect_netware_ip_suboption()", process the suboption length
(which, according to RFC 2242, is present in all suboptions), and use
val_u_byte rather than val_u_short for 1-byte options.

svn path=/trunk/; revision=12386
2004-10-25 08:17:11 +00:00
Guy Harris e08ef66cfe Restructure the DHCP option parsing a bit, to make it a bit clearer -
and fix some bugs that this made a bit more obvious.  Add checks of the
option length.

Clean up white space.

svn path=/trunk/; revision=12385
2004-10-24 22:53:06 +00:00
Guy Harris 7b1b2d0b1a Don't display the FQDN in the FQDN option if the length of the FQDN is
zero.

Clean up some field names and descriptions.

svn path=/trunk/; revision=12384
2004-10-24 10:30:03 +00:00
Guy Harris b248485905 Fix the length used for the name in the FQDN option.
svn path=/trunk/; revision=12383
2004-10-24 10:18:16 +00:00
Gerald Combs 7e6c4fec40 From Thomas Anders:
- change DHCP option 122 dissection to use official RFC 3495/3594 wording
  (if bootp.pkt.ccc.protocol_version preference setting is 2 or 3)
- update CableLabs specification references
- some minor cleanup (option 43 also) 

svn path=/trunk/; revision=12338
2004-10-18 14:24:25 +00:00
Guy Harris 236123a94b From Thomas Anders: DHCP option 6 enhancements:
- add full support for upcoming PacketCable 1.5
- fix bug regarding MTA/CM Device Capabilities Length
- PacketCable MTA: fix bug regarding RSVP and UGS-AD options
- make presentation more compact (similar to other TLV data dissectors)
- change some descriptions and variables to (hopefully) make more sense
  to DOCSIS/PacketCable users

svn path=/trunk/; revision=12325
2004-10-17 02:36:32 +00:00
Guy Harris cde0733be8 Clena up a few things.
Squelch a compiler warning.

svn path=/trunk/; revision=12311
2004-10-16 05:59:24 +00:00
Jörg Mayer 429ede32f8 Add support for draft-ietf-dhc-fqdn-option-07.txt
svn path=/trunk/; revision=12309
2004-10-16 02:04:08 +00:00
Jörg Mayer db564c5096 Change Client Identifier display a bit to better handle non-hw identifiers of length 7
svn path=/trunk/; revision=12308
2004-10-16 00:19:07 +00:00
Guy Harris 063b6fc3f5 Use "tvb_format_stringzpad()" rather than "tvb_format_text()", as per
RFC 2132, which says

	Options containing NVT ASCII data SHOULD NOT include a trailing
	NULL; however, the receiver of such options MUST be prepared to
	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	delete trailing nulls if they exist.
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

svn path=/trunk/; revision=12295
2004-10-14 08:02:58 +00:00
Guy Harris 96fb567289 Use "tvb_format_text()" for string items, so non-printable characters
don't get stuck into protocol tree item representations (and so that
they can be more easily found if, as, and when we get around to handling
different character encodings).

Clean up white space.

Get rid of another sprintf() on top of a string constant.

svn path=/trunk/; revision=12211
2004-10-05 23:22:36 +00:00
Guy Harris 9b9223d710 Fix a bunch of compiler warnings (and some code that was bogusly
attempting to overwrite a string constant - possibly with a longer
string!).

svn path=/trunk/; revision=12210
2004-10-05 23:02:09 +00:00