Commit Graph

71 Commits

Author SHA1 Message Date
Guy Harris ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Stephen Fisher 07eef05406 Rename si_code variable to mtp3_si_code to avoid conflicts with NetBSD's
si_code #define in sys/siginfo.h

Change-Id: I5e183b997768c87f275569343afa69ca542aba46
Reviewed-on: https://code.wireshark.org/review/5844
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-19 00:56:10 +00:00
AndersBroman f2fc562eda Replace tvb_length()
Change-Id: I0b5ad4d588f0b658abaf3892d08d6520ecd2f645
Reviewed-on: https://code.wireshark.org/review/5431
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-21 15:05:33 +00:00
Bill Meier 0b18d6cb77 Add editor modelines; Adjust whitespace as needed.
Change-Id: I6e70c933ae61a97377235d67b2f6a1b3d67dc155
Reviewed-on: https://code.wireshark.org/review/4484
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-05 20:19:02 +00:00
Michael Mann d68d0e88b4 Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.

Change-Id: If73a029f564219782c313d4154c24c7ce7458b52
Reviewed-on: https://code.wireshark.org/review/3574
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-14 04:21:05 +00:00
Michael Tüxen 3e7ed3da2c Escape some characters like \n when appending text
This patch escapes some characters like \n when showing text
contained in a packet by appending it to a protocol item.

Change-Id: Ice0040040ec7ab573dd9a412f8c0c197a566a031
Reviewed-on: https://code.wireshark.org/review/3095
Petri-Dish: Michael Tüxen <tuexen@wireshark.org>
Reviewed-by: Michael Tüxen <tuexen@wireshark.org>
2014-07-17 23:47:03 +00:00
Michael Mann c7a6e6fa13 convert to proto_tree_add_subtree[_format]
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc
Reviewed-on: https://code.wireshark.org/review/2852
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-04 16:59:14 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Michael Mann 346f803d42 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either:
1. Case sensitivity differences between hf_ field name and formatted string.
2. Unnecessary whitespace between hf_ field name and colon in formatted string

There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed.

svn path=/trunk/; revision=52098
2013-09-16 10:39:06 +00:00
Evan Huus a8f4327da7 Convert m3ua to wmem and use the pinfo pool for a variable that might be used
for an address. Fixes the recent valgrind fuzz failure.

svn path=/trunk/; revision=51608
2013-08-31 02:50:32 +00:00
Michael Mann de68fd6eea Removed check_col() and the occasional tree.
svn path=/trunk/; revision=49938
2013-06-14 17:49:53 +00:00
Pascal Quantin 38d9a87a49 From Chris Hellberg via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8723 :
M3UA dissector RFC display update

svn path=/trunk/; revision=49598
2013-05-27 18:58:24 +00:00
Anders Broman 3eb06be97d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48425
2013-03-19 19:28:57 +00:00
Jeff Morriss 21b1b0c5da Add heuristic MTP3 standard detection to M3UA (not for the draft M3UA versions).
The SCCP heuristics actually don't work all that well here but checking the PCs
(in M3UA) seems to do a decent job at least of differentiating ANSI from ITU.

svn path=/trunk/; revision=47407
2013-02-01 02:42:01 +00:00
Bill Meier 959ae3d687 Use '#if 0 ... #endif' rather than /** ... **/ to comment out
unused hf[] entries (which I should have done in the first place).


svn path=/trunk/; revision=47391
2013-01-31 18:35:06 +00:00
Bill Meier c929e42eb4 Fix various instances of unused hf[] entries found
by checkhf.

svn path=/trunk/; revision=47312
2013-01-26 22:43:34 +00:00
Jeff Morriss 0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Jeff Morriss d407ce0d36 Create and start using macros for MTP3 network indicators.
Export the network indicator value_string and use it in M3UA.

svn path=/trunk/; revision=45784
2012-10-25 15:34:57 +00:00
Bill Meier ad0219d033 Change 'for (i=1; i<=n;...' to 'for (i=0; i<n; ...)
The changes fix definite problems or
are done "just in case" for cases not esily determined
to be a problem by quick inspection.

Note: in some cases for loop index variables have been renamed
      to ensure  all required codes changes detected.

##backport

svn path=/trunk/; revision=45477
2012-10-11 19:20:21 +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 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier d53320919a Remove unneeded #includes (stdlib, stdio, ctypes, time);
In a few cases: do some whitespace, indentation cleanup & reformatting.

svn path=/trunk/; revision=42632
2012-05-15 19:23:35 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +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
Bill Meier 3af6394891 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=38001
2011-07-13 19:48:58 +00:00
Michael Tüxen ad619e3a04 Decode the SI value in DATA messages correclty.
This fixes bug 5834.

svn path=/trunk/; revision=36691
2011-04-17 19:37:46 +00:00
Anders Broman d8a87d589b Update standard references.
svn path=/trunk/; revision=35937
2011-02-13 13:56:30 +00:00
Jeff Morriss ae4ef9853c Don't pass the result of tvb_get_ptr() into a %s format string: the string may
not be NULL terminated.  Use tvb_get_ephemeral_string() instead.

svn path=/trunk/; revision=35377
2011-01-05 15:23:53 +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
Jeff Morriss 11ee648da3 Add some hf blurbs (for fields whose description is an acronym)
svn path=/trunk/; revision=34091
2010-09-09 18:36:20 +00:00
Guy Harris 1b444c55fd Refer to the endianness arguments as "encoding" rather than
"representation" - we already use "representation" to refer to the text
representation of fields.

Change some routines with an endianness argument to make it a
representation argument instead; 

svn path=/trunk/; revision=32929
2010-05-24 06:06:17 +00:00
Guy Harris 998677339e Create a new REP_NA value for fields where there are no representations
from which to choose; use that for protocol fields in some protocols
(modify the CORBA generator to use it, and manually update the generated
CORBA dissectors accordingly).

svn path=/trunk/; revision=32777
2010-05-13 00:20:40 +00:00
Guy Harris 308bb550da Instead of using private #defines for the last argument to
proto_tree_add_item(), use the new REP_BIG_ENDIAN and REP_LITTLE_ENDIAN
values.

Use those #defines in variables that represent the byte order, as well.

svn path=/trunk/; revision=32776
2010-05-12 23:45:16 +00:00
Gerasimos Dimitriadis 85793805e3 Interpret international point codes according to Q.708; white space edits
svn path=/trunk/; revision=32546
2010-04-23 21:24:32 +00:00
Jeff Morriss 2adcfeae9b Add an MTP3 equivalent for the SLS
svn path=/trunk/; revision=32489
2010-04-16 14:05:08 +00:00
Jeff Morriss ee803354de As requested in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2748 :
Mark the "MTP3 equivalents" fields as generated.  They do come directly from
the packet but the fields themselves are kind-of artificial so it makes some
sense to mark them as "special" somehow.

svn path=/trunk/; revision=32482
2010-04-15 21:27:27 +00:00
Bill Meier 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Kovarththanan Rajaratnam 17c9803cac Sanitize epan includes
svn path=/trunk/; revision=29499
2009-08-21 20:25:24 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +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