Commit Graph

9 Commits

Author SHA1 Message Date
Guy Harris 903a3db8c1 "get_netbios_name()" can never return a negative number as the name
type, so "netbios_add_name()" doesn't need to check for it doing so
(yes, the tvbuff stuff *does* catch "get_netbios_name()" running past
the end of the packet, and causes an exception to be thrown).  Get rid
of the check, and get rid of "netbios_add_name()"s return value.

In "dissect_nbipx_dg()", always call the SMB dissector if there's data
left in the packet, regardless of whether the "tree" argument is null or
not; subdissectors should always be called, so they can build any
internal state on the first pass through the capture, and so that they
can fill in the Protocol and Info columns.

svn path=/trunk/; revision=2899
2001-01-15 04:39:28 +00:00
Guy Harris 6b0b501519 Fix "packet-netbios.h" to match the new "packet-netbios.c", so that it
compiles.

Doing so reveals that the NBIPX dissector needs to be fixed, as it calls
routines in "packet-netbios.c" whose calling sequence changed; doing so
involves tvbuffifying it.

svn path=/trunk/; revision=2602
2000-11-10 21:09:49 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Guy Harris 0ba3e2b233 Register a "llc.dsap" dissector table for 802.2 LLC, and have dissectors
for protocols that run inside 802.2 LLC register themselves with it
using "dissector_add()".

Make various dissectors static if they can be, and remove from header
files declarations of those dissectors.

svn path=/trunk/; revision=1872
2000-04-17 00:32:43 +00:00
Gilbert Ramirez ddfa11e870 Create a header file for every packet-*.c file. Prune the packet.h file.
This change allows you to add a new packet-*.c file and not cause a
recompilation of everything that #include's packet.h

Add the plugin_api.[ch] files ot the plugins/Makefile.am packaging list.

Add #define YY_NO_UNPUT 1 to the lex source so that the yyunput symbol
is not defined, squelching a compiler complaint when compiling the generated
C file.

svn path=/trunk/; revision=1637
2000-02-15 21:06:58 +00:00
Guy Harris 7d35e30ca6 Make the NetBIOS dissecting routines all take a pointer to the beginning
of the frame, plus at most one offset from the beginning of the frame,
to make it clearer what the offset is.

Then use that offset in at least some places to do bounds checking.

If a packet has no payload, don't hand it to the SMB dissector.

svn path=/trunk/; revision=1165
1999-11-30 07:45:42 +00:00
Guy Harris 27c0d2d022 Use "process_netbios_name()", rather than "canonicalize_netbios_name()",
to turn NetBIOS names into a nice printable form.

Put the description of NetBIOS name types into places where it fits;
have "packet-netbios.c" export a routine to interpret them.

svn path=/trunk/; revision=630
1999-09-03 01:43:09 +00:00
Guy Harris 3d7691d432 Add a bunch more NetBIOS name types.
That makes the space of name types even more sparse; use "val_to_str()"
to decode them, rather than an indexed table.

Make a "process_netbios_name()" routine that shows non-printable
characters in NetBIOS names as <XX>, where "XX" is the value of the
character in hex (the way Network Monitor does), and have
"get_netbios_name()" use it (NetBIOS-over-TCP will be made to use it in
the future).

When displaying NetBIOS names, include the name type character at the
end, in angle brackets, the way Network Monitor does (show it in hex
even if it *is* printable - 0x20 is 0x20, not "space", in that context).

svn path=/trunk/; revision=628
1999-09-03 00:24:40 +00:00
Guy Harris f9a1fea17c Have the IPX code set "pi.len" and "pi.captured_len" based on the length
in the IPX header, and have the dissectors it calls use it rather than
being passed the length as an argument.

Treat both packet type 20 ("WAN Broadcast") and 4 ("IPX", although 3 is
also "IPX", according to Network Monitor) as potentially being NetBIOS
packets.

The packet types for the IPX NetBIOS socket (0x0455) and the NWLink
sockets (0x0551 and 0x0553) are different (perhaps because there's one
socket for the 0x0455 NBIPX, so you have to do name service and datagram
service and have the packet types distinguish them, but NWLink has
separate sockets for name service and datagram service).

The packet type for name service and for datagram service are at
*different locations* in the packet, which is unfortunate if you want to
use the packet type to distinguish name service and datagram service
packets.  Use the packet length, for now, to distinguish them, with
socket 0x0455.

Dissect datagram packets differently from name service packets.

Export "packet-netbios.c"'s "netbios_add_name()" routine, and use it
when dissecting NBIPX packets as well.

Label NBIPX packets as "NBIPX" rather than "NetBIOS".

svn path=/trunk/; revision=627
1999-09-02 23:17:58 +00:00