Commit Graph

47 Commits

Author SHA1 Message Date
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Pascal Quantin e52313959b Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8036 :
Check length of Slow Protocol OAM Vendor Specific Event Notification and add an expert info if it is not at least 2 bytes long

svn path=/trunk/; revision=46336
2012-12-02 22:19:37 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Bill Meier 7cd408ebf4 Replace dup value (typo ?) with what seems to be the correct value.
svn path=/trunk/; revision=44640
2012-08-23 17:24:46 +00:00
Chris Maynard fcd9a6d729 Fix the remaining part of Coverity CID 280009 (formerly CID 9): "Logically dead code". The first part seems to have been committed in r17565, although the checkin comment mistakenly indicates, at least as far as I can tell, that it was for CID 6 instead of CID 9, which is what Coverity is telling me it used to be.
svn path=/trunk/; revision=44180
2012-08-01 02:24:29 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier bab856a504 General cleanup including as appropriate:
- Remove unneeded #include files (string.h, addr_resolv.h);
 - Remove unneeded 'if(!initialized){...}' in proto_reg_handoff();
 - Reformat hf[] entries;
 - Remove unneeded variable initializations;
 - "localize" some variables;
 - Whitespace/indentation/long lines/formatting
(in one case: re-order code slightly to not do col_set_str() & etc until
              after initial "frame acceptance testing" by dissector.

svn path=/trunk/; revision=42683
2012-05-17 20:13:22 +00:00
pascal 0607e2c0bd From vaicebine via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7199 :
wrong value displayed for OAMPDU event notification "Errored Frame Window" field

svn path=/trunk/; revision=42257
2012-04-26 13:20:02 +00:00
pascal 073c692002 From Matt via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7160 :
Offset moves too far when dissecting an Information OAMPDU with Organization Specific TLV

svn path=/trunk/; revision=42157
2012-04-20 12:22:27 +00:00
Jeff Morriss 659d9535aa From Elliot Parsons via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6983 :
In the packet-slowprotocols dissector, there is a bug in the event notification
dissector. The code uses the incorrect value to skip past the data of a vendor
specific notification.

The attached patch file sets the offset to increment by raw_octet, which
corrects the issue.

svn path=/trunk/; revision=41741
2012-03-23 00:53:58 +00:00
Bill Meier 4712178e83 Use tvb_new_subset_remaining(...) rather than tvb_new_subset(...,-1,-1);
Fix up a number of the comments;
Use #if 0/#endif rather than /* */ to comment out code;
Do some minor reformatting.

svn path=/trunk/; revision=41377
2012-03-06 17:33:35 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 293049dfba Do some conversions of proto_tree_add_item() 'encoding' arg.
(previously missed).

    57   FT_BOOLEAN:       FALSE-->ENC_BIG_ENDIAN
    31   FT_BOOLEAN:       TRUE-->ENC_LITTLE_ENDIAN

    10   FT_BYTES:         ENC_BIG_ENDIAN-->ENC_NA
     1   FT_BYTES:         ENC_LITTLE_ENDIAN-->ENC_NA
    21   FT_BYTES:         FALSE-->ENC_NA
     2   FT_BYTES:         TRUE-->ENC_NA

     2   FT_IPXNET:        ENC_BIG_ENDIAN-->ENC_NA

     6   FT_IPv6:          ENC_BIG_ENDIAN-->ENC_NA
     1   FT_IPv6:          FALSE-->ENC_NA

     6   FT_NONE:          ENC_BIG_ENDIAN-->ENC_NA
    19   FT_NONE:          FALSE-->ENC_NA
     3   FT_NONE:          TRUE-->ENC_NA

     1   FT_STRING:        ENC_BIG_ENDIAN-->ENC_ASCII|ENC_NA
     1   FT_STRING:        ENC_LITTLE_ENDIAN-->ENC_ASCII|ENC_NA
     5   FT_STRING:        FALSE-->ENC_ASCII|ENC_NA
     1   FT_STRING:        TRUE-->ENC_ASCII|ENC_NA

     4   FT_STRINGZ:       ENC_NA-->ENC_ASCII|ENC_NA
     8   FT_STRINGZ:       FALSE-->ENC_ASCII|ENC_NA

     1   FT_INT32:         FALSE-->ENC_BIG_ENDIAN
     1   FT_INT32:         TRUE-->ENC_LITTLE_ENDIAN

    11   FT_UINT8:         0-->ENC_BIG_ENDIAN
   111   FT_UINT8:         FALSE-->ENC_BIG_ENDIAN
    17   FT_UINT8:         TRUE-->ENC_LITTLE_ENDIAN
     1   FT_UINT16:        0-->ENC_BIG_ENDIAN
    68   FT_UINT16:        FALSE-->ENC_BIG_ENDIAN
    18   FT_UINT16:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT24:        FALSE-->ENC_BIG_ENDIAN
    70   FT_UINT32:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT32:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT64:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT64:        TRUE-->ENC_LITTLE_ENDIAN

     1   FT_UINT_STRING:   FALSE-->ENC_ASCII|ENC_BIG_ENDIAN


svn path=/trunk/; revision=39442
2011-10-16 23:38:49 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Jeff Morriss da8ec2c2d6 Use proto_tree_add_item() instead of proto_tree_add_xxx() with a pointer into
the TVB.

Introduce and start using tvb_get_manuf_name() and tvb_get_manuf_name_if_known()
which do the same as the non-tvb versions but take a tvb and an offset instead
of (commonly) a pointer into a TVB.

svn path=/trunk/; revision=37317
2011-05-20 02:42:14 +00:00
Jeff Morriss 884d5491b1 Actually use proto_tree_add_item instead of proto_tree_add_bytes. Fixes bug 5588.
svn path=/trunk/; revision=35562
2011-01-16 22:52:17 +00:00
Jeff Morriss 8d32d2066a There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or
tvb_get_const_stringz().

Use tvb_memeql() & tvb_memcmp().

svn path=/trunk/; revision=35558
2011-01-16 20:51:21 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier b883b87c4a Use value_string_ext to access one of the value-string arrays.
Whitespace cleanup.

svn path=/trunk/; revision=34714
2010-10-30 14:48:21 +00:00
Anders Broman d7e5218d7a From Roberto Morro:
Added support for Organization Specific Slow Protocol (OSSP)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4966

svn path=/trunk/; revision=33734
2010-08-08 16:42:57 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Bill Meier 73eb16d678 Fix some gcc -Wshadow warnings
svn path=/trunk/; revision=31623
2010-01-22 17:41:47 +00:00
Gerasimos Dimitriadis c840cdd5a0 Remove the address operator from value_string arrays fed to VALS()
svn path=/trunk/; revision=30995
2009-11-17 18:35:27 +00:00
Stig Bjørlykke 2d9135f98c Removed unused assignments.
svn path=/trunk/; revision=30903
2009-11-09 15:43:05 +00:00
Kovarththanan Rajaratnam 4b6090e576 Don't guard col_set_str (COL_INFO) with col_check
svn path=/trunk/; revision=29342
2009-08-09 07:01:26 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Anders Broman f16859def3 From Kovarththanan Rajaratnam:
Cleanup header_field_info definitions
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3548

svn path=/trunk/; revision=28940
2009-07-05 11:49:36 +00:00
Jaap Keuter 7b79574a5b From Artem Tamazov:
Added: ESMC support as per G.8264 (Slow Protocol Subtype 0x0a).
* QL codes are dissected according to G.781 5.5.1.1 "Option I SDH". 
Added: support for Timestamp entities in ESMC PDU as per WD56 proposal.

svn path=/trunk/; revision=28836
2009-06-24 06:21:45 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Bill Meier 6f92b028aa Use some default true_false_string's.
svn path=/trunk/; revision=27983
2009-04-07 12:20:41 +00:00
Anders Broman f0fdcf55c4 From Chris Maynard:
Incorrect display filter field naming convention.

svn path=/trunk/; revision=22740
2007-08-30 05:02:33 +00:00
Stig Bjørlykke 391431af73 From Todd J Martin:
When LACP packets have the actor state or partner state fields set to 0x00,
wireshark prints the state like this (note the closing parenthesis):

  Actor State: 0x00)

Since there are no flags set, this fields should be printed like this:
  Actor State: 0x00

svn path=/trunk/; revision=22594
2007-08-22 21:58:21 +00:00
Sebastien Tandel 68ad2f4b9b fix MacOSX gcc-3.3 warnings about unused tfs/value_string variables
most have been tagged unused (few have been deleted if dissector has not been
modified since a long time)

move packet-ssl-utils.c to DISSECTOR_SRC


svn path=/trunk/; revision=21431
2007-04-14 14:01:53 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Anders Broman 281e4a7ebb Fix CID 6 - Unused code.
svn path=/trunk/; revision=17565
2006-03-10 07:06:21 +00:00
Jaap Keuter 88e3b88e84 Fix for bug 752:
IEEE802.3ah-2004 (OAM) Errored Frame Seconds Summary Event TLV is not being
decoded properly.  Per IEEE802.3ah-2004 section 57.5.3.4, item g, the Error
Running Total field should be 4-octets however Ethereal is trying to decode this
field as 8-octets which results in incorrect value reported for "Error Running
Total" and "Event Running Total".

svn path=/trunk/; revision=17351
2006-02-19 09:54:37 +00:00
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Ronnie Sahlberg 3b946782dd add missing value_string termination
svn path=/trunk/; revision=15586
2005-08-28 03:09:58 +00:00
Ronnie Sahlberg a5aad765f3 from Dominique Bastien
small update for slowprotocols


svn path=/trunk/; revision=15257
2005-08-07 23:39:00 +00:00
Gerald Combs 3a6c9ab134 Fix a format string vulneratility in the AFP dissector identified
by iDEFENSE.  Add constant format strings to proto_item_append_text()
in a bunch of other dissectors.  Copy a comment from proto.c to proto.h.

svn path=/trunk/; revision=14713
2005-06-20 19:35:58 +00:00
Gerald Combs 62aa500e15 Make hf_oampdu_info_state_parser "BASE_HEX" instead of "8", so that we don't
throw an assertion in hfinfo_uint_vals_format().

svn path=/trunk/; revision=13950
2005-03-28 02:03:45 +00:00
Ulf Lamping 98b3ae923f hf_oampdu_info_state_parser seems to be an uint8 not bool, as it can contain 4 values
svn path=/trunk/; revision=13877
2005-03-23 08:38:47 +00:00
Guy Harris 84dadf4eee From Dominique Bastien: marker and OAM slow protocol support.
Fix his e-mail address.

svn path=/trunk/; revision=13287
2005-02-04 10:48:03 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00