Commit Graph

17 Commits

Author SHA1 Message Date
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris 8ed5e80e14 From Joerg Mayer: get rid of unused function arguments.
svn path=/trunk/; revision=5053
2002-03-31 21:09:00 +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
Gilbert Ramirez aa553f63ec Convert LAPD and V.120 dissector to use tvbuff. Convert xdlc dissector-helper,
too.

svn path=/trunk/; revision=2030
2000-05-31 03:58:56 +00:00
Guy Harris 05b04d0a42 xDLC frames other than I and UI frames may have a payload, e.g. TEST
frames; rename "XDLC_HAS_PAYLOAD()" to "XDLC_IS_INFORMATION()", and if
the frame isn't an "information" frame, dissect its payload (if any) as
data.

svn path=/trunk/; revision=1528
2000-01-24 02:05:39 +00:00
Guy Harris 7a943b7810 Fix Gerald's e-mail address.
svn path=/trunk/; revision=1437
2000-01-07 22:05:43 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by
"proto_register_subtree_array()"; this:

	obviates the need to update "packet.h" whenever you add a new
	subtree type - you only have to add a call to
	"proto_register_subtree_array()" to a "register" routine and an
	array of pointers to "ett_", if they're not already there, and
	add a pointer to the new "ett_" variable to the array, if they
	are there;

	would allow run-time-loaded dissectors to allocate subtree types
	when they're loaded.

svn path=/trunk/; revision=1043
1999-11-16 11:44:20 +00:00
Guy Harris 80d5d4bf7e "XDLC_CONTROL_LEN()" actually returned the length of the entire xDLC
header, under the assumption that the address field was two octets.

It should return the length of the *control* field, and leave it up to
its caller to add in the length of the address field.  (The address
field appears to be one byte in SNA, not two bytes.)

svn path=/trunk/; revision=1006
1999-11-11 08:04:06 +00:00
Gilbert Ramirez 8cdaeb0adc Changed the macro XDLC_HAS_PAYLOAD(control) to look at only the first
bit of 'control' to check to see if it's an information frame:

#define XDLC_HAS_PAYLOAD(control) \
        (((control) & 0x1) == XDLC_I || (control) == (XDLC_UI|XDLC_U))

I had erroneously AND'ed with 0x3 when I first put the AND in there.

svn path=/trunk/; revision=797
1999-10-10 03:59:29 +00:00
Gilbert Ramirez a1f28feb1b Replace the parens around 'control' in the two macros that I modified. I
accidentally removed them.

svn path=/trunk/; revision=732
1999-09-27 13:51:54 +00:00
Guy Harris 0247d914ef When checking whether a control field is for a UI frame, you have to
check all the bits of the control field (otherwise, you're just checking
whether it's a U frame).

svn path=/trunk/; revision=730
1999-09-27 08:33:26 +00:00
Gilbert Ramirez a5558d09fe Mask out unnecessary bits in control guint16 in order to properly
compare against XDLC_I, XDLC_UI, and XDLC_U in XDLC_HAS_PAYLOAD() and
XDLC_CONTROL_LEN() macros.

svn path=/trunk/; revision=729
1999-09-27 03:12:55 +00:00
Guy Harris 63edea877f Have "get_xdlc_control()" and "dissect_xdlc_control()" return the
xDLC control field, so that its caller can not only determine from it
whether the frame has a payload, but can also determine how long the
control field is.  Put macros in "xdlc.h" to determine both of those.

Have "capture_llc()" and "dissect_llc()" use that information
appropriately.

svn path=/trunk/; revision=727
1999-09-26 20:31:51 +00:00
Guy Harris 9fc0d3aefe Have "get_xdlc_control()" and "dissect_xdlc_control()" just return a
Boolean indicating whether the frame has any payload to dissect or not.

svn path=/trunk/; revision=556
1999-08-23 23:24:36 +00:00
Guy Harris 397b2be709 The only LLC frame types that should be dissected based on their SAP or,
if the SAPs are SNAP, based on their ethertype are I frames and UI
frames; others don't have payload to be dissected as belonging to other
protocols.

svn path=/trunk/; revision=555
1999-08-23 22:47:13 +00:00
Guy Harris 47d1269da4 Add a "dissect_xdlc_control()" routine, to dissect the control field of
SDLC-derived protocols such as HDLC and derivatives of it such as LAPB,
IEEE 802.2 LLC, and so on.  Have the LLC and LAPB dissectors use it.

Make "dissect_numeric_bitfield()" put the low-order bit of the bitfield
in the low-order bit of an integer when printing it, so that the right
value is printed.

svn path=/trunk/; revision=434
1999-08-04 04:37:46 +00:00